@contember/utilities 2.1.0-alpha.8 → 2.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/development/index.cjs +8 -8
  2. package/dist/development/index.js +4 -4
  3. package/dist/development/src/assert-types/assertNever.cjs.map +1 -1
  4. package/dist/development/src/assert-types/assertNever.js.map +1 -1
  5. package/dist/development/src/deprecate/deprecate.cjs +6 -2
  6. package/dist/development/src/deprecate/deprecate.cjs.map +1 -1
  7. package/dist/development/src/deprecate/deprecate.js +6 -2
  8. package/dist/development/src/deprecate/deprecate.js.map +1 -1
  9. package/dist/development/src/dom/dataAttribute.cjs.map +1 -1
  10. package/dist/development/src/dom/dataAttribute.js.map +1 -1
  11. package/dist/development/src/dom/svgSizeProps.cjs.map +1 -1
  12. package/dist/development/src/dom/svgSizeProps.js.map +1 -1
  13. package/dist/development/src/structures/BijectiveIndexedMap.cjs +17 -0
  14. package/dist/development/src/structures/BijectiveIndexedMap.cjs.map +1 -1
  15. package/dist/development/src/structures/BijectiveIndexedMap.js +17 -0
  16. package/dist/development/src/structures/BijectiveIndexedMap.js.map +1 -1
  17. package/dist/development/src/structures/LRUCache.cjs.map +1 -1
  18. package/dist/development/src/structures/LRUCache.js.map +1 -1
  19. package/dist/development/src/structures/WeakIdCache.cjs.map +1 -1
  20. package/dist/development/src/structures/WeakIdCache.js.map +1 -1
  21. package/dist/production/index.cjs +8 -8
  22. package/dist/production/index.js +4 -4
  23. package/dist/production/src/assert-types/assertNever.cjs.map +1 -1
  24. package/dist/production/src/assert-types/assertNever.js.map +1 -1
  25. package/dist/production/src/deprecate/deprecate.cjs.map +1 -1
  26. package/dist/production/src/deprecate/deprecate.js.map +1 -1
  27. package/dist/production/src/dom/dataAttribute.cjs.map +1 -1
  28. package/dist/production/src/dom/dataAttribute.js.map +1 -1
  29. package/dist/production/src/dom/svgSizeProps.cjs.map +1 -1
  30. package/dist/production/src/dom/svgSizeProps.js.map +1 -1
  31. package/dist/production/src/structures/BijectiveIndexedMap.cjs +17 -0
  32. package/dist/production/src/structures/BijectiveIndexedMap.cjs.map +1 -1
  33. package/dist/production/src/structures/BijectiveIndexedMap.js +17 -0
  34. package/dist/production/src/structures/BijectiveIndexedMap.js.map +1 -1
  35. package/dist/production/src/structures/LRUCache.cjs.map +1 -1
  36. package/dist/production/src/structures/LRUCache.js.map +1 -1
  37. package/dist/production/src/structures/WeakIdCache.cjs.map +1 -1
  38. package/dist/production/src/structures/WeakIdCache.js.map +1 -1
  39. package/dist/types/deprecate/deprecate.d.ts.map +1 -1
  40. package/dist/types/deprecate/types.d.ts.map +1 -1
  41. package/dist/types/structures/BijectiveIndexedMap.d.ts +2 -0
  42. package/dist/types/structures/BijectiveIndexedMap.d.ts.map +1 -1
  43. package/dist/types/tsconfig.tsbuildinfo +1 -1
  44. package/dist/types/types/Narrow.d.ts +1 -1
  45. package/dist/types/types/Narrow.d.ts.map +1 -1
  46. package/package.json +3 -3
  47. package/src/deprecate/deprecate.ts +10 -2
  48. package/src/deprecate/types.ts +0 -1
  49. package/src/structures/BijectiveIndexedMap.ts +19 -0
  50. package/src/structures/WeakIdCache.ts +1 -1
  51. package/src/types/Narrow.ts +5 -6
  52. package/src/types/NonOptional.ts +1 -1
  53. package/tests/dom/dataAttribute.test.ts +2 -3
  54. package/tests/dom/svgSizeProps.test.ts +2 -2
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const assertNever = require("./src/assert-types/assertNever.cjs");
4
- const deprecate = require("./src/deprecate/deprecate.cjs");
5
- const dataAttribute = require("./src/dom/dataAttribute.cjs");
6
- const svgSizeProps = require("./src/dom/svgSizeProps.cjs");
7
3
  const BijectiveIndexedMap = require("./src/structures/BijectiveIndexedMap.cjs");
8
4
  const LRUCache = require("./src/structures/LRUCache.cjs");
9
5
  const WeakIdCache = require("./src/structures/WeakIdCache.cjs");
10
- exports.assertNever = assertNever.assertNever;
11
- exports.deprecate = deprecate.deprecate;
12
- exports.dataAttribute = dataAttribute.dataAttribute;
13
- exports.svgSizeProps = svgSizeProps.svgSizeProps;
6
+ const assertNever = require("./src/assert-types/assertNever.cjs");
7
+ const dataAttribute = require("./src/dom/dataAttribute.cjs");
8
+ const deprecate = require("./src/deprecate/deprecate.cjs");
9
+ const svgSizeProps = require("./src/dom/svgSizeProps.cjs");
14
10
  exports.BijectiveIndexedMap = BijectiveIndexedMap.BijectiveIndexedMap;
15
11
  exports.LRUCache = LRUCache.LRUCache;
16
12
  exports.WeakIdCache = WeakIdCache.WeakIdCache;
13
+ exports.assertNever = assertNever.assertNever;
14
+ exports.dataAttribute = dataAttribute.dataAttribute;
15
+ exports.deprecate = deprecate.deprecate;
16
+ exports.svgSizeProps = svgSizeProps.svgSizeProps;
17
17
  //# sourceMappingURL=index.cjs.map
@@ -1,10 +1,10 @@
1
- import { assertNever } from "./src/assert-types/assertNever.js";
2
- import { deprecate } from "./src/deprecate/deprecate.js";
3
- import { dataAttribute } from "./src/dom/dataAttribute.js";
4
- import { svgSizeProps } from "./src/dom/svgSizeProps.js";
5
1
  import { BijectiveIndexedMap } from "./src/structures/BijectiveIndexedMap.js";
6
2
  import { LRUCache } from "./src/structures/LRUCache.js";
7
3
  import { WeakIdCache } from "./src/structures/WeakIdCache.js";
