mol_crypto_lib 0.1.1715 → 0.1.1717

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/node.mjs CHANGED
@@ -554,6 +554,8 @@ var $;
554
554
  "use strict";
555
555
  var $;
556
556
  (function ($) {
557
+ if (!Symbol.dispose)
558
+ Symbol.dispose = Symbol('Symbol.dispose');
557
559
  class $mol_object2 {
558
560
  static $ = $;
559
561
  [Symbol.toStringTag];
@@ -586,6 +588,9 @@ var $;
586
588
  }
587
589
  destructor() { }
588
590
  static destructor() { }
591
+ [Symbol.dispose]() {
592
+ this.destructor();
593
+ }
589
594
  toString() {
590
595
  return this[Symbol.toStringTag] || this.constructor.name + '<>';
591
596
  }
@@ -2583,10 +2588,20 @@ var $;
2583
2588
  var $;
2584
2589
  (function ($) {
2585
2590
  let buf = new Uint8Array(2 ** 12);
2591
+ function $mol_charset_buffer(size) {
2592
+ if (buf.byteLength < size)
2593
+ buf = new Uint8Array(size);
2594
+ return buf;
2595
+ }
2596
+ $.$mol_charset_buffer = $mol_charset_buffer;
2597
+ })($ || ($ = {}));
2598
+
2599
+ ;
2600
+ "use strict";
2601
+ var $;
2602
+ (function ($) {
2586
2603
  function $mol_charset_encode(str) {
2587
- const capacity = str.length * 3;
2588
- if (buf.byteLength < capacity)
2589
- buf = new Uint8Array(capacity);
2604
+ const buf = $mol_charset_buffer(str.length * 3);
2590
2605
  return buf.slice(0, $mol_charset_encode_to(str, buf));
2591
2606
  }
2592
2607
  $.$mol_charset_encode = $mol_charset_encode;
package/node.test.js CHANGED
@@ -545,6 +545,8 @@ var $;
545
545
  "use strict";
546
546
  var $;
547
547
  (function ($) {
548
+ if (!Symbol.dispose)
549
+ Symbol.dispose = Symbol('Symbol.dispose');
548
550
  class $mol_object2 {
549
551
  static $ = $;
550
552
  [Symbol.toStringTag];
@@ -577,6 +579,9 @@ var $;
577
579
  }
578
580
  destructor() { }
579
581
  static destructor() { }
582
+ [Symbol.dispose]() {
583
+ this.destructor();
584
+ }
580
585
  toString() {
581
586
  return this[Symbol.toStringTag] || this.constructor.name + '<>';
582
587
  }
@@ -2574,10 +2579,20 @@ var $;
2574
2579
  var $;
2575
2580
  (function ($) {
2576
2581
  let buf = new Uint8Array(2 ** 12);
2582
+ function $mol_charset_buffer(size) {
2583
+ if (buf.byteLength < size)
2584
+ buf = new Uint8Array(size);
2585
+ return buf;
2586
+ }
2587
+ $.$mol_charset_buffer = $mol_charset_buffer;
2588
+ })($ || ($ = {}));
2589
+
2590
+ ;
2591
+ "use strict";
2592
+ var $;
2593
+ (function ($) {
2577
2594
  function $mol_charset_encode(str) {
2578
- const capacity = str.length * 3;
2579
- if (buf.byteLength < capacity)
2580
- buf = new Uint8Array(capacity);
2595
+ const buf = $mol_charset_buffer(str.length * 3);
2581
2596
  return buf.slice(0, $mol_charset_encode_to(str, buf));
2582
2597
  }
2583
2598
  $.$mol_charset_encode = $mol_charset_encode;