@fluid-internal/client-utils 2.0.0-dev-rc.1.0.0.232845 → 2.0.0-dev-rc.2.0.0.246488

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.
Files changed (155) hide show
  1. package/.eslintrc.cjs +1 -1
  2. package/{.mocharc.js → .mocharc.cjs} +1 -1
  3. package/CHANGELOG.md +4 -0
  4. package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
  5. package/api-extractor-lint.json +1 -1
  6. package/api-extractor.json +1 -1
  7. package/api-report/client-utils.api.md +8 -27
  8. package/dist/base64Encoding.js +4 -4
  9. package/dist/base64Encoding.js.map +1 -1
  10. package/dist/client-utils-alpha.d.ts +6 -11
  11. package/dist/client-utils-beta.d.ts +5 -11
  12. package/dist/client-utils-public.d.ts +5 -11
  13. package/dist/client-utils-untrimmed.d.ts +9 -39
  14. package/dist/eventEmitter.cjs +11 -0
  15. package/dist/eventEmitter.cjs.map +1 -0
  16. package/{lib/index.d.mts → dist/eventEmitter.d.cts} +2 -2
  17. package/dist/eventEmitter.d.cts.map +1 -0
  18. package/dist/hashFileBrowser.d.ts +1 -1
  19. package/dist/hashFileBrowser.d.ts.map +1 -1
  20. package/dist/hashFileBrowser.js +2 -2
  21. package/dist/hashFileBrowser.js.map +1 -1
  22. package/dist/hashFileNode.d.ts +1 -1
  23. package/dist/hashFileNode.d.ts.map +1 -1
  24. package/dist/hashFileNode.js.map +1 -1
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/indexBrowser.d.ts +9 -9
  30. package/dist/indexBrowser.d.ts.map +1 -1
  31. package/dist/indexBrowser.js +24 -24
  32. package/dist/indexBrowser.js.map +1 -1
  33. package/dist/indexNode.d.ts +10 -10
  34. package/dist/indexNode.d.ts.map +1 -1
  35. package/dist/indexNode.js +23 -23
  36. package/dist/indexNode.js.map +1 -1
  37. package/dist/package.json +7 -0
  38. package/dist/trace.js +3 -3
  39. package/dist/trace.js.map +1 -1
  40. package/dist/tsdoc-metadata.json +1 -1
  41. package/dist/typedEventEmitter.d.ts +3 -6
  42. package/dist/typedEventEmitter.d.ts.map +1 -1
  43. package/dist/typedEventEmitter.js +2 -4
  44. package/dist/typedEventEmitter.js.map +1 -1
  45. package/{jest-puppeteer.config.js → jest-puppeteer.config.cjs} +4 -1
  46. package/{jest.config.js → jest.config.cjs} +1 -0
  47. package/lib/{base64Encoding.d.mts → base64Encoding.d.ts} +1 -1
  48. package/lib/base64Encoding.d.ts.map +1 -0
  49. package/lib/{base64Encoding.mjs → base64Encoding.js} +2 -2
  50. package/lib/base64Encoding.js.map +1 -0
  51. package/lib/{bufferBrowser.d.mts → bufferBrowser.d.ts} +1 -1
  52. package/lib/bufferBrowser.d.ts.map +1 -0
  53. package/lib/{bufferBrowser.mjs → bufferBrowser.js} +1 -1
  54. package/lib/bufferBrowser.js.map +1 -0
  55. package/lib/{bufferNode.d.mts → bufferNode.d.ts} +1 -1
  56. package/lib/bufferNode.d.ts.map +1 -0
  57. package/lib/{bufferNode.mjs → bufferNode.js} +1 -1
  58. package/lib/bufferNode.js.map +1 -0
  59. package/lib/{bufferShared.d.mts → bufferShared.d.ts} +1 -1
  60. package/lib/bufferShared.d.ts.map +1 -0
  61. package/lib/{bufferShared.mjs → bufferShared.js} +1 -1
  62. package/lib/bufferShared.js.map +1 -0
  63. package/lib/{client-utils-alpha.d.mts → client-utils-alpha.d.ts} +6 -11
  64. package/lib/{client-utils-public.d.mts → client-utils-beta.d.ts} +5 -11
  65. package/lib/{client-utils-beta.d.mts → client-utils-public.d.ts} +5 -11
  66. package/lib/{client-utils-untrimmed.d.mts → client-utils-untrimmed.d.ts} +9 -39
  67. package/lib/eventEmitter.cjs +11 -0
  68. package/lib/eventEmitter.cjs.map +1 -0
  69. package/lib/eventEmitter.d.cts +6 -0
  70. package/lib/eventEmitter.d.cts.map +1 -0
  71. package/lib/{hashFileNode.d.mts → hashFileBrowser.d.ts} +2 -2
  72. package/lib/hashFileBrowser.d.ts.map +1 -0
  73. package/lib/{hashFileBrowser.mjs → hashFileBrowser.js} +5 -3
  74. package/lib/{hashFileBrowser.mjs.map → hashFileBrowser.js.map} +1 -1
  75. package/lib/{hashFileBrowser.d.mts → hashFileNode.d.ts} +2 -2
  76. package/lib/hashFileNode.d.ts.map +1 -0
  77. package/lib/{hashFileNode.mjs → hashFileNode.js} +1 -1
  78. package/lib/hashFileNode.js.map +1 -0
  79. package/lib/{index.mjs → index.d.ts} +2 -2
  80. package/lib/index.d.ts.map +1 -0
  81. package/lib/index.js +10 -0
  82. package/lib/index.js.map +1 -0
  83. package/lib/indexBrowser.d.ts +14 -0
  84. package/lib/indexBrowser.d.ts.map +1 -0
  85. package/lib/indexBrowser.js +13 -0
  86. package/lib/indexBrowser.js.map +1 -0
  87. package/lib/indexNode.d.ts +15 -0
  88. package/lib/indexNode.d.ts.map +1 -0
  89. package/lib/indexNode.js +13 -0
  90. package/lib/indexNode.js.map +1 -0
  91. package/lib/{performanceIsomorphic.d.mts → performanceIsomorphic.d.ts} +1 -1
  92. package/lib/performanceIsomorphic.d.ts.map +1 -0
  93. package/lib/{performanceIsomorphic.mjs → performanceIsomorphic.js} +1 -1
  94. package/lib/performanceIsomorphic.js.map +1 -0
  95. package/lib/test/mocha/typedEventEmitter.spec.js +43 -0
  96. package/lib/test/mocha/typedEventEmitter.spec.js.map +1 -0
  97. package/lib/test/types/validateClientUtilsPrevious.generated.js +42 -0
  98. package/lib/test/types/validateClientUtilsPrevious.generated.js.map +1 -0
  99. package/lib/{trace.d.mts → trace.d.ts} +1 -1
  100. package/lib/trace.d.ts.map +1 -0
  101. package/lib/{trace.mjs → trace.js} +2 -2
  102. package/lib/trace.js.map +1 -0
  103. package/lib/{typedEventEmitter.d.mts → typedEventEmitter.d.ts} +4 -7
  104. package/lib/typedEventEmitter.d.ts.map +1 -0
  105. package/lib/{typedEventEmitter.mjs → typedEventEmitter.js} +2 -2
  106. package/lib/typedEventEmitter.js.map +1 -0
  107. package/package.json +50 -35
  108. package/src/base64Encoding.ts +1 -1
  109. package/src/cjs/package.json +7 -0
  110. package/src/eventEmitter.cts +7 -0
  111. package/src/hashFileBrowser.ts +1 -1
  112. package/src/hashFileNode.ts +1 -1
  113. package/src/index.ts +1 -1
  114. package/src/indexBrowser.ts +13 -9
  115. package/src/indexNode.ts +14 -10
  116. package/src/trace.ts +1 -1
  117. package/src/typedEventEmitter.ts +3 -8
  118. package/tsconfig.cjs.json +7 -0
  119. package/tsconfig.json +4 -7
  120. package/dist/eventForwarder.d.ts +0 -34
  121. package/dist/eventForwarder.d.ts.map +0 -1
  122. package/dist/eventForwarder.js +0 -98
  123. package/dist/eventForwarder.js.map +0 -1
  124. package/lib/base64Encoding.d.mts.map +0 -1
  125. package/lib/base64Encoding.mjs.map +0 -1
  126. package/lib/bufferBrowser.d.mts.map +0 -1
  127. package/lib/bufferBrowser.mjs.map +0 -1
  128. package/lib/bufferNode.d.mts.map +0 -1
  129. package/lib/bufferNode.mjs.map +0 -1
  130. package/lib/bufferShared.d.mts.map +0 -1
  131. package/lib/bufferShared.mjs.map +0 -1
  132. package/lib/eventForwarder.d.mts +0 -34
  133. package/lib/eventForwarder.d.mts.map +0 -1
  134. package/lib/eventForwarder.mjs +0 -94
  135. package/lib/eventForwarder.mjs.map +0 -1
  136. package/lib/hashFileBrowser.d.mts.map +0 -1
  137. package/lib/hashFileNode.d.mts.map +0 -1
  138. package/lib/hashFileNode.mjs.map +0 -1
  139. package/lib/index.d.mts.map +0 -1
  140. package/lib/index.mjs.map +0 -1
  141. package/lib/indexBrowser.d.mts +0 -14
  142. package/lib/indexBrowser.d.mts.map +0 -1
  143. package/lib/indexBrowser.mjs +0 -13
  144. package/lib/indexBrowser.mjs.map +0 -1
  145. package/lib/indexNode.d.mts +0 -15
  146. package/lib/indexNode.d.mts.map +0 -1
  147. package/lib/indexNode.mjs +0 -13
  148. package/lib/indexNode.mjs.map +0 -1
  149. package/lib/performanceIsomorphic.d.mts.map +0 -1
  150. package/lib/performanceIsomorphic.mjs.map +0 -1
  151. package/lib/trace.d.mts.map +0 -1
  152. package/lib/trace.mjs.map +0 -1
  153. package/lib/typedEventEmitter.d.mts.map +0 -1
  154. package/lib/typedEventEmitter.mjs.map +0 -1
  155. package/src/eventForwarder.ts +0 -122
