functions.js 605 B

1234567891011121314151617181920212223
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.assign = assign;
  4. exports.combine = combine;
  5. exports.isEqual = isEqual;
  6. const index_js_1 = require("../bytes/index.js");
  7. function assign(target, ...sources) {
  8. for (const source of sources) {
  9. if (!source) {
  10. continue;
  11. }
  12. for (const prop in source) {
  13. target[prop] = source[prop];
  14. }
  15. }
  16. return target;
  17. }
  18. function combine(...buf) {
  19. return (0, index_js_1.concat)(buf);
  20. }
  21. function isEqual(bytes1, bytes2) {
  22. return (0, index_js_1.equal)(bytes1, bytes2);
  23. }