hyoo_sync_client 0.0.243 → 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/node.mjs CHANGED
@@ -1021,16 +1021,6 @@ var $;
1021
1021
  ;
1022
1022
  "use strict";
1023
1023
  var $;
1024
- (function ($) {
1025
- function $mol_base64_encode_safe(buffer) {
1026
- return $mol_base64_encode(buffer).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/, '');
1027
- }
1028
- $.$mol_base64_encode_safe = $mol_base64_encode_safe;
1029
- })($ || ($ = {}));
1030
- //mol/base64/encode/safe/safe.ts
1031
- ;
1032
- "use strict";
1033
- var $;
1034
1024
  (function ($) {
1035
1025
  function $mol_base64_decode(base64) {
1036
1026
  throw new Error('Not implemented');
@@ -1055,12 +1045,16 @@ var $;
1055
1045
  "use strict";
1056
1046
  var $;
1057
1047
  (function ($) {
1058
- function $mol_base64_decode_safe(str) {
1048
+ function $mol_base64_url_encode(buffer) {
1049
+ return $mol_base64_encode(buffer).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
1050
+ }
1051
+ $.$mol_base64_url_encode = $mol_base64_url_encode;
1052
+ function $mol_base64_url_decode(str) {
1059
1053
  return $mol_base64_decode(str.replace(/-/g, '+').replace(/_/g, '/'));
1060
1054
  }
1061
- $.$mol_base64_decode_safe = $mol_base64_decode_safe;
1055
+ $.$mol_base64_url_decode = $mol_base64_url_decode;
1062
1056
  })($ || ($ = {}));
1063
- //mol/base64/decode/safe/safe.ts
1057
+ //mol/base64/url/url.ts
1064
1058
  ;
1065
1059
  "use strict";
1066
1060
  var $;
@@ -1088,8 +1082,8 @@ var $;
1088
1082
  }
1089
1083
  static async from(serial) {
1090
1084
  if (typeof serial !== 'string') {
1091
- serial = $mol_base64_encode_safe(serial.subarray(0, 32))
1092
- + $mol_base64_encode_safe(serial.subarray(32, 64));
1085
+ serial = $mol_base64_url_encode(serial.subarray(0, 32))
1086
+ + $mol_base64_url_encode(serial.subarray(32, 64));
1093
1087
  }
1094
1088
  return new this(await $mol_crypto_native.subtle.importKey('jwk', {
1095
1089
  crv: "P-256",
@@ -1107,8 +1101,8 @@ var $;
1107
1101
  async toArray() {
1108
1102
  const { x, y, d } = await $mol_crypto_native.subtle.exportKey('jwk', this.native);
1109
1103
  return new Uint8Array([
1110
- ...$mol_base64_decode_safe(x),
1111
- ...$mol_base64_decode_safe(y),
1104
+ ...$mol_base64_url_decode(x),
1105
+ ...$mol_base64_url_decode(y),
1112
1106
  ]);
1113
1107
  }
1114
1108
  async verify(data, sign) {
@@ -1126,9 +1120,9 @@ var $;
1126
1120
  }
1127
1121
  static async from(serial) {
1128
1122
  if (typeof serial !== 'string') {
1129
- serial = $mol_base64_encode_safe(serial.subarray(0, 32))
1130
- + $mol_base64_encode_safe(serial.subarray(32, 64))
1131
- + $mol_base64_encode_safe(serial.subarray(64));
1123
+ serial = $mol_base64_url_encode(serial.subarray(0, 32))
1124
+ + $mol_base64_url_encode(serial.subarray(32, 64))
1125
+ + $mol_base64_url_encode(serial.subarray(64));
1132
1126
  }
1133
1127
  return new this(await $mol_crypto_native.subtle.importKey('jwk', {
1134
1128
  crv: "P-256",
@@ -1147,9 +1141,9 @@ var $;
1147
1141
  async toArray() {
1148
1142
  const { x, y, d } = await $mol_crypto_native.subtle.exportKey('jwk', this.native);
1149
1143
  return new Uint8Array([
1150
- ...$mol_base64_decode_safe(x),
1151
- ...$mol_base64_decode_safe(y),
1152
- ...$mol_base64_decode_safe(d),
1144
+ ...$mol_base64_url_decode(x),
1145
+ ...$mol_base64_url_decode(y),
1146
+ ...$mol_base64_url_decode(d),
1153
1147
  ]);
1154
1148
  }
1155
1149
  async sign(data) {
@@ -1222,7 +1216,12 @@ var $;
1222
1216
  if (!val)
1223
1217
  return null;
1224
1218
  if ($.$mol_dev_format_head in val) {
1225
- return val[$.$mol_dev_format_head]();
1219
+ try {
1220
+ return val[$.$mol_dev_format_head]();
1221
+ }
1222
+ catch (error) {
1223
+ return $.$mol_dev_format_accent($mol_dev_format_native(val), '💨', $mol_dev_format_native(error), '');
1224
+ }
1226
1225
  }
1227
1226
  if (typeof val === 'function') {
1228
1227
  return $mol_dev_format_native(val);
@@ -3075,6 +3074,7 @@ var $;
3075
3074
  const getter = (() => value);
3076
3075
  getter['()'] = value;
3077
3076
  getter[Symbol.toStringTag] = value;
3077
+ getter[$mol_dev_format_head] = () => $mol_dev_format_span({}, '()=> ', $mol_dev_format_auto(value));
3078
3078
  return getter;
3079
3079
  }
3080
3080
  $.$mol_const = $mol_const;
@@ -3448,17 +3448,17 @@ var $;
3448
3448
  (function ($) {
3449
3449
  class $hyoo_crowd_fund extends $mol_object {
3450
3450
  world;
3451
- Node;
3452
- constructor(world, Node) {
3451
+ node_class;
3452
+ constructor(world, node_class) {
3453
3453
  super();
3454
3454
  this.world = world;
3455
- this.Node = Node;
3455
+ this.node_class = node_class;
3456
3456
  }
3457
3457
  Item(id) {
3458
3458
  const [land, head] = id.split('!');
3459
3459
  if (!head)
3460
3460
  return this.Item(`${land}!0_0`);
3461
- return this.world.land_sync(land).node(head, this.Node);
3461
+ return this.world.land_sync(land).node(head, this.node_class);
3462
3462
  }
3463
3463
  make(law = [''], mod = [], add = []) {
3464
3464
  const land = $mol_wire_sync(this.world).grab(law, mod, add);
package/node.test.js CHANGED
@@ -1013,16 +1013,6 @@ var $;
1013
1013
  ;
1014
1014
  "use strict";
1015
1015
  var $;
1016
- (function ($) {
1017
- function $mol_base64_encode_safe(buffer) {
1018
- return $mol_base64_encode(buffer).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/, '');
1019
- }
1020
- $.$mol_base64_encode_safe = $mol_base64_encode_safe;
1021
- })($ || ($ = {}));
1022
- //mol/base64/encode/safe/safe.ts
1023
- ;
1024
- "use strict";
1025
- var $;
1026
1016
  (function ($) {
1027
1017
  function $mol_base64_decode(base64) {
1028
1018
  throw new Error('Not implemented');
@@ -1047,12 +1037,16 @@ var $;
1047
1037
  "use strict";
1048
1038
  var $;
1049
1039
  (function ($) {
1050
- function $mol_base64_decode_safe(str) {
1040
+ function $mol_base64_url_encode(buffer) {
1041
+ return $mol_base64_encode(buffer).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
1042
+ }
1043
+ $.$mol_base64_url_encode = $mol_base64_url_encode;
1044
+ function $mol_base64_url_decode(str) {
1051
1045
  return $mol_base64_decode(str.replace(/-/g, '+').replace(/_/g, '/'));
1052
1046
  }
1053
- $.$mol_base64_decode_safe = $mol_base64_decode_safe;
1047
+ $.$mol_base64_url_decode = $mol_base64_url_decode;
1054
1048
  })($ || ($ = {}));
1055
- //mol/base64/decode/safe/safe.ts
1049
+ //mol/base64/url/url.ts
1056
1050
  ;
1057
1051
  "use strict";
1058
1052
  var $;
@@ -1080,8 +1074,8 @@ var $;
1080
1074
  }
1081
1075
  static async from(serial) {
1082
1076
  if (typeof serial !== 'string') {
1083
- serial = $mol_base64_encode_safe(serial.subarray(0, 32))
1084
- + $mol_base64_encode_safe(serial.subarray(32, 64));
1077
+ serial = $mol_base64_url_encode(serial.subarray(0, 32))
1078
+ + $mol_base64_url_encode(serial.subarray(32, 64));
1085
1079
  }
1086
1080
  return new this(await $mol_crypto_native.subtle.importKey('jwk', {
1087
1081
  crv: "P-256",
@@ -1099,8 +1093,8 @@ var $;
1099
1093
  async toArray() {
1100
1094
  const { x, y, d } = await $mol_crypto_native.subtle.exportKey('jwk', this.native);
1101
1095
  return new Uint8Array([
1102
- ...$mol_base64_decode_safe(x),
1103
- ...$mol_base64_decode_safe(y),
1096
+ ...$mol_base64_url_decode(x),
1097
+ ...$mol_base64_url_decode(y),
1104
1098
  ]);
1105
1099
  }
1106
1100
  async verify(data, sign) {
@@ -1118,9 +1112,9 @@ var $;
1118
1112
  }
1119
1113
  static async from(serial) {
1120
1114
  if (typeof serial !== 'string') {
1121
- serial = $mol_base64_encode_safe(serial.subarray(0, 32))
1122
- + $mol_base64_encode_safe(serial.subarray(32, 64))
1123
- + $mol_base64_encode_safe(serial.subarray(64));
1115
+ serial = $mol_base64_url_encode(serial.subarray(0, 32))
1116
+ + $mol_base64_url_encode(serial.subarray(32, 64))
1117
+ + $mol_base64_url_encode(serial.subarray(64));
1124
1118
  }
1125
1119
  return new this(await $mol_crypto_native.subtle.importKey('jwk', {
1126
1120
  crv: "P-256",
@@ -1139,9 +1133,9 @@ var $;
1139
1133
  async toArray() {
1140
1134
  const { x, y, d } = await $mol_crypto_native.subtle.exportKey('jwk', this.native);
1141
1135
  return new Uint8Array([
1142
- ...$mol_base64_decode_safe(x),
1143
- ...$mol_base64_decode_safe(y),
1144
- ...$mol_base64_decode_safe(d),
1136
+ ...$mol_base64_url_decode(x),
1137
+ ...$mol_base64_url_decode(y),
1138
+ ...$mol_base64_url_decode(d),
1145
1139
  ]);
1146
1140
  }
1147
1141
  async sign(data) {
@@ -1214,7 +1208,12 @@ var $;
1214
1208
  if (!val)
1215
1209
  return null;
1216
1210
  if ($.$mol_dev_format_head in val) {
1217
- return val[$.$mol_dev_format_head]();
1211
+ try {
1212
+ return val[$.$mol_dev_format_head]();
1213
+ }
1214
+ catch (error) {
1215
+ return $.$mol_dev_format_accent($mol_dev_format_native(val), '💨', $mol_dev_format_native(error), '');
1216
+ }
1218
1217
  }
1219
1218
  if (typeof val === 'function') {
1220
1219
  return $mol_dev_format_native(val);
@@ -3067,6 +3066,7 @@ var $;
3067
3066
  const getter = (() => value);
3068
3067
  getter['()'] = value;
3069
3068
  getter[Symbol.toStringTag] = value;
3069
+ getter[$mol_dev_format_head] = () => $mol_dev_format_span({}, '()=> ', $mol_dev_format_auto(value));
3070
3070
  return getter;
3071
3071
  }
3072
3072
  $.$mol_const = $mol_const;
@@ -3440,17 +3440,17 @@ var $;
3440
3440
  (function ($) {
3441
3441
  class $hyoo_crowd_fund extends $mol_object {
3442
3442
  world;
3443
- Node;
3444
- constructor(world, Node) {
3443
+ node_class;
3444
+ constructor(world, node_class) {
3445
3445
  super();
3446
3446
  this.world = world;
3447
- this.Node = Node;
3447
+ this.node_class = node_class;
3448
3448
  }
3449
3449
  Item(id) {
3450
3450
  const [land, head] = id.split('!');
3451
3451
  if (!head)
3452
3452
  return this.Item(`${land}!0_0`);
3453
- return this.world.land_sync(land).node(head, this.Node);
3453
+ return this.world.land_sync(land).node(head, this.node_class);
3454
3454
  }
3455
3455
  make(law = [''], mod = [], add = []) {
3456
3456
  const land = $mol_wire_sync(this.world).grab(law, mod, add);