@@ -1 +1 @@
1
- {"version":3,"file":"indexBrowser.js","sourceRoot":"","sources":["../src/indexBrowser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAMyB;AALxB,+GAAA,cAAc,OAAA;AACd,8GAAA,aAAa,OAAA;AACb,0GAAA,SAAS,OAAA;AACT,+GAAA,cAAc,OAAA;AACd,mHAAA,kBAAkB,OAAA;AAEnB,qDAA0D;AAAjD,8GAAA,WAAW,OAAA;AAAE,2GAAA,QAAQ,OAAA;AAC9B,iEAAsD;AAA7C,oHAAA,WAAW,OAAA;AAEpB,mDAA8E;AAArE,kHAAA,gBAAgB,OAAA;AAAE,kHAAA,gBAAgB,OAAA;AAAE,wGAAA,MAAM,OAAA;AACnD,+CAAyD;AAAhD,uHAAA,uBAAuB,OAAA;AAChC,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AAEvB,iCAA6C;AAAvB,8FAAA,KAAK,OAAA;AAC3B,yDAAoG;AAApE,sHAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tbufferToString,\n\tisArrayBuffer,\n\tIsoBuffer,\n\tstringToBuffer,\n\tUint8ArrayToString,\n} from \"./bufferBrowser\";\nexport { gitHashFile, hashFile } from \"./hashFileBrowser\";\nexport { performance } from \"./performanceIsomorphic\";\n\nexport { fromBase64ToUtf8, fromUtf8ToBase64, toUtf8 } from \"./base64Encoding\";\nexport { Uint8ArrayToArrayBuffer } from \"./bufferShared\";\nexport { EventForwarder } from \"./eventForwarder\";\nexport { IsomorphicPerformance } from \"./performanceIsomorphic\";\nexport { ITraceEvent, Trace } from \"./trace\";\nexport { EventEmitterEventType, TypedEventEmitter, TypedEventTransform } from \"./typedEventEmitter\";\n"]}
1
+ {"version":3,"file":"indexBrowser.js","sourceRoot":"","sources":["../src/indexBrowser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAM4B;AAL3B,kHAAA,cAAc,OAAA;AACd,iHAAA,aAAa,OAAA;AACb,6GAAA,SAAS,OAAA;AACT,kHAAA,cAAc,OAAA;AACd,sHAAA,kBAAkB,OAAA;AAEnB,2DAA6D;AAApD,iHAAA,WAAW,OAAA;AAAE,8GAAA,QAAQ,OAAA;AAC9B,uEAAyD;AAAhD,uHAAA,WAAW,OAAA;AAEpB,yDAAiF;AAAxE,qHAAA,gBAAgB,OAAA;AAAE,qHAAA,gBAAgB,OAAA;AAAE,2GAAA,MAAM,OAAA;AACnD,qDAA4D;AAAnD,0HAAA,uBAAuB,OAAA;AAChC,uDAAkD;AAAzC,gHAAA,YAAY,OAAA;AAErB,uCAAqD;AAA1B,iGAAA,KAAK,OAAA;AAChC,+DAIgC;AAF/B,yHAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tbufferToString,\n\tisArrayBuffer,\n\tIsoBuffer,\n\tstringToBuffer,\n\tUint8ArrayToString,\n} from \"./bufferBrowser.js\";\nexport { gitHashFile, hashFile } from \"./hashFileBrowser.js\";\nexport { performance } from \"./performanceIsomorphic.js\";\n\nexport { fromBase64ToUtf8, fromUtf8ToBase64, toUtf8 } from \"./base64Encoding.js\";\nexport { Uint8ArrayToArrayBuffer } from \"./bufferShared.js\";\nexport { EventEmitter } from \"./eventEmitter.cjs\";\nexport { type IsomorphicPerformance } from \"./performanceIsomorphic.js\";\nexport { type ITraceEvent, Trace } from \"./trace.js\";\nexport {\n\ttype EventEmitterEventType,\n\tTypedEventEmitter,\n\ttype TypedEventTransform,\n} from \"./typedEventEmitter.js\";\n"]}
@@ -2,14 +2,14 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { type Buffer } from "./bufferNode";
6
- export { bufferToString, IsoBuffer, stringToBuffer, Uint8ArrayToString } from "./bufferNode";
7
- export { gitHashFile, hashFile } from "./hashFileNode";
8
- export { performance } from "./performanceIsomorphic";
9
- export { fromBase64ToUtf8, fromUtf8ToBase64, toUtf8 } from "./base64Encoding";
10
- export { Uint8ArrayToArrayBuffer } from "./bufferShared";
11
- export { EventForwarder } from "./eventForwarder";
12
- export { IsomorphicPerformance } from "./performanceIsomorphic";
13
- export { ITraceEvent, Trace } from "./trace";
14
- export { EventEmitterEventType, TypedEventEmitter, TypedEventTransform } from "./typedEventEmitter";
5
+ export { type Buffer } from "./bufferNode.js";
6
+ export { bufferToString, IsoBuffer, stringToBuffer, Uint8ArrayToString } from "./bufferNode.js";
7
+ export { gitHashFile, hashFile } from "./hashFileNode.js";
8
+ export { performance } from "./performanceIsomorphic.js";
9
+ export { fromBase64ToUtf8, fromUtf8ToBase64, toUtf8 } from "./base64Encoding.js";
10
+ export { Uint8ArrayToArrayBuffer } from "./bufferShared.js";
11
+ export { EventEmitter } from "./eventEmitter.cjs";
12
+ export { IsomorphicPerformance } from "./performanceIsomorphic.js";
13
+ export { type ITraceEvent, Trace } from "./trace.js";
14
+ export { type EventEmitterEventType, TypedEventEmitter, type TypedEventTransform, } from "./typedEventEmitter.js";
15
15
  //# sourceMappingURL=indexNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"indexNode.d.ts","sourceRoot":"","sources":["../src/indexNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC7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wB,CAAC"}
