@fluidframework/core-utils 2.1.0-281041 → 2.2.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
  # @fluidframework/core-utils
2
2
 
3
+ ## 2.2.0
4
+
5
+ Dependency updates only.
6
+
7
+ ## 2.1.0
8
+
9
+ Dependency updates only.
10
+
3
11
  ## 2.0.0-rc.5.0.0
4
12
 
5
13
  ### Minor Changes
package/README.md CHANGED
@@ -3,10 +3,41 @@
3
3
  This package is intended for sharing and promoting best-practice implementations of Fluid-agnostic utility functions
4
4
  across packages in the Fluid Framework repo.
5
5
 
6
- <!-- AUTO-GENERATED-CONTENT:START (README_PACKAGE_SCOPE_NOTICE:scopeKind=INTERNAL) -->
6
+ <!-- AUTO-GENERATED-CONTENT:START (LIBRARY_README_HEADER) -->
7
7
 
8
- **IMPORTANT: This package is intended strictly as an implementation detail of the Fluid Framework and is not intended for public consumption.**
9
- **We make no stability guarantees regarding its APIs.**
8
+ <!-- prettier-ignore-start -->
9
+ <!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
10
+
11
+ ## Using Fluid Framework libraries
12
+
13
+ When taking a dependency on a Fluid Framework library's public APIs, we recommend using a `^` (caret) version range, such as `^1.3.4`.
14
+ While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
15
+ library consumers should always prefer `^`.
16
+
17
+ If using any of Fluid Framework's unstable APIs (for example, its `beta` APIs), we recommend using a more constrained version range, such as `~`.
18
+
19
+ ## Installation
20
+
21
+ To get started, install the package by running the following command:
22
+
23
+ ```bash
24
+ npm i @fluidframework/core-utils
25
+ ```
26
+
27
+ ## Importing from this package
28
+
29
+ This package leverages [package.json exports](https://nodejs.org/api/packages.html#exports) to separate its APIs by support level.
30
+ For more information on the related support guarantees, see [API Support Levels](https://fluidframework.com/docs/build/releases-and-apitags/#api-support-levels).
31
+
32
+ To access the `public` ([SemVer](https://semver.org/)) APIs, import via `@fluidframework/core-utils` like normal.
33
+
34
+ To access the `legacy` APIs, import via `@fluidframework/core-utils/legacy`.
35
+
36
+ ## API Documentation
37
+
38
+ API documentation for **@fluidframework/core-utils** is available at <https://fluidframework.com/docs/apis/core-utils>.
39
+
40
+ <!-- prettier-ignore-end -->
10
41
 
11
42
  <!-- AUTO-GENERATED-CONTENT:END -->
12
43
 
@@ -36,27 +67,80 @@ If you want to add code that does not meet these requirements, these other packa
36
67
  **core-interfaces** package.
37
68
  - **Shared implementation code with dependencies** should be put in the **client-utils** package.
38
69
 
39
- <!-- AUTO-GENERATED-CONTENT:START (README_DEPENDENCY_GUIDELINES_SECTION:includeHeading=TRUE) -->
70
+ <!-- AUTO-GENERATED-CONTENT:START (README_FOOTER) -->
40
71
 
41
72
  <!-- prettier-ignore-start -->
42
73
  <!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
43
74
 
44
- ## Using Fluid Framework libraries
75
+ ## Minimum Client Requirements
45
76
 
46
- When taking a dependency on a Fluid Framework library's public APIs, we recommend using a `^` (caret) version range, such as `^1.3.4`.
47
- While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
48
- library consumers should always prefer `^`.
77
+ These are the platform requirements for the current version of Fluid Framework Client Packages.
78
+ These requirements err on the side of being too strict since within a major version they can be relaxed over time, but not made stricter.
79
+ For Long Term Support (LTS) versions this can require supporting these platforms for several years.
49
80
 
50
- If using any of Fluid Framework's unstable APIs (for example, its `beta` APIs), we recommend using a more constrained version range, such as `~`.
81
+ It is likely that other configurations will work, but they are not supported: if they stop working, we do not consider that a bug.
82
+ If you would benefit from support for something not listed here, file an issue and the product team will evaluate your request.
83
+ When making such a request please include if the configuration already works (and thus the request is just that it becomes officially supported), or if changes are required to get it working.
51
84
 
52
- <!-- prettier-ignore-end -->
85
+ ### Supported Runtimes
53
86
 
54
- <!-- AUTO-GENERATED-CONTENT:END -->
87
+ - NodeJs ^20.10.0 except that we will drop support for it [when NodeJs 20 loses its upstream support on 2026-04-30](https://github.com/nodejs/release#release-schedule), and will support a newer LTS version of NodeJS (22) at least 1 year before 20 is end-of-life. This same policy applies to NodeJS 22 when it is end of life (2027-04-30).
88
+ - Modern browsers supporting the es2022 standard library: in response to asks we can add explicit support for using babel to polyfill to target specific standards or runtimes (meaning we can avoid/remove use of things that don't polyfill robustly, but otherwise target modern standards).
55
89
 
56
- <!-- AUTO-GENERATED-CONTENT:START (README_TRADEMARK_SECTION:includeHeading=TRUE) -->
90
+ ### Supported Tools
57
91
 
58
- <!-- prettier-ignore-start -->
59
- <!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
92
+ - TypeScript 5.4:
93
+ - All [`strict`](https://www.typescriptlang.org/tsconfig) options are supported.
94
+ - [`strictNullChecks`](https://www.typescriptlang.org/tsconfig) is required.
95
+ - [Configuration options deprecated in 5.0](https://github.com/microsoft/TypeScript/issues/51909) are not supported.
96
+ - `exactOptionalPropertyTypes` is currently not fully supported.
97
+ If used, narrowing members of Fluid Framework types types using `in`, `Reflect.has`, `Object.hasOwn` or `Object.prototype.hasOwnProperty` should be avoided as they may incorrectly exclude `undefined` from the possible values in some cases.
98
+ - [webpack](https://webpack.js.org/) 5
99
+ - We are not intending to be prescriptive about what bundler to use.
100
+ Other bundlers which can handle ES Modules should work, but webpack is the only one we actively test.
101
+
102
+ ### Module Resolution
103
+
104
+ [`Node16`, `NodeNext`, or `Bundler`](https://www.typescriptlang.org/tsconfig#moduleResolution) resolution should be used with TypeScript compilerOptions to follow the [Node.js v12+ ESM Resolution and Loading algorithm](https://nodejs.github.io/nodejs.dev/en/api/v20/esm/#resolution-and-loading-algorithm).
105
+ Node10 resolution is not supported as it does not support Fluid Framework's API structuring pattern that is used to distinguish stable APIs from those that are in development.
106
+
107
+ ### Module Formats
108
+
109
+ - ES Modules:
110
+ ES Modules are the preferred way to consume our client packages (including in NodeJs) and consuming our client packages from ES Modules is fully supported.
111
+ - CommonJs:
112
+ Consuming our client packages as CommonJs is supported only in NodeJS and only for the cases listed below.
113
+ This is done to accommodate some workflows without good ES Module support.
114
+ If you have a workflow you would like included in this list, file an issue.
115
+ Once this list of workflows motivating CommonJS support is empty, we may drop support for CommonJS one year after notice of the change is posted here.
116
+
117
+ - Testing with Jest (which lacks [stable ESM support](https://jestjs.io/docs/ecmascript-modules) due to [unstable APIs in NodeJs](https://github.com/nodejs/node/issues/37648))
118
+
119
+ ## Contribution Guidelines
120
+
121
+ There are many ways to [contribute](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md) to Fluid.
122
+
123
+ - Participate in Q&A in our [GitHub Discussions](https://github.com/microsoft/FluidFramework/discussions).
124
+ - [Submit bugs](https://github.com/microsoft/FluidFramework/issues) and help us verify fixes as they are checked in.
125
+ - Review the [source code changes](https://github.com/microsoft/FluidFramework/pulls).
126
+ - [Contribute bug fixes](https://github.com/microsoft/FluidFramework/blob/main/CONTRIBUTING.md).
127
+
128
+ Detailed instructions for working in the repo can be found in the [Wiki](https://github.com/microsoft/FluidFramework/wiki).
129
+
130
+ This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
131
+ For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
132
+
133
+ This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
134
+ Use of these trademarks or logos must follow Microsoft’s [Trademark & Brand Guidelines](https://www.microsoft.com/trademarks).
135
+ Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
136
+
137
+ ## Help
138
+
139
+ Not finding what you're looking for in this README? Check out [fluidframework.com](https://fluidframework.com/docs/).
140
+
141
+ Still not finding what you're looking for? Please [file an issue](https://github.com/microsoft/FluidFramework/wiki/Submitting-Bugs-and-Feature-Requests).
142
+
143
+ Thank you!
60
144
 
61
145
  ## Trademark
62
146
 
package/dist/index.d.ts CHANGED
@@ -15,4 +15,5 @@ export type { IPromiseTimer, IPromiseTimerResult, ITimer } from "./timer.js";
15
15
  export { PromiseTimer, setLongTimeout, Timer } from "./timer.js";
16
16
  export { unreachableCase } from "./unreachable.js";
17
17
  export { isObject, isPromiseLike } from "./typesGuards.js";
18
+ export { oob } from "./oob.js";
18
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC9C,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC9C,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.isPromiseLike = exports.isObject = exports.unreachableCase = exports.Timer = exports.setLongTimeout = exports.PromiseTimer = exports.Deferred = exports.PromiseCache = exports.LazyPromise = exports.Lazy = exports.NumberComparer = exports.Heap = exports.delay = exports.compareArrays = exports.assert = void 0;
7
+ exports.oob = exports.isPromiseLike = exports.isObject = exports.unreachableCase = exports.Timer = exports.setLongTimeout = exports.PromiseTimer = exports.Deferred = exports.PromiseCache = exports.LazyPromise = exports.Lazy = exports.NumberComparer = exports.Heap = exports.delay = exports.compareArrays = exports.assert = void 0;
8
8
  var assert_js_1 = require("./assert.js");
9
9
  Object.defineProperty(exports, "assert", { enumerable: true, get: function () { return assert_js_1.assert; } });
10
10
  var compare_js_1 = require("./compare.js");
@@ -30,4 +30,6 @@ Object.defineProperty(exports, "unreachableCase", { enumerable: true, get: funct
30
30
  var typesGuards_js_1 = require("./typesGuards.js");
31
31
  Object.defineProperty(exports, "isObject", { enumerable: true, get: function () { return typesGuards_js_1.isObject; } });
32
32
  Object.defineProperty(exports, "isPromiseLike", { enumerable: true, get: function () { return typesGuards_js_1.isPromiseLike; } });
33
+ var oob_js_1 = require("./oob.js");
34
+ Object.defineProperty(exports, "oob", { enumerable: true, get: function () { return oob_js_1.oob; } });
33
35
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yCAAqC;AAA5B,mGAAA,MAAM,OAAA;AACf,2CAA6C;AAApC,2GAAA,aAAa,OAAA;AACtB,uCAAmC;AAA1B,iGAAA,KAAK,OAAA;AAEd,qCAAiD;AAAxC,+FAAA,IAAI,OAAA;AAAE,yGAAA,cAAc,OAAA;AAC7B,qCAA8C;AAArC,+FAAA,IAAI,OAAA;AAAE,sGAAA,WAAW,OAAA;AAE1B,qDAAiD;AAAxC,+GAAA,YAAY,OAAA;AACrB,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AAEjB,uCAAiE;AAAxD,wGAAA,YAAY,OAAA;AAAE,0GAAA,cAAc,OAAA;AAAE,iGAAA,KAAK,OAAA;AAC5C,mDAAmD;AAA1C,iHAAA,eAAe,OAAA;AACxB,mDAA2D;AAAlD,0GAAA,QAAQ,OAAA;AAAE,+GAAA,aAAa,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { assert } from \"./assert.js\";\nexport { compareArrays } from \"./compare.js\";\nexport { delay } from \"./delay.js\";\nexport type { IComparer, IHeapNode } from \"./heap.js\";\nexport { Heap, NumberComparer } from \"./heap.js\";\nexport { Lazy, LazyPromise } from \"./lazy.js\";\nexport type { PromiseCacheExpiry, PromiseCacheOptions } from \"./promiseCache.js\";\nexport { PromiseCache } from \"./promiseCache.js\";\nexport { Deferred } from \"./promises.js\";\nexport type { IPromiseTimer, IPromiseTimerResult, ITimer } from \"./timer.js\";\nexport { PromiseTimer, setLongTimeout, Timer } from \"./timer.js\";\nexport { unreachableCase } from \"./unreachable.js\";\nexport { isObject, isPromiseLike } from \"./typesGuards.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yCAAqC;AAA5B,mGAAA,MAAM,OAAA;AACf,2CAA6C;AAApC,2GAAA,aAAa,OAAA;AACtB,uCAAmC;AAA1B,iGAAA,KAAK,OAAA;AAEd,qCAAiD;AAAxC,+FAAA,IAAI,OAAA;AAAE,yGAAA,cAAc,OAAA;AAC7B,qCAA8C;AAArC,+FAAA,IAAI,OAAA;AAAE,sGAAA,WAAW,OAAA;AAE1B,qDAAiD;AAAxC,+GAAA,YAAY,OAAA;AACrB,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AAEjB,uCAAiE;AAAxD,wGAAA,YAAY,OAAA;AAAE,0GAAA,cAAc,OAAA;AAAE,iGAAA,KAAK,OAAA;AAC5C,mDAAmD;AAA1C,iHAAA,eAAe,OAAA;AACxB,mDAA2D;AAAlD,0GAAA,QAAQ,OAAA;AAAE,+GAAA,aAAa,OAAA;AAChC,mCAA+B;AAAtB,6FAAA,GAAG,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { assert } from \"./assert.js\";\nexport { compareArrays } from \"./compare.js\";\nexport { delay } from \"./delay.js\";\nexport type { IComparer, IHeapNode } from \"./heap.js\";\nexport { Heap, NumberComparer } from \"./heap.js\";\nexport { Lazy, LazyPromise } from \"./lazy.js\";\nexport type { PromiseCacheExpiry, PromiseCacheOptions } from \"./promiseCache.js\";\nexport { PromiseCache } from \"./promiseCache.js\";\nexport { Deferred } from \"./promises.js\";\nexport type { IPromiseTimer, IPromiseTimerResult, ITimer } from \"./timer.js\";\nexport { PromiseTimer, setLongTimeout, Timer } from \"./timer.js\";\nexport { unreachableCase } from \"./unreachable.js\";\nexport { isObject, isPromiseLike } from \"./typesGuards.js\";\nexport { oob } from \"./oob.js\";\n"]}
package/dist/oob.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * Use this function to assert that an array index is not out-of-bounds.
7
+ * @example
8
+ * ```ts
9
+ * // We know that `numberArray` has four elements in it, so this is safe.
10
+ * const n: number = numberArray[3] ?? oob();
11
+ * ```
12
+ * @internal
13
+ */
14
+ export declare function oob(): never;
15
+ //# sourceMappingURL=oob.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oob.d.ts","sourceRoot":"","sources":["../src/oob.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,GAAG,IAAI,KAAK,CAE3B"}
package/dist/oob.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.oob = void 0;
8
+ /**
9
+ * Use this function to assert that an array index is not out-of-bounds.
10
+ * @example
11
+ * ```ts
12
+ * // We know that `numberArray` has four elements in it, so this is safe.
13
+ * const n: number = numberArray[3] ?? oob();
14
+ * ```
15
+ * @internal
16
+ */
17
+ function oob() {
18
+ throw new Error("Array index is out of bounds");
19
+ }
20
+ exports.oob = oob;
21
+ //# sourceMappingURL=oob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oob.js","sourceRoot":"","sources":["../src/oob.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;;;;GAQG;AACH,SAAgB,GAAG;IAClB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;AACjD,CAAC;AAFD,kBAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Use this function to assert that an array index is not out-of-bounds.\n * @example\n * ```ts\n * // We know that `numberArray` has four elements in it, so this is safe.\n * const n: number = numberArray[3] ?? oob();\n * ```\n * @internal\n */\nexport function oob(): never {\n\tthrow new Error(\"Array index is out of bounds\");\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -15,4 +15,5 @@ export type { IPromiseTimer, IPromiseTimerResult, ITimer } from "./timer.js";
15
15
  export { PromiseTimer, setLongTimeout, Timer } from "./timer.js";
16
16
  export { unreachableCase } from "./unreachable.js";
17
17
  export { isObject, isPromiseLike } from "./typesGuards.js";
18
+ export { oob } from "./oob.js";
18
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC9C,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC9C,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC"}
package/lib/index.js CHANGED
@@ -12,4 +12,5 @@ export { Deferred } from "./promises.js";
12
12
  export { PromiseTimer, setLongTimeout, Timer } from "./timer.js";
13
13
  export { unreachableCase } from "./unreachable.js";
14
14
  export { isObject, isPromiseLike } from "./typesGuards.js";
15
+ export { oob } from "./oob.js";
15
16
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { assert } from \"./assert.js\";\nexport { compareArrays } from \"./compare.js\";\nexport { delay } from \"./delay.js\";\nexport type { IComparer, IHeapNode } from \"./heap.js\";\nexport { Heap, NumberComparer } from \"./heap.js\";\nexport { Lazy, LazyPromise } from \"./lazy.js\";\nexport type { PromiseCacheExpiry, PromiseCacheOptions } from \"./promiseCache.js\";\nexport { PromiseCache } from \"./promiseCache.js\";\nexport { Deferred } from \"./promises.js\";\nexport type { IPromiseTimer, IPromiseTimerResult, ITimer } from \"./timer.js\";\nexport { PromiseTimer, setLongTimeout, Timer } from \"./timer.js\";\nexport { unreachableCase } from \"./unreachable.js\";\nexport { isObject, isPromiseLike } from \"./typesGuards.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { assert } from \"./assert.js\";\nexport { compareArrays } from \"./compare.js\";\nexport { delay } from \"./delay.js\";\nexport type { IComparer, IHeapNode } from \"./heap.js\";\nexport { Heap, NumberComparer } from \"./heap.js\";\nexport { Lazy, LazyPromise } from \"./lazy.js\";\nexport type { PromiseCacheExpiry, PromiseCacheOptions } from \"./promiseCache.js\";\nexport { PromiseCache } from \"./promiseCache.js\";\nexport { Deferred } from \"./promises.js\";\nexport type { IPromiseTimer, IPromiseTimerResult, ITimer } from \"./timer.js\";\nexport { PromiseTimer, setLongTimeout, Timer } from \"./timer.js\";\nexport { unreachableCase } from \"./unreachable.js\";\nexport { isObject, isPromiseLike } from \"./typesGuards.js\";\nexport { oob } from \"./oob.js\";\n"]}
package/lib/oob.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * Use this function to assert that an array index is not out-of-bounds.
7
+ * @example
8
+ * ```ts
9
+ * // We know that `numberArray` has four elements in it, so this is safe.
10
+ * const n: number = numberArray[3] ?? oob();
11
+ * ```
12
+ * @internal
13
+ */
14
+ export declare function oob(): never;
15
+ //# sourceMappingURL=oob.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oob.d.ts","sourceRoot":"","sources":["../src/oob.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,GAAG,IAAI,KAAK,CAE3B"}
package/lib/oob.js ADDED
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * Use this function to assert that an array index is not out-of-bounds.
7
+ * @example
8
+ * ```ts
9
+ * // We know that `numberArray` has four elements in it, so this is safe.
10
+ * const n: number = numberArray[3] ?? oob();
11
+ * ```
12
+ * @internal
13
+ */
14
+ export function oob() {
15
+ throw new Error("Array index is out of bounds");
16
+ }
17
+ //# sourceMappingURL=oob.js.map
package/lib/oob.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oob.js","sourceRoot":"","sources":["../src/oob.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AACH,MAAM,UAAU,GAAG;IAClB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;AACjD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Use this function to assert that an array index is not out-of-bounds.\n * @example\n * ```ts\n * // We know that `numberArray` has four elements in it, so this is safe.\n * const n: number = numberArray[3] ?? oob();\n * ```\n * @internal\n */\nexport function oob(): never {\n\tthrow new Error(\"Array index is out of bounds\");\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/core-utils",
3
- "version": "2.1.0-281041",
3
+ "version": "2.2.0",
4
4
  "description": "Not intended for use outside the Fluid client repo.",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -69,12 +69,12 @@
69
69
  "devDependencies": {
70
70
  "@arethetypeswrong/cli": "^0.15.2",
71
71
  "@biomejs/biome": "~1.8.3",
72
- "@fluid-internal/mocha-test-setup": "2.1.0-281041",
73
- "@fluid-tools/benchmark": "^0.47.0",
74
- "@fluid-tools/build-cli": "^0.40.0",
72
+ "@fluid-internal/mocha-test-setup": "~2.2.0",
73
+ "@fluid-tools/benchmark": "^0.50.0",
74
+ "@fluid-tools/build-cli": "^0.43.0",
75
75
  "@fluidframework/build-common": "^2.0.3",
76
- "@fluidframework/build-tools": "^0.40.0",
77
- "@fluidframework/core-utils-previous": "npm:@fluidframework/core-utils@2.0.0",
76
+ "@fluidframework/build-tools": "^0.43.0",
77
+ "@fluidframework/core-utils-previous": "npm:@fluidframework/core-utils@2.1.0",
78
78
  "@fluidframework/eslint-config-fluid": "^5.3.0",
79
79
  "@microsoft/api-extractor": "^7.45.1",
80
80
  "@types/mocha": "^9.1.1",
package/src/index.ts CHANGED
@@ -16,3 +16,4 @@ export type { IPromiseTimer, IPromiseTimerResult, ITimer } from "./timer.js";
16
16
  export { PromiseTimer, setLongTimeout, Timer } from "./timer.js";
17
17
  export { unreachableCase } from "./unreachable.js";
18
18
  export { isObject, isPromiseLike } from "./typesGuards.js";
19
+ export { oob } from "./oob.js";
package/src/oob.ts ADDED
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /**
7
+ * Use this function to assert that an array index is not out-of-bounds.
8
+ * @example
9
+ * ```ts
10
+ * // We know that `numberArray` has four elements in it, so this is safe.
11
+ * const n: number = numberArray[3] ?? oob();
12
+ * ```
13
+ * @internal
14
+ */
15
+ export function oob(): never {
16
+ throw new Error("Array index is out of bounds");
17
+ }