hyoo_sync_client 0.0.244 → 0.0.245

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/web.mjs CHANGED
@@ -445,16 +445,6 @@ var $;
445
445
  ;
446
446
  "use strict";
447
447
  var $;
448
- (function ($) {
449
- function $mol_base64_encode_safe(buffer) {
450
- return $mol_base64_encode(buffer).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/, '');
451
- }
452
- $.$mol_base64_encode_safe = $mol_base64_encode_safe;
453
- })($ || ($ = {}));
454
- //mol/base64/encode/safe/safe.ts
455
- ;
456
- "use strict";
457
- var $;
458
448
  (function ($) {
459
449
  function $mol_base64_decode(base64) {
460
450
  throw new Error('Not implemented');
@@ -477,12 +467,16 @@ var $;
477
467
  "use strict";
478
468
  var $;
479
469
  (function ($) {
480
- function $mol_base64_decode_safe(str) {
470
+ function $mol_base64_url_encode(buffer) {
471
+ return $mol_base64_encode(buffer).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
472
+ }
473
+ $.$mol_base64_url_encode = $mol_base64_url_encode;
474
+ function $mol_base64_url_decode(str) {
481
475
  return $mol_base64_decode(str.replace(/-/g, '+').replace(/_/g, '/'));
482
476
  }
483
- $.$mol_base64_decode_safe = $mol_base64_decode_safe;
477
+ $.$mol_base64_url_decode = $mol_base64_url_decode;
484
478
  })($ || ($ = {}));
485
- //mol/base64/decode/safe/safe.ts
479
+ //mol/base64/url/url.ts
486
480
  ;
487
481
  "use strict";
488
482
  var $;
@@ -510,8 +504,8 @@ var $;
510
504
  }
511
505
  static async from(serial) {
512
506
  if (typeof serial !== 'string') {
513
- serial = $mol_base64_encode_safe(serial.subarray(0, 32))
514
- + $mol_base64_encode_safe(serial.subarray(32, 64));
507
+ serial = $mol_base64_url_encode(serial.subarray(0, 32))
508
+ + $mol_base64_url_encode(serial.subarray(32, 64));
515
509
  }
516
510
  return new this(await $mol_crypto_native.subtle.importKey('jwk', {
517
511
  crv: "P-256",
@@ -529,8 +523,8 @@ var $;
529
523
  async toArray() {
530
524
  const { x, y, d } = await $mol_crypto_native.subtle.exportKey('jwk', this.native);
531
525
  return new Uint8Array([
532
- ...$mol_base64_decode_safe(x),
533
- ...$mol_base64_decode_safe(y),
526
+ ...$mol_base64_url_decode(x),
527
+ ...$mol_base64_url_decode(y),
534
528
  ]);
535
529
  }
536
530
  async verify(data, sign) {
@@ -548,9 +542,9 @@ var $;
548
542
  }
549
543
  static async from(serial) {
550
544
  if (typeof serial !== 'string') {
551
- serial = $mol_base64_encode_safe(serial.subarray(0, 32))
552
- + $mol_base64_encode_safe(serial.subarray(32, 64))
553
- + $mol_base64_encode_safe(serial.subarray(64));
545
+ serial = $mol_base64_url_encode(serial.subarray(0, 32))
546
+ + $mol_base64_url_encode(serial.subarray(32, 64))
547
+ + $mol_base64_url_encode(serial.subarray(64));
554
548
  }
555
549
  return new this(await $mol_crypto_native.subtle.importKey('jwk', {
556
550
  crv: "P-256",
@@ -569,9 +563,9 @@ var $;
569
563
  async toArray() {
570
564
  const { x, y, d } = await $mol_crypto_native.subtle.exportKey('jwk', this.native);
571
565
  return new Uint8Array([
572
- ...$mol_base64_decode_safe(x),
573
- ...$mol_base64_decode_safe(y),
574
- ...$mol_base64_decode_safe(d),
566
+ ...$mol_base64_url_decode(x),
567
+ ...$mol_base64_url_decode(y),
568
+ ...$mol_base64_url_decode(d),
575
569
  ]);
576
570
  }
577
571
  async sign(data) {
@@ -644,7 +638,12 @@ var $;
644
638
  if (!val)
645
639
  return null;
646
640
  if ($.$mol_dev_format_head in val) {
647
- return val[$.$mol_dev_format_head]();
641
+ try {
642
+ return val[$.$mol_dev_format_head]();
643
+ }
644
+ catch (error) {
645
+ return $.$mol_dev_format_accent($mol_dev_format_native(val), '💨', $mol_dev_format_native(error), '');
646
+ }
648
647
  }
649
648
  if (typeof val === 'function') {
650
649
  return $mol_dev_format_native(val);
@@ -3185,17 +3184,17 @@ var $;
3185
3184
  (function ($) {
3186
3185
  class $hyoo_crowd_fund extends $mol_object {
3187
3186
  world;
3188
- Node;
3189
- constructor(world, Node) {
3187
+ node_class;
3188
+ constructor(world, node_class) {
3190
3189
  super();
3191
3190
  this.world = world;
3192
- this.Node = Node;
3191
+ this.node_class = node_class;
3193
3192
  }
3194
3193
  Item(id) {
3195
3194
  const [land, head] = id.split('!');
3196
3195
  if (!head)
3197
3196
  return this.Item(`${land}!0_0`);
3198
- return this.world.land_sync(land).node(head, this.Node);
3197
+ return this.world.land_sync(land).node(head, this.node_class);
3199
3198
  }
3200
3199
  make(law = [''], mod = [], add = []) {
3201
3200
  const land = $mol_wire_sync(this.world).grab(law, mod, add);