package/dist/indexNode.js CHANGED
@@ -4,27 +4,27 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.TypedEventEmitter = exports.Trace = exports.EventForwarder = exports.Uint8ArrayToArrayBuffer = exports.toUtf8 = exports.fromUtf8ToBase64 = exports.fromBase64ToUtf8 = exports.performance = exports.hashFile = exports.gitHashFile = exports.Uint8ArrayToString = exports.stringToBuffer = exports.IsoBuffer = exports.bufferToString = void 0;
8
- var bufferNode_1 = require("./bufferNode");
9
- Object.defineProperty(exports, "bufferToString", { enumerable: true, get: function () { return bufferNode_1.bufferToString; } });
10
- Object.defineProperty(exports, "IsoBuffer", { enumerable: true, get: function () { return bufferNode_1.IsoBuffer; } });
11
- Object.defineProperty(exports, "stringToBuffer", { enumerable: true, get: function () { return bufferNode_1.stringToBuffer; } });
12
- Object.defineProperty(exports, "Uint8ArrayToString", { enumerable: true, get: function () { return bufferNode_1.Uint8ArrayToString; } });
13
- var hashFileNode_1 = require("./hashFileNode");
14
- Object.defineProperty(exports, "gitHashFile", { enumerable: true, get: function () { return hashFileNode_1.gitHashFile; } });
15
- Object.defineProperty(exports, "hashFile", { enumerable: true, get: function () { return hashFileNode_1.hashFile; } });
16
- var performanceIsomorphic_1 = require("./performanceIsomorphic");
17
- Object.defineProperty(exports, "performance", { enumerable: true, get: function () { return performanceIsomorphic_1.performance; } });
18
- var base64Encoding_1 = require("./base64Encoding");
19
- Object.defineProperty(exports, "fromBase64ToUtf8", { enumerable: true, get: function () { return base64Encoding_1.fromBase64ToUtf8; } });
20
- Object.defineProperty(exports, "fromUtf8ToBase64", { enumerable: true, get: function () { return base64Encoding_1.fromUtf8ToBase64; } });
21
- Object.defineProperty(exports, "toUtf8", { enumerable: true, get: function () { return base64Encoding_1.toUtf8; } });
22
- var bufferShared_1 = require("./bufferShared");
23
- Object.defineProperty(exports, "Uint8ArrayToArrayBuffer", { enumerable: true, get: function () { return bufferShared_1.Uint8ArrayToArrayBuffer; } });
24
- var eventForwarder_1 = require("./eventForwarder");
25
- Object.defineProperty(exports, "EventForwarder", { enumerable: true, get: function () { return eventForwarder_1.EventForwarder; } });
26
- var trace_1 = require("./trace");
27
- Object.defineProperty(exports, "Trace", { enumerable: true, get: function () { return trace_1.Trace; } });
28
- var typedEventEmitter_1 = require("./typedEventEmitter");
29
- Object.defineProperty(exports, "TypedEventEmitter", { enumerable: true, get: function () { return typedEventEmitter_1.TypedEventEmitter; } });
7
+ exports.TypedEventEmitter = exports.Trace = exports.EventEmitter = exports.Uint8ArrayToArrayBuffer = exports.toUtf8 = exports.fromUtf8ToBase64 = exports.fromBase64ToUtf8 = exports.performance = exports.hashFile = exports.gitHashFile = exports.Uint8ArrayToString = exports.stringToBuffer = exports.IsoBuffer = exports.bufferToString = void 0;
8
+ var bufferNode_js_1 = require("./bufferNode.js");
9
+ Object.defineProperty(exports, "bufferToString", { enumerable: true, get: function () { return bufferNode_js_1.bufferToString; } });
10
+ Object.defineProperty(exports, "IsoBuffer", { enumerable: true, get: function () { return bufferNode_js_1.IsoBuffer; } });
11
+ Object.defineProperty(exports, "stringToBuffer", { enumerable: true, get: function () { return bufferNode_js_1.stringToBuffer; } });
12
+ Object.defineProperty(exports, "Uint8ArrayToString", { enumerable: true, get: function () { return bufferNode_js_1.Uint8ArrayToString; } });
13
+ var hashFileNode_js_1 = require("./hashFileNode.js");
14
+ Object.defineProperty(exports, "gitHashFile", { enumerable: true, get: function () { return hashFileNode_js_1.gitHashFile; } });
15
+ Object.defineProperty(exports, "hashFile", { enumerable: true, get: function () { return hashFileNode_js_1.hashFile; } });
16
+ var performanceIsomorphic_js_1 = require("./performanceIsomorphic.js");
17
+ Object.defineProperty(exports, "performance", { enumerable: true, get: function () { return performanceIsomorphic_js_1.performance; } });
18
+ var base64Encoding_js_1 = require("./base64Encoding.js");
19
+ Object.defineProperty(exports, "fromBase64ToUtf8", { enumerable: true, get: function () { return base64Encoding_js_1.fromBase64ToUtf8; } });
20
+ Object.defineProperty(exports, "fromUtf8ToBase64", { enumerable: true, get: function () { return base64Encoding_js_1.fromUtf8ToBase64; } });
21
+ Object.defineProperty(exports, "toUtf8", { enumerable: true, get: function () { return base64Encoding_js_1.toUtf8; } });
22
+ var bufferShared_js_1 = require("./bufferShared.js");
23
+ Object.defineProperty(exports, "Uint8ArrayToArrayBuffer", { enumerable: true, get: function () { return bufferShared_js_1.Uint8ArrayToArrayBuffer; } });
24
+ var eventEmitter_cjs_1 = require("./eventEmitter.cjs");
25
+ Object.defineProperty(exports, "EventEmitter", { enumerable: true, get: function () { return eventEmitter_cjs_1.EventEmitter; } });
26
+ var trace_js_1 = require("./trace.js");
27
+ Object.defineProperty(exports, "Trace", { enumerable: true, get: function () { return trace_js_1.Trace; } });
28
+ var typedEventEmitter_js_1 = require("./typedEventEmitter.js");
29
+ Object.defineProperty(exports, "TypedEventEmitter", { enumerable: true, get: function () { return typedEventEmitter_js_1.TypedEventEmitter; } });
30
30
  //# sourceMappingURL=indexNode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"indexNode.js","sourceRoot":"","sources":["../src/indexNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,2CAA6F;AAApF,4GAAA,cAAc,OAAA;AAAE,uGAAA,SAAS,OAAA;AAAE,4GAAA,cAAc,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AACtE,+CAAuD;AAA9C,2GAAA,WAAW,OAAA;AAAE,wGAAA,QAAQ,OAAA;AAC9B,iEAAsD;AAA7C,oHAAA,WAAW,OAAA;AAEpB,mDAA8E;AAArE,kHAAA,gBAAgB,OAAA;AAAE,kHAAA,gBAAgB,OAAA;AAAE,wGAAA,MAAM,OAAA;AACnD,+CAAyD;AAAhD,uHAAA,uBAAuB,OAAA;AAChC,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AAEvB,iCAA6C;AAAvB,8FAAA,KAAK,OAAA;AAC3B,yDAAoG;AAApE,sHAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { type Buffer } from \"./bufferNode\";\nexport { bufferToString, IsoBuffer, stringToBuffer, Uint8ArrayToString } from \"./bufferNode\";\nexport { gitHashFile, hashFile } from \"./hashFileNode\";\nexport { performance } from \"./performanceIsomorphic\";\n\nexport { fromBase64ToUtf8, fromUtf8ToBase64, toUtf8 } from \"./base64Encoding\";\nexport { Uint8ArrayToArrayBuffer } from \"./bufferShared\";\nexport { EventForwarder } from \"./eventForwarder\";\nexport { IsomorphicPerformance } from \"./performanceIsomorphic\";\nexport { ITraceEvent, Trace } from \"./trace\";\nexport { EventEmitterEventType, TypedEventEmitter, TypedEventTransform } from \"./typedEventEmitter\";\n"]}
1
+ {"version":3,"file":"indexNode.js","sourceRoot":"","sources":["../src/indexNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,iDAAgG;AAAvF,+GAAA,cAAc,OAAA;AAAE,0GAAA,SAAS,OAAA;AAAE,+GAAA,cAAc,OAAA;AAAE,mHAAA,kBAAkB,OAAA;AACtE,qDAA0D;AAAjD,8GAAA,WAAW,OAAA;AAAE,2GAAA,QAAQ,OAAA;AAC9B,uEAAyD;AAAhD,uHAAA,WAAW,OAAA;AAEpB,yDAAiF;AAAxE,qHAAA,gBAAgB,OAAA;AAAE,qHAAA,gBAAgB,OAAA;AAAE,2GAAA,MAAM,OAAA;AACnD,qDAA4D;AAAnD,0HAAA,uBAAuB,OAAA;AAChC,uDAAkD;AAAzC,gHAAA,YAAY,OAAA;AAErB,uCAAqD;AAA1B,iGAAA,KAAK,OAAA;AAChC,+DAIgC;AAF/B,yHAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { type Buffer } from \"./bufferNode.js\";\nexport { bufferToString, IsoBuffer, stringToBuffer, Uint8ArrayToString } from \"./bufferNode.js\";\nexport { gitHashFile, hashFile } from \"./hashFileNode.js\";\nexport { performance } from \"./performanceIsomorphic.js\";\n\nexport { fromBase64ToUtf8, fromUtf8ToBase64, toUtf8 } from \"./base64Encoding.js\";\nexport { Uint8ArrayToArrayBuffer } from \"./bufferShared.js\";\nexport { EventEmitter } from \"./eventEmitter.cjs\";\nexport { IsomorphicPerformance } from \"./performanceIsomorphic.js\";\nexport { type ITraceEvent, Trace } from \"./trace.js\";\nexport {\n\ttype EventEmitterEventType,\n\tTypedEventEmitter,\n\ttype TypedEventTransform,\n} from \"./typedEventEmitter.js\";\n"]}
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "commonjs",
3
+ "browser": {
4
+ "./indexNode.js": "./indexBrowser.js",
5
+ "./indexNode.d.ts": "./indexBrowser.d.ts"
6
+ }
7
+ }
package/dist/trace.js CHANGED
@@ -5,7 +5,7 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.Trace = void 0;
8
- const indexNode_1 = require("./indexNode");
8
+ const indexNode_js_1 = require("./indexNode.js");
9
9
  /**
10
10
  * Helper class for tracing performance of events
11
11
  * Time measurements are in milliseconds as a floating point with a decimal
@@ -14,7 +14,7 @@ const indexNode_1 = require("./indexNode");
14
14
  */
