typeson-registry 11.1.0 → 11.1.1

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/dist/index.js CHANGED
@@ -113,7 +113,8 @@ const arraybuffer = {
113
113
  stateObj.buffers.push(b);
114
114
  return {
115
115
  s: encode(b),
116
- maxByteLength: b.maxByteLength
116
+ maxByteLength: b.maxByteLength,
117
+ resizable: b.resizable
117
118
  };
118
119
  },
119
120
  revive (
@@ -137,7 +138,11 @@ const arraybuffer = {
137
138
  }
138
139
  const buffer = decode(
139
140
  /** @type {string} */ (b64.s),
140
- {maxByteLength: b64.maxByteLength}
141
+ b64.resizable
142
+ // todo[engine:node@>20]: Remove comment
143
+ /* c8 ignore next -- Node >= 20 */
144
+ ? {maxByteLength: b64.maxByteLength}
145
+ : undefined
141
146
  );
142
147
  stateObj.buffers.push(buffer);
143
148
  return buffer;
@@ -323,11 +328,11 @@ function generateUUID () { // Adapted from original: public domain/MIT: http://
323
328
  let d = Date.now();
324
329
 
325
330
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replaceAll(/[xy]/gu, function (c) {
326
- /* eslint-disable no-bitwise -- Convenient */
331
+ /* eslint-disable no-bitwise, sonarjs/pseudo-random -- Convenient */
327
332
  const r = Math.trunc((d + (Math.random() * 16)) % 16);
328
333
  d = Math.floor(d / 16);
329
334
  return (c === 'x' ? r : ((r & 0x3) | 0x8)).toString(16);
330
- /* eslint-enable no-bitwise -- Convenient */
335
+ /* eslint-enable no-bitwise, sonarjs/pseudo-random -- Convenient */
331
336
  });
332
337
  }
333
338
 
@@ -437,6 +442,7 @@ const dataview = {
437
442
  return {
438
443
  encoded: encode(buffer),
439
444
  maxByteLength: buffer.maxByteLength,
445
+ resizable: buffer.resizable,
440
446
  byteOffset,
441
447
  byteLength
442
448
  };
@@ -454,7 +460,8 @@ const dataview = {
454
460
  stateObj.buffers = [];
455
461
  }
456
462
  const {
457
- byteOffset, byteLength, encoded, index, maxByteLength
463
+ byteOffset, byteLength, encoded, index, maxByteLength,
464
+ resizable
458
465
  } = b64Obj;
459
466
  let buffer;
460
467
  if ('index' in b64Obj) {
@@ -462,10 +469,11 @@ const dataview = {
462
469
  } else {
463
470
  buffer = decode(
464
471
  encoded,
472
+ // todo[engine:node@>20]: Remove comment
465
473
  /* c8 ignore next 3 -- Depends on Node version */
466
- maxByteLength === undefined
467
- ? maxByteLength
468
- : {maxByteLength}
474
+ resizable
475
+ ? {maxByteLength}
476
+ : maxByteLength
469
477
  );
470
478
  stateObj.buffers.push(buffer);
471
479
  }
@@ -1423,6 +1431,7 @@ function create (TypedArray) {
1423
1431
  stateObj.buffers.push(buffer);
1424
1432
  return {
1425
1433
  maxByteLength: buffer.maxByteLength,
1434
+ resizable: buffer.resizable,
1426
1435
  encoded: encode(buffer),
1427
1436
  byteOffset,
1428
1437
  length: l
@@ -1441,7 +1450,8 @@ function create (TypedArray) {
1441
1450
  stateObj.buffers = [];
1442
1451
  }
1443
1452
  const {
1444
- byteOffset, length: len, encoded, index, maxByteLength
1453
+ byteOffset, length: len, encoded, index, maxByteLength,
1454
+ resizable
1445
1455
  } = b64Obj;
1446
1456
  let buffer;
1447
1457
  if ('index' in b64Obj) {
@@ -1449,10 +1459,11 @@ function create (TypedArray) {
1449
1459
  } else {
1450
1460
  buffer = decode(
1451
1461
  encoded,
1462
+ // todo[engine:node@>20]: Remove comment
1452
1463
  /* c8 ignore next 3 -- Depends on Node version */
1453
- maxByteLength === undefined
1454
- ? undefined
1455
- : {maxByteLength}
1464
+ resizable
1465
+ ? {maxByteLength}
1466
+ : undefined
1456
1467
  );
1457
1468
  stateObj.buffers.push(buffer);
1458
1469
  }