@fluidframework/core-utils 2.71.0 → 2.72.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/.eslintrc.cjs CHANGED
@@ -20,7 +20,7 @@ module.exports = {
20
20
  files: ["*.spec.ts", "*.test.ts", "src/test/**"],
21
21
  rules: {
22
22
  // Test files are run in node only so additional node libraries can be used.
23
- "import/no-nodejs-modules": ["error", { allow: ["node:assert", "node:process"] }],
23
+ "import-x/no-nodejs-modules": ["error", { allow: ["node:assert", "node:process"] }],
24
24
 
25
25
  // Does not work well with describe/it block scoping
26
26
  "unicorn/consistent-function-scoping": "off",
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/core-utils
2
2
 
3
+ ## 2.72.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.71.0
4
8
 
5
9
  Dependency updates only.
@@ -173,7 +177,6 @@ Dependency updates only.
173
177
  TypeScript types and implementation code.
174
178
 
175
179
  This means that using Fluid Framework packages require the following TypeScript settings in tsconfig.json:
176
-
177
180
  - `"moduleResolution": "Node16"` with `"module": "Node16"`
178
181
  - `"moduleResolution": "Bundler"` with `"module": "ESNext"`
179
182
 
package/dist/index.d.ts CHANGED
@@ -18,4 +18,5 @@ export { PromiseTimer, setLongTimeout, Timer } from "./timer.js";
18
18
  export { unreachableCase } from "./unreachable.js";
19
19
  export { isObject, isPromiseLike } from "./typesGuards.js";
20
20
  export { oob } from "./oob.js";
21
+ export { transformMapValues } from "./map.js";
21
22
  //# 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,EACN,MAAM,EACN,IAAI,EACJ,WAAW,EACX,qBAAqB,EACrB,iCAAiC,EACjC,sBAAsB,EACtB,kBAAkB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,M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,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,OAAO,EACN,gBAAgB,EAChB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,sBAAsB,EACtB,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,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,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,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;AAC/B,OAAO,EAAE,kBAAkB,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.oob = exports.isPromiseLike = exports.isObject = exports.unreachableCase = exports.Timer = exports.setLongTimeout = exports.PromiseTimer = exports.shallowCloneObject = exports.Deferred = exports.PromiseCache = exports.walkList = exports.iterateListValuesWhile = exports.DoublyLinkedList = exports.LazyPromise = exports.Lazy = exports.NumberComparer = exports.Heap = exports.delay = exports.compareArrays = exports.onAssertionFailure = exports.emulateProductionBuild = exports.nonProductionConditionalsIncluded = exports.configureDebugAsserts = exports.debugAssert = exports.fail = exports.assert = void 0;
7
+ exports.transformMapValues = exports.oob = exports.isPromiseLike = exports.isObject = exports.unreachableCase = exports.Timer = exports.setLongTimeout = exports.PromiseTimer = exports.shallowCloneObject = exports.Deferred = exports.PromiseCache = exports.walkList = exports.iterateListValuesWhile = exports.DoublyLinkedList = exports.LazyPromise = exports.Lazy = exports.NumberComparer = exports.Heap = exports.delay = exports.compareArrays = exports.onAssertionFailure = exports.emulateProductionBuild = exports.nonProductionConditionalsIncluded = exports.configureDebugAsserts = exports.debugAssert = exports.fail = 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
  Object.defineProperty(exports, "fail", { enumerable: true, get: function () { return assert_js_1.fail; } });
@@ -44,4 +44,6 @@ Object.defineProperty(exports, "isObject", { enumerable: true, get: function ()
44
44
  Object.defineProperty(exports, "isPromiseLike", { enumerable: true, get: function () { return typesGuards_js_1.isPromiseLike; } });
45
45
  var oob_js_1 = require("./oob.js");
46
46
  Object.defineProperty(exports, "oob", { enumerable: true, get: function () { return oob_js_1.oob; } });
47
+ var map_js_1 = require("./map.js");
48
+ Object.defineProperty(exports, "transformMapValues", { enumerable: true, get: function () { return map_js_1.transformMapValues; } });
47
49
  //# 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,yCAQqB;AAPpB,mGAAA,MAAM,OAAA;AACN,iGAAA,IAAI,OAAA;AACJ,wGAAA,WAAW,OAAA;AACX,kHAAA,qBAAqB,OAAA;AACrB,8HAAA,iCAAiC,OAAA;AACjC,mHAAA,sBAAsB,OAAA;AACtB,+GAAA,kBAAkB,OAAA;AAEnB,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;AAC1B,qCAMmB;AALlB,2GAAA,gBAAgB,OAAA;AAGhB,iHAAA,sBAAsB,OAAA;AACtB,mGAAA,QAAQ,OAAA;AAGT,qDAAiD;AAAxC,+GAAA,YAAY,OAAA;AACrB,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AACjB,qDAAuD;AAA9C,qHAAA,kBAAkB,OAAA;AAE3B,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 {\n\tassert,\n\tfail,\n\tdebugAssert,\n\tconfigureDebugAsserts,\n\tnonProductionConditionalsIncluded,\n\temulateProductionBuild,\n\tonAssertionFailure,\n} 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 {\n\tDoublyLinkedList,\n\ttype ListNode,\n\ttype ListNodeRange,\n\titerateListValuesWhile,\n\twalkList,\n} from \"./list.js\";\nexport type { PromiseCacheExpiry, PromiseCacheOptions } from \"./promiseCache.js\";\nexport { PromiseCache } from \"./promiseCache.js\";\nexport { Deferred } from \"./promises.js\";\nexport { shallowCloneObject } from \"./shallowClone.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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yCAQqB;AAPpB,mGAAA,MAAM,OAAA;AACN,iGAAA,IAAI,OAAA;AACJ,wGAAA,WAAW,OAAA;AACX,kHAAA,qBAAqB,OAAA;AACrB,8HAAA,iCAAiC,OAAA;AACjC,mHAAA,sBAAsB,OAAA;AACtB,+GAAA,kBAAkB,OAAA;AAEnB,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;AAC1B,qCAMmB;AALlB,2GAAA,gBAAgB,OAAA;AAGhB,iHAAA,sBAAsB,OAAA;AACtB,mGAAA,QAAQ,OAAA;AAGT,qDAAiD;AAAxC,+GAAA,YAAY,OAAA;AACrB,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AACjB,qDAAuD;AAA9C,qHAAA,kBAAkB,OAAA;AAE3B,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;AACZ,mCAA8C;AAArC,4GAAA,kBAAkB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tassert,\n\tfail,\n\tdebugAssert,\n\tconfigureDebugAsserts,\n\tnonProductionConditionalsIncluded,\n\temulateProductionBuild,\n\tonAssertionFailure,\n} 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 {\n\tDoublyLinkedList,\n\ttype ListNode,\n\ttype ListNodeRange,\n\titerateListValuesWhile,\n\twalkList,\n} from \"./list.js\";\nexport type { PromiseCacheExpiry, PromiseCacheOptions } from \"./promiseCache.js\";\nexport { PromiseCache } from \"./promiseCache.js\";\nexport { Deferred } from \"./promises.js\";\nexport { shallowCloneObject } from \"./shallowClone.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\";\nexport { transformMapValues } from \"./map.js\";\n"]}
package/dist/map.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * Transform the values of a Map using the provided transform function.
7
+ * @param map - The map to transform.
8
+ * @param transformValue - A method for transforming values in the map.
9
+ * @returns A new map with the transformed values.
10
+ *
11
+ * @internal
12
+ */
13
+ export declare function transformMapValues<Key, InputValue, OutputValue>(map: ReadonlyMap<Key, InputValue>, transformValue: (value: InputValue, key: Key) => OutputValue): Map<Key, OutputValue>;
14
+ //# sourceMappingURL=map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,EAAE,WAAW,EAC9D,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,UAAU,CAAC,EACjC,cAAc,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,KAAK,WAAW,GAC1D,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC,CAEvB"}
package/dist/map.js ADDED
@@ -0,0 +1,20 @@
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.transformMapValues = void 0;
8
+ /**
9
+ * Transform the values of a Map using the provided transform function.
10
+ * @param map - The map to transform.
11
+ * @param transformValue - A method for transforming values in the map.
12
+ * @returns A new map with the transformed values.
13
+ *
14
+ * @internal
15
+ */
16
+ function transformMapValues(map, transformValue) {
17
+ return new Map([...map.entries()].map(([key, value]) => [key, transformValue(value, key)]));
18
+ }
19
+ exports.transformMapValues = transformMapValues;
20
+ //# sourceMappingURL=map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map.js","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CACjC,GAAiC,EACjC,cAA4D;IAE5D,OAAO,IAAI,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7F,CAAC;AALD,gDAKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Transform the values of a Map using the provided transform function.\n * @param map - The map to transform.\n * @param transformValue - A method for transforming values in the map.\n * @returns A new map with the transformed values.\n *\n * @internal\n */\nexport function transformMapValues<Key, InputValue, OutputValue>(\n\tmap: ReadonlyMap<Key, InputValue>,\n\ttransformValue: (value: InputValue, key: Key) => OutputValue,\n): Map<Key, OutputValue> {\n\treturn new Map([...map.entries()].map(([key, value]) => [key, transformValue(value, key)]));\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -18,4 +18,5 @@ export { PromiseTimer, setLongTimeout, Timer } from "./timer.js";
18
18
  export { unreachableCase } from "./unreachable.js";
19
19
  export { isObject, isPromiseLike } from "./typesGuards.js";
20
20
  export { oob } from "./oob.js";
21
+ export { transformMapValues } from "./map.js";
21
22
  //# 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,EACN,MAAM,EACN,IAAI,EACJ,WAAW,EACX,qBAAqB,EACrB,iCAAiC,EACjC,sBAAsB,EACtB,kBAAkB,GAClB,MAAM,aAAa,CAAC;AACrB,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,OAAO,EACN,gBAAgB,EAChB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,sBAAsB,EACtB,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,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,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,YAAY,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AAE,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;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
package/lib/index.js CHANGED
@@ -15,4 +15,5 @@ export { PromiseTimer, setLongTimeout, Timer } from "./timer.js";
15
15
  export { unreachableCase } from "./unreachable.js";
16
16
  export { isObject, isPromiseLike } from "./typesGuards.js";
17
17
  export { oob } from "./oob.js";
18
+ export { transformMapValues } from "./map.js";
18
19
  //# 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,EACN,MAAM,EACN,IAAI,EACJ,WAAW,EACX,qBAAqB,EACrB,iCAAiC,EACjC,sBAAsB,EACtB,kBAAkB,GAClB,MAAM,aAAa,CAAC;AACrB,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;AAC9C,OAAO,EACN,gBAAgB,EAGhB,sBAAsB,EACtB,QAAQ,GACR,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,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 {\n\tassert,\n\tfail,\n\tdebugAssert,\n\tconfigureDebugAsserts,\n\tnonProductionConditionalsIncluded,\n\temulateProductionBuild,\n\tonAssertionFailure,\n} 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 {\n\tDoublyLinkedList,\n\ttype ListNode,\n\ttype ListNodeRange,\n\titerateListValuesWhile,\n\twalkList,\n} from \"./list.js\";\nexport type { PromiseCacheExpiry, PromiseCacheOptions } from \"./promiseCache.js\";\nexport { PromiseCache } from \"./promiseCache.js\";\nexport { Deferred } from \"./promises.js\";\nexport { shallowCloneObject } from \"./shallowClone.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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,MAAM,EACN,IAAI,EACJ,WAAW,EACX,qBAAqB,EACrB,iCAAiC,EACjC,sBAAsB,EACtB,kBAAkB,GAClB,MAAM,aAAa,CAAC;AACrB,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;AAC9C,OAAO,EACN,gBAAgB,EAGhB,sBAAsB,EACtB,QAAQ,GACR,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,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;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tassert,\n\tfail,\n\tdebugAssert,\n\tconfigureDebugAsserts,\n\tnonProductionConditionalsIncluded,\n\temulateProductionBuild,\n\tonAssertionFailure,\n} 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 {\n\tDoublyLinkedList,\n\ttype ListNode,\n\ttype ListNodeRange,\n\titerateListValuesWhile,\n\twalkList,\n} from \"./list.js\";\nexport type { PromiseCacheExpiry, PromiseCacheOptions } from \"./promiseCache.js\";\nexport { PromiseCache } from \"./promiseCache.js\";\nexport { Deferred } from \"./promises.js\";\nexport { shallowCloneObject } from \"./shallowClone.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\";\nexport { transformMapValues } from \"./map.js\";\n"]}
package/lib/map.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * Transform the values of a Map using the provided transform function.
7
+ * @param map - The map to transform.
8
+ * @param transformValue - A method for transforming values in the map.
9
+ * @returns A new map with the transformed values.
10
+ *
11
+ * @internal
12
+ */
13
+ export declare function transformMapValues<Key, InputValue, OutputValue>(map: ReadonlyMap<Key, InputValue>, transformValue: (value: InputValue, key: Key) => OutputValue): Map<Key, OutputValue>;
14
+ //# sourceMappingURL=map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,EAAE,WAAW,EAC9D,GAAG,EAAE,WAAW,CAAC,GAAG,EAAE,UAAU,CAAC,EACjC,cAAc,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,KAAK,WAAW,GAC1D,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC,CAEvB"}
package/lib/map.js ADDED
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * Transform the values of a Map using the provided transform function.
7
+ * @param map - The map to transform.
8
+ * @param transformValue - A method for transforming values in the map.
9
+ * @returns A new map with the transformed values.
10
+ *
11
+ * @internal
12
+ */
13
+ export function transformMapValues(map, transformValue) {
14
+ return new Map([...map.entries()].map(([key, value]) => [key, transformValue(value, key)]));
15
+ }
16
+ //# sourceMappingURL=map.js.map
package/lib/map.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map.js","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CACjC,GAAiC,EACjC,cAA4D;IAE5D,OAAO,IAAI,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7F,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Transform the values of a Map using the provided transform function.\n * @param map - The map to transform.\n * @param transformValue - A method for transforming values in the map.\n * @returns A new map with the transformed values.\n *\n * @internal\n */\nexport function transformMapValues<Key, InputValue, OutputValue>(\n\tmap: ReadonlyMap<Key, InputValue>,\n\ttransformValue: (value: InputValue, key: Key) => OutputValue,\n): Map<Key, OutputValue> {\n\treturn new Map([...map.entries()].map(([key, value]) => [key, transformValue(value, key)]));\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/core-utils",
3
- "version": "2.71.0",
3
+ "version": "2.72.0",
4
4
  "description": "Not intended for use outside the Fluid client repo.",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -69,13 +69,13 @@
69
69
  "devDependencies": {
70
70
  "@arethetypeswrong/cli": "^0.17.1",
71
71
  "@biomejs/biome": "~1.9.3",
72
- "@fluid-internal/mocha-test-setup": "~2.71.0",
72
+ "@fluid-internal/mocha-test-setup": "~2.72.0",
73
73
  "@fluid-tools/benchmark": "^0.51.0",
74
- "@fluid-tools/build-cli": "^0.58.3",
74
+ "@fluid-tools/build-cli": "^0.60.0",
75
75
  "@fluidframework/build-common": "^2.0.3",
76
- "@fluidframework/build-tools": "^0.58.3",
77
- "@fluidframework/core-utils-previous": "npm:@fluidframework/core-utils@2.70.0",
78
- "@fluidframework/eslint-config-fluid": "^7.0.0",
76
+ "@fluidframework/build-tools": "^0.60.0",
77
+ "@fluidframework/core-utils-previous": "npm:@fluidframework/core-utils@2.71.0",
78
+ "@fluidframework/eslint-config-fluid": "~2.72.0",
79
79
  "@microsoft/api-extractor": "7.52.11",
80
80
  "@types/mocha": "^10.0.10",
81
81
  "@types/node": "^18.19.0",
package/src/index.ts CHANGED
@@ -33,3 +33,4 @@ export { PromiseTimer, setLongTimeout, Timer } from "./timer.js";
33
33
  export { unreachableCase } from "./unreachable.js";
34
34
  export { isObject, isPromiseLike } from "./typesGuards.js";
35
35
  export { oob } from "./oob.js";
36
+ export { transformMapValues } from "./map.js";
package/src/map.ts ADDED
@@ -0,0 +1,19 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /**
7
+ * Transform the values of a Map using the provided transform function.
8
+ * @param map - The map to transform.
9
+ * @param transformValue - A method for transforming values in the map.
10
+ * @returns A new map with the transformed values.
11
+ *
12
+ * @internal
13
+ */
14
+ export function transformMapValues<Key, InputValue, OutputValue>(
15
+ map: ReadonlyMap<Key, InputValue>,
16
+ transformValue: (value: InputValue, key: Key) => OutputValue,
17
+ ): Map<Key, OutputValue> {
18
+ return new Map([...map.entries()].map(([key, value]) => [key, transformValue(value, key)]));
19
+ }