15
15
  class Trace {
16
16
  static start() {
17
- const startTick = indexNode_1.performance.now();
17
+ const startTick = indexNode_js_1.performance.now();
18
18
  return new Trace(startTick);
19
19
  }
20
20
  constructor(startTick) {
@@ -22,7 +22,7 @@ class Trace {
22
22
  this.lastTick = startTick;
23
23
  }
24
24
  trace() {
25
- const tick = indexNode_1.performance.now();
25
+ const tick = indexNode_js_1.performance.now();
26
26
  const event = {
27
27
  totalTimeElapsed: tick - this.startTick,
28
28
  duration: tick - this.lastTick,
package/dist/trace.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"trace.js","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2CAA0C;AAE1C;;;;;GAKG;AACH,MAAa,KAAK;IACV,MAAM,CAAC,KAAK;QAClB,MAAM,SAAS,GAAG,uBAAW,CAAC,GAAG,EAAE,CAAC;QACpC,OAAO,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7B,CAAC;IAGD,YAAsC,SAAiB;QAAjB,cAAS,GAAT,SAAS,CAAQ;QACtD,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC3B,CAAC;IAEM,KAAK;QACX,MAAM,IAAI,GAAG,uBAAW,CAAC,GAAG,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG;YACb,gBAAgB,EAAE,IAAI,GAAG,IAAI,CAAC,SAAS;YACvC,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC,QAAQ;YAC9B,IAAI;SACJ,CAAC;QACF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,OAAO,KAAK,CAAC;IACd,CAAC;CACD;AArBD,sBAqBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performance } from \"./indexNode\";\n\n/**\n * Helper class for tracing performance of events\n * Time measurements are in milliseconds as a floating point with a decimal\n *\n * @internal\n */\nexport class Trace {\n\tpublic static start(): Trace {\n\t\tconst startTick = performance.now();\n\t\treturn new Trace(startTick);\n\t}\n\n\tprotected lastTick: number;\n\tprotected constructor(public readonly startTick: number) {\n\t\tthis.lastTick = startTick;\n\t}\n\n\tpublic trace(): ITraceEvent {\n\t\tconst tick = performance.now();\n\t\tconst event = {\n\t\t\ttotalTimeElapsed: tick - this.startTick,\n\t\t\tduration: tick - this.lastTick,\n\t\t\ttick,\n\t\t};\n\t\tthis.lastTick = tick;\n\t\treturn event;\n\t}\n}\n\n/**\n * Event in a performance trace including time elapsed.\n *\n * @internal\n */\nexport interface ITraceEvent {\n\t/**\n\t * Total time elapsed since the start of the Trace.\n\t * Measured in milliseconds as a floating point with a decimal\n\t */\n\treadonly totalTimeElapsed: number;\n\t/**\n\t * Time elapsed since the last trace event.\n\t * Measured in milliseconds as a floating point with a decimal\n\t */\n\treadonly duration: number;\n\t/**\n\t * This number represents a relative time which should\n\t * be consistent for all trace ticks.\n\t */\n\treadonly tick: number;\n}\n"]}
1
+ {"version":3,"file":"trace.js","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAA6C;AAE7C;;;;;GAKG;AACH,MAAa,KAAK;IACV,MAAM,CAAC,KAAK;QAClB,MAAM,SAAS,GAAG,0BAAW,CAAC,GAAG,EAAE,CAAC;QACpC,OAAO,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7B,CAAC;IAGD,YAAsC,SAAiB;QAAjB,cAAS,GAAT,SAAS,CAAQ;QACtD,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC3B,CAAC;IAEM,KAAK;QACX,MAAM,IAAI,GAAG,0BAAW,CAAC,GAAG,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG;YACb,gBAAgB,EAAE,IAAI,GAAG,IAAI,CAAC,SAAS;YACvC,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC,QAAQ;YAC9B,IAAI;SACJ,CAAC;QACF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,OAAO,KAAK,CAAC;IACd,CAAC;CACD;AArBD,sBAqBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performance } from \"./indexNode.js\";\n\n/**\n * Helper class for tracing performance of events\n * Time measurements are in milliseconds as a floating point with a decimal\n *\n * @internal\n */\nexport class Trace {\n\tpublic static start(): Trace {\n\t\tconst startTick = performance.now();\n\t\treturn new Trace(startTick);\n\t}\n\n\tprotected lastTick: number;\n\tprotected constructor(public readonly startTick: number) {\n\t\tthis.lastTick = startTick;\n\t}\n\n\tpublic trace(): ITraceEvent {\n\t\tconst tick = performance.now();\n\t\tconst event = {\n\t\t\ttotalTimeElapsed: tick - this.startTick,\n\t\t\tduration: tick - this.lastTick,\n\t\t\ttick,\n\t\t};\n\t\tthis.lastTick = tick;\n\t\treturn event;\n\t}\n}\n\n/**\n * Event in a performance trace including time elapsed.\n *\n * @internal\n */\nexport interface ITraceEvent {\n\t/**\n\t * Total time elapsed since the start of the Trace.\n\t * Measured in milliseconds as a floating point with a decimal\n\t */\n\treadonly totalTimeElapsed: number;\n\t/**\n\t * Time elapsed since the last trace event.\n\t * Measured in milliseconds as a floating point with a decimal\n\t */\n\treadonly duration: number;\n\t/**\n\t * This number represents a relative time which should\n\t * be consistent for all trace ticks.\n\t */\n\treadonly tick: number;\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.39.1"
8
+ "packageVersion": "7.42.3"
9
9
  }
10
10
  ]
11
11
  }
@@ -2,19 +2,16 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- /// <reference types="node" />
6
- import { EventEmitter } from "events";
7
5
  import { IEvent, TransformedEvent, IEventTransformer, IEventProvider } from "@fluidframework/core-interfaces";
6
+ import { EventEmitter } from "./eventEmitter.cjs";
8
7
  /**
9
8
  * The event emitter polyfill and the node event emitter have different event types:
10
9
  * string | symbol vs. string | number
11
10
  *
12
- * This type allow us to correctly handle either type
11
+ * The polyfill is now always used, but string is the only event type preferred.
13
12
  * @public
14
13
  */
15
- export type EventEmitterEventType = EventEmitter extends {
16
- on(event: infer E, listener: any): any;
17
- } ? E : never;
14
+ export type EventEmitterEventType = string;
18
15
  /**
19
16
  * @public
20
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"typedEventEmitter.d.ts","sourceRoot":"","sources":["../src/typedEventEmitter.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EACN,MAAM,EACN,gBAAg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AmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC3D,QAAQ,CAAC,GAAG,EAAE,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;CAChD"}
@@ -5,14 +5,12 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.TypedEventEmitter = void 0;
8
- // False positive: this is an import from the `events` package, not from Node.
9
- // eslint-disable-next-line unicorn/prefer-node-protocol
10
- const events_1 = require("events");
8
+ const eventEmitter_cjs_1 = require("./eventEmitter.cjs");
11
9
  /**
12
10
  * Event Emitter helper class the supports emitting typed events
13
11
  * @public
14
12
  */