4
+ import { assertNever } from "./src/assert-types/assertNever.js";
5
+ import { dataAttribute } from "./src/dom/dataAttribute.js";
6
+ import { deprecate } from "./src/deprecate/deprecate.js";
7
+ import { svgSizeProps } from "./src/dom/svgSizeProps.js";
8
8
  export {
9
9
  BijectiveIndexedMap,
10
10
  LRUCache,
@@ -1 +1 @@
1
- {"version":3,"file":"assertNever.cjs","sources":["../../../../../packages/utilities/src/assert-types/assertNever.ts"],"sourcesContent":["export function assertNever(_: never): never {\n\tthrow new Error('Exhaustive Error: This line should never be reached.')\n}\n"],"names":[],"mappings":";;AAAO,SAAS,YAAY,GAAiB;AACtC,QAAA,IAAI,MAAM,sDAAsD;AACvE;;"}
1
+ {"version":3,"file":"assertNever.cjs","sources":["../../../../../packages/utilities/src/assert-types/assertNever.ts"],"sourcesContent":["export function assertNever(_: never): never {\n\tthrow new Error('Exhaustive Error: This line should never be reached.')\n}\n"],"names":[],"mappings":";;AAAO,SAAS,YAAY,GAAiB;AAC5C,QAAM,IAAI,MAAM,sDAAsD;AACvE;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"assertNever.js","sources":["../../../../../packages/utilities/src/assert-types/assertNever.ts"],"sourcesContent":["export function assertNever(_: never): never {\n\tthrow new Error('Exhaustive Error: This line should never be reached.')\n}\n"],"names":[],"mappings":"AAAO,SAAS,YAAY,GAAiB;AACtC,QAAA,IAAI,MAAM,sDAAsD;AACvE;"}
1
+ {"version":3,"file":"assertNever.js","sources":["../../../../../packages/utilities/src/assert-types/assertNever.ts"],"sourcesContent":["export function assertNever(_: never): never {\n\tthrow new Error('Exhaustive Error: This line should never be reached.')\n}\n"],"names":[],"mappings":"AAAO,SAAS,YAAY,GAAiB;AAC5C,QAAM,IAAI,MAAM,sDAAsD;AACvE;"}
@@ -5,9 +5,13 @@ function deprecate(removal, condition, deprecated, replacement) {
5
5
  {
6
6
  const shouldThrow = Boolean(void 0);
7
7
  if (shouldThrow) {
8
- throw new Error(`Support for ${deprecated} was planned to be removed in the ${removal} release.${replacement ? ` Replace it with ${replacement} instead.` : "Remove it."}`);
8
+ throw new Error(
9
+ `Support for ${deprecated} was planned to be removed in the ${removal} release.${replacement ? ` Replace it with ${replacement} instead.` : "Remove it."}`
10
+ );
9
11
  } else {
10
- console.warn(`Use of ${deprecated} is deprecated and might be removed in the next release.${replacement ? ` Use ${replacement} instead.` : " There is no replacement."}`);
12
+ console.warn(
13
+ `Use of ${deprecated} is deprecated and might be removed in the next release.${replacement ? ` Use ${replacement} instead.` : " There is no replacement."}`
14
+ );
11
15
  }
12
16
  }
13
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"deprecate.cjs","sources":["../../../../../packages/utilities/src/deprecate/deprecate.ts"],"sourcesContent":["import { SemverString } from './types'\n\n/**\n * Logs a deprecation warning if the assertion is `false`.\n * @internal\n *\n * @param removal - Version when the deprecated feature will be removed\n * @param condition - Condition under which the deprecation warning will be logged\n * @param deprecated - Name of the deprecated feature\n * @param replacement - Name of the feature that replaces the deprecated feature\n *\n * @example\n * ```ts\n * const { visible } = props\n * deprecate(visible !== 'default', '1.3.0', '\"default\"', '\"hidden\"')\n * // Logs: Use of \"default\" is deprecated and might be removed in the next release. Use \"hidden\" instead.\n * ```\n */\nexport function deprecate(removal: SemverString, condition: boolean, deprecated: string, replacement: string | null): void {\n\tif (condition === true) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconst shouldThrow = Boolean(import.meta.env.VITE_CONTEMBER_ADMIN_STRICT_DEPRECATIONS)\n\n\t\t\tif (shouldThrow) {\n\t\t\t\tthrow new Error(`Support for ${deprecated} was planned to be removed in the ${removal} release.${replacement ? ` Replace it with ${replacement} instead.` : 'Remove it.'}`)\n\t\t\t} else {\n\t\t\t\tconsole.warn(`Use of ${deprecated} is deprecated and might be removed in the next release.${replacement ? ` Use ${replacement} instead.` : ' There is no replacement.'}`)\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAkBO,SAAS,UAAU,SAAuB,WAAoB,YAAoB,aAAkC;AAC1H,MAAI,cAAc,MAAM;AACE;AAClB,YAAA,cAAc,QAAQ,MAAwD;AAEpF,UAAI,aAAa;AAChB,cAAM,IAAI,MAAM,eAAe,UAAU,qCAAqC,OAAO,YAAY,cAAc,oBAAoB,WAAW,cAAc,YAAY,EAAE;AAAA,MAAA,OACpK;AACE,gBAAA,KAAK,UAAU,UAAU,2DAA2D,cAAc,QAAQ,WAAW,cAAc,2BAA2B,EAAE;AAAA,MAAA;AAAA,IACzK;AAAA,EACD;AAEF;;"}
1
+ {"version":3,"file":"deprecate.cjs","sources":["../../../../../packages/utilities/src/deprecate/deprecate.ts"],"sourcesContent":["import { SemverString } from './types'\n\n/**\n * Logs a deprecation warning if the assertion is `false`.\n * @internal\n *\n * @param removal - Version when the deprecated feature will be removed\n * @param condition - Condition under which the deprecation warning will be logged\n * @param deprecated - Name of the deprecated feature\n * @param replacement - Name of the feature that replaces the deprecated feature\n *\n * @example\n * ```ts\n * const { visible } = props\n * deprecate(visible !== 'default', '1.3.0', '\"default\"', '\"hidden\"')\n * // Logs: Use of \"default\" is deprecated and might be removed in the next release. Use \"hidden\" instead.\n * ```\n */\nexport function deprecate(removal: SemverString, condition: boolean, deprecated: string, replacement: string | null): void {\n\tif (condition === true) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconst shouldThrow = Boolean(import.meta.env.VITE_CONTEMBER_ADMIN_STRICT_DEPRECATIONS)\n\n\t\t\tif (shouldThrow) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Support for ${deprecated} was planned to be removed in the ${removal} release.${\n\t\t\t\t\t\treplacement ? ` Replace it with ${replacement} instead.` : 'Remove it.'\n\t\t\t\t\t}`,\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`Use of ${deprecated} is deprecated and might be removed in the next release.${\n\t\t\t\t\t\treplacement ? ` Use ${replacement} instead.` : ' There is no replacement.'\n\t\t\t\t\t}`,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAkBO,SAAS,UAAU,SAAuB,WAAoB,YAAoB,aAAkC;AAC1H,MAAI,cAAc,MAAM;AACE;AACxB,YAAM,cAAc,QAAQ,MAAA;AAE5B,UAAI,aAAa;AAChB,cAAM,IAAI;AAAA,UACT,eAAe,UAAU,qCAAqC,OAAO,YACpE,cAAc,oBAAoB,WAAW,cAAc,YAC5D;AAAA,QAAA;AAAA,MAEF,OAAO;AACN,gBAAQ;AAAA,UACP,UAAU,UAAU,2DACnB,cAAc,QAAQ,WAAW,cAAc,2BAChD;AAAA,QAAA;AAAA,MAEF;AAAA,IACD;AAAA,EACD;AACD;;"}
@@ -3,9 +3,13 @@ function deprecate(removal, condition, deprecated, replacement) {
3
3
  {
4
4
  const shouldThrow = Boolean(void 0);
5
5
  if (shouldThrow) {
6
- throw new Error(`Support for ${deprecated} was planned to be removed in the ${removal} release.${replacement ? ` Replace it with ${replacement} instead.` : "Remove it."}`);
6
+ throw new Error(
7
+ `Support for ${deprecated} was planned to be removed in the ${removal} release.${replacement ? ` Replace it with ${replacement} instead.` : "Remove it."}`
8
+ );
7
9
  } else {
8
- console.warn(`Use of ${deprecated} is deprecated and might be removed in the next release.${replacement ? ` Use ${replacement} instead.` : " There is no replacement."}`);
10
+ console.warn(
11
+ `Use of ${deprecated} is deprecated and might be removed in the next release.${replacement ? ` Use ${replacement} instead.` : " There is no replacement."}`
12
+ );
9
13
  }
10
14
  }
11
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"deprecate.js","sources":["../../../../../packages/utilities/src/deprecate/deprecate.ts"],"sourcesContent":["import { SemverString } from './types'\n\n/**\n * Logs a deprecation warning if the assertion is `false`.\n * @internal\n *\n * @param removal - Version when the deprecated feature will be removed\n * @param condition - Condition under which the deprecation warning will be logged\n * @param deprecated - Name of the deprecated feature\n * @param replacement - Name of the feature that replaces the deprecated feature\n *\n * @example\n * ```ts\n * const { visible } = props\n * deprecate(visible !== 'default', '1.3.0', '\"default\"', '\"hidden\"')\n * // Logs: Use of \"default\" is deprecated and might be removed in the next release. Use \"hidden\" instead.\n * ```\n */\nexport function deprecate(removal: SemverString, condition: boolean, deprecated: string, replacement: string | null): void {\n\tif (condition === true) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconst shouldThrow = Boolean(import.meta.env.VITE_CONTEMBER_ADMIN_STRICT_DEPRECATIONS)\n\n\t\t\tif (shouldThrow) {\n\t\t\t\tthrow new Error(`Support for ${deprecated} was planned to be removed in the ${removal} release.${replacement ? ` Replace it with ${replacement} instead.` : 'Remove it.'}`)\n\t\t\t} else {\n\t\t\t\tconsole.warn(`Use of ${deprecated} is deprecated and might be removed in the next release.${replacement ? ` Use ${replacement} instead.` : ' There is no replacement.'}`)\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAkBO,SAAS,UAAU,SAAuB,WAAoB,YAAoB,aAAkC;AAC1H,MAAI,cAAc,MAAM;AACE;AAClB,YAAA,cAAc,QAAQ,MAAwD;AAEpF,UAAI,aAAa;AAChB,cAAM,IAAI,MAAM,eAAe,UAAU,qCAAqC,OAAO,YAAY,cAAc,oBAAoB,WAAW,cAAc,YAAY,EAAE;AAAA,MAAA,OACpK;AACE,gBAAA,KAAK,UAAU,UAAU,2DAA2D,cAAc,QAAQ,WAAW,cAAc,2BAA2B,EAAE;AAAA,MAAA;AAAA,IACzK;AAAA,EACD;AAEF;"}
1
+ {"version":3,"file":"deprecate.js","sources":["../../../../../packages/utilities/src/deprecate/deprecate.ts"],"sourcesContent":["import { SemverString } from './types'\n\n/**\n * Logs a deprecation warning if the assertion is `false`.\n * @internal\n *\n * @param removal - Version when the deprecated feature will be removed\n * @param condition - Condition under which the deprecation warning will be logged\n * @param deprecated - Name of the deprecated feature\n * @param replacement - Name of the feature that replaces the deprecated feature\n *\n * @example\n * ```ts\n * const { visible } = props\n * deprecate(visible !== 'default', '1.3.0', '\"default\"', '\"hidden\"')\n * // Logs: Use of \"default\" is deprecated and might be removed in the next release. Use \"hidden\" instead.\n * ```\n */\nexport function deprecate(removal: SemverString, condition: boolean, deprecated: string, replacement: string | null): void {\n\tif (condition === true) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconst shouldThrow = Boolean(import.meta.env.VITE_CONTEMBER_ADMIN_STRICT_DEPRECATIONS)\n\n\t\t\tif (shouldThrow) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Support for ${deprecated} was planned to be removed in the ${removal} release.${\n\t\t\t\t\t\treplacement ? ` Replace it with ${replacement} instead.` : 'Remove it.'\n\t\t\t\t\t}`,\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`Use of ${deprecated} is deprecated and might be removed in the next release.${\n\t\t\t\t\t\treplacement ? ` Use ${replacement} instead.` : ' There is no replacement.'\n\t\t\t\t\t}`,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAkBO,SAAS,UAAU,SAAuB,WAAoB,YAAoB,aAAkC;AAC1H,MAAI,cAAc,MAAM;AACE;AACxB,YAAM,cAAc,QAAQ,MAAA;AAE5B,UAAI,aAAa;AAChB,cAAM,IAAI;AAAA,UACT,eAAe,UAAU,qCAAqC,OAAO,YACpE,cAAc,oBAAoB,WAAW,cAAc,YAC5D;AAAA,QAAA;AAAA,MAEF,OAAO;AACN,gBAAQ;AAAA,UACP,UAAU,UAAU,2DACnB,cAAc,QAAQ,WAAW,cAAc,2BAChD;AAAA,QAAA;AAAA,MAEF;AAAA,IACD;AAAA,EACD;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"dataAttribute.cjs","sources":["../../../../../packages/utilities/src/dom/dataAttribute.ts"],"sourcesContent":["export function dataAttribute(value: boolean | null | undefined): '' | undefined\nexport function dataAttribute<const T extends string>(value: T): T\nexport function dataAttribute(value: boolean | string | number | undefined | null): string | undefined\nexport function dataAttribute(value: unknown): string | true | undefined {\n\tif (value === false || value === undefined || value === null) {\n\t\treturn undefined\n\t} else if (value === true) {\n\t\t// Closest to HTML: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n\t\t// React issue: https://github.com/facebook/react/issues/24812\n\t\treturn ''\n\t} else {\n\t\treturn String(value)\n\t}\n}\n"],"names":[],"mappings":";;AAGO,SAAS,cAAc,OAA2C;AACxE,MAAI,UAAU,SAAS,UAAU,UAAa,UAAU,MAAM;AACtD,WAAA;AAAA,EAAA,WACG,UAAU,MAAM;AAGnB,WAAA;AAAA,EAAA,OACD;AACN,WAAO,OAAO,KAAK;AAAA,EAAA;AAErB;;"}
1
+ {"version":3,"file":"dataAttribute.cjs","sources":["../../../../../packages/utilities/src/dom/dataAttribute.ts"],"sourcesContent":["export function dataAttribute(value: boolean | null | undefined): '' | undefined\nexport function dataAttribute<const T extends string>(value: T): T\nexport function dataAttribute(value: boolean | string | number | undefined | null): string | undefined\nexport function dataAttribute(value: unknown): string | true | undefined {\n\tif (value === false || value === undefined || value === null) {\n\t\treturn undefined\n\t} else if (value === true) {\n\t\t// Closest to HTML: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n\t\t// React issue: https://github.com/facebook/react/issues/24812\n\t\treturn ''\n\t} else {\n\t\treturn String(value)\n\t}\n}\n"],"names":[],"mappings":";;AAGO,SAAS,cAAc,OAA2C;AACxE,MAAI,UAAU,SAAS,UAAU,UAAa,UAAU,MAAM;AAC7D,WAAO;AAAA,EACR,WAAW,UAAU,MAAM;AAG1B,WAAO;AAAA,EACR,OAAO;AACN,WAAO,OAAO,KAAK;AAAA,EACpB;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"dataAttribute.js","sources":["../../../../../packages/utilities/src/dom/dataAttribute.ts"],"sourcesContent":["export function dataAttribute(value: boolean | null | undefined): '' | undefined\nexport function dataAttribute<const T extends string>(value: T): T\nexport function dataAttribute(value: boolean | string | number | undefined | null): string | undefined\nexport function dataAttribute(value: unknown): string | true | undefined {\n\tif (value === false || value === undefined || value === null) {\n\t\treturn undefined\n\t} else if (value === true) {\n\t\t// Closest to HTML: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n\t\t// React issue: https://github.com/facebook/react/issues/24812\n\t\treturn ''\n\t} else {\n\t\treturn String(value)\n\t}\n}\n"],"names":[],"mappings":"AAGO,SAAS,cAAc,OAA2C;AACxE,MAAI,UAAU,SAAS,UAAU,UAAa,UAAU,MAAM;AACtD,WAAA;AAAA,EAAA,WACG,UAAU,MAAM;AAGnB,WAAA;AAAA,EAAA,OACD;AACN,WAAO,OAAO,KAAK;AAAA,EAAA;AAErB;"}
1
+ {"version":3,"file":"dataAttribute.js","sources":["../../../../../packages/utilities/src/dom/dataAttribute.ts"],"sourcesContent":["export function dataAttribute(value: boolean | null | undefined): '' | undefined\nexport function dataAttribute<const T extends string>(value: T): T\nexport function dataAttribute(value: boolean | string | number | undefined | null): string | undefined\nexport function dataAttribute(value: unknown): string | true | undefined {\n\tif (value === false || value === undefined || value === null) {\n\t\treturn undefined\n\t} else if (value === true) {\n\t\t// Closest to HTML: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n\t\t// React issue: https://github.com/facebook/react/issues/24812\n\t\treturn ''\n\t} else {\n\t\treturn String(value)\n\t}\n}\n"],"names":[],"mappings":"AAGO,SAAS,cAAc,OAA2C;AACxE,MAAI,UAAU,SAAS,UAAU,UAAa,UAAU,MAAM;AAC7D,WAAO;AAAA,EACR,WAAW,UAAU,MAAM;AAG1B,WAAO;AAAA,EACR,OAAO;AACN,WAAO,OAAO,KAAK;AAAA,EACpB;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"svgSizeProps.cjs","sources":["../../../../../packages/utilities/src/dom/svgSizeProps.ts"],"sourcesContent":["export interface SvgSizeProps {\n\twidth: number\n\theight: number\n\tviewBox: string\n}\n\nexport function svgSizeProps(\n\twidth: number,\n\theight?: number,\n\tcrop: number = 0,\n): SvgSizeProps {\n\tconst viewBoxWidth = width - crop * 2\n\tconst viewBoxHeight = (height ?? width) - crop * 2\n\tconst viewBoxX = crop\n\tconst viewBoxY = crop\n\treturn {\n\t\twidth: viewBoxWidth,\n\t\theight: viewBoxHeight,\n\t\tviewBox: `${viewBoxX} ${viewBoxY} ${viewBoxWidth} ${viewBoxHeight}`,\n\t}\n}\n"],"names":[],"mappings":";;AAMO,SAAS,aACf,OACA,QACA,OAAe,GACA;AACT,QAAA,eAAe,QAAQ,OAAO;AAC9B,QAAA,iBAAiB,UAAU,SAAS,OAAO;AACjD,QAAM,WAAW;AACjB,QAAM,WAAW;AACV,SAAA;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS,GAAG,QAAQ,IAAI,QAAQ,IAAI,YAAY,IAAI,aAAa;AAAA,EAClE;AACD;;"}
1
+ {"version":3,"file":"svgSizeProps.cjs","sources":["../../../../../packages/utilities/src/dom/svgSizeProps.ts"],"sourcesContent":["export interface SvgSizeProps {\n\twidth: number\n\theight: number\n\tviewBox: string\n}\n\nexport function svgSizeProps(\n\twidth: number,\n\theight?: number,\n\tcrop: number = 0,\n): SvgSizeProps {\n\tconst viewBoxWidth = width - crop * 2\n\tconst viewBoxHeight = (height ?? width) - crop * 2\n\tconst viewBoxX = crop\n\tconst viewBoxY = crop\n\treturn {\n\t\twidth: viewBoxWidth,\n\t\theight: viewBoxHeight,\n\t\tviewBox: `${viewBoxX} ${viewBoxY} ${viewBoxWidth} ${viewBoxHeight}`,\n\t}\n}\n"],"names":[],"mappings":";;AAMO,SAAS,aACf,OACA,QACA,OAAe,GACA;AACf,QAAM,eAAe,QAAQ,OAAO;AACpC,QAAM,iBAAiB,UAAU,SAAS,OAAO;AACjD,QAAM,WAAW;AACjB,QAAM,WAAW;AACjB,SAAO;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS,GAAG,QAAQ,IAAI,QAAQ,IAAI,YAAY,IAAI,aAAa;AAAA,EAAA;AAEnE;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"svgSizeProps.js","sources":["../../../../../packages/utilities/src/dom/svgSizeProps.ts"],"sourcesContent":["export interface SvgSizeProps {\n\twidth: number\n\theight: number\n\tviewBox: string\n}\n\nexport function svgSizeProps(\n\twidth: number,\n\theight?: number,\n\tcrop: number = 0,\n): SvgSizeProps {\n\tconst viewBoxWidth = width - crop * 2\n\tconst viewBoxHeight = (height ?? width) - crop * 2\n\tconst viewBoxX = crop\n\tconst viewBoxY = crop\n\treturn {\n\t\twidth: viewBoxWidth,\n\t\theight: viewBoxHeight,\n\t\tviewBox: `${viewBoxX} ${viewBoxY} ${viewBoxWidth} ${viewBoxHeight}`,\n\t}\n}\n"],"names":[],"mappings":"AAMO,SAAS,aACf,OACA,QACA,OAAe,GACA;AACT,QAAA,eAAe,QAAQ,OAAO;AAC9B,QAAA,iBAAiB,UAAU,SAAS,OAAO;AACjD,QAAM,WAAW;AACjB,QAAM,WAAW;AACV,SAAA;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS,GAAG,QAAQ,IAAI,QAAQ,IAAI,YAAY,IAAI,aAAa;AAAA,EAClE;AACD;"}
1
+ {"version":3,"file":"svgSizeProps.js","sources":["../../../../../packages/utilities/src/dom/svgSizeProps.ts"],"sourcesContent":["export interface SvgSizeProps {\n\twidth: number\n\theight: number\n\tviewBox: string\n}\n\nexport function svgSizeProps(\n\twidth: number,\n\theight?: number,\n\tcrop: number = 0,\n): SvgSizeProps {\n\tconst viewBoxWidth = width - crop * 2\n\tconst viewBoxHeight = (height ?? width) - crop * 2\n\tconst viewBoxX = crop\n\tconst viewBoxY = crop\n\treturn {\n\t\twidth: viewBoxWidth,\n\t\theight: viewBoxHeight,\n\t\tviewBox: `${viewBoxX} ${viewBoxY} ${viewBoxWidth} ${viewBoxHeight}`,\n\t}\n}\n"],"names":[],"mappings":"AAMO,SAAS,aACf,OACA,QACA,OAAe,GACA;AACf,QAAM,eAAe,QAAQ,OAAO;AACpC,QAAM,iBAAiB,UAAU,SAAS,OAAO;AACjD,QAAM,WAAW;AACjB,QAAM,WAAW;AACjB,SAAO;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS,GAAG,QAAQ,IAAI,QAAQ,IAAI,YAAY,IAAI,aAAa;AAAA,EAAA;AAEnE;"}
@@ -57,6 +57,23 @@ class BijectiveIndexedMap {
57
57
  has(key) {
58
58
  return this.index.has(key);
59
59
  }
60
+ getOrInsert(key, defaultValue) {
61
+ const existing = this.get(key);
62
+ if (existing !== void 0) {
63
+ return existing;
64
+ }
65
+ this.set(key, defaultValue);
66
+ return defaultValue;
67
+ }
68
+ getOrInsertComputed(key, callback) {
69
+ const existing = this.get(key);
70
+ if (existing !== void 0) {
71
+ return existing;
72
+ }
73
+ const value = callback(key);
74
+ this.set(key, value);
75
+ return value;
76
+ }
60
77
  set(key, value) {
61
78
  const existingIndex = this.index.get(key);
62
79
  if (existingIndex === void 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"BijectiveIndexedMap.cjs","sources":["../../../../../packages/utilities/src/structures/BijectiveIndexedMap.ts"],"sourcesContent":["// Bijective as in we need to supply the inverse and also guarantee that the values are unique.\n// Provided this invariant, this should behave more or less like a regular map except it has a somewhat special\n// iteration order. Unlike a regular map, which just honors insertion order, this also provides a special method\n// changeKey. With this, we can change the key under which a value (that is already on the map) is accessible.\n// With an ordinary map, that operation would require us to delete the original [K1, V] pair and insert\n// a new one [K2, V]. That would however change the order of iteration. This main purpose of this data structure is\n// the ability to avoid that and enable the value V to preserve its original place.\nexport class BijectiveIndexedMap<K, V> implements Map<K, V> {\n\tprivate readonly valueStore: Map<number, V>\n\tprivate readonly index: Map<K, number>\n\tprivate indexSeed: number\n\n\tprivate readonly inverse: (value: V) => K\n\n\tpublic readonly [Symbol.toStringTag] = 'BijectiveIndexedMap'\n\n\tpublic constructor(originalMap: BijectiveIndexedMap<K, V>)\n\tpublic constructor(inverse: (value: V) => K)\n\tpublic constructor(inverseOrMap: BijectiveIndexedMap<K, V> | ((value: V) => K)) {\n\t\tif (inverseOrMap instanceof BijectiveIndexedMap) {\n\t\t\tthis.valueStore = new Map(inverseOrMap.valueStore)\n\t\t\tthis.index = new Map(inverseOrMap.index)\n\t\t\tthis.indexSeed = inverseOrMap.indexSeed\n\t\t\tthis.inverse = inverseOrMap.inverse\n\t\t} else {\n\t\t\tthis.valueStore = new Map()\n\t\t\tthis.index = new Map()\n\t\t\tthis.indexSeed = 0\n\t\t\tthis.inverse = inverseOrMap\n\t\t}\n\t}\n\n\tprivate getNewIndex() {\n\t\treturn this.indexSeed++\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.valueStore.size\n\t}\n\n\tpublic clear(): void {\n\t\tthis.valueStore.clear()\n\t\tthis.index.clear()\n\t}\n\tpublic delete(key: K): boolean {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn false\n\t\t}\n\t\tthis.valueStore.delete(index)\n\t\tthis.index.delete(key)\n\t\treturn true\n\t}\n\tpublic forEach(callback: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void {\n\t\tfor (const [key, value] of this.entries()) {\n\t\t\tcallback.call(thisArg, value, key, this)\n\t\t}\n\t}\n\n\tpublic get(key: K): V | undefined {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn this.valueStore.get(index)\n\t}\n\tpublic has(key: K): boolean {\n\t\treturn this.index.has(key)\n\t}\n\tpublic set(key: K, value: V): this {\n\t\tconst existingIndex = this.index.get(key)\n\n\t\tif (existingIndex === undefined) {\n\t\t\tconst newIndex = this.getNewIndex()\n\t\t\tthis.index.set(key, newIndex)\n\t\t\tthis.valueStore.set(newIndex, value)\n\t\t} else {\n\t\t\tthis.valueStore.set(existingIndex, value)\n\t\t}\n\t\treturn this\n\t}\n\n\t// This doesn't use the inverse in order to avoid confusion.\n\t// See the description above.\n\tpublic changeKey(oldKey: K, newKey: K): this {\n\t\tconst index = this.index.get(oldKey)\n\t\tif (index === undefined) {\n\t\t\tthrow new Error()\n\t\t}\n\t\tthis.index.delete(oldKey)\n\t\tthis.index.set(newKey, index)\n\t\treturn this\n\t}\n\n\tpublic changeKeyOrder(newOrder: Iterable<K>) {\n\t\tfor (const key of newOrder) {\n\t\t\tconst keyIndex = this.index.get(key)\n\t\t\tif (keyIndex === undefined) {\n\t\t\t\tthrow new Error()\n\t\t\t}\n\t\t\tconst value = this.valueStore.get(keyIndex)!\n\n\t\t\t// This effectively removes value from wherever it was and puts it at the end.\n\t\t\t// Provided newOrder.size is the same as valueStore, by the end of this loop\n\t\t\t// the values will be in the correct order.\n\t\t\tthis.valueStore.delete(keyIndex)\n\t\t\tthis.valueStore.set(keyIndex, value)\n\t\t}\n\t}\n\n\tpublic *[Symbol.iterator](): MapIterator<[K, V]> {\n\t\tyield* this.entries()\n\t}\n\n\tpublic *entries(): MapIterator<[K, V]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [this.inverse(value), value]\n\t\t}\n\t}\n\n\tpublic *keys(): MapIterator<K> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield this.inverse(value)\n\t\t}\n\t}\n\n\tpublic *values(): MapIterator<V> {\n\t\tfor (const value of this.valueStore.values()) {\n\t\t\tif (value === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tyield value\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;AAAA,IAAA;AAOO,MAAM,oBAA+C;AAAA,EAWpD,YAAY,cAA6D;AAV/D,kBAAA,MAAA,YAAA;AACA,kBAAA,MAAA,OAAA;AACT,kBAAA,MAAA,WAAA;AAES,kBAAA,MAAA,SAAA;AAEjB,kBAAA,MAAiB,IAAsB,qBAAA;AAKtC,QAAI,wBAAwB,qBAAqB;AAChD,WAAK,aAAa,IAAI,IAAI,aAAa,UAAU;AACjD,WAAK,QAAQ,IAAI,IAAI,aAAa,KAAK;AACvC,WAAK,YAAY,aAAa;AAC9B,WAAK,UAAU,aAAa;AAAA,IAAA,OACtB;AACD,WAAA,iCAAiB,IAAI;AACrB,WAAA,4BAAY,IAAI;AACrB,WAAK,YAAY;AACjB,WAAK,UAAU;AAAA,IAAA;AAAA,EAChB;AAAA,EAGO,cAAc;AACrB,WAAO,KAAK;AAAA,EAAA;AAAA,EAGb,IAAW,OAAe;AACzB,WAAO,KAAK,WAAW;AAAA,EAAA;AAAA,EAGjB,QAAc;AACpB,SAAK,WAAW,MAAM;AACtB,SAAK,MAAM,MAAM;AAAA,EAAA;AAAA,EAEX,OAAO,KAAiB;AAC9B,UAAM,QAAQ,KAAK,MAAM,IAAI,GAAG;AAEhC,QAAI,UAAU,QAA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QAAQ;AAKrC,WAAA,WAAW,OAAO,QAAQ;AAC1B,WAAA,WAAW,IAAI,UAAU,KAAK;AAAA,IAAA;AAAA,EACpC;AAAA,EAGD,GAlGiB,KAAA,OAAO,aAkGf,OAAO,aAAiC;AAChD,WAAO,KAAK,QAAQ;AAAA,EAAA;AAAA,EAGrB,CAAQ,UAA+B;AAC3B,eAAA,SAAS,KAAK,UAAU;AAClC,YAAM,CAAC,KAAK,QAAQ,KAAK,GAAG,KAAK;AAAA,IAAA;AAAA,EAClC;AAAA,EAGD,CAAQ,OAAuB;AACnB,eAAA,SAAS,KAAK,UAAU;AAC5B,YAAA,KAAK,QAAQ,KAAK;AAAA,IAAA;AAAA,EACzB;AAAA,EAGD,CAAQ,SAAyB;AAChC,eAAW,SAAS,KAAK,WAAW,OAAA,GAAU;AAC7C,UAAI,UAAU,QAAW;AACxB;AAAA,MAAA;AAEK,YAAA;AAAA,IAAA;AAAA,EACP;AAEF;;"}
1
+ {"version":3,"file":"BijectiveIndexedMap.cjs","sources":["../../../../../packages/utilities/src/structures/BijectiveIndexedMap.ts"],"sourcesContent":["// Bijective as in we need to supply the inverse and also guarantee that the values are unique.\n// Provided this invariant, this should behave more or less like a regular map except it has a somewhat special\n// iteration order. Unlike a regular map, which just honors insertion order, this also provides a special method\n// changeKey. With this, we can change the key under which a value (that is already on the map) is accessible.\n// With an ordinary map, that operation would require us to delete the original [K1, V] pair and insert\n// a new one [K2, V]. That would however change the order of iteration. This main purpose of this data structure is\n// the ability to avoid that and enable the value V to preserve its original place.\nexport class BijectiveIndexedMap<K, V> implements Map<K, V> {\n\tprivate readonly valueStore: Map<number, V>\n\tprivate readonly index: Map<K, number>\n\tprivate indexSeed: number\n\n\tprivate readonly inverse: (value: V) => K\n\n\tpublic readonly [Symbol.toStringTag] = 'BijectiveIndexedMap'\n\n\tpublic constructor(originalMap: BijectiveIndexedMap<K, V>)\n\tpublic constructor(inverse: (value: V) => K)\n\tpublic constructor(inverseOrMap: BijectiveIndexedMap<K, V> | ((value: V) => K)) {\n\t\tif (inverseOrMap instanceof BijectiveIndexedMap) {\n\t\t\tthis.valueStore = new Map(inverseOrMap.valueStore)\n\t\t\tthis.index = new Map(inverseOrMap.index)\n\t\t\tthis.indexSeed = inverseOrMap.indexSeed\n\t\t\tthis.inverse = inverseOrMap.inverse\n\t\t} else {\n\t\t\tthis.valueStore = new Map()\n\t\t\tthis.index = new Map()\n\t\t\tthis.indexSeed = 0\n\t\t\tthis.inverse = inverseOrMap\n\t\t}\n\t}\n\n\tprivate getNewIndex() {\n\t\treturn this.indexSeed++\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.valueStore.size\n\t}\n\n\tpublic clear(): void {\n\t\tthis.valueStore.clear()\n\t\tthis.index.clear()\n\t}\n\tpublic delete(key: K): boolean {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn false\n\t\t}\n\t\tthis.valueStore.delete(index)\n\t\tthis.index.delete(key)\n\t\treturn true\n\t}\n\tpublic forEach(callback: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void {\n\t\tfor (const [key, value] of this.entries()) {\n\t\t\tcallback.call(thisArg, value, key, this)\n\t\t}\n\t}\n\n\tpublic get(key: K): V | undefined {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn this.valueStore.get(index)\n\t}\n\tpublic has(key: K): boolean {\n\t\treturn this.index.has(key)\n\t}\n\tpublic getOrInsert(key: K, defaultValue: V): V {\n\t\tconst existing = this.get(key)\n\t\tif (existing !== undefined) {\n\t\t\treturn existing\n\t\t}\n\t\tthis.set(key, defaultValue)\n\t\treturn defaultValue\n\t}\n\n\tpublic getOrInsertComputed(key: K, callback: (key: K) => V): V {\n\t\tconst existing = this.get(key)\n\t\tif (existing !== undefined) {\n\t\t\treturn existing\n\t\t}\n\t\tconst value = callback(key)\n\t\tthis.set(key, value)\n\t\treturn value\n\t}\n\n\tpublic set(key: K, value: V): this {\n\t\tconst existingIndex = this.index.get(key)\n\n\t\tif (existingIndex === undefined) {\n\t\t\tconst newIndex = this.getNewIndex()\n\t\t\tthis.index.set(key, newIndex)\n\t\t\tthis.valueStore.set(newIndex, value)\n\t\t} else {\n\t\t\tthis.valueStore.set(existingIndex, value)\n\t\t}\n\t\treturn this\n\t}\n\n\t// This doesn't use the inverse in order to avoid confusion.\n\t// See the description above.\n\tpublic changeKey(oldKey: K, newKey: K): this {\n\t\tconst index = this.index.get(oldKey)\n\t\tif (index === undefined) {\n\t\t\tthrow new Error()\n\t\t}\n\t\tthis.index.delete(oldKey)\n\t\tthis.index.set(newKey, index)\n\t\treturn this\n\t}\n\n\tpublic changeKeyOrder(newOrder: Iterable<K>) {\n\t\tfor (const key of newOrder) {\n\t\t\tconst keyIndex = this.index.get(key)\n\t\t\tif (keyIndex === undefined) {\n\t\t\t\tthrow new Error()\n\t\t\t}\n\t\t\tconst value = this.valueStore.get(keyIndex)!\n\n\t\t\t// This effectively removes value from wherever it was and puts it at the end.\n\t\t\t// Provided newOrder.size is the same as valueStore, by the end of this loop\n\t\t\t// the values will be in the correct order.\n\t\t\tthis.valueStore.delete(keyIndex)\n\t\t\tthis.valueStore.set(keyIndex, value)\n\t\t}\n\t}\n\n\tpublic *[Symbol.iterator](): MapIterator<[K, V]> {\n\t\tyield* this.entries()\n\t}\n\n\tpublic *entries(): MapIterator<[K, V]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [this.inverse(value), value]\n\t\t}\n\t}\n\n\tpublic *keys(): MapIterator<K> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield this.inverse(value)\n\t\t}\n\t}\n\n\tpublic *values(): MapIterator<V> {\n\t\tfor (const value of this.valueStore.values()) {\n\t\t\tif (value === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tyield value\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;AAAA,IAAA;AAOO,MAAM,oBAA+C;AAAA,EAWpD,YAAY,cAA6D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WAAO,KAAK,QAAA;AAAA,EACb;AAAA,EAEA,CAAQ,UAA+B;AACtC,eAAW,SAAS,KAAK,UAAU;AAClC,YAAM,CAAC,KAAK,QAAQ,KAAK,GAAG,KAAK;AAAA,IAClC;AAAA,EACD;AAAA,EAEA,CAAQ,OAAuB;AAC9B,eAAW,SAAS,KAAK,UAAU;AAClC,YAAM,KAAK,QAAQ,KAAK;AAAA,IACzB;AAAA,EACD;AAAA,EAEA,CAAQ,SAAyB;AAChC,eAAW,SAAS,KAAK,WAAW,OAAA,GAAU;AAC7C,UAAI,UAAU,QAAW;AACxB;AAAA,MACD;AACA,YAAM;AAAA,IACP;AAAA,EACD;AACD;;"}
@@ -55,6 +55,23 @@ class BijectiveIndexedMap {
55
55
  has(key) {
56
56
  return this.index.has(key);
57
57
  }
58
+ getOrInsert(key, defaultValue) {
59
+ const existing = this.get(key);
60
+ if (existing !== void 0) {
61
+ return existing;
62
+ }
63
+ this.set(key, defaultValue);
64
+ return defaultValue;
65
+ }
66
+ getOrInsertComputed(key, callback) {
67
+ const existing = this.get(key);
68
+ if (existing !== void 0) {
69
+ return existing;
70
+ }
71
+ const value = callback(key);
72
+ this.set(key, value);
73
+ return value;
74
+ }
58
75
  set(key, value) {
59
76
  const existingIndex = this.index.get(key);
60
77
  if (existingIndex === void 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"BijectiveIndexedMap.js","sources":["../../../../../packages/utilities/src/structures/BijectiveIndexedMap.ts"],"sourcesContent":["// Bijective as in we need to supply the inverse and also guarantee that the values are unique.\n// Provided this invariant, this should behave more or less like a regular map except it has a somewhat special\n// iteration order. Unlike a regular map, which just honors insertion order, this also provides a special method\n// changeKey. With this, we can change the key under which a value (that is already on the map) is accessible.\n// With an ordinary map, that operation would require us to delete the original [K1, V] pair and insert\n// a new one [K2, V]. That would however change the order of iteration. This main purpose of this data structure is\n// the ability to avoid that and enable the value V to preserve its original place.\nexport class BijectiveIndexedMap<K, V> implements Map<K, V> {\n\tprivate readonly valueStore: Map<number, V>\n\tprivate readonly index: Map<K, number>\n\tprivate indexSeed: number\n\n\tprivate readonly inverse: (value: V) => K\n\n\tpublic readonly [Symbol.toStringTag] = 'BijectiveIndexedMap'\n\n\tpublic constructor(originalMap: BijectiveIndexedMap<K, V>)\n\tpublic constructor(inverse: (value: V) => K)\n\tpublic constructor(inverseOrMap: BijectiveIndexedMap<K, V> | ((value: V) => K)) {\n\t\tif (inverseOrMap instanceof BijectiveIndexedMap) {\n\t\t\tthis.valueStore = new Map(inverseOrMap.valueStore)\n\t\t\tthis.index = new Map(inverseOrMap.index)\n\t\t\tthis.indexSeed = inverseOrMap.indexSeed\n\t\t\tthis.inverse = inverseOrMap.inverse\n\t\t} else {\n\t\t\tthis.valueStore = new Map()\n\t\t\tthis.index = new Map()\n\t\t\tthis.indexSeed = 0\n\t\t\tthis.inverse = inverseOrMap\n\t\t}\n\t}\n\n\tprivate getNewIndex() {\n\t\treturn this.indexSeed++\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.valueStore.size\n\t}\n\n\tpublic clear(): void {\n\t\tthis.valueStore.clear()\n\t\tthis.index.clear()\n\t}\n\tpublic delete(key: K): boolean {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn false\n\t\t}\n\t\tthis.valueStore.delete(index)\n\t\tthis.index.delete(key)\n\t\treturn true\n\t}\n\tpublic forEach(callback: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void {\n\t\tfor (const [key, value] of this.entries()) {\n\t\t\tcallback.call(thisArg, value, key, this)\n\t\t}\n\t}\n\n\tpublic get(key: K): V | undefined {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn this.valueStore.get(index)\n\t}\n\tpublic has(key: K): boolean {\n\t\treturn this.index.has(key)\n\t}\n\tpublic set(key: K, value: V): this {\n\t\tconst existingIndex = this.index.get(key)\n\n\t\tif (existingIndex === undefined) {\n\t\t\tconst newIndex = this.getNewIndex()\n\t\t\tthis.index.set(key, newIndex)\n\t\t\tthis.valueStore.set(newIndex, value)\n\t\t} else {\n\t\t\tthis.valueStore.set(existingIndex, value)\n\t\t}\n\t\treturn this\n\t}\n\n\t// This doesn't use the inverse in order to avoid confusion.\n\t// See the description above.\n\tpublic changeKey(oldKey: K, newKey: K): this {\n\t\tconst index = this.index.get(oldKey)\n\t\tif (index === undefined) {\n\t\t\tthrow new Error()\n\t\t}\n\t\tthis.index.delete(oldKey)\n\t\tthis.index.set(newKey, index)\n\t\treturn this\n\t}\n\n\tpublic changeKeyOrder(newOrder: Iterable<K>) {\n\t\tfor (const key of newOrder) {\n\t\t\tconst keyIndex = this.index.get(key)\n\t\t\tif (keyIndex === undefined) {\n\t\t\t\tthrow new Error()\n\t\t\t}\n\t\t\tconst value = this.valueStore.get(keyIndex)!\n\n\t\t\t// This effectively removes value from wherever it was and puts it at the end.\n\t\t\t// Provided newOrder.size is the same as valueStore, by the end of this loop\n\t\t\t// the values will be in the correct order.\n\t\t\tthis.valueStore.delete(keyIndex)\n\t\t\tthis.valueStore.set(keyIndex, value)\n\t\t}\n\t}\n\n\tpublic *[Symbol.iterator](): MapIterator<[K, V]> {\n\t\tyield* this.entries()\n\t}\n\n\tpublic *entries(): MapIterator<[K, V]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [this.inverse(value), value]\n\t\t}\n\t}\n\n\tpublic *keys(): MapIterator<K> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield this.inverse(value)\n\t\t}\n\t}\n\n\tpublic *values(): MapIterator<V> {\n\t\tfor (const value of this.valueStore.values()) {\n\t\t\tif (value === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tyield value\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;AAAA,IAAA;AAOO,MAAM,oBAA+C;AAAA,EAWpD,YAAY,cAA6D;AAV/D,kBAAA,MAAA,YAAA;AACA,kBAAA,MAAA,OAAA;AACT,kBAAA,MAAA,WAAA;A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"version":3,"file":"BijectiveIndexedMap.js","sources":["../../../../../packages/utilities/src/structures/BijectiveIndexedMap.ts"],"sourcesContent":["// Bijective as in we need to supply the inverse and also guarantee that the values are unique.\n// Provided this invariant, this should behave more or less like a regular map except it has a somewhat special\n// iteration order. Unlike a regular map, which just honors insertion order, this also provides a special method\n// changeKey. With this, we can change the key under which a value (that is already on the map) is accessible.\n// With an ordinary map, that operation would require us to delete the original [K1, V] pair and insert\n// a new one [K2, V]. That would however change the order of iteration. This main purpose of this data structure is\n// the ability to avoid that and enable the value V to preserve its original place.\nexport class BijectiveIndexedMap<K, V> implements Map<K, V> {\n\tprivate readonly valueStore: Map<number, V>\n\tprivate readonly index: Map<K, number>\n\tprivate indexSeed: number\n\n\tprivate readonly inverse: (value: V) => K\n\n\tpublic readonly [Symbol.toStringTag] = 'BijectiveIndexedMap'\n\n\tpublic constructor(originalMap: BijectiveIndexedMap<K, V>)\n\tpublic constructor(inverse: (value: V) => K)\n\tpublic constructor(inverseOrMap: BijectiveIndexedMap<K, V> | ((value: V) => K)) {\n\t\tif (inverseOrMap instanceof BijectiveIndexedMap) {\n\t\t\tthis.valueStore = new Map(inverseOrMap.valueStore)\n\t\t\tthis.index = new Map(inverseOrMap.index)\n\t\t\tthis.indexSeed = inverseOrMap.indexSeed\n\t\t\tthis.inverse = inverseOrMap.inverse\n\t\t} else {\n\t\t\tthis.valueStore = new Map()\n\t\t\tthis.index = new Map()\n\t\t\tthis.indexSeed = 0\n\t\t\tthis.inverse = inverseOrMap\n\t\t}\n\t}\n\n\tprivate getNewIndex() {\n\t\treturn this.indexSeed++\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.valueStore.size\n\t}\n\n\tpublic clear(): void {\n\t\tthis.valueStore.clear()\n\t\tthis.index.clear()\n\t}\n\tpublic delete(key: K): boolean {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn false\n\t\t}\n\t\tthis.valueStore.delete(index)\n\t\tthis.index.delete(key)\n\t\treturn true\n\t}\n\tpublic forEach(callback: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void {\n\t\tfor (const [key, value] of this.entries()) {\n\t\t\tcallback.call(thisArg, value, key, this)\n\t\t}\n\t}\n\n\tpublic get(key: K): V | undefined {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn this.valueStore.get(index)\n\t}\n\tpublic has(key: K): boolean {\n\t\treturn this.index.has(key)\n\t}\n\tpublic getOrInsert(key: K, defaultValue: V): V {\n\t\tconst existing = this.get(key)\n\t\tif (existing !== undefined) {\n\t\t\treturn existing\n\t\t}\n\t\tthis.set(key, defaultValue)\n\t\treturn defaultValue\n\t}\n\n\tpublic getOrInsertComputed(key: K, callback: (key: K) => V): V {\n\t\tconst existing = this.get(key)\n\t\tif (existing !== undefined) {\n\t\t\treturn existing\n\t\t}\n\t\tconst value = callback(key)\n\t\tthis.set(key, value)\n\t\treturn value\n\t}\n\n\tpublic set(key: K, value: V): this {\n\t\tconst existingIndex = this.index.get(key)\n\n\t\tif (existingIndex === undefined) {\n\t\t\tconst newIndex = this.getNewIndex()\n\t\t\tthis.index.set(key, newIndex)\n\t\t\tthis.valueStore.set(newIndex, value)\n\t\t} else {\n\t\t\tthis.valueStore.set(existingIndex, value)\n\t\t}\n\t\treturn this\n\t}\n\n\t// This doesn't use the inverse in order to avoid confusion.\n\t// See the description above.\n\tpublic changeKey(oldKey: K, newKey: K): this {\n\t\tconst index = this.index.get(oldKey)\n\t\tif (index === undefined) {\n\t\t\tthrow new Error()\n\t\t}\n\t\tthis.index.delete(oldKey)\n\t\tthis.index.set(newKey, index)\n\t\treturn this\n\t}\n\n\tpublic changeKeyOrder(newOrder: Iterable<K>) {\n\t\tfor (const key of newOrder) {\n\t\t\tconst keyIndex = this.index.get(key)\n\t\t\tif (keyIndex === undefined) {\n\t\t\t\tthrow new Error()\n\t\t\t}\n\t\t\tconst value = this.valueStore.get(keyIndex)!\n\n\t\t\t// This effectively removes value from wherever it was and puts it at the end.\n\t\t\t// Provided newOrder.size is the same as valueStore, by the end of this loop\n\t\t\t// the values will be in the correct order.\n\t\t\tthis.valueStore.delete(keyIndex)\n\t\t\tthis.valueStore.set(keyIndex, value)\n\t\t}\n\t}\n\n\tpublic *[Symbol.iterator](): MapIterator<[K, V]> {\n\t\tyield* this.entries()\n\t}\n\n\tpublic *entries(): MapIterator<[K, V]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [this.inverse(value), value]\n\t\t}\n\t}\n\n\tpublic *keys(): MapIterator<K> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield this.inverse(value)\n\t\t}\n\t}\n\n\tpublic *values(): MapIterator<V> {\n\t\tfor (const value of this.valueStore.values()) {\n\t\t\tif (value === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tyield value\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;AAAA,IAAA;AAOO,MAAM,oBAA+C;AAAA,EAWpD,YAAY,cAA6D;AAVhF,kBAAA,MAAiB,YAAA;AACjB,kBAAA,MAAiB,OAAA;AACjB,kBAAA,MAAQ,WAAA;AAER,kBAAA,MAAiB,SAAA;AAEjB,kBAAA,MAAiB,IAAsB,qBAAA;AAKtC,QAAI,wBAAwB,qBAAqB;AAChD,WAAK,aAAa,IAAI,IAAI,aAAa,UAAU;AACjD,WAAK,QAAQ,IAAI,IAAI,aAAa,KAAK;AACvC,WAAK,YAAY,aAAa;AAC9B,WAAK,UAAU,aAAa;AAAA,IAC7B,OAAO;AACN,WAAK,iCAAiB,IAAA;AACtB,WAAK,4BAAY,IAAA;AACjB,WAAK,YAAY;AACjB,WAAK,UAAU;AAAA,IAChB;AAAA,EACD;AAAA,EAEQ,cAAc;AACrB,WAAO,KAAK;AAAA,EACb;AAAA,EAEA,IAAW,OAAe;AACzB,WAAO,KAAK,WAAW;AAAA,EACxB;AAAA,EAEO,QAAc;AACpB,SAAK,WAAW,MAAA;AAChB,SAAK,MAAM,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e,KAAK;AAAA,IACzC;AACA,WAAO;AAAA,EACR;AAAA;AAAA;AAAA,EAIO,UAAU,QAAW,QAAiB;AAC5C,UAAM,QAAQ,KAAK,MAAM,IAAI,MAAM;AACnC,QAAI,UAAU,QAAW;AACxB,YAAM,IAAI,MAAA;AAAA,IACX;AACA,SAAK,MAAM,OAAO,MAAM;AACxB,SAAK,MAAM,IAAI,QAAQ,KAAK;AAC5B,WAAO;AAAA,EACR;AAAA,EAEO,eAAe,UAAuB;AAC5C,eAAW,OAAO,UAAU;AAC3B,YAAM,WAAW,KAAK,MAAM,IAAI,GAAG;AACnC,UAAI,aAAa,QAAW;AAC3B,cAAM,IAAI,MAAA;AAAA,MACX;AACA,YAAM,QAAQ,KAAK,WAAW,IAAI,QAAQ;AAK1C,WAAK,WAAW,OAAO,QAAQ;AAC/B,WAAK,WAAW,IAAI,UAAU,KAAK;AAAA,IACpC;AAAA,EACD;AAAA,EAEA,GArHiB,KAAA,OAAO,aAqHf,OAAO,aAAiC;AAChD,WAAO,KAAK,QAAA;AAAA,EACb;AAAA,EAEA,CAAQ,UAA+B;AACtC,eAAW,SAAS,KAAK,UAAU;AAClC,YAAM,CAAC,KAAK,QAAQ,KAAK,GAAG,KAAK;AAAA,IAClC;AAAA,EACD;AAAA,EAEA,CAAQ,OAAuB;AAC9B,eAAW,SAAS,KAAK,UAAU;AAClC,YAAM,KAAK,QAAQ,KAAK;AAAA,IACzB;AAAA,EACD;AAAA,EAEA,CAAQ,SAAyB;AAChC,eAAW,SAAS,KAAK,WAAW,OAAA,GAAU;AAC7C,UAAI,UAAU,QAAW;AACxB;AAAA,MACD;AACA,YAAM;AAAA,IACP;AAAA,EACD;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"LRUCache.cjs","sources":["../../../../../packages/utilities/src/structures/LRUCache.ts"],"sourcesContent":["// This is heavily inspired by https://stackoverflow.com/a/46432113\nexport class LRUCache<Key, Value> {\n\tprivate readonly cache = new Map<Key, Value>()\n\n\tpublic constructor(private readonly maxSize: number) {}\n\n\tpublic get(key: Key): Value | undefined {\n\t\tconst value = this.cache.get(key)\n\n\t\tif (value !== undefined) {\n\t\t\tthis.cache.delete(key)\n\t\t\tthis.cache.set(key, value)\n\t\t}\n\t\treturn value\n\t}\n\n\tpublic set(key: Key, value: Value) {\n\t\tif (this.cache.has(key)) {\n\t\t\tthis.cache.delete(key) // Refresh this key\n\t\t} else if (this.cache.size === this.maxSize) {\n\t\t\tthis.cache.delete(this.getOldestKey()) // Evict the oldest value\n\t\t}\n\t\tthis.cache.set(key, value)\n\t}\n\n\tprivate getOldestKey(): Key {\n\t\treturn this.cache.keys().next().value!\n\t}\n}\n"],"names":[],"mappings":";;;;;AACO,MAAM,SAAqB;AAAA,EAG1B,YAA6B,SAAiB;AAAjB,SAAA,UAAA;AAFnB,kBAAA,MAAA,6BAAY,IAAgB,CAAA;AAAA,EAAA;AAAA,EAItC,IAAI,KAA6B;AACvC,UAAM,QAAQ,KAAK,MAAM,IAAI,GAAG;AAEhC,QAAI,UAAU,QAAW;AACnB,WAAA,MAAM,OAAO,GAAG;AAChB,WAAA,MAAM,IAAI,KAAK,KAAK;AAAA,IAAA;AAEnB,WAAA;AAAA,EAAA;AAAA,EAGD,IAAI,KAAU,OAAc;AAClC,QAAI,KAAK,MAAM,IAAI,GAAG,GAAG;AACnB,WAAA,MAAM,OAAO,GAAG;AAAA,IACX,WAAA,KAAK,MAAM,SAAS,KAAK,SAAS;AAC5C,WAAK,MAAM,OAAO,KAAK,aAAA,CAAc;AAAA,IAAA;AAEjC,SAAA,MAAM,IAAI,KAAK,KAAK;AAAA,EAAA;AAAA,EAGlB,eAAoB;AAC3B,WAAO,KAAK,MAAM,KAAK,EAAE,KAAO,EAAA;AAAA,EAAA;AAElC;;"}
1
+ {"version":3,"file":"LRUCache.cjs","sources":["../../../../../packages/utilities/src/structures/LRUCache.ts"],"sourcesContent":["// This is heavily inspired by https://stackoverflow.com/a/46432113\nexport class LRUCache<Key, Value> {\n\tprivate readonly cache = new Map<Key, Value>()\n\n\tpublic constructor(private readonly maxSize: number) {}\n\n\tpublic get(key: Key): Value | undefined {\n\t\tconst value = this.cache.get(key)\n\n\t\tif (value !== undefined) {\n\t\t\tthis.cache.delete(key)\n\t\t\tthis.cache.set(key, value)\n\t\t}\n\t\treturn value\n\t}\n\n\tpublic set(key: Key, value: Value) {\n\t\tif (this.cache.has(key)) {\n\t\t\tthis.cache.delete(key) // Refresh this key\n\t\t} else if (this.cache.size === this.maxSize) {\n\t\t\tthis.cache.delete(this.getOldestKey()) // Evict the oldest value\n\t\t}\n\t\tthis.cache.set(key, value)\n\t}\n\n\tprivate getOldestKey(): Key {\n\t\treturn this.cache.keys().next().value!\n\t}\n}\n"],"names":[],"mappings":";;;;;AACO,MAAM,SAAqB;AAAA,EAG1B,YAA6B,SAAiB;AAAjB,SAAA,UAAA;AAFpC,kBAAA,MAAiB,6BAAY,IAAA,CAAgB;AAAA,EAES;AAAA,EAE/C,IAAI,KAA6B;AACvC,UAAM,QAAQ,KAAK,MAAM,IAAI,GAAG;AAEhC,QAAI,UAAU,QAAW;AACxB,WAAK,MAAM,OAAO,GAAG;AACrB,WAAK,MAAM,IAAI,KAAK,KAAK;AAAA,IAC1B;AACA,WAAO;AAAA,EACR;AAAA,EAEO,IAAI,KAAU,OAAc;AAClC,QAAI,KAAK,MAAM,IAAI,GAAG,GAAG;AACxB,WAAK,MAAM,OAAO,GAAG;AAAA,IACtB,WAAW,KAAK,MAAM,SAAS,KAAK,SAAS;AAC5C,WAAK,MAAM,OAAO,KAAK,aAAA,CAAc;AAAA,IACtC;AACA,SAAK,MAAM,IAAI,KAAK,KAAK;AAAA,EAC1B;AAAA,EAEQ,eAAoB;AAC3B,WAAO,KAAK,MAAM,KAAA,EAAO,OAAO;AAAA,EACjC;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"LRUCache.js","sources":["../../../../../packages/utilities/src/structures/LRUCache.ts"],"sourcesContent":["// This is heavily inspired by https://stackoverflow.com/a/46432113\nexport class LRUCache<Key, Value> {\n\tprivate readonly cache = new Map<Key, Value>()\n\n\tpublic constructor(private readonly maxSize: number) {}\n\n\tpublic get(key: Key): Value | undefined {\n\t\tconst value = this.cache.get(key)\n\n\t\tif (value !== undefined) {\n\t\t\tthis.cache.delete(key)\n\t\t\tthis.cache.set(key, value)\n\t\t}\n\t\treturn value\n\t}\n\n\tpublic set(key: Key, value: Value) {\n\t\tif (this.cache.has(key)) {\n\t\t\tthis.cache.delete(key) // Refresh this key\n\t\t} else if (this.cache.size === this.maxSize) {\n\t\t\tthis.cache.delete(this.getOldestKey()) // Evict the oldest value\n\t\t}\n\t\tthis.cache.set(key, value)\n\t}\n\n\tprivate getOldestKey(): Key {\n\t\treturn this.cache.keys().next().value!\n\t}\n}\n"],"names":[],"mappings":";;;AACO,MAAM,SAAqB;AAAA,EAG1B,YAA6B,SAAiB;AAAjB,SAAA,UAAA;AAFnB,kBAAA,MAAA,6BAAY,IAAgB,CAAA;AAAA,EAAA;AAAA,EAItC,IAAI,KAA6B;AACvC,UAAM,QAAQ,KAAK,MAAM,IAAI,GAAG;AAEhC,QAAI,UAAU,QAAW;AACnB,WAAA,MAAM,OAAO,GAAG;AAChB,WAAA,MAAM,IAAI,KAAK,KAAK;AAAA,IAAA;AAEnB,WAAA;AAAA,EAAA;AAAA,EAGD,IAAI,KAAU,OAAc;AAClC,QAAI,KAAK,MAAM,IAAI,GAAG,GAAG;AACnB,WAAA,MAAM,OAAO,GAAG;AAAA,IACX,WAAA,KAAK,MAAM,SAAS,KAAK,SAAS;AAC5C,WAAK,MAAM,OAAO,KAAK,aAAA,CAAc;AAAA,IAAA;AAEjC,SAAA,MAAM,IAAI,KAAK,KAAK;AAAA,EAAA;AAAA,EAGlB,eAAoB;AAC3B,WAAO,KAAK,MAAM,KAAK,EAAE,KAAO,EAAA;AAAA,EAAA;AAElC;"}
1
+ {"version":3,"file":"LRUCache.js","sources":["../../../../../packages/utilities/src/structures/LRUCache.ts"],"sourcesContent":["// This is heavily inspired by https://stackoverflow.com/a/46432113\nexport class LRUCache<Key, Value> {\n\tprivate readonly cache = new Map<Key, Value>()\n\n\tpublic constructor(private readonly maxSize: number) {}\n\n\tpublic get(key: Key): Value | undefined {\n\t\tconst value = this.cache.get(key)\n\n\t\tif (value !== undefined) {\n\t\t\tthis.cache.delete(key)\n\t\t\tthis.cache.set(key, value)\n\t\t}\n\t\treturn value\n\t}\n\n\tpublic set(key: Key, value: Value) {\n\t\tif (this.cache.has(key)) {\n\t\t\tthis.cache.delete(key) // Refresh this key\n\t\t} else if (this.cache.size === this.maxSize) {\n\t\t\tthis.cache.delete(this.getOldestKey()) // Evict the oldest value\n\t\t}\n\t\tthis.cache.set(key, value)\n\t}\n\n\tprivate getOldestKey(): Key {\n\t\treturn this.cache.keys().next().value!\n\t}\n}\n"],"names":[],"mappings":";;;AACO,MAAM,SAAqB;AAAA,EAG1B,YAA6B,SAAiB;AAAjB,SAAA,UAAA;AAFpC,kBAAA,MAAiB,6BAAY,IAAA,CAAgB;AAAA,EAES;AAAA,EAE/C,IAAI,KAA6B;AACvC,UAAM,QAAQ,KAAK,MAAM,IAAI,GAAG;AAEhC,QAAI,UAAU,QAAW;AACxB,WAAK,MAAM,OAAO,GAAG;AACrB,WAAK,MAAM,IAAI,KAAK,KAAK;AAAA,IAC1B;AACA,WAAO;AAAA,EACR;AAAA,EAEO,IAAI,KAAU,OAAc;AAClC,QAAI,KAAK,MAAM,IAAI,GAAG,GAAG;AACxB,WAAK,MAAM,OAAO,GAAG;AAAA,IACtB,WAAW,KAAK,MAAM,SAAS,KAAK,SAAS;AAC5C,WAAK,MAAM,OAAO,KAAK,aAAA,CAAc;AAAA,IACtC;AACA,SAAK,MAAM,IAAI,KAAK,KAAK;AAAA,EAC1B;AAAA,EAEQ,eAAoB;AAC3B,WAAO,KAAK,MAAM,KAAA,EAAO,OAAO;AAAA,EACjC;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"WeakIdCache.cjs","sources":["../../../../../packages/utilities/src/structures/WeakIdCache.ts"],"sourcesContent":["export class WeakIdCache<K extends object> {\n\tprivate readonly cache = new WeakMap<K, string>()\n\tprivate seed = 0\n\tprivate readonly rootId = this.seedToId(this.seed++)\n\n\tpublic getId(key: K): string {\n\t\tlet existing = this.cache.get(key)\n\n\t\tif (existing === undefined) {\n\t\t\tthis.cache.set(key, (existing = this.seedToId(this.seed++)))\n\t\t}\n\t\treturn existing\n\t}\n\n\tpublic getOptionalKeyId(key: K | undefined): string {\n\t\tif (key === undefined) {\n\t\t\treturn this.rootId\n\t\t}\n\t\treturn this.getId(key)\n\t}\n\n\tprivate seedToId(seed: number): string {\n\t\treturn seed.toFixed(0)\n\t}\n}\n"],"names":[],"mappings":";;;;;AAAO,MAAM,YAA8B;AAAA,EAApC,cAAA;AACW,kBAAA,MAAA,6BAAY,QAAmB,CAAA;AAChD,kBAAA,MAAQ,QAAO,CAAA;AACf,kBAAA,MAAiB,UAAS,KAAK,SAAS,KAAK,MAAM,CAAA;AAAA,EAAA;AAAA,EAE5C,MAAM,KAAgB;AAC5B,QAAI,WAAW,KAAK,MAAM,IAAI,GAAG;AAEjC,QAAI,aAAa,QAAW;AACtB,WAAA,MAAM,IAAI,KAAM,WAAW,KAAK,SAAS,KAAK,MAAM,CAAE;AAAA,IAAA;AAErD,WAAA;AAAA,EAAA;AAAA,EAGD,iBAAiB,KAA4B;AACnD,QAAI,QAAQ,QAAW;AACtB,aAAO,KAAK;AAAA,IAAA;AAEN,WAAA,KAAK,MAAM,GAAG;AAAA,EAAA;AAAA,EAGd,SAAS,MAAsB;AAC/B,WAAA,KAAK,QAAQ,CAAC;AAAA,EAAA;AAEvB;;"}
1
+ {"version":3,"file":"WeakIdCache.cjs","sources":["../../../../../packages/utilities/src/structures/WeakIdCache.ts"],"sourcesContent":["export class WeakIdCache<K extends object> {\n\tprivate readonly cache = new WeakMap<K, string>()\n\tprivate seed = 0\n\tprivate readonly rootId = this.seedToId(this.seed++)\n\n\tpublic getId(key: K): string {\n\t\tlet existing = this.cache.get(key)\n\n\t\tif (existing === undefined) {\n\t\t\tthis.cache.set(key, existing = this.seedToId(this.seed++))\n\t\t}\n\t\treturn existing\n\t}\n\n\tpublic getOptionalKeyId(key: K | undefined): string {\n\t\tif (key === undefined) {\n\t\t\treturn this.rootId\n\t\t}\n\t\treturn this.getId(key)\n\t}\n\n\tprivate seedToId(seed: number): string {\n\t\treturn seed.toFixed(0)\n\t}\n}\n"],"names":[],"mappings":";;;;;AAAO,MAAM,YAA8B;AAAA,EAApC,cAAA;AACN,kBAAA,MAAiB,6BAAY,QAAA,CAAmB;AAChD,kBAAA,MAAQ,QAAO,CAAA;AACf,kBAAA,MAAiB,UAAS,KAAK,SAAS,KAAK,MAAM,CAAA;AAAA,EAAA;AAAA,EAE5C,MAAM,KAAgB;AAC5B,QAAI,WAAW,KAAK,MAAM,IAAI,GAAG;AAEjC,QAAI,aAAa,QAAW;AAC3B,WAAK,MAAM,IAAI,KAAK,WAAW,KAAK,SAAS,KAAK,MAAM,CAAC;AAAA,IAC1D;AACA,WAAO;AAAA,EACR;AAAA,EAEO,iBAAiB,KAA4B;AACnD,QAAI,QAAQ,QAAW;AACtB,aAAO,KAAK;AAAA,IACb;AACA,WAAO,KAAK,MAAM,GAAG;AAAA,EACtB;AAAA,EAEQ,SAAS,MAAsB;AACtC,WAAO,KAAK,QAAQ,CAAC;AAAA,EACtB;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"WeakIdCache.js","sources":["../../../../../packages/utilities/src/structures/WeakIdCache.ts"],"sourcesContent":["export class WeakIdCache<K extends object> {\n\tprivate readonly cache = new WeakMap<K, string>()\n\tprivate seed = 0\n\tprivate readonly rootId = this.seedToId(this.seed++)\n\n\tpublic getId(key: K): string {\n\t\tlet existing = this.cache.get(key)\n\n\t\tif (existing === undefined) {\n\t\t\tthis.cache.set(key, (existing = this.seedToId(this.seed++)))\n\t\t}\n\t\treturn existing\n\t}\n\n\tpublic getOptionalKeyId(key: K | undefined): string {\n\t\tif (key === undefined) {\n\t\t\treturn this.rootId\n\t\t}\n\t\treturn this.getId(key)\n\t}\n\n\tprivate seedToId(seed: number): string {\n\t\treturn seed.toFixed(0)\n\t}\n}\n"],"names":[],"mappings":";;;AAAO,MAAM,YAA8B;AAAA,EAApC,cAAA;AACW,kBAAA,MAAA,6BAAY,QAAmB,CAAA;AAChD,kBAAA,MAAQ,QAAO,CAAA;AACf,kBAAA,MAAiB,UAAS,KAAK,SAAS,KAAK,MAAM,CAAA;AAAA,EAAA;AAAA,EAE5C,MAAM,KAAgB;AAC5B,QAAI,WAAW,KAAK,MAAM,IAAI,GAAG;AAEjC,QAAI,aAAa,QAAW;AACtB,WAAA,MAAM,IAAI,KAAM,WAAW,KAAK,SAAS,KAAK,MAAM,CAAE;AAAA,IAAA;AAErD,WAAA;AAAA,EAAA;AAAA,EAGD,iBAAiB,KAA4B;AACnD,QAAI,QAAQ,QAAW;AACtB,aAAO,KAAK;AAAA,IAAA;AAEN,WAAA,KAAK,MAAM,GAAG;AAAA,EAAA;AAAA,EAGd,SAAS,MAAsB;AAC/B,WAAA,KAAK,QAAQ,CAAC;AAAA,EAAA;AAEvB;"}
1
+ {"version":3,"file":"WeakIdCache.js","sources":["../../../../../packages/utilities/src/structures/WeakIdCache.ts"],"sourcesContent":["export class WeakIdCache<K extends object> {\n\tprivate readonly cache = new WeakMap<K, string>()\n\tprivate seed = 0\n\tprivate readonly rootId = this.seedToId(this.seed++)\n\n\tpublic getId(key: K): string {\n\t\tlet existing = this.cache.get(key)\n\n\t\tif (existing === undefined) {\n\t\t\tthis.cache.set(key, existing = this.seedToId(this.seed++))\n\t\t}\n\t\treturn existing\n\t}\n\n\tpublic getOptionalKeyId(key: K | undefined): string {\n\t\tif (key === undefined) {\n\t\t\treturn this.rootId\n\t\t}\n\t\treturn this.getId(key)\n\t}\n\n\tprivate seedToId(seed: number): string {\n\t\treturn seed.toFixed(0)\n\t}\n}\n"],"names":[],"mappings":";;;AAAO,MAAM,YAA8B;AAAA,EAApC,cAAA;AACN,kBAAA,MAAiB,6BAAY,QAAA,CAAmB;AAChD,kBAAA,MAAQ,QAAO,CAAA;AACf,kBAAA,MAAiB,UAAS,KAAK,SAAS,KAAK,MAAM,CAAA;AAAA,EAAA;AAAA,EAE5C,MAAM,KAAgB;AAC5B,QAAI,WAAW,KAAK,MAAM,IAAI,GAAG;AAEjC,QAAI,aAAa,QAAW;AAC3B,WAAK,MAAM,IAAI,KAAK,WAAW,KAAK,SAAS,KAAK,MAAM,CAAC;AAAA,IAC1D;AACA,WAAO;AAAA,EACR;AAAA,EAEO,iBAAiB,KAA4B;AACnD,QAAI,QAAQ,QAAW;AACtB,aAAO,KAAK;AAAA,IACb;AACA,WAAO,KAAK,MAAM,GAAG;AAAA,EACtB;AAAA,EAEQ,SAAS,MAAsB;AACtC,WAAO,KAAK,QAAQ,CAAC;AAAA,EACtB;AACD;"}
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const assertNever = require("./src/assert-types/assertNever.cjs");
4
- const deprecate = require("./src/deprecate/deprecate.cjs");
5
- const dataAttribute = require("./src/dom/dataAttribute.cjs");
6
- const svgSizeProps = require("./src/dom/svgSizeProps.cjs");
7
3
  const BijectiveIndexedMap = require("./src/structures/BijectiveIndexedMap.cjs");
8
4
  const LRUCache = require("./src/structures/LRUCache.cjs");
9
5
  const WeakIdCache = require("./src/structures/WeakIdCache.cjs");
10
- exports.assertNever = assertNever.assertNever;
11
- exports.deprecate = deprecate.deprecate;
12
- exports.dataAttribute = dataAttribute.dataAttribute;
13
- exports.svgSizeProps = svgSizeProps.svgSizeProps;
6
+ const assertNever = require("./src/assert-types/assertNever.cjs");
7
+ const dataAttribute = require("./src/dom/dataAttribute.cjs");
8
+ const deprecate = require("./src/deprecate/deprecate.cjs");
9
+ const svgSizeProps = require("./src/dom/svgSizeProps.cjs");
14
10
  exports.BijectiveIndexedMap = BijectiveIndexedMap.BijectiveIndexedMap;
15
11
  exports.LRUCache = LRUCache.LRUCache;
16
12
  exports.WeakIdCache = WeakIdCache.WeakIdCache;
13
+ exports.assertNever = assertNever.assertNever;
14
+ exports.dataAttribute = dataAttribute.dataAttribute;
15
+ exports.deprecate = deprecate.deprecate;
16
+ exports.svgSizeProps = svgSizeProps.svgSizeProps;
17
17
  //# sourceMappingURL=index.cjs.map
@@ -1,10 +1,10 @@
1
- import { assertNever } from "./src/assert-types/assertNever.js";
2
- import { deprecate } from "./src/deprecate/deprecate.js";
3
- import { dataAttribute } from "./src/dom/dataAttribute.js";
4
- import { svgSizeProps } from "./src/dom/svgSizeProps.js";
5
1
  import { BijectiveIndexedMap } from "./src/structures/BijectiveIndexedMap.js";
6
2
  import { LRUCache } from "./src/structures/LRUCache.js";
7
3
  import { WeakIdCache } from "./src/structures/WeakIdCache.js";
4
+ import { assertNever } from "./src/assert-types/assertNever.js";
5
+ import { dataAttribute } from "./src/dom/dataAttribute.js";
6
+ import { deprecate } from "./src/deprecate/deprecate.js";
7
+ import { svgSizeProps } from "./src/dom/svgSizeProps.js";
8
8
  export {
9
9
  BijectiveIndexedMap,
10
10
  LRUCache,
@@ -1 +1 @@
1
- {"version":3,"file":"assertNever.cjs","sources":["../../../../../packages/utilities/src/assert-types/assertNever.ts"],"sourcesContent":["export function assertNever(_: never): never {\n\tthrow new Error('Exhaustive Error: This line should never be reached.')\n}\n"],"names":[],"mappings":";;AAAO,SAAS,YAAY,GAAiB;AACtC,QAAA,IAAI,MAAM,sDAAsD;AACvE;;"}
1
+ {"version":3,"file":"assertNever.cjs","sources":["../../../../../packages/utilities/src/assert-types/assertNever.ts"],"sourcesContent":["export function assertNever(_: never): never {\n\tthrow new Error('Exhaustive Error: This line should never be reached.')\n}\n"],"names":[],"mappings":";;AAAO,SAAS,YAAY,GAAiB;AAC5C,QAAM,IAAI,MAAM,sDAAsD;AACvE;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"assertNever.js","sources":["../../../../../packages/utilities/src/assert-types/assertNever.ts"],"sourcesContent":["export function assertNever(_: never): never {\n\tthrow new Error('Exhaustive Error: This line should never be reached.')\n}\n"],"names":[],"mappings":"AAAO,SAAS,YAAY,GAAiB;AACtC,QAAA,IAAI,MAAM,sDAAsD;AACvE;"}
1
+ {"version":3,"file":"assertNever.js","sources":["../../../../../packages/utilities/src/assert-types/assertNever.ts"],"sourcesContent":["export function assertNever(_: never): never {\n\tthrow new Error('Exhaustive Error: This line should never be reached.')\n}\n"],"names":[],"mappings":"AAAO,SAAS,YAAY,GAAiB;AAC5C,QAAM,IAAI,MAAM,sDAAsD;AACvE;"}
@@ -1 +1 @@
1
- {"version":3,"file":"deprecate.cjs","sources":["../../../../../packages/utilities/src/deprecate/deprecate.ts"],"sourcesContent":["import { SemverString } from './types'\n\n/**\n * Logs a deprecation warning if the assertion is `false`.\n * @internal\n *\n * @param removal - Version when the deprecated feature will be removed\n * @param condition - Condition under which the deprecation warning will be logged\n * @param deprecated - Name of the deprecated feature\n * @param replacement - Name of the feature that replaces the deprecated feature\n *\n * @example\n * ```ts\n * const { visible } = props\n * deprecate(visible !== 'default', '1.3.0', '\"default\"', '\"hidden\"')\n * // Logs: Use of \"default\" is deprecated and might be removed in the next release. Use \"hidden\" instead.\n * ```\n */\nexport function deprecate(removal: SemverString, condition: boolean, deprecated: string, replacement: string | null): void {\n\tif (condition === true) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconst shouldThrow = Boolean(import.meta.env.VITE_CONTEMBER_ADMIN_STRICT_DEPRECATIONS)\n\n\t\t\tif (shouldThrow) {\n\t\t\t\tthrow new Error(`Support for ${deprecated} was planned to be removed in the ${removal} release.${replacement ? ` Replace it with ${replacement} instead.` : 'Remove it.'}`)\n\t\t\t} else {\n\t\t\t\tconsole.warn(`Use of ${deprecated} is deprecated and might be removed in the next release.${replacement ? ` Use ${replacement} instead.` : ' There is no replacement.'}`)\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAkBO,SAAS,UAAU,SAAuB,WAAoB,YAAoB,aAAkC;AAY3H;;"}
1
+ {"version":3,"file":"deprecate.cjs","sources":["../../../../../packages/utilities/src/deprecate/deprecate.ts"],"sourcesContent":["import { SemverString } from './types'\n\n/**\n * Logs a deprecation warning if the assertion is `false`.\n * @internal\n *\n * @param removal - Version when the deprecated feature will be removed\n * @param condition - Condition under which the deprecation warning will be logged\n * @param deprecated - Name of the deprecated feature\n * @param replacement - Name of the feature that replaces the deprecated feature\n *\n * @example\n * ```ts\n * const { visible } = props\n * deprecate(visible !== 'default', '1.3.0', '\"default\"', '\"hidden\"')\n * // Logs: Use of \"default\" is deprecated and might be removed in the next release. Use \"hidden\" instead.\n * ```\n */\nexport function deprecate(removal: SemverString, condition: boolean, deprecated: string, replacement: string | null): void {\n\tif (condition === true) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconst shouldThrow = Boolean(import.meta.env.VITE_CONTEMBER_ADMIN_STRICT_DEPRECATIONS)\n\n\t\t\tif (shouldThrow) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Support for ${deprecated} was planned to be removed in the ${removal} release.${\n\t\t\t\t\t\treplacement ? ` Replace it with ${replacement} instead.` : 'Remove it.'\n\t\t\t\t\t}`,\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`Use of ${deprecated} is deprecated and might be removed in the next release.${\n\t\t\t\t\t\treplacement ? ` Use ${replacement} instead.` : ' There is no replacement.'\n\t\t\t\t\t}`,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAkBO,SAAS,UAAU,SAAuB,WAAoB,YAAoB,aAAkC;AAoB3H;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"deprecate.js","sources":["../../../../../packages/utilities/src/deprecate/deprecate.ts"],"sourcesContent":["import { SemverString } from './types'\n\n/**\n * Logs a deprecation warning if the assertion is `false`.\n * @internal\n *\n * @param removal - Version when the deprecated feature will be removed\n * @param condition - Condition under which the deprecation warning will be logged\n * @param deprecated - Name of the deprecated feature\n * @param replacement - Name of the feature that replaces the deprecated feature\n *\n * @example\n * ```ts\n * const { visible } = props\n * deprecate(visible !== 'default', '1.3.0', '\"default\"', '\"hidden\"')\n * // Logs: Use of \"default\" is deprecated and might be removed in the next release. Use \"hidden\" instead.\n * ```\n */\nexport function deprecate(removal: SemverString, condition: boolean, deprecated: string, replacement: string | null): void {\n\tif (condition === true) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconst shouldThrow = Boolean(import.meta.env.VITE_CONTEMBER_ADMIN_STRICT_DEPRECATIONS)\n\n\t\t\tif (shouldThrow) {\n\t\t\t\tthrow new Error(`Support for ${deprecated} was planned to be removed in the ${removal} release.${replacement ? ` Replace it with ${replacement} instead.` : 'Remove it.'}`)\n\t\t\t} else {\n\t\t\t\tconsole.warn(`Use of ${deprecated} is deprecated and might be removed in the next release.${replacement ? ` Use ${replacement} instead.` : ' There is no replacement.'}`)\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAkBO,SAAS,UAAU,SAAuB,WAAoB,YAAoB,aAAkC;AAY3H;"}
1
+ {"version":3,"file":"deprecate.js","sources":["../../../../../packages/utilities/src/deprecate/deprecate.ts"],"sourcesContent":["import { SemverString } from './types'\n\n/**\n * Logs a deprecation warning if the assertion is `false`.\n * @internal\n *\n * @param removal - Version when the deprecated feature will be removed\n * @param condition - Condition under which the deprecation warning will be logged\n * @param deprecated - Name of the deprecated feature\n * @param replacement - Name of the feature that replaces the deprecated feature\n *\n * @example\n * ```ts\n * const { visible } = props\n * deprecate(visible !== 'default', '1.3.0', '\"default\"', '\"hidden\"')\n * // Logs: Use of \"default\" is deprecated and might be removed in the next release. Use \"hidden\" instead.\n * ```\n */\nexport function deprecate(removal: SemverString, condition: boolean, deprecated: string, replacement: string | null): void {\n\tif (condition === true) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconst shouldThrow = Boolean(import.meta.env.VITE_CONTEMBER_ADMIN_STRICT_DEPRECATIONS)\n\n\t\t\tif (shouldThrow) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Support for ${deprecated} was planned to be removed in the ${removal} release.${\n\t\t\t\t\t\treplacement ? ` Replace it with ${replacement} instead.` : 'Remove it.'\n\t\t\t\t\t}`,\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`Use of ${deprecated} is deprecated and might be removed in the next release.${\n\t\t\t\t\t\treplacement ? ` Use ${replacement} instead.` : ' There is no replacement.'\n\t\t\t\t\t}`,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAkBO,SAAS,UAAU,SAAuB,WAAoB,YAAoB,aAAkC;AAoB3H;"}
@@ -1 +1 @@
1
- {"version":3,"file":"dataAttribute.cjs","sources":["../../../../../packages/utilities/src/dom/dataAttribute.ts"],"sourcesContent":["export function dataAttribute(value: boolean | null | undefined): '' | undefined\nexport function dataAttribute<const T extends string>(value: T): T\nexport function dataAttribute(value: boolean | string | number | undefined | null): string | undefined\nexport function dataAttribute(value: unknown): string | true | undefined {\n\tif (value === false || value === undefined || value === null) {\n\t\treturn undefined\n\t} else if (value === true) {\n\t\t// Closest to HTML: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n\t\t// React issue: https://github.com/facebook/react/issues/24812\n\t\treturn ''\n\t} else {\n\t\treturn String(value)\n\t}\n}\n"],"names":[],"mappings":";;AAGO,SAAS,cAAc,OAA2C;AACxE,MAAI,UAAU,SAAS,UAAU,UAAa,UAAU,MAAM;AACtD,WAAA;AAAA,EAAA,WACG,UAAU,MAAM;AAGnB,WAAA;AAAA,EAAA,OACD;AACN,WAAO,OAAO,KAAK;AAAA,EAAA;AAErB;;"}
1
+ {"version":3,"file":"dataAttribute.cjs","sources":["../../../../../packages/utilities/src/dom/dataAttribute.ts"],"sourcesContent":["export function dataAttribute(value: boolean | null | undefined): '' | undefined\nexport function dataAttribute<const T extends string>(value: T): T\nexport function dataAttribute(value: boolean | string | number | undefined | null): string | undefined\nexport function dataAttribute(value: unknown): string | true | undefined {\n\tif (value === false || value === undefined || value === null) {\n\t\treturn undefined\n\t} else if (value === true) {\n\t\t// Closest to HTML: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n\t\t// React issue: https://github.com/facebook/react/issues/24812\n\t\treturn ''\n\t} else {\n\t\treturn String(value)\n\t}\n}\n"],"names":[],"mappings":";;AAGO,SAAS,cAAc,OAA2C;AACxE,MAAI,UAAU,SAAS,UAAU,UAAa,UAAU,MAAM;AAC7D,WAAO;AAAA,EACR,WAAW,UAAU,MAAM;AAG1B,WAAO;AAAA,EACR,OAAO;AACN,WAAO,OAAO,KAAK;AAAA,EACpB;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"dataAttribute.js","sources":["../../../../../packages/utilities/src/dom/dataAttribute.ts"],"sourcesContent":["export function dataAttribute(value: boolean | null | undefined): '' | undefined\nexport function dataAttribute<const T extends string>(value: T): T\nexport function dataAttribute(value: boolean | string | number | undefined | null): string | undefined\nexport function dataAttribute(value: unknown): string | true | undefined {\n\tif (value === false || value === undefined || value === null) {\n\t\treturn undefined\n\t} else if (value === true) {\n\t\t// Closest to HTML: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n\t\t// React issue: https://github.com/facebook/react/issues/24812\n\t\treturn ''\n\t} else {\n\t\treturn String(value)\n\t}\n}\n"],"names":[],"mappings":"AAGO,SAAS,cAAc,OAA2C;AACxE,MAAI,UAAU,SAAS,UAAU,UAAa,UAAU,MAAM;AACtD,WAAA;AAAA,EAAA,WACG,UAAU,MAAM;AAGnB,WAAA;AAAA,EAAA,OACD;AACN,WAAO,OAAO,KAAK;AAAA,EAAA;AAErB;"}
1
+ {"version":3,"file":"dataAttribute.js","sources":["../../../../../packages/utilities/src/dom/dataAttribute.ts"],"sourcesContent":["export function dataAttribute(value: boolean | null | undefined): '' | undefined\nexport function dataAttribute<const T extends string>(value: T): T\nexport function dataAttribute(value: boolean | string | number | undefined | null): string | undefined\nexport function dataAttribute(value: unknown): string | true | undefined {\n\tif (value === false || value === undefined || value === null) {\n\t\treturn undefined\n\t} else if (value === true) {\n\t\t// Closest to HTML: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n\t\t// React issue: https://github.com/facebook/react/issues/24812\n\t\treturn ''\n\t} else {\n\t\treturn String(value)\n\t}\n}\n"],"names":[],"mappings":"AAGO,SAAS,cAAc,OAA2C;AACxE,MAAI,UAAU,SAAS,UAAU,UAAa,UAAU,MAAM;AAC7D,WAAO;AAAA,EACR,WAAW,UAAU,MAAM;AAG1B,WAAO;AAAA,EACR,OAAO;AACN,WAAO,OAAO,KAAK;AAAA,EACpB;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"svgSizeProps.cjs","sources":["../../../../../packages/utilities/src/dom/svgSizeProps.ts"],"sourcesContent":["export interface SvgSizeProps {\n\twidth: number\n\theight: number\n\tviewBox: string\n}\n\nexport function svgSizeProps(\n\twidth: number,\n\theight?: number,\n\tcrop: number = 0,\n): SvgSizeProps {\n\tconst viewBoxWidth = width - crop * 2\n\tconst viewBoxHeight = (height ?? width) - crop * 2\n\tconst viewBoxX = crop\n\tconst viewBoxY = crop\n\treturn {\n\t\twidth: viewBoxWidth,\n\t\theight: viewBoxHeight,\n\t\tviewBox: `${viewBoxX} ${viewBoxY} ${viewBoxWidth} ${viewBoxHeight}`,\n\t}\n}\n"],"names":[],"mappings":";;AAMO,SAAS,aACf,OACA,QACA,OAAe,GACA;AACT,QAAA,eAAe,QAAQ,OAAO;AAC9B,QAAA,iBAAiB,UAAU,SAAS,OAAO;AACjD,QAAM,WAAW;AACjB,QAAM,WAAW;AACV,SAAA;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS,GAAG,QAAQ,IAAI,QAAQ,IAAI,YAAY,IAAI,aAAa;AAAA,EAClE;AACD;;"}
1
+ {"version":3,"file":"svgSizeProps.cjs","sources":["../../../../../packages/utilities/src/dom/svgSizeProps.ts"],"sourcesContent":["export interface SvgSizeProps {\n\twidth: number\n\theight: number\n\tviewBox: string\n}\n\nexport function svgSizeProps(\n\twidth: number,\n\theight?: number,\n\tcrop: number = 0,\n): SvgSizeProps {\n\tconst viewBoxWidth = width - crop * 2\n\tconst viewBoxHeight = (height ?? width) - crop * 2\n\tconst viewBoxX = crop\n\tconst viewBoxY = crop\n\treturn {\n\t\twidth: viewBoxWidth,\n\t\theight: viewBoxHeight,\n\t\tviewBox: `${viewBoxX} ${viewBoxY} ${viewBoxWidth} ${viewBoxHeight}`,\n\t}\n}\n"],"names":[],"mappings":";;AAMO,SAAS,aACf,OACA,QACA,OAAe,GACA;AACf,QAAM,eAAe,QAAQ,OAAO;AACpC,QAAM,iBAAiB,UAAU,SAAS,OAAO;AACjD,QAAM,WAAW;AACjB,QAAM,WAAW;AACjB,SAAO;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS,GAAG,QAAQ,IAAI,QAAQ,IAAI,YAAY,IAAI,aAAa;AAAA,EAAA;AAEnE;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"svgSizeProps.js","sources":["../../../../../packages/utilities/src/dom/svgSizeProps.ts"],"sourcesContent":["export interface SvgSizeProps {\n\twidth: number\n\theight: number\n\tviewBox: string\n}\n\nexport function svgSizeProps(\n\twidth: number,\n\theight?: number,\n\tcrop: number = 0,\n): SvgSizeProps {\n\tconst viewBoxWidth = width - crop * 2\n\tconst viewBoxHeight = (height ?? width) - crop * 2\n\tconst viewBoxX = crop\n\tconst viewBoxY = crop\n\treturn {\n\t\twidth: viewBoxWidth,\n\t\theight: viewBoxHeight,\n\t\tviewBox: `${viewBoxX} ${viewBoxY} ${viewBoxWidth} ${viewBoxHeight}`,\n\t}\n}\n"],"names":[],"mappings":"AAMO,SAAS,aACf,OACA,QACA,OAAe,GACA;AACT,QAAA,eAAe,QAAQ,OAAO;AAC9B,QAAA,iBAAiB,UAAU,SAAS,OAAO;AACjD,QAAM,WAAW;AACjB,QAAM,WAAW;AACV,SAAA;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS,GAAG,QAAQ,IAAI,QAAQ,IAAI,YAAY,IAAI,aAAa;AAAA,EAClE;AACD;"}
1
+ {"version":3,"file":"svgSizeProps.js","sources":["../../../../../packages/utilities/src/dom/svgSizeProps.ts"],"sourcesContent":["export interface SvgSizeProps {\n\twidth: number\n\theight: number\n\tviewBox: string\n}\n\nexport function svgSizeProps(\n\twidth: number,\n\theight?: number,\n\tcrop: number = 0,\n): SvgSizeProps {\n\tconst viewBoxWidth = width - crop * 2\n\tconst viewBoxHeight = (height ?? width) - crop * 2\n\tconst viewBoxX = crop\n\tconst viewBoxY = crop\n\treturn {\n\t\twidth: viewBoxWidth,\n\t\theight: viewBoxHeight,\n\t\tviewBox: `${viewBoxX} ${viewBoxY} ${viewBoxWidth} ${viewBoxHeight}`,\n\t}\n}\n"],"names":[],"mappings":"AAMO,SAAS,aACf,OACA,QACA,OAAe,GACA;AACf,QAAM,eAAe,QAAQ,OAAO;AACpC,QAAM,iBAAiB,UAAU,SAAS,OAAO;AACjD,QAAM,WAAW;AACjB,QAAM,WAAW;AACjB,SAAO;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS,GAAG,QAAQ,IAAI,QAAQ,IAAI,YAAY,IAAI,aAAa;AAAA,EAAA;AAEnE;"}
@@ -57,6 +57,23 @@ class BijectiveIndexedMap {
57
57
  has(key) {
58
58
  return this.index.has(key);
59
59
  }
60
+ getOrInsert(key, defaultValue) {
61
+ const existing = this.get(key);
62
+ if (existing !== void 0) {
63
+ return existing;
64
+ }
65
+ this.set(key, defaultValue);
66
+ return defaultValue;
67
+ }
68
+ getOrInsertComputed(key, callback) {
69
+ const existing = this.get(key);
70
+ if (existing !== void 0) {
71
+ return existing;
72
+ }
73
+ const value = callback(key);
74
+ this.set(key, value);
75
+ return value;
76
+ }
60
77
  set(key, value) {
61
78
  const existingIndex = this.index.get(key);
62
79
  if (existingIndex === void 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"BijectiveIndexedMap.cjs","sources":["../../../../../packages/utilities/src/structures/BijectiveIndexedMap.ts"],"sourcesContent":["// Bijective as in we need to supply the inverse and also guarantee that the values are unique.\n// Provided this invariant, this should behave more or less like a regular map except it has a somewhat special\n// iteration order. Unlike a regular map, which just honors insertion order, this also provides a special method\n// changeKey. With this, we can change the key under which a value (that is already on the map) is accessible.\n// With an ordinary map, that operation would require us to delete the original [K1, V] pair and insert\n// a new one [K2, V]. That would however change the order of iteration. This main purpose of this data structure is\n// the ability to avoid that and enable the value V to preserve its original place.\nexport class BijectiveIndexedMap<K, V> implements Map<K, V> {\n\tprivate readonly valueStore: Map<number, V>\n\tprivate readonly index: Map<K, number>\n\tprivate indexSeed: number\n\n\tprivate readonly inverse: (value: V) => K\n\n\tpublic readonly [Symbol.toStringTag] = 'BijectiveIndexedMap'\n\n\tpublic constructor(originalMap: BijectiveIndexedMap<K, V>)\n\tpublic constructor(inverse: (value: V) => K)\n\tpublic constructor(inverseOrMap: BijectiveIndexedMap<K, V> | ((value: V) => K)) {\n\t\tif (inverseOrMap instanceof BijectiveIndexedMap) {\n\t\t\tthis.valueStore = new Map(inverseOrMap.valueStore)\n\t\t\tthis.index = new Map(inverseOrMap.index)\n\t\t\tthis.indexSeed = inverseOrMap.indexSeed\n\t\t\tthis.inverse = inverseOrMap.inverse\n\t\t} else {\n\t\t\tthis.valueStore = new Map()\n\t\t\tthis.index = new Map()\n\t\t\tthis.indexSeed = 0\n\t\t\tthis.inverse = inverseOrMap\n\t\t}\n\t}\n\n\tprivate getNewIndex() {\n\t\treturn this.indexSeed++\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.valueStore.size\n\t}\n\n\tpublic clear(): void {\n\t\tthis.valueStore.clear()\n\t\tthis.index.clear()\n\t}\n\tpublic delete(key: K): boolean {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn false\n\t\t}\n\t\tthis.valueStore.delete(index)\n\t\tthis.index.delete(key)\n\t\treturn true\n\t}\n\tpublic forEach(callback: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void {\n\t\tfor (const [key, value] of this.entries()) {\n\t\t\tcallback.call(thisArg, value, key, this)\n\t\t}\n\t}\n\n\tpublic get(key: K): V | undefined {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn this.valueStore.get(index)\n\t}\n\tpublic has(key: K): boolean {\n\t\treturn this.index.has(key)\n\t}\n\tpublic set(key: K, value: V): this {\n\t\tconst existingIndex = this.index.get(key)\n\n\t\tif (existingIndex === undefined) {\n\t\t\tconst newIndex = this.getNewIndex()\n\t\t\tthis.index.set(key, newIndex)\n\t\t\tthis.valueStore.set(newIndex, value)\n\t\t} else {\n\t\t\tthis.valueStore.set(existingIndex, value)\n\t\t}\n\t\treturn this\n\t}\n\n\t// This doesn't use the inverse in order to avoid confusion.\n\t// See the description above.\n\tpublic changeKey(oldKey: K, newKey: K): this {\n\t\tconst index = this.index.get(oldKey)\n\t\tif (index === undefined) {\n\t\t\tthrow new Error()\n\t\t}\n\t\tthis.index.delete(oldKey)\n\t\tthis.index.set(newKey, index)\n\t\treturn this\n\t}\n\n\tpublic changeKeyOrder(newOrder: Iterable<K>) {\n\t\tfor (const key of newOrder) {\n\t\t\tconst keyIndex = this.index.get(key)\n\t\t\tif (keyIndex === undefined) {\n\t\t\t\tthrow new Error()\n\t\t\t}\n\t\t\tconst value = this.valueStore.get(keyIndex)!\n\n\t\t\t// This effectively removes value from wherever it was and puts it at the end.\n\t\t\t// Provided newOrder.size is the same as valueStore, by the end of this loop\n\t\t\t// the values will be in the correct order.\n\t\t\tthis.valueStore.delete(keyIndex)\n\t\t\tthis.valueStore.set(keyIndex, value)\n\t\t}\n\t}\n\n\tpublic *[Symbol.iterator](): MapIterator<[K, V]> {\n\t\tyield* this.entries()\n\t}\n\n\tpublic *entries(): MapIterator<[K, V]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [this.inverse(value), value]\n\t\t}\n\t}\n\n\tpublic *keys(): MapIterator<K> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield this.inverse(value)\n\t\t}\n\t}\n\n\tpublic *values(): MapIterator<V> {\n\t\tfor (const value of this.valueStore.values()) {\n\t\t\tif (value === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tyield value\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;AAAA,IAAA;AAOO,MAAM,oBAA+C;AAAA,EAWpD,YAAY,cAA6D;AAV/D,kBAAA,MAAA,YAAA;AACA,kBAAA,MAAA,OAAA;AACT,kBAAA,MAAA,WAAA;AAES,kBAAA,MAAA,SAAA;AAEjB,kBAAA,MAAiB,IAAsB,qBAAA;AAKtC,QAAI,wBAAwB,qBAAqB;AAChD,WAAK,aAAa,IAAI,IAAI,aAAa,UAAU;AACjD,WAAK,QAAQ,IAAI,IAAI,aAAa,KAAK;AACvC,WAAK,YAAY,aAAa;AAC9B,WAAK,UAAU,aAAa;AAAA,IAAA,OACtB;AACD,WAAA,iCAAiB,IAAI;AACrB,WAAA,4BAAY,IAAI;AACrB,WAAK,YAAY;AACjB,WAAK,UAAU;AAAA,IAAA;AAAA,EAChB;AAAA,EAGO,cAAc;AACrB,WAAO,KAAK;AAAA,EAAA;AAAA,EAGb,IAAW,OAAe;AACzB,WAAO,KAAK,WAAW;AAAA,EAAA;AAAA,EAGjB,QAAc;AACpB,SAAK,WAAW,MAAM;AACtB,SAAK,MAAM,MAAM;AAAA,EAAA;AAAA,EAEX,OAAO,KAAiB;AAC9B,UAAM,QAAQ,KAAK,MAAM,IAAI,GAAG;AAEhC,QAAI,UAAU,QAAW;AACjB,aAAA;AAAA,IAAA;AAEH,SAAA,WAAW,OAAO,KAAK;AACvB,SAAA,MAAM,OAAO,GAAG;AAC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AAAA,EACpC;AAAA,EAGD,GAlGiB,KAAA,OAAO,aAkGf,OAAO,aAAiC;AAChD,WAAO,KAAK,QAAQ;AAAA,EAAA;AAAA,EAGrB,CAAQ,UAA+B;AAC3B,eAAA,SAAS,KAAK,UAAU;AAClC,YAAM,CAAC,KAAK,QAAQ,KAAK,GAAG,KAAK;AAAA,IAAA;AAAA,EAClC;AAAA,EAGD,CAAQ,OAAuB;AACnB,eAAA,SAAS,KAAK,UAAU;AAC5B,YAAA,KAAK,QAAQ,KAAK;AAAA,IAAA;AAAA,EACzB;AAAA,EAGD,CAAQ,SAAyB;AAChC,eAAW,SAAS,KAAK,WAAW,OAAA,GAAU;AAC7C,UAAI,UAAU,QAAW;AACxB;AAAA,MAAA;AAEK,YAAA;AAAA,IAAA;AAAA,EACP;AAEF;;"}
1
+ {"version":3,"file":"BijectiveIndexedMap.cjs","sources":["../../../../../packages/utilities/src/structures/BijectiveIndexedMap.ts"],"sourcesContent":["// Bijective as in we need to supply the inverse and also guarantee that the values are unique.\n// Provided this invariant, this should behave more or less like a regular map except it has a somewhat special\n// iteration order. Unlike a regular map, which just honors insertion order, this also provides a special method\n// changeKey. With this, we can change the key under which a value (that is already on the map) is accessible.\n// With an ordinary map, that operation would require us to delete the original [K1, V] pair and insert\n// a new one [K2, V]. That would however change the order of iteration. This main purpose of this data structure is\n// the ability to avoid that and enable the value V to preserve its original place.\nexport class BijectiveIndexedMap<K, V> implements Map<K, V> {\n\tprivate readonly valueStore: Map<number, V>\n\tprivate readonly index: Map<K, number>\n\tprivate indexSeed: number\n\n\tprivate readonly inverse: (value: V) => K\n\n\tpublic readonly [Symbol.toStringTag] = 'BijectiveIndexedMap'\n\n\tpublic constructor(originalMap: BijectiveIndexedMap<K, V>)\n\tpublic constructor(inverse: (value: V) => K)\n\tpublic constructor(inverseOrMap: BijectiveIndexedMap<K, V> | ((value: V) => K)) {\n\t\tif (inverseOrMap instanceof BijectiveIndexedMap) {\n\t\t\tthis.valueStore = new Map(inverseOrMap.valueStore)\n\t\t\tthis.index = new Map(inverseOrMap.index)\n\t\t\tthis.indexSeed = inverseOrMap.indexSeed\n\t\t\tthis.inverse = inverseOrMap.inverse\n\t\t} else {\n\t\t\tthis.valueStore = new Map()\n\t\t\tthis.index = new Map()\n\t\t\tthis.indexSeed = 0\n\t\t\tthis.inverse = inverseOrMap\n\t\t}\n\t}\n\n\tprivate getNewIndex() {\n\t\treturn this.indexSeed++\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.valueStore.size\n\t}\n\n\tpublic clear(): void {\n\t\tthis.valueStore.clear()\n\t\tthis.index.clear()\n\t}\n\tpublic delete(key: K): boolean {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn false\n\t\t}\n\t\tthis.valueStore.delete(index)\n\t\tthis.index.delete(key)\n\t\treturn true\n\t}\n\tpublic forEach(callback: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void {\n\t\tfor (const [key, value] of this.entries()) {\n\t\t\tcallback.call(thisArg, value, key, this)\n\t\t}\n\t}\n\n\tpublic get(key: K): V | undefined {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn this.valueStore.get(index)\n\t}\n\tpublic has(key: K): boolean {\n\t\treturn this.index.has(key)\n\t}\n\tpublic getOrInsert(key: K, defaultValue: V): V {\n\t\tconst existing = this.get(key)\n\t\tif (existing !== undefined) {\n\t\t\treturn existing\n\t\t}\n\t\tthis.set(key, defaultValue)\n\t\treturn defaultValue\n\t}\n\n\tpublic getOrInsertComputed(key: K, callback: (key: K) => V): V {\n\t\tconst existing = this.get(key)\n\t\tif (existing !== undefined) {\n\t\t\treturn existing\n\t\t}\n\t\tconst value = callback(key)\n\t\tthis.set(key, value)\n\t\treturn value\n\t}\n\n\tpublic set(key: K, value: V): this {\n\t\tconst existingIndex = this.index.get(key)\n\n\t\tif (existingIndex === undefined) {\n\t\t\tconst newIndex = this.getNewIndex()\n\t\t\tthis.index.set(key, newIndex)\n\t\t\tthis.valueStore.set(newIndex, value)\n\t\t} else {\n\t\t\tthis.valueStore.set(existingIndex, value)\n\t\t}\n\t\treturn this\n\t}\n\n\t// This doesn't use the inverse in order to avoid confusion.\n\t// See the description above.\n\tpublic changeKey(oldKey: K, newKey: K): this {\n\t\tconst index = this.index.get(oldKey)\n\t\tif (index === undefined) {\n\t\t\tthrow new Error()\n\t\t}\n\t\tthis.index.delete(oldKey)\n\t\tthis.index.set(newKey, index)\n\t\treturn this\n\t}\n\n\tpublic changeKeyOrder(newOrder: Iterable<K>) {\n\t\tfor (const key of newOrder) {\n\t\t\tconst keyIndex = this.index.get(key)\n\t\t\tif (keyIndex === undefined) {\n\t\t\t\tthrow new Error()\n\t\t\t}\n\t\t\tconst value = this.valueStore.get(keyIndex)!\n\n\t\t\t// This effectively removes value from wherever it was and puts it at the end.\n\t\t\t// Provided newOrder.size is the same as valueStore, by the end of this loop\n\t\t\t// the values will be in the correct order.\n\t\t\tthis.valueStore.delete(keyIndex)\n\t\t\tthis.valueStore.set(keyIndex, value)\n\t\t}\n\t}\n\n\tpublic *[Symbol.iterator](): MapIterator<[K, V]> {\n\t\tyield* this.entries()\n\t}\n\n\tpublic *entries(): MapIterator<[K, V]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [this.inverse(value), value]\n\t\t}\n\t}\n\n\tpublic *keys(): MapIterator<K> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield this.inverse(value)\n\t\t}\n\t}\n\n\tpublic *values(): MapIterator<V> {\n\t\tfor (const value of this.valueStore.values()) {\n\t\t\tif (value === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tyield value\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;AAAA,IAAA;AAOO,MAAM,oBAA+C;AAAA,EAWpD,YAAY,cAA6D;AAVhF,kBAAA,MAAiB,YAAA;AACjB,kBAAA,MAAiB,OAAA;AACjB,kBAAA,MAAQ,WAAA;AAER,kB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C,YAAM,CAAC,KAAK,QAAQ,KAAK,GAAG,KAAK;AAAA,IAClC;AAAA,EACD;AAAA,EAEA,CAAQ,OAAuB;AAC9B,eAAW,SAAS,KAAK,UAAU;AAClC,YAAM,KAAK,QAAQ,KAAK;AAAA,IACzB;AAAA,EACD;AAAA,EAEA,CAAQ,SAAyB;AAChC,eAAW,SAAS,KAAK,WAAW,OAAA,GAAU;AAC7C,UAAI,UAAU,QAAW;AACxB;AAAA,MACD;AACA,YAAM;AAAA,IACP;AAAA,EACD;AACD;;"}
@@ -55,6 +55,23 @@ class BijectiveIndexedMap {
55
55
  has(key) {
56
56
  return this.index.has(key);
57
57
  }
58
+ getOrInsert(key, defaultValue) {
59
+ const existing = this.get(key);
60
+ if (existing !== void 0) {
61
+ return existing;
62
+ }
63
+ this.set(key, defaultValue);
64
+ return defaultValue;
65
+ }
66
+ getOrInsertComputed(key, callback) {
67
+ const existing = this.get(key);
68
+ if (existing !== void 0) {
69
+ return existing;
70
+ }
71
+ const value = callback(key);
72
+ this.set(key, value);
73
+ return value;
74
+ }
58
75
  set(key, value) {
59
76
  const existingIndex = this.index.get(key);
60
77
  if (existingIndex === void 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"BijectiveIndexedMap.js","sources":["../../../../../packages/utilities/src/structures/BijectiveIndexedMap.ts"],"sourcesContent":["// Bijective as in we need to supply the inverse and also guarantee that the values are unique.\n// Provided this invariant, this should behave more or less like a regular map except it has a somewhat special\n// iteration order. Unlike a regular map, which just honors insertion order, this also provides a special method\n// changeKey. With this, we can change the key under which a value (that is already on the map) is accessible.\n// With an ordinary map, that operation would require us to delete the original [K1, V] pair and insert\n// a new one [K2, V]. That would however change the order of iteration. This main purpose of this data structure is\n// the ability to avoid that and enable the value V to preserve its original place.\nexport class BijectiveIndexedMap<K, V> implements Map<K, V> {\n\tprivate readonly valueStore: Map<number, V>\n\tprivate readonly index: Map<K, number>\n\tprivate indexSeed: number\n\n\tprivate readonly inverse: (value: V) => K\n\n\tpublic readonly [Symbol.toStringTag] = 'BijectiveIndexedMap'\n\n\tpublic constructor(originalMap: BijectiveIndexedMap<K, V>)\n\tpublic constructor(inverse: (value: V) => K)\n\tpublic constructor(inverseOrMap: BijectiveIndexedMap<K, V> | ((value: V) => K)) {\n\t\tif (inverseOrMap instanceof BijectiveIndexedMap) {\n\t\t\tthis.valueStore = new Map(inverseOrMap.valueStore)\n\t\t\tthis.index = new Map(inverseOrMap.index)\n\t\t\tthis.indexSeed = inverseOrMap.indexSeed\n\t\t\tthis.inverse = inverseOrMap.inverse\n\t\t} else {\n\t\t\tthis.valueStore = new Map()\n\t\t\tthis.index = new Map()\n\t\t\tthis.indexSeed = 0\n\t\t\tthis.inverse = inverseOrMap\n\t\t}\n\t}\n\n\tprivate getNewIndex() {\n\t\treturn this.indexSeed++\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.valueStore.size\n\t}\n\n\tpublic clear(): void {\n\t\tthis.valueStore.clear()\n\t\tthis.index.clear()\n\t}\n\tpublic delete(key: K): boolean {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn false\n\t\t}\n\t\tthis.valueStore.delete(index)\n\t\tthis.index.delete(key)\n\t\treturn true\n\t}\n\tpublic forEach(callback: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void {\n\t\tfor (const [key, value] of this.entries()) {\n\t\t\tcallback.call(thisArg, value, key, this)\n\t\t}\n\t}\n\n\tpublic get(key: K): V | undefined {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn this.valueStore.get(index)\n\t}\n\tpublic has(key: K): boolean {\n\t\treturn this.index.has(key)\n\t}\n\tpublic set(key: K, value: V): this {\n\t\tconst existingIndex = this.index.get(key)\n\n\t\tif (existingIndex === undefined) {\n\t\t\tconst newIndex = this.getNewIndex()\n\t\t\tthis.index.set(key, newIndex)\n\t\t\tthis.valueStore.set(newIndex, value)\n\t\t} else {\n\t\t\tthis.valueStore.set(existingIndex, value)\n\t\t}\n\t\treturn this\n\t}\n\n\t// This doesn't use the inverse in order to avoid confusion.\n\t// See the description above.\n\tpublic changeKey(oldKey: K, newKey: K): this {\n\t\tconst index = this.index.get(oldKey)\n\t\tif (index === undefined) {\n\t\t\tthrow new Error()\n\t\t}\n\t\tthis.index.delete(oldKey)\n\t\tthis.index.set(newKey, index)\n\t\treturn this\n\t}\n\n\tpublic changeKeyOrder(newOrder: Iterable<K>) {\n\t\tfor (const key of newOrder) {\n\t\t\tconst keyIndex = this.index.get(key)\n\t\t\tif (keyIndex === undefined) {\n\t\t\t\tthrow new Error()\n\t\t\t}\n\t\t\tconst value = this.valueStore.get(keyIndex)!\n\n\t\t\t// This effectively removes value from wherever it was and puts it at the end.\n\t\t\t// Provided newOrder.size is the same as valueStore, by the end of this loop\n\t\t\t// the values will be in the correct order.\n\t\t\tthis.valueStore.delete(keyIndex)\n\t\t\tthis.valueStore.set(keyIndex, value)\n\t\t}\n\t}\n\n\tpublic *[Symbol.iterator](): MapIterator<[K, V]> {\n\t\tyield* this.entries()\n\t}\n\n\tpublic *entries(): MapIterator<[K, V]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [this.inverse(value), value]\n\t\t}\n\t}\n\n\tpublic *keys(): MapIterator<K> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield this.inverse(value)\n\t\t}\n\t}\n\n\tpublic *values(): MapIterator<V> {\n\t\tfor (const value of this.valueStore.values()) {\n\t\t\tif (value === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tyield value\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;AAAA,IAAA;AAOO,MAAM,oBAA+C;AAAA,EAWpD,YAAY,cAA6D;AAV/D,kBAAA,MAAA,YAAA;AACA,kBAAA,MAAA,OAAA;AACT,kBAAA,MAAA,WAAA;AAES,kBAAA,MAAA,SAAA;AAEjB,kBAAA,MAAiB,IAAsB,qBAAA;AAKtC,QAAI,wBAAwB,qBAAqB;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as in we need to supply the inverse and also guarantee that the values are unique.\n// Provided this invariant, this should behave more or less like a regular map except it has a somewhat special\n// iteration order. Unlike a regular map, which just honors insertion order, this also provides a special method\n// changeKey. With this, we can change the key under which a value (that is already on the map) is accessible.\n// With an ordinary map, that operation would require us to delete the original [K1, V] pair and insert\n// a new one [K2, V]. That would however change the order of iteration. This main purpose of this data structure is\n// the ability to avoid that and enable the value V to preserve its original place.\nexport class BijectiveIndexedMap<K, V> implements Map<K, V> {\n\tprivate readonly valueStore: Map<number, V>\n\tprivate readonly index: Map<K, number>\n\tprivate indexSeed: number\n\n\tprivate readonly inverse: (value: V) => K\n\n\tpublic readonly [Symbol.toStringTag] = 'BijectiveIndexedMap'\n\n\tpublic constructor(originalMap: BijectiveIndexedMap<K, V>)\n\tpublic constructor(inverse: (value: V) => K)\n\tpublic constructor(inverseOrMap: BijectiveIndexedMap<K, V> | ((value: V) => K)) {\n\t\tif (inverseOrMap instanceof BijectiveIndexedMap) {\n\t\t\tthis.valueStore = new Map(inverseOrMap.valueStore)\n\t\t\tthis.index = new Map(inverseOrMap.index)\n\t\t\tthis.indexSeed = inverseOrMap.indexSeed\n\t\t\tthis.inverse = inverseOrMap.inverse\n\t\t} else {\n\t\t\tthis.valueStore = new Map()\n\t\t\tthis.index = new Map()\n\t\t\tthis.indexSeed = 0\n\t\t\tthis.inverse = inverseOrMap\n\t\t}\n\t}\n\n\tprivate getNewIndex() {\n\t\treturn this.indexSeed++\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.valueStore.size\n\t}\n\n\tpublic clear(): void {\n\t\tthis.valueStore.clear()\n\t\tthis.index.clear()\n\t}\n\tpublic delete(key: K): boolean {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn false\n\t\t}\n\t\tthis.valueStore.delete(index)\n\t\tthis.index.delete(key)\n\t\treturn true\n\t}\n\tpublic forEach(callback: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void {\n\t\tfor (const [key, value] of this.entries()) {\n\t\t\tcallback.call(thisArg, value, key, this)\n\t\t}\n\t}\n\n\tpublic get(key: K): V | undefined {\n\t\tconst index = this.index.get(key)\n\n\t\tif (index === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn this.valueStore.get(index)\n\t}\n\tpublic has(key: K): boolean {\n\t\treturn this.index.has(key)\n\t}\n\tpublic getOrInsert(key: K, defaultValue: V): V {\n\t\tconst existing = this.get(key)\n\t\tif (existing !== undefined) {\n\t\t\treturn existing\n\t\t}\n\t\tthis.set(key, defaultValue)\n\t\treturn defaultValue\n\t}\n\n\tpublic getOrInsertComputed(key: K, callback: (key: K) => V): V {\n\t\tconst existing = this.get(key)\n\t\tif (existing !== undefined) {\n\t\t\treturn existing\n\t\t}\n\t\tconst value = callback(key)\n\t\tthis.set(key, value)\n\t\treturn value\n\t}\n\n\tpublic set(key: K, value: V): this {\n\t\tconst existingIndex = this.index.get(key)\n\n\t\tif (existingIndex === undefined) {\n\t\t\tconst newIndex = this.getNewIndex()\n\t\t\tthis.index.set(key, newIndex)\n\t\t\tthis.valueStore.set(newIndex, value)\n\t\t} else {\n\t\t\tthis.valueStore.set(existingIndex, value)\n\t\t}\n\t\treturn this\n\t}\n\n\t// This doesn't use the inverse in order to avoid confusion.\n\t// See the description above.\n\tpublic changeKey(oldKey: K, newKey: K): this {\n\t\tconst index = this.index.get(oldKey)\n\t\tif (index === undefined) {\n\t\t\tthrow new Error()\n\t\t}\n\t\tthis.index.delete(oldKey)\n\t\tthis.index.set(newKey, index)\n\t\treturn this\n\t}\n\n\tpublic changeKeyOrder(newOrder: Iterable<K>) {\n\t\tfor (const key of newOrder) {\n\t\t\tconst keyIndex = this.index.get(key)\n\t\t\tif (keyIndex === undefined) {\n\t\t\t\tthrow new Error()\n\t\t\t}\n\t\t\tconst value = this.valueStore.get(keyIndex)!\n\n\t\t\t// This effectively removes value from wherever it was and puts it at the end.\n\t\t\t// Provided newOrder.size is the same as valueStore, by the end of this loop\n\t\t\t// the values will be in the correct order.\n\t\t\tthis.valueStore.delete(keyIndex)\n\t\t\tthis.valueStore.set(keyIndex, value)\n\t\t}\n\t}\n\n\tpublic *[Symbol.iterator](): MapIterator<[K, V]> {\n\t\tyield* this.entries()\n\t}\n\n\tpublic *entries(): MapIterator<[K, V]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [this.inverse(value), value]\n\t\t}\n\t}\n\n\tpublic *keys(): MapIterator<K> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield this.inverse(value)\n\t\t}\n\t}\n\n\tpublic *values(): MapIterator<V> {\n\t\tfor (const value of this.valueStore.values()) {\n\t\t\tif (value === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tyield value\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;AAAA,IAAA;AAOO,MAAM,oBAA+C;AAAA,EAWpD,YAAY,cAA6D;AAVhF,kBAAA,MAAiB,YAAA;AACjB,kBAAA,MAAiB,OAAA;AACjB,kBAAA,MAAQ,WAAA;AAER,kBAAA,MAAiB,SAAA;AAEjB,kBAAA,MAAiB,IAAsB,qBAAA;AAKtC,QAAI,wBAAwB,qBAAqB;AAChD,WAAK,aAAa,IAAI,IAAI,aAAa,UAAU;AACjD,WAAK,QAAQ,IAAI,IAAI,aAAa,KAAK;AACvC,WAAK,YAAY,aAAa;AAC9B,WAAK,UAAU,aAAa;AAAA,IAC7B,OAAO;AACN,WAAK,iCAAiB,IAAA;AACtB,WAAK,4BAAY,IAAA;AACjB,WAAK,YAAY;AACjB,WAAK,UAAU;AAAA,IAChB;AAAA,EACD;AAAA,EAEQ,cAAc;AACrB,WAAO,KAAK;AAAA,EACb;AAAA,EAEA,IAAW,OAAe;AACzB,WAAO,KAAK,WAAW;AAAA,EACxB;AAAA,EAEO,QAAc;AACpB,SAAK,WAAW,MAAA;AAChB,SAAK,MAAM,MAAA;AAAA,EACZ;AAAA,EACO,OAAO,KAAiB;AAC9B,UAAM,QAAQ,KAAK,MAAM,IAAI,GAAG;AA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5C,UAAM,QAAQ,KAAK,MAAM,IAAI,MAAM;AACnC,QAAI,UAAU,QAAW;AACxB,YAAM,IAAI,MAAA;AAAA,IACX;AACA,SAAK,MAAM,OAAO,MAAM;AACxB,SAAK,MAAM,IAAI,QAAQ,KAAK;AAC5B,WAAO;AAAA,EACR;AAAA,EAEO,eAAe,UAAuB;AAC5C,eAAW,OAAO,UAAU;AAC3B,YAAM,WAAW,KAAK,MAAM,IAAI,GAAG;AACnC,UAAI,aAAa,QAAW;AAC3B,cAAM,IAAI,MAAA;AAAA,MACX;AACA,YAAM,QAAQ,KAAK,WAAW,IAAI,QAAQ;AAK1C,WAAK,WAAW,OAAO,QAAQ;AAC/B,WAAK,WAAW,IAAI,UAAU,KAAK;AAAA,IACpC;AAAA,EACD;AAAA,EAEA,GArHiB,KAAA,OAAO,aAqHf,OAAO,aAAiC;AAChD,WAAO,KAAK,QAAA;AAAA,EACb;AAAA,EAEA,CAAQ,UAA+B;AACtC,eAAW,SAAS,KAAK,UAAU;AAClC,YAAM,CAAC,KAAK,QAAQ,KAAK,GAAG,KAAK;AAAA,IAClC;AAAA,EACD;AAAA,EAEA,CAAQ,OAAuB;AAC9B,eAAW,SAAS,KAAK,UAAU;AAClC,YAAM,KAAK,QAAQ,KAAK;AAAA,IACzB;AAAA,EACD;AAAA,EAEA,CAAQ,SAAyB;AAChC,eAAW,SAAS,KAAK,WAAW,OAAA,GAAU;AAC7C,UAAI,UAAU,QAAW;AACxB;AAAA,MACD;AACA,YAAM;AAAA,IACP;AAAA,EACD;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"LRUCache.cjs","sources":["../../../../../packages/utilities/src/structures/LRUCache.ts"],"sourcesContent":["// This is heavily inspired by https://stackoverflow.com/a/46432113\nexport class LRUCache<Key, Value> {\n\tprivate readonly cache = new Map<Key, Value>()\n\n\tpublic constructor(private readonly maxSize: number) {}\n\n\tpublic get(key: Key): Value | undefined {\n\t\tconst value = this.cache.get(key)\n\n\t\tif (value !== undefined) {\n\t\t\tthis.cache.delete(key)\n\t\t\tthis.cache.set(key, value)\n\t\t}\n\t\treturn value\n\t}\n\n\tpublic set(key: Key, value: Value) {\n\t\tif (this.cache.has(key)) {\n\t\t\tthis.cache.delete(key) // Refresh this key\n\t\t} else if (this.cache.size === this.maxSize) {\n\t\t\tthis.cache.delete(this.getOldestKey()) // Evict the oldest value\n\t\t}\n\t\tthis.cache.set(key, value)\n\t}\n\n\tprivate getOldestKey(): Key {\n\t\treturn this.cache.keys().next().value!\n\t}\n}\n"],"names":[],"mappings":";;;;;AACO,MAAM,SAAqB;AAAA,EAG1B,YAA6B,SAAiB;AAAjB,SAAA,UAAA;AAFnB,kBAAA,MAAA,6BAAY,IAAgB,CAAA;AAAA,EAAA;AAAA,EAItC,IAAI,KAA6B;AACvC,UAAM,QAAQ,KAAK,MAAM,IAAI,GAAG;AAEhC,QAAI,UAAU,QAAW;AACnB,WAAA,MAAM,OAAO,GAAG;AAChB,WAAA,MAAM,IAAI,KAAK,KAAK;AAAA,IAAA;AAEnB,WAAA;AAAA,EAAA;AAAA,EAGD,IAAI,KAAU,OAAc;AAClC,QAAI,KAAK,MAAM,IAAI,GAAG,GAAG;AACnB,WAAA,MAAM,OAAO,GAAG;AAAA,IACX,WAAA,KAAK,MAAM,SAAS,KAAK,SAAS;AAC5C,WAAK,MAAM,OAAO,KAAK,aAAA,CAAc;AAAA,IAAA;AAEjC,SAAA,MAAM,IAAI,KAAK,KAAK;AAAA,EAAA;AAAA,EAGlB,eAAoB;AAC3B,WAAO,KAAK,MAAM,KAAK,EAAE,KAAO,EAAA;AAAA,EAAA;AAElC;;"}
1
+ {"version":3,"file":"LRUCache.cjs","sources":["../../../../../packages/utilities/src/structures/LRUCache.ts"],"sourcesContent":["// This is heavily inspired by https://stackoverflow.com/a/46432113\nexport class LRUCache<Key, Value> {\n\tprivate readonly cache = new Map<Key, Value>()\n\n\tpublic constructor(private readonly maxSize: number) {}\n\n\tpublic get(key: Key): Value | undefined {\n\t\tconst value = this.cache.get(key)\n\n\t\tif (value !== undefined) {\n\t\t\tthis.cache.delete(key)\n\t\t\tthis.cache.set(key, value)\n\t\t}\n\t\treturn value\n\t}\n\n\tpublic set(key: Key, value: Value) {\n\t\tif (this.cache.has(key)) {\n\t\t\tthis.cache.delete(key) // Refresh this key\n\t\t} else if (this.cache.size === this.maxSize) {\n\t\t\tthis.cache.delete(this.getOldestKey()) // Evict the oldest value\n\t\t}\n\t\tthis.cache.set(key, value)\n\t}\n\n\tprivate getOldestKey(): Key {\n\t\treturn this.cache.keys().next().value!\n\t}\n}\n"],"names":[],"mappings":";;;;;AACO,MAAM,SAAqB;AAAA,EAG1B,YAA6B,SAAiB;AAAjB,SAAA,UAAA;AAFpC,kBAAA,MAAiB,6BAAY,IAAA,CAAgB;AAAA,EAES;AAAA,EAE/C,IAAI,KAA6B;AACvC,UAAM,QAAQ,KAAK,MAAM,IAAI,GAAG;AAEhC,QAAI,UAAU,QAAW;AACxB,WAAK,MAAM,OAAO,GAAG;AACrB,WAAK,MAAM,IAAI,KAAK,KAAK;AAAA,IAC1B;AACA,WAAO;AAAA,EACR;AAAA,EAEO,IAAI,KAAU,OAAc;AAClC,QAAI,KAAK,MAAM,IAAI,GAAG,GAAG;AACxB,WAAK,MAAM,OAAO,GAAG;AAAA,IACtB,WAAW,KAAK,MAAM,SAAS,KAAK,SAAS;AAC5C,WAAK,MAAM,OAAO,KAAK,aAAA,CAAc;AAAA,IACtC;AACA,SAAK,MAAM,IAAI,KAAK,KAAK;AAAA,EAC1B;AAAA,EAEQ,eAAoB;AAC3B,WAAO,KAAK,MAAM,KAAA,EAAO,OAAO;AAAA,EACjC;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"LRUCache.js","sources":["../../../../../packages/utilities/src/structures/LRUCache.ts"],"sourcesContent":["// This is heavily inspired by https://stackoverflow.com/a/46432113\nexport class LRUCache<Key, Value> {\n\tprivate readonly cache = new Map<Key, Value>()\n\n\tpublic constructor(private readonly maxSize: number) {}\n\n\tpublic get(key: Key): Value | undefined {\n\t\tconst value = this.cache.get(key)\n\n\t\tif (value !== undefined) {\n\t\t\tthis.cache.delete(key)\n\t\t\tthis.cache.set(key, value)\n\t\t}\n\t\treturn value\n\t}\n\n\tpublic set(key: Key, value: Value) {\n\t\tif (this.cache.has(key)) {\n\t\t\tthis.cache.delete(key) // Refresh this key\n\t\t} else if (this.cache.size === this.maxSize) {\n\t\t\tthis.cache.delete(this.getOldestKey()) // Evict the oldest value\n\t\t}\n\t\tthis.cache.set(key, value)\n\t}\n\n\tprivate getOldestKey(): Key {\n\t\treturn this.cache.keys().next().value!\n\t}\n}\n"],"names":[],"mappings":";;;AACO,MAAM,SAAqB;AAAA,EAG1B,YAA6B,SAAiB;AAAjB,SAAA,UAAA;AAFnB,kBAAA,MAAA,6BAAY,IAAgB,CAAA;AAAA,EAAA;AAAA,EAItC,IAAI,KAA6B;AACvC,UAAM,QAAQ,KAAK,MAAM,IAAI,GAAG;AAEhC,QAAI,UAAU,QAAW;AACnB,WAAA,MAAM,OAAO,GAAG;AAChB,WAAA,MAAM,IAAI,KAAK,KAAK;AAAA,IAAA;AAEnB,WAAA;AAAA,EAAA;AAAA,EAGD,IAAI,KAAU,OAAc;AAClC,QAAI,KAAK,MAAM,IAAI,GAAG,GAAG;AACnB,WAAA,MAAM,OAAO,GAAG;AAAA,IACX,WAAA,KAAK,MAAM,SAAS,KAAK,SAAS;AAC5C,WAAK,MAAM,OAAO,KAAK,aAAA,CAAc;AAAA,IAAA;AAEjC,SAAA,MAAM,IAAI,KAAK,KAAK;AAAA,EAAA;AAAA,EAGlB,eAAoB;AAC3B,WAAO,KAAK,MAAM,KAAK,EAAE,KAAO,EAAA;AAAA,EAAA;AAElC;"}
1
+ {"version":3,"file":"LRUCache.js","sources":["../../../../../packages/utilities/src/structures/LRUCache.ts"],"sourcesContent":["// This is heavily inspired by https://stackoverflow.com/a/46432113\nexport class LRUCache<Key, Value> {\n\tprivate readonly cache = new Map<Key, Value>()\n\n\tpublic constructor(private readonly maxSize: number) {}\n\n\tpublic get(key: Key): Value | undefined {\n\t\tconst value = this.cache.get(key)\n\n\t\tif (value !== undefined) {\n\t\t\tthis.cache.delete(key)\n\t\t\tthis.cache.set(key, value)\n\t\t}\n\t\treturn value\n\t}\n\n\tpublic set(key: Key, value: Value) {\n\t\tif (this.cache.has(key)) {\n\t\t\tthis.cache.delete(key) // Refresh this key\n\t\t} else if (this.cache.size === this.maxSize) {\n\t\t\tthis.cache.delete(this.getOldestKey()) // Evict the oldest value\n\t\t}\n\t\tthis.cache.set(key, value)\n\t}\n\n\tprivate getOldestKey(): Key {\n\t\treturn this.cache.keys().next().value!\n\t}\n}\n"],"names":[],"mappings":";;;AACO,MAAM,SAAqB;AAAA,EAG1B,YAA6B,SAAiB;AAAjB,SAAA,UAAA;AAFpC,kBAAA,MAAiB,6BAAY,IAAA,CAAgB;AAAA,EAES;AAAA,EAE/C,IAAI,KAA6B;AACvC,UAAM,QAAQ,KAAK,MAAM,IAAI,GAAG;AAEhC,QAAI,UAAU,QAAW;AACxB,WAAK,MAAM,OAAO,GAAG;AACrB,WAAK,MAAM,IAAI,KAAK,KAAK;AAAA,IAC1B;AACA,WAAO;AAAA,EACR;AAAA,EAEO,IAAI,KAAU,OAAc;AAClC,QAAI,KAAK,MAAM,IAAI,GAAG,GAAG;AACxB,WAAK,MAAM,OAAO,GAAG;AAAA,IACtB,WAAW,KAAK,MAAM,SAAS,KAAK,SAAS;AAC5C,WAAK,MAAM,OAAO,KAAK,aAAA,CAAc;AAAA,IACtC;AACA,SAAK,MAAM,IAAI,KAAK,KAAK;AAAA,EAC1B;AAAA,EAEQ,eAAoB;AAC3B,WAAO,KAAK,MAAM,KAAA,EAAO,OAAO;AAAA,EACjC;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"WeakIdCache.cjs","sources":["../../../../../packages/utilities/src/structures/WeakIdCache.ts"],"sourcesContent":["export class WeakIdCache<K extends object> {\n\tprivate readonly cache = new WeakMap<K, string>()\n\tprivate seed = 0\n\tprivate readonly rootId = this.seedToId(this.seed++)\n\n\tpublic getId(key: K): string {\n\t\tlet existing = this.cache.get(key)\n\n\t\tif (existing === undefined) {\n\t\t\tthis.cache.set(key, (existing = this.seedToId(this.seed++)))\n\t\t}\n\t\treturn existing\n\t}\n\n\tpublic getOptionalKeyId(key: K | undefined): string {\n\t\tif (key === undefined) {\n\t\t\treturn this.rootId\n\t\t}\n\t\treturn this.getId(key)\n\t}\n\n\tprivate seedToId(seed: number): string {\n\t\treturn seed.toFixed(0)\n\t}\n}\n"],"names":[],"mappings":";;;;;AAAO,MAAM,YAA8B;AAAA,EAApC,cAAA;AACW,kBAAA,MAAA,6BAAY,QAAmB,CAAA;AAChD,kBAAA,MAAQ,QAAO,CAAA;AACf,kBAAA,MAAiB,UAAS,KAAK,SAAS,KAAK,MAAM,CAAA;AAAA,EAAA;AAAA,EAE5C,MAAM,KAAgB;AAC5B,QAAI,WAAW,KAAK,MAAM,IAAI,GAAG;AAEjC,QAAI,aAAa,QAAW;AACtB,WAAA,MAAM,IAAI,KAAM,WAAW,KAAK,SAAS,KAAK,MAAM,CAAE;AAAA,IAAA;AAErD,WAAA;AAAA,EAAA;AAAA,EAGD,iBAAiB,KAA4B;AACnD,QAAI,QAAQ,QAAW;AACtB,aAAO,KAAK;AAAA,IAAA;AAEN,WAAA,KAAK,MAAM,GAAG;AAAA,EAAA;AAAA,EAGd,SAAS,MAAsB;AAC/B,WAAA,KAAK,QAAQ,CAAC;AAAA,EAAA;AAEvB;;"}
1
+ {"version":3,"file":"WeakIdCache.cjs","sources":["../../../../../packages/utilities/src/structures/WeakIdCache.ts"],"sourcesContent":["export class WeakIdCache<K extends object> {\n\tprivate readonly cache = new WeakMap<K, string>()\n\tprivate seed = 0\n\tprivate readonly rootId = this.seedToId(this.seed++)\n\n\tpublic getId(key: K): string {\n\t\tlet existing = this.cache.get(key)\n\n\t\tif (existing === undefined) {\n\t\t\tthis.cache.set(key, existing = this.seedToId(this.seed++))\n\t\t}\n\t\treturn existing\n\t}\n\n\tpublic getOptionalKeyId(key: K | undefined): string {\n\t\tif (key === undefined) {\n\t\t\treturn this.rootId\n\t\t}\n\t\treturn this.getId(key)\n\t}\n\n\tprivate seedToId(seed: number): string {\n\t\treturn seed.toFixed(0)\n\t}\n}\n"],"names":[],"mappings":";;;;;AAAO,MAAM,YAA8B;AAAA,EAApC,cAAA;AACN,kBAAA,MAAiB,6BAAY,QAAA,CAAmB;AAChD,kBAAA,MAAQ,QAAO,CAAA;AACf,kBAAA,MAAiB,UAAS,KAAK,SAAS,KAAK,MAAM,CAAA;AAAA,EAAA;AAAA,EAE5C,MAAM,KAAgB;AAC5B,QAAI,WAAW,KAAK,MAAM,IAAI,GAAG;AAEjC,QAAI,aAAa,QAAW;AAC3B,WAAK,MAAM,IAAI,KAAK,WAAW,KAAK,SAAS,KAAK,MAAM,CAAC;AAAA,IAC1D;AACA,WAAO;AAAA,EACR;AAAA,EAEO,iBAAiB,KAA4B;AACnD,QAAI,QAAQ,QAAW;AACtB,aAAO,KAAK;AAAA,IACb;AACA,WAAO,KAAK,MAAM,GAAG;AAAA,EACtB;AAAA,EAEQ,SAAS,MAAsB;AACtC,WAAO,KAAK,QAAQ,CAAC;AAAA,EACtB;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"WeakIdCache.js","sources":["../../../../../packages/utilities/src/structures/WeakIdCache.ts"],"sourcesContent":["export class WeakIdCache<K extends object> {\n\tprivate readonly cache = new WeakMap<K, string>()\n\tprivate seed = 0\n\tprivate readonly rootId = this.seedToId(this.seed++)\n\n\tpublic getId(key: K): string {\n\t\tlet existing = this.cache.get(key)\n\n\t\tif (existing === undefined) {\n\t\t\tthis.cache.set(key, (existing = this.seedToId(this.seed++)))\n\t\t}\n\t\treturn existing\n\t}\n\n\tpublic getOptionalKeyId(key: K | undefined): string {\n\t\tif (key === undefined) {\n\t\t\treturn this.rootId\n\t\t}\n\t\treturn this.getId(key)\n\t}\n\n\tprivate seedToId(seed: number): string {\n\t\treturn seed.toFixed(0)\n\t}\n}\n"],"names":[],"mappings":";;;AAAO,MAAM,YAA8B;AAAA,EAApC,cAAA;AACW,kBAAA,MAAA,6BAAY,QAAmB,CAAA;AAChD,kBAAA,MAAQ,QAAO,CAAA;AACf,kBAAA,MAAiB,UAAS,KAAK,SAAS,KAAK,MAAM,CAAA;AAAA,EAAA;AAAA,EAE5C,MAAM,KAAgB;AAC5B,QAAI,WAAW,KAAK,MAAM,IAAI,GAAG;AAEjC,QAAI,aAAa,QAAW;AACtB,WAAA,MAAM,IAAI,KAAM,WAAW,KAAK,SAAS,KAAK,MAAM,CAAE;AAAA,IAAA;AAErD,WAAA;AAAA,EAAA;AAAA,EAGD,iBAAiB,KAA4B;AACnD,QAAI,QAAQ,QAAW;AACtB,aAAO,KAAK;AAAA,IAAA;AAEN,WAAA,KAAK,MAAM,GAAG;AAAA,EAAA;AAAA,EAGd,SAAS,MAAsB;AAC/B,WAAA,KAAK,QAAQ,CAAC;AAAA,EAAA;AAEvB;"}
1
+ {"version":3,"file":"WeakIdCache.js","sources":["../../../../../packages/utilities/src/structures/WeakIdCache.ts"],"sourcesContent":["export class WeakIdCache<K extends object> {\n\tprivate readonly cache = new WeakMap<K, string>()\n\tprivate seed = 0\n\tprivate readonly rootId = this.seedToId(this.seed++)\n\n\tpublic getId(key: K): string {\n\t\tlet existing = this.cache.get(key)\n\n\t\tif (existing === undefined) {\n\t\t\tthis.cache.set(key, existing = this.seedToId(this.seed++))\n\t\t}\n\t\treturn existing\n\t}\n\n\tpublic getOptionalKeyId(key: K | undefined): string {\n\t\tif (key === undefined) {\n\t\t\treturn this.rootId\n\t\t}\n\t\treturn this.getId(key)\n\t}\n\n\tprivate seedToId(seed: number): string {\n\t\treturn seed.toFixed(0)\n\t}\n}\n"],"names":[],"mappings":";;;AAAO,MAAM,YAA8B;AAAA,EAApC,cAAA;AACN,kBAAA,MAAiB,6BAAY,QAAA,CAAmB;AAChD,kBAAA,MAAQ,QAAO,CAAA;AACf,kBAAA,MAAiB,UAAS,KAAK,SAAS,KAAK,MAAM,CAAA;AAAA,EAAA;AAAA,EAE5C,MAAM,KAAgB;AAC5B,QAAI,WAAW,KAAK,MAAM,IAAI,GAAG;AAEjC,QAAI,aAAa,QAAW;AAC3B,WAAK,MAAM,IAAI,KAAK,WAAW,KAAK,SAAS,KAAK,MAAM,CAAC;AAAA,IAC1D;AACA,WAAO;AAAA,EACR;AAAA,EAEO,iBAAiB,KAA4B;AACnD,QAAI,QAAQ,QAAW;AACtB,aAAO,KAAK;AAAA,IACb;AACA,WAAO,KAAK,MAAM,GAAG;AAAA,EACtB;AAAA,EAEQ,SAAS,MAAsB;AACtC,WAAO,KAAK,QAAQ,CAAC;AAAA,EACtB;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"deprecate.d.ts","sourceRoot":"","sources":["../../../src/deprecate/deprecate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAYzH"}
1
+ {"version":3,"file":"deprecate.d.ts","sourceRoot":"","sources":["../../../src/deprecate/deprecate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAoBzH"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/deprecate/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,YAAY,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/deprecate/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAA"}
@@ -13,6 +13,8 @@ export declare class BijectiveIndexedMap<K, V> implements Map<K, V> {
13
13
  forEach(callback: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
14
14
  get(key: K): V | undefined;
15
15
  has(key: K): boolean;
16
+ getOrInsert(key: K, defaultValue: V): V;
17
+ getOrInsertComputed(key: K, callback: (key: K) => V): V;
16
18
  set(key: K, value: V): this;
17
19
  changeKey(oldKey: K, newKey: K): this;
18
20
  changeKeyOrder(newOrder: Iterable<K>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"BijectiveIndexedMap.d.ts","sourceRoot":"","sources":["../../../src/structures/BijectiveIndexedMap.ts"],"names":[],"mappings":"AAOA,qBAAa,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAE,YAAW,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;IAC1D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAgB;IAC3C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,SAAS,CAAQ;IAEzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IAEzC,SAAgB,CAAC,MAAM,CAAC,WAAW,CAAC,yBAAwB;gBAEzC,WAAW,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC;gBACtC,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC;IAe3C,OAAO,CAAC,WAAW;IAInB,IAAW,IAAI,IAAI,MAAM,CAExB;IAEM,KAAK,IAAI,IAAI;IAIb,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAUvB,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE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CAAC;IAe3C,OAAO,CAAC,WAAW;IAInB,IAAW,IAAI,IAAI,MAAM,CAExB;IAEM,KAAK,IAAI,IAAI;IAIb,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAUvB,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI;IAMlF,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAQ1B,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO;IAGpB,WAAW,CAAC,GAAG,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC;IASvC,mBAAmB,CAAC,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC;IAUvD,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAe3B,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI;IAUrC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;IAgBnC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAIxC,OAAO,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAM9B,IAAI,IAAI,WAAW,CAAC,CAAC,CAAC;IAMtB,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC;CAQhC"}
@@ -1 +1 @@
1
- {"fileNames":["../../../../node_modules/typescript/lib/lib.es5.d.ts","../../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../../node_modules/typescript/lib/lib.es2024.d.ts","../../../../node_modules/typescript/lib/lib.esnext.d.ts","../../../../node_modules/typescript/lib/lib.dom.d.ts","../../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../../node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../../../node_modules/typescript/lib/lib.esnext.float16.d.ts","../../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../node_modules/@types/react/global.d.ts","../../../../node_modules/csstype/index.d.ts","../../../../node_modules/@types/prop-types/index.d.ts","../../../../node_modules/@types/react/index.d.ts","../../../../node_modules/@types/react/jsx-runtime.d.ts","../../src/assert-types/assertNever.ts","../../src/assert-types/index.ts","../../src/deprecate/types.ts","../../src/deprecate/deprecate.ts","../../src/deprecate/index.ts","../../src/dom/dataAttribute.ts","../../src/dom/svgSizeProps.ts","../../src/dom/index.ts","../../src/structures/BijectiveIndexedMap.ts","../../src/structures/LRUCache.ts","../../src/structures/WeakIdCache.ts","../../src/structures/index.ts","../../src/index.ts","../../src/types/Narrow.ts","../../src/types/NonOptional.ts","../../src/types/Partial.ts","../../src/types/index.ts","../../../../node_modules/vite/types/hmrPayload.d.ts","../../../../node_modules/vite/types/customEvent.d.ts","../../../../node_modules/vite/types/hot.d.ts","../../../../node_modules/vite/types/importGlob.d.ts","../../../../node_modules/vite/types/importMeta.d.ts","../../../../node_modules/vite/client.d.ts"],"fileIdsList":[[81,82,83],[84],[107],[103],[104],[105,106],[85],[85,86],[85,88],[85,88,89],[85,91,92],[85,87,90,93,97],[85,94,95,96],[85,99,100,101]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"8bf8b5e44e3c9c36f98e1007e8b7018c0f38d8adc07aecef42f5200114547c70","impliedFormat":1},{"version":"092c2bfe125ce69dbb1223c85d68d4d2397d7d8411867b5cc03cec902c233763","affectsGlobalScope":true,"impliedFormat":1},{"version":"07f073f19d67f74d732b1adea08e1dc66b1b58d77cb5b43931dee3d798a2fd53","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"df83c2a6c73228b625b0beb6669c7ee2a09c914637e2d35170723ad49c0f5cd4","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"60037901da1a425516449b9a20073aa03386cce92f7a1fd902d7602be3a7c2e9","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"22adec94ef7047a6c9d1af3cb96be87a335908bf9ef386ae9fd50eeb37f44c47","affectsGlobalScope":true,"impliedFormat":1},{"version":"4245fee526a7d1754529d19227ecbf3be066ff79ebb6a380d78e41648f2f224d","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"36a2e4c9a67439aca5f91bb304611d5ae6e20d420503e96c230cf8fcdc948d94","affectsGlobalScope":true,"impliedFormat":1},{"version":"8a8eb4ebffd85e589a1cc7c178e291626c359543403d58c9cd22b81fab5b1fb9","impliedFormat":1},{"version":"65ff5a0aefd7817a03c1ad04fee85c9cdd3ec415cc3c9efec85d8008d4d5e4ee","impliedFormat":1},{"version":"aea201321e7df78b294c9c39c61503ed81fb73b1b1703240013b557dfa25b016","affectsGlobalScope":true,"impliedFormat":1},{"version":"42c169fb8c2d42f4f668c624a9a11e719d5d07dacbebb63cbcf7ef365b0a75b3","impliedFormat":1},{"version":"7be88c2404537cbdca4832137d03286f8c84851efaf83a1f340fabdd3003dc2c","signature":"a95c25e1f9146dd90f7cb36c7e306a25a67bdef1eaae7319a60d2f9d3ff66804"},{"version":"bc99098c23e78a102426f7d1b1b93df0d3369b7ec0bdfc8aa185a3f87fb09ccc","signature":"3436aa850e6d85c1ca81028e1ac6a9ba3ca0cbc27efe797fe99aea0a99a49881"},{"version":"7c1ef2858023d458381a39fc942913615059ce65be3c3438312c8032b44a9003","signature":"624e76b41eb76400df5e0cbacc5f7091e6bd0518e0f9f4ac4a047794b2c189f9"},{"version":"11548231d2005e6247817053a59ac02d30af6258d7a179b53e5a5658d2e2ad2b","signature":"f14113b17b6a1863dd58e49e0bc504f21d51da969bc1fc4af1a07b3684f0de25"},{"version":"f035dfc7958d57f735fde87661307862a05a071093db6d53fd3bbdacf1832a89","signature":"1762533296e00297d454534bdb27ddae5f6b69fef679295094cb0afb4e9a526a"},{"version":"015b058062979c6c5e4a2530175f12b6bb4fe3a245c2e3b3e76c7515c11a1868","signature":"369ae551d795d7eb44e05de3c26d4fddb0f524ea0900826ae6511cdd7d68ab5a"},{"version":"d4be883c6198341aaa9a7b9d4f90b9ae099e22752e438862e3afcf8533f1a07c","signature":"dfe644b96a0786c3ed103bffe7331349022c647802d40030067cf71c9ce79bb5"},{"version":"b054537a7b99d170c21efd871e3741d0ad88636f8a4fd0dfc232a465216aef1b","signature":"893bdae1d9648d1f4da2ddad5647a63282aef8d30df09eacb14fdb68e2349a1d"},{"version":"25fac41b19b5f994710f78fa1635544d738c92b0e98c1f9aab771a14f6349817","signature":"0a52d67559b7ef5541d532dc78fbbfb69d028a4adf1c3501424e355e53e66257"},{"version":"714828297e6484405a8aa6a8f1012d70b1814c399a8e035fe8292777b958370f","signature":"fed47bc1ca2d6c672b7ce3be63f206bd0ad5e67c18c2650eb9d79d842e9d208a"},{"version":"5cb87a77954d8ada89b71c00bbb71a2e01b2fef4be837b22105be4d2aeb73d68","signature":"cd7e9d427302a244cce2881eceae5fbaccf62a7a6064f161a699fe39bad1d998"},{"version":"64e9820a0c959c53c6f07ca0e1fc6b0c755f37627472e365f22bb4d3fecab92c","signature":"fb6bb88e6e41f878eaf58a6c141e0379f208f85f6f922512b3b25efffe70380b"},{"version":"3dfa8f6833975f283fa08acfd4edbdfbbaac85b47e0dcdfbbd5af417aa92180a","signature":"e31346a3e386e227daee4cd99ac59dc7bd0e324541ea401bdf8b623a7e20bf56"},{"version":"a4e528eee9a2b45a402b4d6b119133fd76284ae7db4fece35f55ba782789bb8b","signature":"2530e26913543800e9f329fcaefbffe2904036d62aef1cf97e9738f070295ee7"},{"version":"9b463ec2af65d63c90bada0a7af2bd34e4e04d0170e6561aaeb30447ec9f8751","signature":"c921746b36842e21243970c5ed44b488e842afe99843da3cb7f197242f4f2c9e"},{"version":"d10333dba53eed78f299c62c1c10ca6ce894c42008de73f2760312423bc5b20e","signature":"2ed3dabf6725944e4a6aada55ce34ec864b8f593c7669cab66e690c5dad92077"},{"version":"e2e90315922686542d21abd67ea05b2f290a6b15d9f01474a21b767d36f85e50","signature":"8a84838d3d8d395279c09a7a87737131b7aa680e12848a9b2b0d7bc57cd99e34"},{"version":"02b1133807234b1a7d9bf9b1419ee19444dd8c26b101bc268aa8181591241f1f","impliedFormat":1},{"version":"6222e987b58abfe92597e1273ad7233626285bc2d78409d4a7b113d81a83496b","impliedFormat":1},{"version":"cbe726263ae9a7bf32352380f7e8ab66ee25b3457137e316929269c19e18a2be","impliedFormat":1},{"version":"7f698624bbbb060ece7c0e51b7236520ebada74b747d7523c7df376453ed6fea","impliedFormat":1},{"version":"4025a454b1ca489b179ee8c684bdd70ff8c1967e382076ade53e7e4653e1daec","affectsGlobalScope":true,"impliedFormat":1},{"version":"1eef826bc4a19de22155487984e345a34c9cd511dd1170edc7a447cb8231dd4a","affectsGlobalScope":true,"impliedFormat":99}],"root":[[86,102]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":4,"module":99,"noEmitOnError":true,"noImplicitOverride":true,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":true,"target":7,"useDefineForClassFields":true},"referencedMap":[[84,1],[85,2],[108,3],[104,4],[105,5],[107,6],[86,7],[87,8],[89,9],[90,10],[88,7],[91,7],[93,11],[92,7],[98,12],[94,7],[95,7],[96,7],[97,13],[99,7],[100,7],[101,7],[102,14]],"latestChangedDtsFile":"./types/index.d.ts","version":"5.8.2"}
1
+ {"fileNames":["../../../../node_modules/typescript/lib/lib.es5.d.ts","../../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../../node_modules/typescript/lib/lib.es2024.d.ts","../../../../node_modules/typescript/lib/lib.es2025.d.ts","../../../../node_modules/typescript/lib/lib.esnext.d.ts","../../../../node_modules/typescript/lib/lib.dom.d.ts","../../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../../../node_modules/typescript/lib/lib.es2025.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2025.float16.d.ts","../../../../node_modules/typescript/lib/lib.es2025.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2025.iterator.d.ts","../../../../node_modules/typescript/lib/lib.es2025.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2025.regexp.d.ts","../../../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../../node_modules/typescript/lib/lib.esnext.date.d.ts","../../../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../../node_modules/typescript/lib/lib.esnext.error.d.ts","../../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.esnext.temporal.d.ts","../../../../node_modules/typescript/lib/lib.esnext.typedarrays.d.ts","../../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../node_modules/@types/react/global.d.ts","../../../../node_modules/csstype/index.d.ts","../../../../node_modules/@types/react/index.d.ts","../../../../node_modules/@types/react/jsx-runtime.d.ts","../../src/assert-types/assertNever.ts","../../src/assert-types/index.ts","../../src/deprecate/types.ts","../../src/deprecate/deprecate.ts","../../src/deprecate/index.ts","../../src/dom/dataAttribute.ts","../../src/dom/svgSizeProps.ts","../../src/dom/index.ts","../../src/structures/BijectiveIndexedMap.ts","../../src/structures/LRUCache.ts","../../src/structures/WeakIdCache.ts","../../src/structures/index.ts","../../src/index.ts","../../src/types/Narrow.ts","../../src/types/NonOptional.ts","../../src/types/Partial.ts","../../src/types/index.ts","../../../../node_modules/vite/types/hmrPayload.d.ts","../../../../node_modules/vite/types/customEvent.d.ts","../../../../node_modules/vite/types/hot.d.ts","../../../../node_modules/vite/types/importGlob.d.ts","../../../../node_modules/vite/types/importMeta.d.ts","../../../../node_modules/vite/client.d.ts"],"fileIdsList":[[90,91],[92],[115],[111],[112],[113,114],[93],[93,94],[93,96],[93,96,97],[93,99,100],[93,95,98,101,105],[93,102,103,104],[93,107,108,109]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"1e9332c23e9a907175e0ffc6a49e236f97b48838cc8aec9ce7e4cec21e544b65","impliedFormat":1},{"version":"3753fbc1113dc511214802a2342280a8b284ab9094f6420e7aa171e868679f91","impliedFormat":1},{"version":"999ca32883495a866aa5737fe1babc764a469e4cde6ee6b136a4b9ae68853e4b","impliedFormat":1},{"version":"17f13ecb98cbc39243f2eee1f16d45cd8ec4706b03ee314f1915f1a8b42f6984","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"0bd714129fca875f7d4c477a1a392200b0bcd13fb2e80928cd334b63830ea047","affectsGlobalScope":true,"impliedFormat":1},{"version":"e2c9037ae6cd2c52d80ceef0b3c5ffdb488627d71529cf4f63776daf11161c9a","affectsGlobalScope":true,"impliedFormat":1},{"version":"135d5cf4d345f59f1a9caadfafcd858d3d9cc68290db616cc85797224448cccc","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc238c3f81c2984751932b6aab223cd5b830e0ac6cad76389e5e9d2ffc03287d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4a07f9b76d361f572620927e5735b77d6d2101c23cdd94383eb5b706e7b36357","affectsGlobalScope":true,"impliedFormat":1},{"version":"7c4e8dc6ab834cc6baa0227e030606d29e3e8449a9f67cdf5605ea5493c4db29","affectsGlobalScope":true,"impliedFormat":1},{"version":"de7ba0fd02e06cd9a5bd4ab441ed0e122735786e67dde1e849cced1cd8b46b78","affectsGlobalScope":true,"impliedFormat":1},{"version":"6148e4e88d720a06855071c3db02069434142a8332cf9c182cda551adedf3156","affectsGlobalScope":true,"impliedFormat":1},{"version":"d63dba625b108316a40c95a4425f8d4294e0deeccfd6c7e59d819efa19e23409","affectsGlobalScope":true,"impliedFormat":1},{"version":"0568d6befee03dd435bed4fc25c4e46865b24bdcb8c563fdc21f580a2c301904","affectsGlobalScope":true,"impliedFormat":1},{"version":"30d62269b05b584741f19a5369852d5d34895aa2ac4fd948956f886d15f9cc0d","affectsGlobalScope":true,"impliedFormat":1},{"version":"f128dae7c44d8f35ee42e0a437000a57c9f06cc04f8b4fb42eebf44954d53dc8","affectsGlobalScope":true,"impliedFormat":1},{"version":"ffbe6d7b295306b2ba88030f65b74c107d8d99bdcf596ea99c62a02f606108b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"996fb27b15277369c68a4ba46ed138b4e9e839a02fb4ec756f7997629242fd9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"79b712591b270d4778c89706ca2cfc56ddb8c3f895840e477388f1710dc5eda9","affectsGlobalScope":true,"impliedFormat":1},{"version":"20884846cef428b992b9bd032e70a4ef88e349263f63aeddf04dda837a7dba26","affectsGlobalScope":true,"impliedFormat":1},{"version":"5fcab789c73a97cd43828ee3cc94a61264cf24d4c44472ce64ced0e0f148bdb2","affectsGlobalScope":true,"impliedFormat":1},{"version":"db59a81f070c1880ad645b2c0275022baa6a0c4f0acdc58d29d349c6efcf0903","affectsGlobalScope":true,"impliedFormat":1},{"version":"673294292640f5722b700e7d814e17aaf7d93f83a48a2c9b38f33cbc940ad8b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"d786b48f934cbca483b3c6d0a798cb43bbb4ada283e76fb22c28e53ae05b9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ecb8e347cb6b2a8927c09b86263663289418df375f5e68e11a0ae683776978f","affectsGlobalScope":true,"impliedFormat":1},{"version":"142efd4ce210576f777dc34df121777be89eda476942d6d6663b03dcb53be3ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"379bc41580c2d774f82e828c70308f24a005b490c25ba34d679d84bcf05c3d9d","affectsGlobalScope":true,"impliedFormat":1},{"version":"ed484fb2aa8a1a23d0277056ec3336e0a0b52f9b8d6a961f338a642faf43235d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ffedae1d1c2d53fdbca1c96d3c7dda544281f7d262f99b6880634f8fd8d9820","affectsGlobalScope":true,"impliedFormat":1},{"version":"83a730b125d477dd264df8ba479afab27a3dae7152b005c214ab94dc7ee44fd3","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"7e29f41b158de217f94cb9676bf9cbd0cd9b5a46e1985141ed36e075c52bf6ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac51dd7d31333793807a6abaa5ae168512b6131bd41d9c5b98477fc3b7800f9f","impliedFormat":1},{"version":"dc0a7f107690ee5cd8afc8dbf05c4df78085471ce16bdd9881642ec738bc81fe","impliedFormat":1},{"version":"42c169fb8c2d42f4f668c624a9a11e719d5d07dacbebb63cbcf7ef365b0a75b3","impliedFormat":1},{"version":"7be88c2404537cbdca4832137d03286f8c84851efaf83a1f340fabdd3003dc2c","signature":"a95c25e1f9146dd90f7cb36c7e306a25a67bdef1eaae7319a60d2f9d3ff66804"},{"version":"bc99098c23e78a102426f7d1b1b93df0d3369b7ec0bdfc8aa185a3f87fb09ccc","signature":"3436aa850e6d85c1ca81028e1ac6a9ba3ca0cbc27efe797fe99aea0a99a49881"},{"version":"c41fdc947cb2dcdca6445834e64754bc4ebd9e846304759ead89826c0622ad19","signature":"624e76b41eb76400df5e0cbacc5f7091e6bd0518e0f9f4ac4a047794b2c189f9"},{"version":"f67e23e35f6c9a5d583ef14b187a4da715b8aca10db8dfc9e688c821b389b788","signature":"f14113b17b6a1863dd58e49e0bc504f21d51da969bc1fc4af1a07b3684f0de25"},{"version":"f035dfc7958d57f735fde87661307862a05a071093db6d53fd3bbdacf1832a89","signature":"1762533296e00297d454534bdb27ddae5f6b69fef679295094cb0afb4e9a526a"},{"version":"015b058062979c6c5e4a2530175f12b6bb4fe3a245c2e3b3e76c7515c11a1868","signature":"369ae551d795d7eb44e05de3c26d4fddb0f524ea0900826ae6511cdd7d68ab5a"},{"version":"d4be883c6198341aaa9a7b9d4f90b9ae099e22752e438862e3afcf8533f1a07c","signature":"dfe644b96a0786c3ed103bffe7331349022c647802d40030067cf71c9ce79bb5"},{"version":"b054537a7b99d170c21efd871e3741d0ad88636f8a4fd0dfc232a465216aef1b","signature":"893bdae1d9648d1f4da2ddad5647a63282aef8d30df09eacb14fdb68e2349a1d"},{"version":"497ef8d24b6e3299ae0e93189548d57a8af08ee66a821bdca678f3178efce7b8","signature":"2ba7774faf2cf5494ed860b8bf914938b7f4dee9a15453053bac3925ef6732c2"},{"version":"714828297e6484405a8aa6a8f1012d70b1814c399a8e035fe8292777b958370f","signature":"fed47bc1ca2d6c672b7ce3be63f206bd0ad5e67c18c2650eb9d79d842e9d208a"},{"version":"e744ad6c258236889592904eb2ba715e991af86d665f4a3db12809e3a74f47f1","signature":"cd7e9d427302a244cce2881eceae5fbaccf62a7a6064f161a699fe39bad1d998"},{"version":"64e9820a0c959c53c6f07ca0e1fc6b0c755f37627472e365f22bb4d3fecab92c","signature":"fb6bb88e6e41f878eaf58a6c141e0379f208f85f6f922512b3b25efffe70380b"},{"version":"3dfa8f6833975f283fa08acfd4edbdfbbaac85b47e0dcdfbbd5af417aa92180a","signature":"e31346a3e386e227daee4cd99ac59dc7bd0e324541ea401bdf8b623a7e20bf56"},{"version":"33259faa7186c7aa6eb3e5fb7279da8b413a544474c415143b1fb2e4d05d86a1","signature":"31e322a3343aeb9230e6e06c3a5382b1654026749480de4cce4eb428e2b9cbaf"},{"version":"425caa8f446b1deb03306c88d9688c1a0349d30b01a151d7c2845100b4df7da8","signature":"c921746b36842e21243970c5ed44b488e842afe99843da3cb7f197242f4f2c9e"},{"version":"d10333dba53eed78f299c62c1c10ca6ce894c42008de73f2760312423bc5b20e","signature":"2ed3dabf6725944e4a6aada55ce34ec864b8f593c7669cab66e690c5dad92077"},{"version":"e2e90315922686542d21abd67ea05b2f290a6b15d9f01474a21b767d36f85e50","signature":"8a84838d3d8d395279c09a7a87737131b7aa680e12848a9b2b0d7bc57cd99e34"},{"version":"a7ca8df4f2931bef2aa4118078584d84a0b16539598eaadf7dce9104dfaa381c","impliedFormat":1},{"version":"72950913f4900b680f44d8cab6dd1ea0311698fc1eefb014eb9cdfc37ac4a734","impliedFormat":1},{"version":"36977c14a7f7bfc8c0426ae4343875689949fb699f3f84ecbe5b300ebf9a2c55","impliedFormat":1},{"version":"59f8dc89b9e724a6a667f52cdf4b90b6816ae6c9842ce176d38fcc973669009e","affectsGlobalScope":true,"impliedFormat":1},{"version":"474eba6689e97bf58edd28c90524e70f4fb11820df66752182a1ad1ff9970bb2","affectsGlobalScope":true,"impliedFormat":1},{"version":"1eef826bc4a19de22155487984e345a34c9cd511dd1170edc7a447cb8231dd4a","affectsGlobalScope":true,"impliedFormat":99}],"root":[[94,110]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":4,"module":99,"noEmitOnError":true,"noImplicitOverride":true,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":true,"target":7,"useDefineForClassFields":true},"referencedMap":[[92,1],[93,2],[116,3],[112,4],[113,5],[115,6],[94,7],[95,8],[97,9],[98,10],[96,7],[99,7],[101,11],[100,7],[106,12],[102,7],[103,7],[104,7],[105,13],[107,7],[108,7],[109,7],[110,14]],"latestChangedDtsFile":"./types/index.d.ts","version":"6.0.1-rc"}
@@ -5,6 +5,6 @@ export type Narrowable = string | number | bigint | boolean;
5
5
  type NarrowRaw<A> = (A extends [] ? [] : never) | (A extends Narrowable ? A : never) | ({
6
6
  [K in keyof A]: A[K] extends Function ? A[K] : NarrowRaw<A[K]>;
7
7
  });
8
- export type Narrow<A extends any> = A extends [] ? A : NarrowRaw<A>;
8
+ export type Narrow<A> = A extends [] ? A : NarrowRaw<A>;
9
9
  export {};
10
10
  //# sourceMappingURL=Narrow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Narrow.d.ts","sourceRoot":"","sources":["../../../src/types/Narrow.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,UAAU,GACnB,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,CAAA;AAGV,KAAK,SAAS,CAAC,CAAC,IACb,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC,GAC3B,CAAC,CAAC,SAAS,UAAU,GAAG,CAAC,GAAG,KAAK,CAAC,GAClC,CAAC;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,GACvC,CAAC,CAAC,CAAC,CAAC,GACJ,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC,CAAA;AAGtB,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"Narrow.d.ts","sourceRoot":"","sources":["../../../src/types/Narrow.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,UAAU,GACnB,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,CAAA;AAEV,KAAK,SAAS,CAAC,CAAC,IACb,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC,GAC3B,CAAC,CAAC,SAAS,UAAU,GAAG,CAAC,GAAG,KAAK,CAAC,GAClC,CAAC;KACD,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,GACzC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAClB,CAAC,CAAA;AAEH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@contember/utilities",
3
3
  "license": "Apache-2.0",
4
- "version": "2.1.0-alpha.8",
4
+ "version": "2.1.0-beta.1",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "main": "./dist/production/index.js",
@@ -30,10 +30,10 @@
30
30
  },
31
31
  "repository": {
32
32
  "type": "git",
33
- "url": "https://github.com/contember/interface.git",
33
+ "url": "git+https://github.com/contember/contember.git",
34
34
  "directory": "packages/utilities"
35
35
  },
36
36
  "peerDependencies": {
37
- "react": "^18 || ^19"
37
+ "react": "^19.2.4"
38
38
  }
39
39
  }
@@ -22,9 +22,17 @@ export function deprecate(removal: SemverString, condition: boolean, deprecated:
22
22
  const shouldThrow = Boolean(import.meta.env.VITE_CONTEMBER_ADMIN_STRICT_DEPRECATIONS)
23
23
 
24
24
  if (shouldThrow) {
25
- throw new Error(`Support for ${deprecated} was planned to be removed in the ${removal} release.${replacement ? ` Replace it with ${replacement} instead.` : 'Remove it.'}`)
25
+ throw new Error(
26
+ `Support for ${deprecated} was planned to be removed in the ${removal} release.${
27
+ replacement ? ` Replace it with ${replacement} instead.` : 'Remove it.'
28
+ }`,
29
+ )
26
30
  } else {
27
- console.warn(`Use of ${deprecated} is deprecated and might be removed in the next release.${replacement ? ` Use ${replacement} instead.` : ' There is no replacement.'}`)
31
+ console.warn(
32
+ `Use of ${deprecated} is deprecated and might be removed in the next release.${
33
+ replacement ? ` Use ${replacement} instead.` : ' There is no replacement.'
34
+ }`,
35
+ )
28
36
  }
29
37
  }
30
38
  }
@@ -1,2 +1 @@
1
-
2
1
  export type SemverString = `${number}.${number}.${number}`
@@ -69,6 +69,25 @@ export class BijectiveIndexedMap<K, V> implements Map<K, V> {
69
69
  public has(key: K): boolean {
70
70
  return this.index.has(key)
71
71
  }
72
+ public getOrInsert(key: K, defaultValue: V): V {
73
+ const existing = this.get(key)
74
+ if (existing !== undefined) {
75
+ return existing
76
+ }
77
+ this.set(key, defaultValue)
78
+ return defaultValue
79
+ }
80
+
81
+ public getOrInsertComputed(key: K, callback: (key: K) => V): V {
82
+ const existing = this.get(key)
83
+ if (existing !== undefined) {
84
+ return existing
85
+ }
86
+ const value = callback(key)
87
+ this.set(key, value)
88
+ return value
89
+ }
90
+
72
91
  public set(key: K, value: V): this {
73
92
  const existingIndex = this.index.get(key)
74
93
 
@@ -7,7 +7,7 @@ export class WeakIdCache<K extends object> {
7
7
  let existing = this.cache.get(key)
8
8
 
9
9
  if (existing === undefined) {
10
- this.cache.set(key, (existing = this.seedToId(this.seed++)))
10
+ this.cache.set(key, existing = this.seedToId(this.seed++))
11
11
  }
12
12
  return existing
13
13
  }
@@ -7,13 +7,12 @@ export type Narrowable =
7
7
  | bigint
8
8
  | boolean
9
9
 
10
-
11
10
  type NarrowRaw<A> =
12
11
  | (A extends [] ? [] : never)
13
12
  | (A extends Narrowable ? A : never)
14
- | ({ [K in keyof A]: A[K] extends Function
15
- ? A[K]
16
- : NarrowRaw<A[K]> })
13
+ | ({
14
+ [K in keyof A]: A[K] extends Function ? A[K]
15
+ : NarrowRaw<A[K]>
16
+ })
17
17
 
18
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint
19
- export type Narrow<A extends any> = A extends [] ? A : NarrowRaw<A>
18
+ export type Narrow<A> = A extends [] ? A : NarrowRaw<A>
@@ -3,5 +3,5 @@
3
3
  * and previously optional properties will accept undefined.
4
4
  */
5
5
  export type NonOptional<T> = {
6
- [P in keyof Required<T>]: Pick<T, P> extends Required<Pick<T, P>> ? T[P] : (T[P] | undefined);
6
+ [P in keyof Required<T>]: Pick<T, P> extends Required<Pick<T, P>> ? T[P] : (T[P] | undefined)
7
7
  }
@@ -1,9 +1,8 @@
1
1
  import { describe, expect, test } from 'bun:test'
2
2
  import { dataAttribute } from '../../src'
3
3
 
4
- describe('@contember/utilities', function () {
5
- test('@contember/utilities.dataAttribute', function () {
6
-
4
+ describe('@contember/utilities', function() {
5
+ test('@contember/utilities.dataAttribute', function() {
7
6
  expect(dataAttribute(false)).toBeUndefined()
8
7
  expect(dataAttribute(true)).toBe('')
9
8
  expect(dataAttribute('string')).toBe('string')
@@ -1,8 +1,8 @@
1
1
  import { describe, expect, test } from 'bun:test'
2
2
  import { svgSizeProps } from '../../src'
3
3
 
4
- describe('@contember/utilities', function () {
5
- test('@contember/utilities.svgViewBox', function () {
4
+ describe('@contember/utilities', function() {
5
+ test('@contember/utilities.svgViewBox', function() {
6
6
  expect(svgSizeProps(100)).toEqual({
7
7
  width: 100,
8
8
  height: 100,