@fluid-internal/client-utils 3.5.0 → 3.7.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @fluid-internal/client-utils
2
2
 
3
+ ## 3.7.0
4
+
5
+ Dependency updates only.
6
+
7
+ ## 3.6.0
8
+
9
+ Dependency updates only.
10
+
3
11
  ## 3.5.0
4
12
 
5
13
  Dependency updates only.
@@ -1 +1 @@
1
- {"version":3,"file":"bufferShared.d.ts","sourceRoot":"","sources":["../src/bufferShared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW,CASjF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,SAAS,eAAe,EAC/E,KAAK,EAAE,UAAU,CAAC,YAAY,CAAC,GAC7B,YAAY,CAWd;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,CAgBzE"}
1
+ {"version":3,"file":"bufferShared.d.ts","sourceRoot":"","sources":["../src/bufferShared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW,CASjF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,SAAS,eAAe,EAC/E,KAAK,EAAE,UAAU,CAAC,YAAY,CAAC,GAC7B,YAAY,CAWd;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,CAmBzE"}
@@ -72,12 +72,15 @@ function AnyUint8ArrayToArrayBuffer(array) {
72
72
  array.buffer instanceof ArrayBuffer) {
73
73
  return array.buffer;
74
74
  }
75
- // .slice is used to ensure underlying buffer is:
75
+ // Copy into a new `Uint8Array` so that the result's underlying buffer is:
76
76
  // 1. ArrayBuffer
77
77
  // 2. the complete data (no offset, full length)
78
- // Cloning specified per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice
79
- // and ECMAScript https://tc39.es/ecma262/multipage/indexed-collections.html#sec-%typedarray%.prototype.slice.
80
- // eslint-disable-next-line unicorn/prefer-spread -- spread is not the same as slice for `Uint8Array`
81
- return array.slice().buffer;
78
+ // Constructing from a typed array always allocates a fresh `ArrayBuffer` of exactly
79
+ // `array.byteLength` bytes. See ECMAScript https://tc39.es/ecma262/multipage/indexed-collections.html#sec-initializetypedarrayfromtypedarray.
80
+ //
81
+ // `array.slice()` must not be used here: Node.js `Buffer` extends Uint8Array and overrides `slice` to
82
+ // return a view over the same memory (like `subarray`) rather than a copy, so `.buffer` of the result
83
+ // would be the entire (possibly pooled) backing buffer, including bytes outside the input view.
84
+ return new Uint8Array(array).buffer;
82
85
  }
83
86
  //# sourceMappingURL=bufferShared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bufferShared.js","sourceRoot":"","sources":["../src/bufferShared.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAaH,oEASC;AAeD,kEAaC;AAiBD,gEAgBC;AAjFD;;;;;;;;;;GAUG;AACH,SAAgB,4BAA4B,CAAC,MAAuB;IACnE,IAAI,MAAM,YAAY,WAAW,EAAE,CAAC;QACnC,OAAO,MAAM,CAAC;IACf,CAAC;IACD,gEAAgE;IAChE,uEAAuE;IACvE,0EAA0E;IAC1E,qGAAqG;IACrG,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC;AAC9C,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,2BAA2B,CAC1C,KAA+B;IAE/B,IAAI,KAAK,CAAC,UAAU,KAAK,CAAC,IAAI,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QAC5E,OAAO,KAAK,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,6EAA6E;IAC7E,yEAAyE;IACzE,+DAA+D;IAC/D,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CACxB,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CACnB,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,0BAA0B,CAAC,KAAiB;IAC3D,8DAA8D;IAC9D,IACC,KAAK,CAAC,UAAU,KAAK,CAAC;QACtB,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,MAAM,CAAC,UAAU;QAC5C,KAAK,CAAC,MAAM,YAAY,WAAW,EAClC,CAAC;QACF,OAAO,KAAK,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,iDAAiD;IACjD,kBAAkB;IAClB,iDAAiD;IACjD,0HAA0H;IAC1H,8GAA8G;IAC9G,qGAAqG;IACrG,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC;AAC7B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Distills an `ArrayBuffer` from an `ArrayBufferLike` or creates one from `SharedArrayBuffer` if needed.\n *\n * @param buffer - `ArrayBuffer` or any `ArrayBufferLike` to convert to `ArrayBuffer`.\n *\n * @remarks The returned buffer may be the input array's backing buffer or a copy of its bytes.\n * Callers should not mutate the returned buffer unless they own the input array and its backing\n * storage, and should not rely on mutations being reflected in the input array.\n *\n * @internal\n */\nexport function ArrayBufferLikeToArrayBuffer(buffer: ArrayBufferLike): ArrayBuffer {\n\tif (buffer instanceof ArrayBuffer) {\n\t\treturn buffer;\n\t}\n\t// Use .slice to get `ArrayBuffer` backing that `Blob` requires.\n\t// Note that `buffer.slice` preserves the underlying buffer type, so we\n\t// need to use .slice on a `Uint8Array` to ensure we get an `ArrayBuffer`.\n\t// eslint-disable-next-line unicorn/prefer-spread -- spread is not the same as slice for `Uint8Array`\n\treturn new Uint8Array(buffer).slice().buffer;\n}\n\n/**\n * Distills a `Uint8Array` array to an `ArrayBuffer | SharedArrayBuffer` copying\n * data as needed per the array's `byteOffset` and `byteLength` to have a full\n * buffer (no offset and entire length).\n *\n * @param array - Array to extract buffer from.\n *\n * @remarks The returned buffer may be the input array's backing buffer or a copy of its bytes.\n * Callers should not mutate the returned buffer unless they own the input array and its backing\n * storage, and should not rely on mutations being reflected in the input array.\n *\n * @internal\n */\nexport function Uint8ArrayToArrayBufferLike<TArrayBuffer extends ArrayBufferLike>(\n\tarray: Uint8Array<TArrayBuffer>,\n): TArrayBuffer {\n\tif (array.byteOffset === 0 && array.byteLength === array.buffer.byteLength) {\n\t\treturn array.buffer;\n\t}\n\t// Both ArrayBuffer and SharedArrayBuffer have a slice method and will return\n\t// their same type, but TypeScript does not correctly determine that will\n\t// satisfy TArrayBuffer. Cast to TArrayBuffer to indicate that.\n\treturn array.buffer.slice(\n\t\tarray.byteOffset,\n\t\tarray.byteOffset + array.byteLength,\n\t) as TArrayBuffer;\n}\n\n/**\n * Distills a `Uint8Array` array to an `ArrayBuffer` copying data as needed per the array's\n * `byteOffset` and `byteLength` or if underlying buffer is not `ArrayBuffer`.\n *\n * @param array - Array to convert to `ArrayBuffer`.\n *\n * @remarks The returned buffer may be the input array's backing buffer or a copy of its bytes.\n * Callers should not mutate the returned buffer unless they own the input array and its backing\n * storage, and should not rely on mutations being reflected in the input array.\n *\n * Prefer to use {@link Uint8ArrayToArrayBufferLike} if the call site doesn't require\n * an explicit `ArrayBuffer` (can also handle `SharedArrayBuffer`).\n *\n * @internal\n */\nexport function AnyUint8ArrayToArrayBuffer(array: Uint8Array): ArrayBuffer {\n\t// Shortcut to provider underlying buffer as-is when possible.\n\tif (\n\t\tarray.byteOffset === 0 &&\n\t\tarray.byteLength === array.buffer.byteLength &&\n\t\tarray.buffer instanceof ArrayBuffer\n\t) {\n\t\treturn array.buffer;\n\t}\n\t// .slice is used to ensure underlying buffer is:\n\t// 1. ArrayBuffer\n\t// 2. the complete data (no offset, full length)\n\t// Cloning specified per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice\n\t// and ECMAScript https://tc39.es/ecma262/multipage/indexed-collections.html#sec-%typedarray%.prototype.slice.\n\t// eslint-disable-next-line unicorn/prefer-spread -- spread is not the same as slice for `Uint8Array`\n\treturn array.slice().buffer;\n}\n"]}
1
+ {"version":3,"file":"bufferShared.js","sourceRoot":"","sources":["../src/bufferShared.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAaH,oEASC;AAeD,kEAaC;AAiBD,gEAmBC;AApFD;;;;;;;;;;GAUG;AACH,SAAgB,4BAA4B,CAAC,MAAuB;IACnE,IAAI,MAAM,YAAY,WAAW,EAAE,CAAC;QACnC,OAAO,MAAM,CAAC;IACf,CAAC;IACD,gEAAgE;IAChE,uEAAuE;IACvE,0EAA0E;IAC1E,qGAAqG;IACrG,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC;AAC9C,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,2BAA2B,CAC1C,KAA+B;IAE/B,IAAI,KAAK,CAAC,UAAU,KAAK,CAAC,IAAI,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QAC5E,OAAO,KAAK,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,6EAA6E;IAC7E,yEAAyE;IACzE,+DAA+D;IAC/D,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CACxB,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CACnB,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,0BAA0B,CAAC,KAAiB;IAC3D,8DAA8D;IAC9D,IACC,KAAK,CAAC,UAAU,KAAK,CAAC;QACtB,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,MAAM,CAAC,UAAU;QAC5C,KAAK,CAAC,MAAM,YAAY,WAAW,EAClC,CAAC;QACF,OAAO,KAAK,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,0EAA0E;IAC1E,kBAAkB;IAClB,iDAAiD;IACjD,oFAAoF;IACpF,8IAA8I;IAC9I,EAAE;IACF,sGAAsG;IACtG,sGAAsG;IACtG,gGAAgG;IAChG,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;AACrC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Distills an `ArrayBuffer` from an `ArrayBufferLike` or creates one from `SharedArrayBuffer` if needed.\n *\n * @param buffer - `ArrayBuffer` or any `ArrayBufferLike` to convert to `ArrayBuffer`.\n *\n * @remarks The returned buffer may be the input array's backing buffer or a copy of its bytes.\n * Callers should not mutate the returned buffer unless they own the input array and its backing\n * storage, and should not rely on mutations being reflected in the input array.\n *\n * @internal\n */\nexport function ArrayBufferLikeToArrayBuffer(buffer: ArrayBufferLike): ArrayBuffer {\n\tif (buffer instanceof ArrayBuffer) {\n\t\treturn buffer;\n\t}\n\t// Use .slice to get `ArrayBuffer` backing that `Blob` requires.\n\t// Note that `buffer.slice` preserves the underlying buffer type, so we\n\t// need to use .slice on a `Uint8Array` to ensure we get an `ArrayBuffer`.\n\t// eslint-disable-next-line unicorn/prefer-spread -- spread is not the same as slice for `Uint8Array`\n\treturn new Uint8Array(buffer).slice().buffer;\n}\n\n/**\n * Distills a `Uint8Array` array to an `ArrayBuffer | SharedArrayBuffer` copying\n * data as needed per the array's `byteOffset` and `byteLength` to have a full\n * buffer (no offset and entire length).\n *\n * @param array - Array to extract buffer from.\n *\n * @remarks The returned buffer may be the input array's backing buffer or a copy of its bytes.\n * Callers should not mutate the returned buffer unless they own the input array and its backing\n * storage, and should not rely on mutations being reflected in the input array.\n *\n * @internal\n */\nexport function Uint8ArrayToArrayBufferLike<TArrayBuffer extends ArrayBufferLike>(\n\tarray: Uint8Array<TArrayBuffer>,\n): TArrayBuffer {\n\tif (array.byteOffset === 0 && array.byteLength === array.buffer.byteLength) {\n\t\treturn array.buffer;\n\t}\n\t// Both ArrayBuffer and SharedArrayBuffer have a slice method and will return\n\t// their same type, but TypeScript does not correctly determine that will\n\t// satisfy TArrayBuffer. Cast to TArrayBuffer to indicate that.\n\treturn array.buffer.slice(\n\t\tarray.byteOffset,\n\t\tarray.byteOffset + array.byteLength,\n\t) as TArrayBuffer;\n}\n\n/**\n * Distills a `Uint8Array` array to an `ArrayBuffer` copying data as needed per the array's\n * `byteOffset` and `byteLength` or if underlying buffer is not `ArrayBuffer`.\n *\n * @param array - Array to convert to `ArrayBuffer`.\n *\n * @remarks The returned buffer may be the input array's backing buffer or a copy of its bytes.\n * Callers should not mutate the returned buffer unless they own the input array and its backing\n * storage, and should not rely on mutations being reflected in the input array.\n *\n * Prefer to use {@link Uint8ArrayToArrayBufferLike} if the call site doesn't require\n * an explicit `ArrayBuffer` (can also handle `SharedArrayBuffer`).\n *\n * @internal\n */\nexport function AnyUint8ArrayToArrayBuffer(array: Uint8Array): ArrayBuffer {\n\t// Shortcut to provider underlying buffer as-is when possible.\n\tif (\n\t\tarray.byteOffset === 0 &&\n\t\tarray.byteLength === array.buffer.byteLength &&\n\t\tarray.buffer instanceof ArrayBuffer\n\t) {\n\t\treturn array.buffer;\n\t}\n\t// Copy into a new `Uint8Array` so that the result's underlying buffer is:\n\t// 1. ArrayBuffer\n\t// 2. the complete data (no offset, full length)\n\t// Constructing from a typed array always allocates a fresh `ArrayBuffer` of exactly\n\t// `array.byteLength` bytes. See ECMAScript https://tc39.es/ecma262/multipage/indexed-collections.html#sec-initializetypedarrayfromtypedarray.\n\t//\n\t// `array.slice()` must not be used here: Node.js `Buffer` extends Uint8Array and overrides `slice` to\n\t// return a view over the same memory (like `subarray`) rather than a copy, so `.buffer` of the result\n\t// would be the entire (possibly pooled) backing buffer, including bytes outside the input view.\n\treturn new Uint8Array(array).buffer;\n}\n"]}
@@ -8,5 +8,5 @@
8
8
  * The generation number for Fluid layer compatibility.
9
9
  * @internal
10
10
  */
11
- export declare const generation = 10;
11
+ export declare const generation = 11;
12
12
  //# sourceMappingURL=layerGenerationState.d.ts.map
@@ -11,5 +11,5 @@ exports.generation = void 0;
11
11
  * The generation number for Fluid layer compatibility.
12
12
  * @internal
13
13
  */
14
- exports.generation = 10;
14
+ exports.generation = 11;
15
15
  //# sourceMappingURL=layerGenerationState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layerGenerationState.js","sourceRoot":"","sources":["../src/layerGenerationState.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH;;;GAGG;AACU,QAAA,UAAU,GAAG,EAAE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\n/**\n * The generation number for Fluid layer compatibility.\n * @internal\n */\nexport const generation = 10;\n"]}
1
+ {"version":3,"file":"layerGenerationState.js","sourceRoot":"","sources":["../src/layerGenerationState.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH;;;GAGG;AACU,QAAA,UAAU,GAAG,EAAE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\n/**\n * The generation number for Fluid layer compatibility.\n * @internal\n */\nexport const generation = 11;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bufferShared.d.ts","sourceRoot":"","sources":["../src/bufferShared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW,CASjF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,SAAS,eAAe,EAC/E,KAAK,EAAE,UAAU,CAAC,YAAY,CAAC,GAC7B,YAAY,CAWd;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,CAgBzE"}
1
+ {"version":3,"file":"bufferShared.d.ts","sourceRoot":"","sources":["../src/bufferShared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,eAAe,GAAG,WAAW,CASjF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,SAAS,eAAe,EAC/E,KAAK,EAAE,UAAU,CAAC,YAAY,CAAC,GAC7B,YAAY,CAWd;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,CAmBzE"}
@@ -67,12 +67,15 @@ export function AnyUint8ArrayToArrayBuffer(array) {
67
67
  array.buffer instanceof ArrayBuffer) {
68
68
  return array.buffer;
69
69
  }
70
- // .slice is used to ensure underlying buffer is:
70
+ // Copy into a new `Uint8Array` so that the result's underlying buffer is:
71
71
  // 1. ArrayBuffer
72
72
  // 2. the complete data (no offset, full length)
73
- // Cloning specified per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice
74
- // and ECMAScript https://tc39.es/ecma262/multipage/indexed-collections.html#sec-%typedarray%.prototype.slice.
75
- // eslint-disable-next-line unicorn/prefer-spread -- spread is not the same as slice for `Uint8Array`
76
- return array.slice().buffer;
73
+ // Constructing from a typed array always allocates a fresh `ArrayBuffer` of exactly
74
+ // `array.byteLength` bytes. See ECMAScript https://tc39.es/ecma262/multipage/indexed-collections.html#sec-initializetypedarrayfromtypedarray.
75
+ //
76
+ // `array.slice()` must not be used here: Node.js `Buffer` extends Uint8Array and overrides `slice` to
77
+ // return a view over the same memory (like `subarray`) rather than a copy, so `.buffer` of the result
78
+ // would be the entire (possibly pooled) backing buffer, including bytes outside the input view.
79
+ return new Uint8Array(array).buffer;
77
80
  }
78
81
  //# sourceMappingURL=bufferShared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bufferShared.js","sourceRoot":"","sources":["../src/bufferShared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,4BAA4B,CAAC,MAAuB;IACnE,IAAI,MAAM,YAAY,WAAW,EAAE,CAAC;QACnC,OAAO,MAAM,CAAC;IACf,CAAC;IACD,gEAAgE;IAChE,uEAAuE;IACvE,0EAA0E;IAC1E,qGAAqG;IACrG,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC;AAC9C,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,2BAA2B,CAC1C,KAA+B;IAE/B,IAAI,KAAK,CAAC,UAAU,KAAK,CAAC,IAAI,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QAC5E,OAAO,KAAK,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,6EAA6E;IAC7E,yEAAyE;IACzE,+DAA+D;IAC/D,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CACxB,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CACnB,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,0BAA0B,CAAC,KAAiB;IAC3D,8DAA8D;IAC9D,IACC,KAAK,CAAC,UAAU,KAAK,CAAC;QACtB,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,MAAM,CAAC,UAAU;QAC5C,KAAK,CAAC,MAAM,YAAY,WAAW,EAClC,CAAC;QACF,OAAO,KAAK,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,iDAAiD;IACjD,kBAAkB;IAClB,iDAAiD;IACjD,0HAA0H;IAC1H,8GAA8G;IAC9G,qGAAqG;IACrG,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC;AAC7B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Distills an `ArrayBuffer` from an `ArrayBufferLike` or creates one from `SharedArrayBuffer` if needed.\n *\n * @param buffer - `ArrayBuffer` or any `ArrayBufferLike` to convert to `ArrayBuffer`.\n *\n * @remarks The returned buffer may be the input array's backing buffer or a copy of its bytes.\n * Callers should not mutate the returned buffer unless they own the input array and its backing\n * storage, and should not rely on mutations being reflected in the input array.\n *\n * @internal\n */\nexport function ArrayBufferLikeToArrayBuffer(buffer: ArrayBufferLike): ArrayBuffer {\n\tif (buffer instanceof ArrayBuffer) {\n\t\treturn buffer;\n\t}\n\t// Use .slice to get `ArrayBuffer` backing that `Blob` requires.\n\t// Note that `buffer.slice` preserves the underlying buffer type, so we\n\t// need to use .slice on a `Uint8Array` to ensure we get an `ArrayBuffer`.\n\t// eslint-disable-next-line unicorn/prefer-spread -- spread is not the same as slice for `Uint8Array`\n\treturn new Uint8Array(buffer).slice().buffer;\n}\n\n/**\n * Distills a `Uint8Array` array to an `ArrayBuffer | SharedArrayBuffer` copying\n * data as needed per the array's `byteOffset` and `byteLength` to have a full\n * buffer (no offset and entire length).\n *\n * @param array - Array to extract buffer from.\n *\n * @remarks The returned buffer may be the input array's backing buffer or a copy of its bytes.\n * Callers should not mutate the returned buffer unless they own the input array and its backing\n * storage, and should not rely on mutations being reflected in the input array.\n *\n * @internal\n */\nexport function Uint8ArrayToArrayBufferLike<TArrayBuffer extends ArrayBufferLike>(\n\tarray: Uint8Array<TArrayBuffer>,\n): TArrayBuffer {\n\tif (array.byteOffset === 0 && array.byteLength === array.buffer.byteLength) {\n\t\treturn array.buffer;\n\t}\n\t// Both ArrayBuffer and SharedArrayBuffer have a slice method and will return\n\t// their same type, but TypeScript does not correctly determine that will\n\t// satisfy TArrayBuffer. Cast to TArrayBuffer to indicate that.\n\treturn array.buffer.slice(\n\t\tarray.byteOffset,\n\t\tarray.byteOffset + array.byteLength,\n\t) as TArrayBuffer;\n}\n\n/**\n * Distills a `Uint8Array` array to an `ArrayBuffer` copying data as needed per the array's\n * `byteOffset` and `byteLength` or if underlying buffer is not `ArrayBuffer`.\n *\n * @param array - Array to convert to `ArrayBuffer`.\n *\n * @remarks The returned buffer may be the input array's backing buffer or a copy of its bytes.\n * Callers should not mutate the returned buffer unless they own the input array and its backing\n * storage, and should not rely on mutations being reflected in the input array.\n *\n * Prefer to use {@link Uint8ArrayToArrayBufferLike} if the call site doesn't require\n * an explicit `ArrayBuffer` (can also handle `SharedArrayBuffer`).\n *\n * @internal\n */\nexport function AnyUint8ArrayToArrayBuffer(array: Uint8Array): ArrayBuffer {\n\t// Shortcut to provider underlying buffer as-is when possible.\n\tif (\n\t\tarray.byteOffset === 0 &&\n\t\tarray.byteLength === array.buffer.byteLength &&\n\t\tarray.buffer instanceof ArrayBuffer\n\t) {\n\t\treturn array.buffer;\n\t}\n\t// .slice is used to ensure underlying buffer is:\n\t// 1. ArrayBuffer\n\t// 2. the complete data (no offset, full length)\n\t// Cloning specified per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice\n\t// and ECMAScript https://tc39.es/ecma262/multipage/indexed-collections.html#sec-%typedarray%.prototype.slice.\n\t// eslint-disable-next-line unicorn/prefer-spread -- spread is not the same as slice for `Uint8Array`\n\treturn array.slice().buffer;\n}\n"]}
1
+ {"version":3,"file":"bufferShared.js","sourceRoot":"","sources":["../src/bufferShared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,4BAA4B,CAAC,MAAuB;IACnE,IAAI,MAAM,YAAY,WAAW,EAAE,CAAC;QACnC,OAAO,MAAM,CAAC;IACf,CAAC;IACD,gEAAgE;IAChE,uEAAuE;IACvE,0EAA0E;IAC1E,qGAAqG;IACrG,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC;AAC9C,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,2BAA2B,CAC1C,KAA+B;IAE/B,IAAI,KAAK,CAAC,UAAU,KAAK,CAAC,IAAI,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QAC5E,OAAO,KAAK,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,6EAA6E;IAC7E,yEAAyE;IACzE,+DAA+D;IAC/D,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CACxB,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CACnB,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,0BAA0B,CAAC,KAAiB;IAC3D,8DAA8D;IAC9D,IACC,KAAK,CAAC,UAAU,KAAK,CAAC;QACtB,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,MAAM,CAAC,UAAU;QAC5C,KAAK,CAAC,MAAM,YAAY,WAAW,EAClC,CAAC;QACF,OAAO,KAAK,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,0EAA0E;IAC1E,kBAAkB;IAClB,iDAAiD;IACjD,oFAAoF;IACpF,8IAA8I;IAC9I,EAAE;IACF,sGAAsG;IACtG,sGAAsG;IACtG,gGAAgG;IAChG,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;AACrC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Distills an `ArrayBuffer` from an `ArrayBufferLike` or creates one from `SharedArrayBuffer` if needed.\n *\n * @param buffer - `ArrayBuffer` or any `ArrayBufferLike` to convert to `ArrayBuffer`.\n *\n * @remarks The returned buffer may be the input array's backing buffer or a copy of its bytes.\n * Callers should not mutate the returned buffer unless they own the input array and its backing\n * storage, and should not rely on mutations being reflected in the input array.\n *\n * @internal\n */\nexport function ArrayBufferLikeToArrayBuffer(buffer: ArrayBufferLike): ArrayBuffer {\n\tif (buffer instanceof ArrayBuffer) {\n\t\treturn buffer;\n\t}\n\t// Use .slice to get `ArrayBuffer` backing that `Blob` requires.\n\t// Note that `buffer.slice` preserves the underlying buffer type, so we\n\t// need to use .slice on a `Uint8Array` to ensure we get an `ArrayBuffer`.\n\t// eslint-disable-next-line unicorn/prefer-spread -- spread is not the same as slice for `Uint8Array`\n\treturn new Uint8Array(buffer).slice().buffer;\n}\n\n/**\n * Distills a `Uint8Array` array to an `ArrayBuffer | SharedArrayBuffer` copying\n * data as needed per the array's `byteOffset` and `byteLength` to have a full\n * buffer (no offset and entire length).\n *\n * @param array - Array to extract buffer from.\n *\n * @remarks The returned buffer may be the input array's backing buffer or a copy of its bytes.\n * Callers should not mutate the returned buffer unless they own the input array and its backing\n * storage, and should not rely on mutations being reflected in the input array.\n *\n * @internal\n */\nexport function Uint8ArrayToArrayBufferLike<TArrayBuffer extends ArrayBufferLike>(\n\tarray: Uint8Array<TArrayBuffer>,\n): TArrayBuffer {\n\tif (array.byteOffset === 0 && array.byteLength === array.buffer.byteLength) {\n\t\treturn array.buffer;\n\t}\n\t// Both ArrayBuffer and SharedArrayBuffer have a slice method and will return\n\t// their same type, but TypeScript does not correctly determine that will\n\t// satisfy TArrayBuffer. Cast to TArrayBuffer to indicate that.\n\treturn array.buffer.slice(\n\t\tarray.byteOffset,\n\t\tarray.byteOffset + array.byteLength,\n\t) as TArrayBuffer;\n}\n\n/**\n * Distills a `Uint8Array` array to an `ArrayBuffer` copying data as needed per the array's\n * `byteOffset` and `byteLength` or if underlying buffer is not `ArrayBuffer`.\n *\n * @param array - Array to convert to `ArrayBuffer`.\n *\n * @remarks The returned buffer may be the input array's backing buffer or a copy of its bytes.\n * Callers should not mutate the returned buffer unless they own the input array and its backing\n * storage, and should not rely on mutations being reflected in the input array.\n *\n * Prefer to use {@link Uint8ArrayToArrayBufferLike} if the call site doesn't require\n * an explicit `ArrayBuffer` (can also handle `SharedArrayBuffer`).\n *\n * @internal\n */\nexport function AnyUint8ArrayToArrayBuffer(array: Uint8Array): ArrayBuffer {\n\t// Shortcut to provider underlying buffer as-is when possible.\n\tif (\n\t\tarray.byteOffset === 0 &&\n\t\tarray.byteLength === array.buffer.byteLength &&\n\t\tarray.buffer instanceof ArrayBuffer\n\t) {\n\t\treturn array.buffer;\n\t}\n\t// Copy into a new `Uint8Array` so that the result's underlying buffer is:\n\t// 1. ArrayBuffer\n\t// 2. the complete data (no offset, full length)\n\t// Constructing from a typed array always allocates a fresh `ArrayBuffer` of exactly\n\t// `array.byteLength` bytes. See ECMAScript https://tc39.es/ecma262/multipage/indexed-collections.html#sec-initializetypedarrayfromtypedarray.\n\t//\n\t// `array.slice()` must not be used here: Node.js `Buffer` extends Uint8Array and overrides `slice` to\n\t// return a view over the same memory (like `subarray`) rather than a copy, so `.buffer` of the result\n\t// would be the entire (possibly pooled) backing buffer, including bytes outside the input view.\n\treturn new Uint8Array(array).buffer;\n}\n"]}
@@ -8,5 +8,5 @@
8
8
  * The generation number for Fluid layer compatibility.
9
9
  * @internal
10
10
  */
11
- export declare const generation = 10;
11
+ export declare const generation = 11;
12
12
  //# sourceMappingURL=layerGenerationState.d.ts.map
@@ -8,5 +8,5 @@
8
8
  * The generation number for Fluid layer compatibility.
9
9
  * @internal
10
10
  */
11
- export const generation = 10;
11
+ export const generation = 11;
12
12
  //# sourceMappingURL=layerGenerationState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layerGenerationState.js","sourceRoot":"","sources":["../src/layerGenerationState.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\n/**\n * The generation number for Fluid layer compatibility.\n * @internal\n */\nexport const generation = 10;\n"]}
1
+ {"version":3,"file":"layerGenerationState.js","sourceRoot":"","sources":["../src/layerGenerationState.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\n/**\n * The generation number for Fluid layer compatibility.\n * @internal\n */\nexport const generation = 11;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-internal/client-utils",
3
- "version": "3.5.0",
3
+ "version": "3.7.0",
4
4
  "description": "Not intended for use outside the Fluid Framework.",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -63,7 +63,7 @@
63
63
  "temp-directory": "nyc/.nyc_output"
64
64
  },
65
65
  "dependencies": {
66
- "@fluidframework/core-interfaces": "~3.5.0",
66
+ "@fluidframework/core-interfaces": "~3.7.0",
67
67
  "@types/events_pkg": "npm:@types/events@^3.0.0",
68
68
  "base64-js": "^1.5.1",
69
69
  "buffer": "^6.0.3",
@@ -73,11 +73,11 @@
73
73
  "devDependencies": {
74
74
  "@arethetypeswrong/cli": "^0.18.5",
75
75
  "@biomejs/biome": "~2.4.5",
76
- "@fluid-internal/client-utils-previous": "npm:@fluid-internal/client-utils@3.4.0",
77
- "@fluid-internal/mocha-test-setup": "~3.5.0",
78
- "@fluid-tools/build-cli": "^0.67.0",
76
+ "@fluid-internal/client-utils-previous": "npm:@fluid-internal/client-utils@3.6.0",
77
+ "@fluid-internal/mocha-test-setup": "~3.7.0",
78
+ "@fluid-tools/build-cli": "^0.68.0",
79
79
  "@fluidframework/build-common": "^2.0.3",
80
- "@fluidframework/build-tools": "^0.67.0",
80
+ "@fluidframework/build-tools": "^0.68.0",
81
81
  "@fluidframework/eslint-config-fluid": "^14.0.0",
82
82
  "@microsoft/api-extractor": "7.58.1",
83
83
  "@playwright/test": "^1.62.1",
@@ -198,9 +198,9 @@
198
198
  }
199
199
  },
200
200
  "fluidCompatMetadata": {
201
- "generation": 10,
202
- "releaseDate": "2026-09-14",
203
- "releasePkgVersion": "3.1.0"
201
+ "generation": 11,
202
+ "releaseDate": "2026-10-19",
203
+ "releasePkgVersion": "3.6.0"
204
204
  },
205
205
  "typeValidation": {
206
206
  "broken": {},
@@ -77,11 +77,14 @@ export function AnyUint8ArrayToArrayBuffer(array: Uint8Array): ArrayBuffer {
77
77
  ) {
78
78
  return array.buffer;
79
79
  }
80
- // .slice is used to ensure underlying buffer is:
80
+ // Copy into a new `Uint8Array` so that the result's underlying buffer is:
81
81
  // 1. ArrayBuffer
82
82
  // 2. the complete data (no offset, full length)
83
- // Cloning specified per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice
84
- // and ECMAScript https://tc39.es/ecma262/multipage/indexed-collections.html#sec-%typedarray%.prototype.slice.
85
- // eslint-disable-next-line unicorn/prefer-spread -- spread is not the same as slice for `Uint8Array`
86
- return array.slice().buffer;
83
+ // Constructing from a typed array always allocates a fresh `ArrayBuffer` of exactly
84
+ // `array.byteLength` bytes. See ECMAScript https://tc39.es/ecma262/multipage/indexed-collections.html#sec-initializetypedarrayfromtypedarray.
85
+ //
86
+ // `array.slice()` must not be used here: Node.js `Buffer` extends Uint8Array and overrides `slice` to
87
+ // return a view over the same memory (like `subarray`) rather than a copy, so `.buffer` of the result
88
+ // would be the entire (possibly pooled) backing buffer, including bytes outside the input view.
89
+ return new Uint8Array(array).buffer;
87
90
  }
@@ -9,4 +9,4 @@
9
9
  * The generation number for Fluid layer compatibility.
10
10
  * @internal
11
11
  */
12
- export const generation = 10;
12
+ export const generation = 11;