15
- class TypedEventEmitter extends events_1.EventEmitter {
13
+ class TypedEventEmitter extends eventEmitter_cjs_1.EventEmitter {
16
14
  constructor() {
17
15
  super();
18
16
  this.addListener = super.addListener.bind(this);
@@ -1 +1 @@
1
- {"version":3,"file":"typedEventEmitter.js","sourceRoot":"","sources":["../src/typedEventEmitter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,8EAA8E;AAC9E,wDAAwD;AACxD,mCAAsC;AAwCtC;;;GAGG;AACH,MAAa,iBACZ,SAAQ,qBAAY;IAGpB;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACrF,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACnE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACvE,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAGrD,CAAC;QACF,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAG7D,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QAC3F,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;IACtE,CAAC;CAQD;AA3BD,8CA2BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// False positive: this is an import from the `events` package, not from Node.\n// eslint-disable-next-line unicorn/prefer-node-protocol\nimport { EventEmitter } from \"events\";\nimport {\n\tIEvent,\n\tTransformedEvent,\n\tIEventTransformer,\n\tIEventProvider,\n} from \"@fluidframework/core-interfaces\";\n\n/**\n * The event emitter polyfill and the node event emitter have different event types:\n * string | symbol vs. string | number\n *\n * This type allow us to correctly handle either type\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type EventEmitterEventType = EventEmitter extends { on(event: infer E, listener: any) }\n\t? E\n\t: never;\n\n/**\n * @public\n */\nexport type TypedEventTransform<TThis, TEvent> =\n\t// Event emitter supports some special events for the emitter itself to use\n\t// this exposes those events for the TypedEventEmitter.\n\t// Since we know what the shape of these events are, we can describe them directly via a TransformedEvent\n\t// which easier than trying to extend TEvent directly\n\tTransformedEvent<\n\t\tTThis,\n\t\t\"newListener\" | \"removeListener\",\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tParameters<(event: string, listener: (...args: any[]) => void) => void>\n\t> &\n\t\t// Expose all the events provides by TEvent\n\t\tIEventTransformer<TThis, TEvent & IEvent> &\n\t\t// Add the default overload so this is covertable to EventEmitter regardless of environment\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tTransformedEvent<TThis, EventEmitterEventType, any[]>;\n\n/**\n * Event Emitter helper class the supports emitting typed events\n * @public\n */\nexport class TypedEventEmitter<TEvent>\n\textends EventEmitter\n\timplements IEventProvider<TEvent & IEvent>\n{\n\tconstructor() {\n\t\tsuper();\n\t\tthis.addListener = super.addListener.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.on = super.on.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.once = super.once.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.prependListener = super.prependListener.bind(this) as TypedEventTransform<\n\t\t\tthis,\n\t\t\tTEvent\n\t\t>;\n\t\tthis.prependOnceListener = super.prependOnceListener.bind(this) as TypedEventTransform<\n\t\t\tthis,\n\t\t\tTEvent\n\t\t>;\n\t\tthis.removeListener = super.removeListener.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.off = super.off.bind(this) as TypedEventTransform<this, TEvent>;\n\t}\n\treadonly addListener: TypedEventTransform<this, TEvent>;\n\treadonly on: TypedEventTransform<this, TEvent>;\n\treadonly once: TypedEventTransform<this, TEvent>;\n\treadonly prependListener: TypedEventTransform<this, TEvent>;\n\treadonly prependOnceListener: TypedEventTransform<this, TEvent>;\n\treadonly removeListener: TypedEventTransform<this, TEvent>;\n\treadonly off: TypedEventTransform<this, TEvent>;\n}\n"]}
1
+ {"version":3,"file":"typedEventEmitter.js","sourceRoot":"","sources":["../src/typedEventEmitter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,yDAAkD;AA+BlD;;;GAGG;AACH,MAAa,iBACZ,SAAQ,+BAAY;IAGpB;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACrF,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACnE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACvE,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAGrD,CAAC;QACF,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAG7D,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QAC3F,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;IACtE,CAAC;CAQD;AA3BD,8CA2BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIEvent,\n\tTransformedEvent,\n\tIEventTransformer,\n\tIEventProvider,\n} from \"@fluidframework/core-interfaces\";\nimport { EventEmitter } from \"./eventEmitter.cjs\";\n\n/**\n * The event emitter polyfill and the node event emitter have different event types:\n * string | symbol vs. string | number\n *\n * The polyfill is now always used, but string is the only event type preferred.\n * @public\n */\nexport type EventEmitterEventType = string;\n\n/**\n * @public\n */\nexport type TypedEventTransform<TThis, TEvent> =\n\t// Event emitter supports some special events for the emitter itself to use\n\t// this exposes those events for the TypedEventEmitter.\n\t// Since we know what the shape of these events are, we can describe them directly via a TransformedEvent\n\t// which easier than trying to extend TEvent directly\n\tTransformedEvent<\n\t\tTThis,\n\t\t\"newListener\" | \"removeListener\",\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tParameters<(event: string, listener: (...args: any[]) => void) => void>\n\t> &\n\t\t// Expose all the events provides by TEvent\n\t\tIEventTransformer<TThis, TEvent & IEvent> &\n\t\t// Add the default overload so this is covertable to EventEmitter regardless of environment\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tTransformedEvent<TThis, EventEmitterEventType, any[]>;\n\n/**\n * Event Emitter helper class the supports emitting typed events\n * @public\n */\nexport class TypedEventEmitter<TEvent>\n\textends EventEmitter\n\timplements IEventProvider<TEvent & IEvent>\n{\n\tconstructor() {\n\t\tsuper();\n\t\tthis.addListener = super.addListener.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.on = super.on.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.once = super.once.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.prependListener = super.prependListener.bind(this) as TypedEventTransform<\n\t\t\tthis,\n\t\t\tTEvent\n\t\t>;\n\t\tthis.prependOnceListener = super.prependOnceListener.bind(this) as TypedEventTransform<\n\t\t\tthis,\n\t\t\tTEvent\n\t\t>;\n\t\tthis.removeListener = super.removeListener.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.off = super.off.bind(this) as TypedEventTransform<this, TEvent>;\n\t}\n\treadonly addListener: TypedEventTransform<this, TEvent>;\n\treadonly on: TypedEventTransform<this, TEvent>;\n\treadonly once: TypedEventTransform<this, TEvent>;\n\treadonly prependListener: TypedEventTransform<this, TEvent>;\n\treadonly prependOnceListener: TypedEventTransform<this, TEvent>;\n\treadonly removeListener: TypedEventTransform<this, TEvent>;\n\treadonly off: TypedEventTransform<this, TEvent>;\n}\n"]}
@@ -8,6 +8,9 @@ module.exports = {
8
8
  args: ["--no-sandbox", "--disable-setuid-sandbox"], // https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#setting-up-chrome-linux-sandbox
9
9
  dumpio: true, // output browser console to cmd line
10
10
  // slowMo: 500, // slows down process for easier viewing
11
- // headless: false, // run in the browser
11
+
12
+ // Use chrome-headless-shell since some tests don't work as-is with the new headless mode.
13
+ // AB#7150: Remove this once we have fixed the tests.
14
+ headless: "shell",
12
15
  },
13
16
  };
@@ -15,6 +15,7 @@ module.exports = {
15
15
  },
16
16
  ],
17
17
  ],
18
+ // Only CJS is tested per use of `rewire` in gitHash.spec.ts.
18
19
  testMatch: ["**/dist/test/jest/?(*.)+(spec|test).*js"],
19
20
  testPathIgnorePatterns: ["/node_modules/"],
20
21
  };
@@ -25,4 +25,4 @@ export declare const fromUtf8ToBase64: (input: string) => string;
25
25
  * @internal
26
26
  */
27
27
  export declare const toUtf8: (input: string, encoding: string) => string;
28
- //# sourceMappingURL=base64Encoding.d.mts.map
28
+ //# sourceMappingURL=base64Encoding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64Encoding.d.ts","sourceRoot":"","sources":["../src/base64Encoding.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UAAW,MAAM,KAAG,MACA,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UAAW,MAAM,KAAG,MACA,CAAC;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,UAAW,MAAM,YAAY,MAAM,KAAG,MAWxD,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IsoBuffer } from "./indexNode.mjs";
5
+ import { IsoBuffer } from "./indexNode.js";
6
6
  /**
7
7
  * Converts the provided {@link https://en.wikipedia.org/wiki/Base64 | base64}-encoded string
8
8
  * to {@link https://en.wikipedia.org/wiki/UTF-8 | utf-8}.
@@ -37,4 +37,4 @@ export const toUtf8 = (input, encoding) => {
37
37
  }
38
38
  }
39
39
  };
40
- //# sourceMappingURL=base64Encoding.mjs.map
40
+ //# sourceMappingURL=base64Encoding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64Encoding.js","sourceRoot":"","sources":["../src/base64Encoding.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAU,EAAE,CACzD,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAElD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAU,EAAE,CACzD,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,QAAgB,EAAU,EAAE;IACjE,QAAQ,QAAQ,EAAE;QACjB,KAAK,MAAM,CAAC;QACZ,8GAA8G;QAC9G,KAAK,OAAO,CAAC,CAAC;YACb,OAAO,KAAK,CAAC;SACb;QACD,OAAO,CAAC,CAAC;YACR,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;SAClD;KACD;AACF,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IsoBuffer } from \"./indexNode.js\";\n\n/**\n * Converts the provided {@link https://en.wikipedia.org/wiki/Base64 | base64}-encoded string\n * to {@link https://en.wikipedia.org/wiki/UTF-8 | utf-8}.\n *\n * @internal\n */\nexport const fromBase64ToUtf8 = (input: string): string =>\n\tIsoBuffer.from(input, \"base64\").toString(\"utf8\");\n\n/**\n * Converts the provided {@link https://en.wikipedia.org/wiki/UTF-8 | utf-8}-encoded string\n * to {@link https://en.wikipedia.org/wiki/Base64 | base64}.\n *\n * @internal\n */\nexport const fromUtf8ToBase64 = (input: string): string =>\n\tIsoBuffer.from(input, \"utf8\").toString(\"base64\");\n\n/**\n * Convenience function to convert unknown encoding to utf8 that avoids\n * buffer copies/encode ops when no conversion is needed.\n * @param input - The source string to convert.\n * @param encoding - The source string's encoding.\n *\n * @internal\n */\nexport const toUtf8 = (input: string, encoding: string): string => {\n\tswitch (encoding) {\n\t\tcase \"utf8\":\n\t\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\t\tcase \"utf-8\": {\n\t\t\treturn input;\n\t\t}\n\t\tdefault: {\n\t\t\treturn IsoBuffer.from(input, encoding).toString();\n\t\t}\n\t}\n};\n"]}
@@ -81,4 +81,4 @@ export declare class IsoBuffer extends Uint8Array {
81
81
  */
82
82
  private static sanitizeBase64;
83
83
  }
84
- //# sourceMappingURL=bufferBrowser.d.mts.map
84
+ //# sourceMappingURL=bufferBrowser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bufferBrowser.d.ts","sourceRoot":"","sources":["../src/bufferBrowser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CACjC,GAAG,EAAE,UAAU,EAEf,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GACpC,MAAM,CAeR;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,UAAW,MAAM,YAAY,MAAM,KAAG,eAC1B,CAAC;AAExC;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,SACpB,eAAe,YAEX,MAAM,GAAG,OAAO,GAAG,QAAQ,KACnC,MAAiD,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,WAAW,CAW9D;AAED;;;;GAIG;AACH,qBAAa,SAAU,SAAQ,UAAU;IACxC;;;;;;OAMG;IAEI,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM;IAI/D;;;;;;;OAOG;IAEH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,gBAAgB,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,SAAS;IAsBxE,MAAM,CAAC,eAAe,CACrB,WAAW,EAAE,WAAW,EACxB,UAAU,CAAC,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GACjB,SAAS;IAeZ,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAoB5D,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO;IAItC;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;CAkB7B"}
@@ -178,4 +178,4 @@ export class IsoBuffer extends Uint8Array {
178
178
  return sanitizedStr;
179
179
  }
180
180
  }
181
- //# sourceMappingURL=bufferBrowser.mjs.map
181
+ //# sourceMappingURL=bufferBrowser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bufferBrowser.js","sourceRoot":"","sources":["../src/bufferBrowser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CACjC,GAAe;AACf,8GAA8G;AAC9G,QAAsC;IAEtC,QAAQ,QAAQ,EAAE;QACjB,KAAK,QAAQ,CAAC,CAAC;YACd,OAAO,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;SACnC;QACD,KAAK,MAAM,CAAC;QACZ,8GAA8G;QAC9G,KAAK,OAAO,CAAC;QACb,KAAK,SAAS,CAAC,CAAC;YACf,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACrC;QACD,OAAO,CAAC,CAAC;YACR,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SAChD;KACD;AACF,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,QAAgB,EAAmB,EAAE,CAClF,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC;AAExC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC7B,IAAqB;AACrB,8GAA8G;AAC9G,QAAqC,EAC5B,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAA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OAIG;IACK,MAAM,CAAC,cAAc,CAAC,GAAW;QACxC,IAAI,YAAY,GAAG,GAAG,CAAC;QACvB,mEAAmE;QACnE,+CAA+C;QAC/C,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAE1C,oEAAoE;QACpE,2CAA2C;QAC3C,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAErD,oEAAoE;QACpE,6BAA6B;QAC7B,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE;YAClC,MAAM,YAAY,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;YAC5C,YAAY,IAAI,YAAY,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;SACtD;QACD,OAAO,YAAY,CAAC;IACrB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as base64js from \"base64-js\";\n\n/**\n * Converts a Uint8Array to a string of the provided encoding\n * Useful when the array might be an {@link IsoBuffer}.\n *\n * @param arr - The array to convert.\n * @param encoding - Optional target encoding; only \"utf8\" and \"base64\" are\n * supported, with \"utf8\" being default.\n * @returns The converted string.\n *\n * @internal\n */\nexport function Uint8ArrayToString(\n\tarr: Uint8Array,\n\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\tencoding?: \"utf8\" | \"utf-8\" | \"base64\",\n): string {\n\tswitch (encoding) {\n\t\tcase \"base64\": {\n\t\t\treturn base64js.fromByteArray(arr);\n\t\t}\n\t\tcase \"utf8\":\n\t\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\t\tcase \"utf-8\":\n\t\tcase undefined: {\n\t\t\treturn new TextDecoder().decode(arr);\n\t\t}\n\t\tdefault: {\n\t\t\tthrow new Error(\"invalid/unsupported encoding\");\n\t\t}\n\t}\n}\n\n/**\n * Converts a {@link https://en.wikipedia.org/wiki/Base64 | base64} or\n * {@link https://en.wikipedia.org/wiki/UTF-8 | utf-8} string to array buffer.\n *\n * @param encoding - The input string's encoding.\n *\n * @internal\n */\nexport const stringToBuffer = (input: string, encoding: string): ArrayBufferLike =>\n\tIsoBuffer.from(input, encoding).buffer;\n\n/**\n * Convert binary blob to string format\n *\n * @param blob - the binary blob\n * @param encoding - output string's encoding\n * @returns the blob in string format\n *\n * @alpha\n */\nexport const bufferToString = (\n\tblob: ArrayBufferLike,\n\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\tencoding: \"utf8\" | \"utf-8\" | \"base64\",\n): string => IsoBuffer.from(blob).toString(encoding);\n\n/**\n * Determines if an object is an array buffer.\n *\n * @remarks Will detect and reject TypedArrays, like Uint8Array.\n * Reason - they can be viewport into Array, they can be accepted, but caller has to deal with\n * math properly (i.e. Take into account byteOffset at minimum).\n * For example, construction of new TypedArray can be in the form of new TypedArray(typedArray) or\n * new TypedArray(buffer, byteOffset, length), but passing TypedArray will result in fist path (and\n * ignoring byteOffice, length).\n *\n * @param obj - The object to determine if it is an ArrayBuffer.\n *\n * @internal\n */\nexport function isArrayBuffer(obj: unknown): obj is ArrayBuffer {\n\tconst maybe = obj as (Partial<ArrayBuffer> & Partial<Uint8Array>) | undefined;\n\treturn (\n\t\tobj instanceof ArrayBuffer ||\n\t\t(typeof maybe === \"object\" &&\n\t\t\tmaybe !== null &&\n\t\t\ttypeof maybe.byteLength === \"number\" &&\n\t\t\ttypeof maybe.slice === \"function\" &&\n\t\t\tmaybe.byteOffset === undefined &&\n\t\t\tmaybe.buffer === undefined)\n\t);\n}\n\n/**\n * Minimal implementation of Buffer for our usages in the browser environment.\n *\n * @internal\n */\nexport class IsoBuffer extends Uint8Array {\n\t/**\n\t * Convert the buffer to a string.\n\t * Only supports encoding the whole string (unlike the Node Buffer equivalent)\n\t * and only utf8 and base64 encodings.\n\t *\n\t * @param encoding - The encoding to use.\n\t */\n\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\tpublic toString(encoding?: \"utf8\" | \"utf-8\" | \"base64\"): string {\n\t\treturn Uint8ArrayToString(this, encoding);\n\t}\n\n\t/**\n\t * Static constructor\n\t * @param value - (string | ArrayBuffer)\n\t * @param encodingOrOffset - (string | number)\n\t * @param length - (number)\n\t *\n\t * @privateRemarks TODO: Use actual types\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\tstatic from(value: any, encodingOrOffset?: any, length?: any): IsoBuffer {\n\t\tif (typeof value === \"string\") {\n\t\t\treturn IsoBuffer.fromString(value, encodingOrOffset as string | undefined);\n\t\t\t// Capture any typed arrays, including Uint8Array (and thus - IsoBuffer!)\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t} else if (value !== null && typeof value === \"object\" && isArrayBuffer(value.buffer)) {\n\t\t\t// The version of the from function for the node buffer, which takes a buffer or typed array\n\t\t\t// as first parameter, does not have any offset or length parameters. Those are just silently\n\t\t\t// ignored and not taken into account\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access\n\t\t\treturn IsoBuffer.fromArrayBuffer(value.buffer, value.byteOffset, value.byteLength);\n\t\t} else if (isArrayBuffer(value)) {\n\t\t\treturn IsoBuffer.fromArrayBuffer(\n\t\t\t\tvalue,\n\t\t\t\tencodingOrOffset as number | undefined,\n\t\t\t\tlength as number,\n\t\t\t);\n\t\t} else {\n\t\t\tthrow new TypeError(\"Input value was neither a string nor an ArrayBuffer.\");\n\t\t}\n\t}\n\n\tstatic fromArrayBuffer(\n\t\tarrayBuffer: ArrayBuffer,\n\t\tbyteOffset?: number,\n\t\tbyteLength?: number,\n\t): IsoBuffer {\n\t\tconst offset = byteOffset ?? 0;\n\t\tconst validLength = byteLength ?? arrayBuffer.byteLength - offset;\n\t\tif (\n\t\t\toffset < 0 ||\n\t\t\toffset > arrayBuffer.byteLength ||\n\t\t\tvalidLength < 0 ||\n\t\t\tvalidLength + offset > arrayBuffer.byteLength\n\t\t) {\n\t\t\tthrow new RangeError(\"Invalid range specified.\");\n\t\t}\n\n\t\treturn new IsoBuffer(arrayBuffer, offset, validLength);\n\t}\n\n\tstatic fromString(str: string, encoding?: string): IsoBuffer {\n\t\tswitch (encoding) {\n\t\t\tcase \"base64\": {\n\t\t\t\tconst sanitizedString = this.sanitizeBase64(str);\n\t\t\t\tconst encoded = base64js.toByteArray(sanitizedString);\n\t\t\t\treturn new IsoBuffer(encoded.buffer);\n\t\t\t}\n\t\t\tcase \"utf8\":\n\t\t\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\t\t\tcase \"utf-8\":\n\t\t\tcase undefined: {\n\t\t\t\tconst encoded = new TextEncoder().encode(str);\n\t\t\t\treturn new IsoBuffer(encoded.buffer);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(\"invalid/unsupported encoding\");\n\t\t\t}\n\t\t}\n\t}\n\n\tstatic isBuffer(obj: unknown): boolean {\n\t\tthrow new Error(\"unimplemented\");\n\t}\n\n\t/**\n\t * Sanitize a base64 string to provide to base64-js library.\n\t * {@link https://www.npmjs.com/package/base64-js} is not as tolerant of the same malformed base64 as Node'\n\t * Buffer is.\n\t */\n\tprivate static sanitizeBase64(str: string): string {\n\t\tlet sanitizedStr = str;\n\t\t// Remove everything after padding - Node buffer ignores everything\n\t\t// after any padding whereas base64-js does not\n\t\tsanitizedStr = sanitizedStr.split(\"=\")[0];\n\n\t\t// Remove invalid characters - Node buffer strips invalid characters\n\t\t// whereas base64-js replaces them with \"A\"\n\t\tsanitizedStr = sanitizedStr.replace(/[^\\w+-/]/g, \"\");\n\n\t\t// Check for missing padding - Node buffer tolerates missing padding\n\t\t// whereas base64-js does not\n\t\tif (sanitizedStr.length % 4 !== 0) {\n\t\t\tconst paddingArray = [\"\", \"===\", \"==\", \"=\"];\n\t\t\tsanitizedStr += paddingArray[sanitizedStr.length % 4];\n\t\t}\n\t\treturn sanitizedStr;\n\t}\n}\n"]}
@@ -59,4 +59,4 @@ export declare function stringToBuffer(input: string, encoding: string): ArrayBu
59
59
  * @alpha
60
60
  */
61
61
  export declare const bufferToString: (blob: ArrayBufferLike, encoding: "utf8" | "utf-8" | "base64") => string;
62
- //# sourceMappingURL=bufferNode.d.mts.map
62
+ //# sourceMappingURL=bufferNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bufferNode.d.ts","sourceRoot":"","sources":["../src/bufferNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,UAAU;IAE7C,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM;IAExD;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,gBAAgB,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS;IACpF,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM;CAC5C;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,eAAS,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CACjC,GAAG,EAAE,UAAU,EAEf,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GACpC,MAAM,CAIR;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,eAAe,CAQ/E;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,SACpB,eAAe,YAEX,MAAM,GAAG,OAAO,GAAG,QAAQ,KACnC,MAAiD,CAAC"}
@@ -50,4 +50,4 @@ export function stringToBuffer(input, encoding) {
50
50
  export const bufferToString = (blob,
51
51
  // eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged
52
52
  encoding) => IsoBuffer.from(blob).toString(encoding);
53
- //# sourceMappingURL=bufferNode.mjs.map
53
+ //# sourceMappingURL=bufferNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bufferNode.js","sourceRoot":"","sources":["../src/bufferNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0BH;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC;AAOhC;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CACjC,GAAe;AACf,8GAA8G;AAC9G,QAAsC;IAEtC,2EAA2E;IAC3E,6EAA6E;IAC7E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa,EAAE,QAAgB;IAC7D,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC5C,0EAA0E;IAC1E,2EAA2E;IAC3E,uDAAuD;IACvD,OAAO,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,MAAM,CAAC,UAAU;QAC9C,CAAC,CAAC,GAAG,CAAC,MAAM;QACZ,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC;AACtE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC7B,IAAqB;AACrB,8GAA8G;AAC9G,QAAqC,EAC5B,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Declare the subset of Buffer functionality we want to make available instead of\n * exposing the entirely of Node's typings. This should match the public interface\n * of the browser implementation, so any changes made in one should be made in both.\n *\n * @internal\n */\nexport declare class Buffer extends Uint8Array {\n\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\ttoString(encoding?: \"utf8\" | \"utf-8\" | \"base64\"): string;\n\n\t/**\n\t * Static constructor\n\t *\n\t * @param value - (string | ArrayBuffer).\n\t * @param encodingOrOffset - (string | number).\n\t * @param length - (number).\n\t *\n\t * @privateRemarks TODO: Use actual types\n\t */\n\tstatic from(value: unknown, encodingOrOffset?: unknown, length?: unknown): IsoBuffer;\n\tstatic isBuffer(obj: unknown): obj is Buffer;\n}\n\n/**\n * @internal\n */\nexport const IsoBuffer = Buffer;\n\n/**\n * @internal\n */\nexport type IsoBuffer = Buffer;\n\n/**\n * Converts a Uint8Array to a string of the provided encoding.\n * @remarks Useful when the array might be an IsoBuffer.\n * @param arr - The array to convert.\n * @param encoding - Optional target encoding; only \"utf8\" and \"base64\" are\n * supported, with \"utf8\" being default.\n * @returns The converted string.\n *\n * @internal\n */\nexport function Uint8ArrayToString(\n\tarr: Uint8Array,\n\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\tencoding?: \"utf8\" | \"utf-8\" | \"base64\",\n): string {\n\t// Buffer extends Uint8Array. Therefore, 'arr' may already be a Buffer, in\n\t// which case we can avoid copying the Uint8Array into a new Buffer instance.\n\treturn (Buffer.isBuffer(arr) ? arr : Buffer.from(arr)).toString(encoding);\n}\n\n/**\n * Convert base64 or utf8 string to array buffer.\n * @param encoding - The input string's encoding.\n *\n * @internal\n */\nexport function stringToBuffer(input: string, encoding: string): ArrayBufferLike {\n\tconst iso = IsoBuffer.from(input, encoding);\n\t// In a Node environment, IsoBuffer may be a Node.js Buffer. Node.js will\n\t// pool multiple small Buffer instances into a single ArrayBuffer, in which\n\t// case we need to slice the appropriate span of bytes.\n\treturn iso.byteLength === iso.buffer.byteLength\n\t\t? iso.buffer\n\t\t: iso.buffer.slice(iso.byteOffset, iso.byteOffset + iso.byteLength);\n}\n\n/**\n * Convert binary blob to string format\n *\n * @param blob - The binary blob\n * @param encoding - Output string's encoding\n * @returns The blob in string format\n *\n * @alpha\n */\nexport const bufferToString = (\n\tblob: ArrayBufferLike,\n\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\tencoding: \"utf8\" | \"utf-8\" | \"base64\",\n): string => IsoBuffer.from(blob).toString(encoding);\n"]}
@@ -9,4 +9,4 @@
9
9
  * @internal
10
10
  */
11
11
  export declare function Uint8ArrayToArrayBuffer(array: Uint8Array): ArrayBuffer;
12
- //# sourceMappingURL=bufferShared.d.mts.map
12
+ //# sourceMappingURL=bufferShared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bufferShared.d.ts","sourceRoot":"","sources":["../src/bufferShared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,CAKtE"}
@@ -14,4 +14,4 @@ export function Uint8ArrayToArrayBuffer(array) {
14
14
  }
15
15
  return array.buffer.slice(array.byteOffset, array.byteOffset + array.byteLength);
16
16
  }
17
- //# sourceMappingURL=bufferShared.mjs.map
17
+ //# sourceMappingURL=bufferShared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bufferShared.js","sourceRoot":"","sources":["../src/bufferShared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAiB;IACxD,IAAI,KAAK,CAAC,UAAU,KAAK,CAAC,IAAI,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE;QAC3E,OAAO,KAAK,CAAC,MAAM,CAAC;KACpB;IACD,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;AAClF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Converts a Uint8Array array to an ArrayBuffer.\n * @param array - Array to convert to ArrayBuffer.\n *\n * @internal\n */\nexport function Uint8ArrayToArrayBuffer(array: Uint8Array): ArrayBuffer {\n\tif (array.byteOffset === 0 && array.byteLength === array.buffer.byteLength) {\n\t\treturn array.buffer;\n\t}\n\treturn array.buffer.slice(array.byteOffset, array.byteOffset + array.byteLength);\n}\n"]}
@@ -1,13 +1,10 @@
1
- /// <reference types="node" />
2
-
3
- import { EventEmitter } from 'events';
4
- import { IDisposable } from '@fluidframework/core-interfaces';
1
+ import { EventEmitter } from 'events_pkg';
5
2
  import { IEvent } from '@fluidframework/core-interfaces';
6
3
  import { IEventProvider } from '@fluidframework/core-interfaces';
7
4
  import { IEventTransformer } from '@fluidframework/core-interfaces';
8
5
  import { TransformedEvent } from '@fluidframework/core-interfaces';
9
6
 
10
- /* Excluded from this release type: Buffer_2 */
7
+ /* Excluded from this release type: Buffer */
11
8
 
12
9
  /**
13
10
  * Convert binary blob to string format
@@ -20,18 +17,16 @@ import { TransformedEvent } from '@fluidframework/core-interfaces';
20
17
  */
21
18
  export declare const bufferToString: (blob: ArrayBufferLike, encoding: "utf8" | "utf-8" | "base64") => string;
22
19
 
20
+ export { EventEmitter }
21
+
23
22
  /**
24
23
  * The event emitter polyfill and the node event emitter have different event types:
25
24
  * string | symbol vs. string | number
26
25
  *
27
- * This type allow us to correctly handle either type
26
+ * The polyfill is now always used, but string is the only event type preferred.
28
27
  * @public
29
28
  */
30
- export declare type EventEmitterEventType = EventEmitter extends {
31
- on(event: infer E, listener: any): any;
32
- } ? E : never;
33
-
34
- /* Excluded from this release type: EventForwarder */
29
+ export declare type EventEmitterEventType = string;
35
30
 
36
31
  /* Excluded from this release type: fromBase64ToUtf8 */
37
32
 
@@ -1,28 +1,22 @@
1
- /// <reference types="node" />
2
-
3
- import { EventEmitter } from 'events';
4
- import { IDisposable } from '@fluidframework/core-interfaces';
1
+ import { EventEmitter } from 'events_pkg';
5
2
  import { IEvent } from '@fluidframework/core-interfaces';
6
3
  import { IEventProvider } from '@fluidframework/core-interfaces';
7
4
  import { IEventTransformer } from '@fluidframework/core-interfaces';
8
5
  import { TransformedEvent } from '@fluidframework/core-interfaces';
9
6
 
10
- /* Excluded from this release type: Buffer_2 */
7
+ /* Excluded from this release type: Buffer */
11
8
 
12
9
  /* Excluded from this release type: bufferToString */
10
+ export { EventEmitter }
13
11
 
14
12
  /**
15
13
  * The event emitter polyfill and the node event emitter have different event types:
16
14
  * string | symbol vs. string | number
17
15
  *
18
- * This type allow us to correctly handle either type
16
+ * The polyfill is now always used, but string is the only event type preferred.
19
17
  * @public
20
18
  */
21
- export declare type EventEmitterEventType = EventEmitter extends {
22
- on(event: infer E, listener: any): any;
23
- } ? E : never;
24
-
25
- /* Excluded from this release type: EventForwarder */
19
+ export declare type EventEmitterEventType = string;
26
20
 
27
21
  /* Excluded from this release type: fromBase64ToUtf8 */
28
22
 
@@ -1,28 +1,22 @@
1
- /// <reference types="node" />
2
-
3
- import { EventEmitter } from 'events';
4
- import { IDisposable } from '@fluidframework/core-interfaces';
1
+ import { EventEmitter } from 'events_pkg';
5
2
  import { IEvent } from '@fluidframework/core-interfaces';
6
3
  import { IEventProvider } from '@fluidframework/core-interfaces';
7
4
  import { IEventTransformer } from '@fluidframework/core-interfaces';
8
5
  import { TransformedEvent } from '@fluidframework/core-interfaces';
9
6
 
10
- /* Excluded from this release type: Buffer_2 */
7
+ /* Excluded from this release type: Buffer */
11
8
 
12
9
  /* Excluded from this release type: bufferToString */
10
+ export { EventEmitter }
13
11
 
14
12
  /**
15
13
  * The event emitter polyfill and the node event emitter have different event types:
16
14
  * string | symbol vs. string | number
17
15
  *
18
- * This type allow us to correctly handle either type
16
+ * The polyfill is now always used, but string is the only event type preferred.
19
17
  * @public
20
18
  */
21
- export declare type EventEmitterEventType = EventEmitter extends {
22
- on(event: infer E, listener: any): any;
23
- } ? E : never;
24
-
25
- /* Excluded from this release type: EventForwarder */
19
+ export declare type EventEmitterEventType = string;
26
20
 
27
21
  /* Excluded from this release type: fromBase64ToUtf8 */
28
22
 
@@ -1,7 +1,4 @@
1
- /// <reference types="node" />
2
-
3
- import { EventEmitter } from 'events';
4
- import { IDisposable } from '@fluidframework/core-interfaces';
1
+ import { EventEmitter } from 'events_pkg';
5
2
  import { IEvent } from '@fluidframework/core-interfaces';
6
3
  import { IEventProvider } from '@fluidframework/core-interfaces';
7
4
  import { IEventTransformer } from '@fluidframework/core-interfaces';
@@ -14,7 +11,7 @@ import { TransformedEvent } from '@fluidframework/core-interfaces';
14
11
  *
15
12
  * @internal
16
13
  */
17
- declare class Buffer_2 extends Uint8Array {
14
+ export declare class Buffer extends Uint8Array {
18
15
  toString(encoding?: "utf8" | "utf-8" | "base64"): string;
19
16
  /**
20
17
  * Static constructor
@@ -26,9 +23,8 @@ declare class Buffer_2 extends Uint8Array {
26
23
  * @privateRemarks TODO: Use actual types
27
24
  */
28
25
  static from(value: unknown, encodingOrOffset?: unknown, length?: unknown): IsoBuffer;
29
- static isBuffer(obj: unknown): obj is Buffer_2;
26
+ static isBuffer(obj: unknown): obj is Buffer;
30
27
  }
31
- export { Buffer_2 as Buffer }
32
28
 
33
29
  /**
34
30
  * Convert binary blob to string format
@@ -41,42 +37,16 @@ export { Buffer_2 as Buffer }
41
37
  */
42
38
  export declare const bufferToString: (blob: ArrayBufferLike, encoding: "utf8" | "utf-8" | "base64") => string;
43
39
 
40
+ export { EventEmitter }
41
+
44
42
  /**
45
43
  * The event emitter polyfill and the node event emitter have different event types:
46
44
  * string | symbol vs. string | number
47
45
  *
48
- * This type allow us to correctly handle either type
46
+ * The polyfill is now always used, but string is the only event type preferred.
49
47
  * @public
50
48
  */
51
- export declare type EventEmitterEventType = EventEmitter extends {
52
- on(event: infer E, listener: any): any;
53
- } ? E : never;
54
-
55
- /**
56
- * Base class used for forwarding events from a source EventEmitter.
57
- * This can be useful when all arbitrary listeners need to be removed,
58
- * but the primary source needs to stay intact.
59
- *
60
- * @internal
61
- */
62
- export declare class EventForwarder<TEvent = IEvent> extends TypedEventEmitter<TEvent> implements IDisposable {
63
- protected static isEmitterEvent(event: string): boolean;
64
- private static readonly newListenerEvent;
65
- private static readonly removeListenerEvent;
66
- /**
67
- * {@inheritDoc @fluidframework/core-interfaces#IDisposable.disposed}
68
- */
69
- get disposed(): boolean;
70
- private isDisposed;
71
- private readonly forwardingEvents;
72
- constructor(source?: EventEmitter | IEventProvider<TEvent & IEvent>);
73
- /**
74
- * {@inheritDoc @fluidframework/core-interfaces#IDisposable.dispose}
75
- */
76
- dispose(): void;
77
- protected forwardEvent(source: EventEmitter | IEventProvider<TEvent & IEvent>, ...events: string[]): void;
78
- protected unforwardEvent(source: EventEmitter | IEventProvider<TEvent & IEvent>, ...events: string[]): void;
79
- }
49
+ export declare type EventEmitterEventType = string;
80
50
 
81
51
  /**
82
52
  * Converts the provided {@link https://en.wikipedia.org/wiki/Base64 | base64}-encoded string
@@ -123,12 +93,12 @@ export declare function hashFile(file: IsoBuffer, algorithm?: "SHA-1" | "SHA-256
123
93
  /**
124
94
  * @internal
125
95
  */
126
- export declare const IsoBuffer: typeof Buffer_2;
96
+ export declare const IsoBuffer: typeof Buffer;
127
97
 
128
98
  /**
129
99
  * @internal
130
100
  */
131
- export declare type IsoBuffer = Buffer_2;
101
+ export declare type IsoBuffer = Buffer;
132
102
 
133
103
  /**
134
104
  * This type contains all browser performance properties as optional, and some