@contember/utilities 2.0.0-alpha.2 → 2.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-extractor.json +3 -0
- package/dist/development/index.cjs +10 -33
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +11 -34
- package/dist/development/index.js.map +1 -1
- package/dist/development/src/assert-types/assertNever.cjs.map +1 -0
- package/dist/development/src/assert-types/assertNever.js.map +1 -0
- package/dist/development/{deprecate → src/deprecate}/deprecate.cjs +1 -2
- package/dist/development/src/deprecate/deprecate.cjs.map +1 -0
- package/dist/development/{deprecate → src/deprecate}/deprecate.js +1 -2
- package/dist/development/src/deprecate/deprecate.js.map +1 -0
- package/dist/development/src/dom/dataAttribute.cjs.map +1 -0
- package/dist/development/src/dom/dataAttribute.js.map +1 -0
- package/dist/development/src/dom/svgSizeProps.cjs.map +1 -0
- package/dist/development/src/dom/svgSizeProps.js.map +1 -0
- package/dist/development/src/structures/BijectiveIndexedMap.cjs +116 -0
- package/dist/development/src/structures/BijectiveIndexedMap.cjs.map +1 -0
- package/dist/development/src/structures/BijectiveIndexedMap.js +116 -0
- package/dist/development/src/structures/BijectiveIndexedMap.js.map +1 -0
- package/dist/development/src/structures/LRUCache.cjs +32 -0
- package/dist/development/src/structures/LRUCache.cjs.map +1 -0
- package/dist/development/src/structures/LRUCache.js +32 -0
- package/dist/development/src/structures/LRUCache.js.map +1 -0
- package/dist/development/src/structures/WeakIdCache.cjs +30 -0
- package/dist/development/src/structures/WeakIdCache.cjs.map +1 -0
- package/dist/development/src/structures/WeakIdCache.js +30 -0
- package/dist/development/src/structures/WeakIdCache.js.map +1 -0
- package/dist/production/index.cjs +10 -33
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.js +11 -34
- package/dist/production/index.js.map +1 -1
- package/dist/production/src/assert-types/assertNever.cjs.map +1 -0
- package/dist/production/src/assert-types/assertNever.js.map +1 -0
- package/dist/production/src/deprecate/deprecate.cjs.map +1 -0
- package/dist/production/src/deprecate/deprecate.js.map +1 -0
- package/dist/production/src/dom/dataAttribute.cjs.map +1 -0
- package/dist/production/src/dom/dataAttribute.js.map +1 -0
- package/dist/production/src/dom/svgSizeProps.cjs.map +1 -0
- package/dist/production/src/dom/svgSizeProps.js.map +1 -0
- package/dist/production/src/structures/BijectiveIndexedMap.cjs +116 -0
- package/dist/production/src/structures/BijectiveIndexedMap.cjs.map +1 -0
- package/dist/production/src/structures/BijectiveIndexedMap.js +116 -0
- package/dist/production/src/structures/BijectiveIndexedMap.js.map +1 -0
- package/dist/production/src/structures/LRUCache.cjs +32 -0
- package/dist/production/src/structures/LRUCache.cjs.map +1 -0
- package/dist/production/src/structures/LRUCache.js +32 -0
- package/dist/production/src/structures/LRUCache.js.map +1 -0
- package/dist/production/src/structures/WeakIdCache.cjs +30 -0
- package/dist/production/src/structures/WeakIdCache.cjs.map +1 -0
- package/dist/production/src/structures/WeakIdCache.js +30 -0
- package/dist/production/src/structures/WeakIdCache.js.map +1 -0
- package/dist/types/assert-types/index.d.ts +0 -4
- package/dist/types/assert-types/index.d.ts.map +1 -1
- package/dist/types/dom/index.d.ts +0 -4
- package/dist/types/dom/index.d.ts.map +1 -1
- package/dist/types/dom/svgSizeProps.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/structures/BijectiveIndexedMap.d.ts +24 -0
- package/dist/types/structures/BijectiveIndexedMap.d.ts.map +1 -0
- package/dist/types/structures/LRUCache.d.ts +9 -0
- package/dist/types/structures/LRUCache.d.ts.map +1 -0
- package/dist/types/structures/WeakIdCache.d.ts +9 -0
- package/dist/types/structures/WeakIdCache.d.ts.map +1 -0
- package/dist/types/structures/index.d.ts +4 -0
- package/dist/types/structures/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/types/index.d.ts +0 -1
- package/dist/types/types/index.d.ts.map +1 -1
- package/package.json +4 -12
- package/src/assert-types/index.ts +0 -4
- package/src/dom/index.ts +0 -4
- package/src/dom/svgSizeProps.ts +3 -3
- package/src/index.ts +1 -6
- package/src/structures/BijectiveIndexedMap.ts +137 -0
- package/src/structures/LRUCache.ts +29 -0
- package/src/structures/WeakIdCache.ts +25 -0
- package/src/structures/index.ts +3 -0
- package/src/tsconfig.json +4 -1
- package/src/types/index.ts +0 -1
- package/tests/dom/dataAttribute.test.ts +13 -0
- package/tests/dom/svgSizeProps.test.ts +22 -0
- package/tests/tsconfig.json +10 -0
- package/tsconfig.json +8 -0
- package/tsdoc.json +6 -0
- package/vitest.config.ts +3 -0
- package/dist/development/assert-types/AssertionError.cjs +0 -9
- package/dist/development/assert-types/AssertionError.cjs.map +0 -1
- package/dist/development/assert-types/AssertionError.js +0 -9
- package/dist/development/assert-types/AssertionError.js.map +0 -1
- package/dist/development/assert-types/Predicates.cjs +0 -7
- package/dist/development/assert-types/Predicates.cjs.map +0 -1
- package/dist/development/assert-types/Predicates.js +0 -7
- package/dist/development/assert-types/Predicates.js.map +0 -1
- package/dist/development/assert-types/assert.cjs +0 -10
- package/dist/development/assert-types/assert.cjs.map +0 -1
- package/dist/development/assert-types/assert.js +0 -10
- package/dist/development/assert-types/assert.js.map +0 -1
- package/dist/development/assert-types/assertNever.cjs.map +0 -1
- package/dist/development/assert-types/assertNever.js.map +0 -1
- package/dist/development/css-utilities/px.cjs +0 -7
- package/dist/development/css-utilities/px.cjs.map +0 -1
- package/dist/development/css-utilities/px.js +0 -7
- package/dist/development/css-utilities/px.js.map +0 -1
- package/dist/development/data-utilities/dateToStringWithoutTimezone.cjs +0 -20
- package/dist/development/data-utilities/dateToStringWithoutTimezone.cjs.map +0 -1
- package/dist/development/data-utilities/dateToStringWithoutTimezone.js +0 -20
- package/dist/development/data-utilities/dateToStringWithoutTimezone.js.map +0 -1
- package/dist/development/deprecate/deprecate.cjs.map +0 -1
- package/dist/development/deprecate/deprecate.js.map +0 -1
- package/dist/development/dom/dataAttribute.cjs.map +0 -1
- package/dist/development/dom/dataAttribute.js.map +0 -1
- package/dist/development/dom/getElementDimensions.cjs +0 -22
- package/dist/development/dom/getElementDimensions.cjs.map +0 -1
- package/dist/development/dom/getElementDimensions.js +0 -22
- package/dist/development/dom/getElementDimensions.js.map +0 -1
- package/dist/development/dom/getSizeFromResizeObserverEntry.cjs +0 -24
- package/dist/development/dom/getSizeFromResizeObserverEntry.cjs.map +0 -1
- package/dist/development/dom/getSizeFromResizeObserverEntry.js +0 -24
- package/dist/development/dom/getSizeFromResizeObserverEntry.js.map +0 -1
- package/dist/development/dom/shouldCancelStart.cjs +0 -29
- package/dist/development/dom/shouldCancelStart.cjs.map +0 -1
- package/dist/development/dom/shouldCancelStart.js +0 -29
- package/dist/development/dom/shouldCancelStart.js.map +0 -1
- package/dist/development/dom/stateDataAttributes.cjs +0 -11
- package/dist/development/dom/stateDataAttributes.cjs.map +0 -1
- package/dist/development/dom/stateDataAttributes.js +0 -11
- package/dist/development/dom/stateDataAttributes.js.map +0 -1
- package/dist/development/dom/svgSizeProps.cjs.map +0 -1
- package/dist/development/dom/svgSizeProps.js.map +0 -1
- package/dist/development/events/isSpecialLinkClick.cjs +0 -5
- package/dist/development/events/isSpecialLinkClick.cjs.map +0 -1
- package/dist/development/events/isSpecialLinkClick.js +0 -5
- package/dist/development/events/isSpecialLinkClick.js.map +0 -1
- package/dist/development/functional/omit.cjs +0 -15
- package/dist/development/functional/omit.cjs.map +0 -1
- package/dist/development/functional/omit.js +0 -15
- package/dist/development/functional/omit.js.map +0 -1
- package/dist/development/functional/pick.cjs +0 -15
- package/dist/development/functional/pick.cjs.map +0 -1
- package/dist/development/functional/pick.js +0 -15
- package/dist/development/functional/pick.js.map +0 -1
- package/dist/development/functional/range.cjs +0 -7
- package/dist/development/functional/range.cjs.map +0 -1
- package/dist/development/functional/range.js +0 -7
- package/dist/development/functional/range.js.map +0 -1
- package/dist/development/string-utilities/kebabCase.cjs +0 -8
- package/dist/development/string-utilities/kebabCase.cjs.map +0 -1
- package/dist/development/string-utilities/kebabCase.js +0 -8
- package/dist/development/string-utilities/kebabCase.js.map +0 -1
- package/dist/production/assert-types/AssertionError.cjs +0 -9
- package/dist/production/assert-types/AssertionError.cjs.map +0 -1
- package/dist/production/assert-types/AssertionError.js +0 -9
- package/dist/production/assert-types/AssertionError.js.map +0 -1
- package/dist/production/assert-types/Predicates.cjs +0 -7
- package/dist/production/assert-types/Predicates.cjs.map +0 -1
- package/dist/production/assert-types/Predicates.js +0 -7
- package/dist/production/assert-types/Predicates.js.map +0 -1
- package/dist/production/assert-types/assert.cjs +0 -10
- package/dist/production/assert-types/assert.cjs.map +0 -1
- package/dist/production/assert-types/assert.js +0 -10
- package/dist/production/assert-types/assert.js.map +0 -1
- package/dist/production/assert-types/assertNever.cjs.map +0 -1
- package/dist/production/assert-types/assertNever.js.map +0 -1
- package/dist/production/css-utilities/px.cjs +0 -7
- package/dist/production/css-utilities/px.cjs.map +0 -1
- package/dist/production/css-utilities/px.js +0 -7
- package/dist/production/css-utilities/px.js.map +0 -1
- package/dist/production/data-utilities/dateToStringWithoutTimezone.cjs +0 -20
- package/dist/production/data-utilities/dateToStringWithoutTimezone.cjs.map +0 -1
- package/dist/production/data-utilities/dateToStringWithoutTimezone.js +0 -20
- package/dist/production/data-utilities/dateToStringWithoutTimezone.js.map +0 -1
- package/dist/production/deprecate/deprecate.cjs.map +0 -1
- package/dist/production/deprecate/deprecate.js.map +0 -1
- package/dist/production/dom/dataAttribute.cjs.map +0 -1
- package/dist/production/dom/dataAttribute.js.map +0 -1
- package/dist/production/dom/getElementDimensions.cjs +0 -22
- package/dist/production/dom/getElementDimensions.cjs.map +0 -1
- package/dist/production/dom/getElementDimensions.js +0 -22
- package/dist/production/dom/getElementDimensions.js.map +0 -1
- package/dist/production/dom/getSizeFromResizeObserverEntry.cjs +0 -24
- package/dist/production/dom/getSizeFromResizeObserverEntry.cjs.map +0 -1
- package/dist/production/dom/getSizeFromResizeObserverEntry.js +0 -24
- package/dist/production/dom/getSizeFromResizeObserverEntry.js.map +0 -1
- package/dist/production/dom/shouldCancelStart.cjs +0 -29
- package/dist/production/dom/shouldCancelStart.cjs.map +0 -1
- package/dist/production/dom/shouldCancelStart.js +0 -29
- package/dist/production/dom/shouldCancelStart.js.map +0 -1
- package/dist/production/dom/stateDataAttributes.cjs +0 -11
- package/dist/production/dom/stateDataAttributes.cjs.map +0 -1
- package/dist/production/dom/stateDataAttributes.js +0 -11
- package/dist/production/dom/stateDataAttributes.js.map +0 -1
- package/dist/production/dom/svgSizeProps.cjs.map +0 -1
- package/dist/production/dom/svgSizeProps.js.map +0 -1
- package/dist/production/events/isSpecialLinkClick.cjs +0 -5
- package/dist/production/events/isSpecialLinkClick.cjs.map +0 -1
- package/dist/production/events/isSpecialLinkClick.js +0 -5
- package/dist/production/events/isSpecialLinkClick.js.map +0 -1
- package/dist/production/functional/omit.cjs +0 -15
- package/dist/production/functional/omit.cjs.map +0 -1
- package/dist/production/functional/omit.js +0 -15
- package/dist/production/functional/omit.js.map +0 -1
- package/dist/production/functional/pick.cjs +0 -15
- package/dist/production/functional/pick.cjs.map +0 -1
- package/dist/production/functional/pick.js +0 -15
- package/dist/production/functional/pick.js.map +0 -1
- package/dist/production/functional/range.cjs +0 -7
- package/dist/production/functional/range.cjs.map +0 -1
- package/dist/production/functional/range.js +0 -7
- package/dist/production/functional/range.js.map +0 -1
- package/dist/production/string-utilities/kebabCase.cjs +0 -8
- package/dist/production/string-utilities/kebabCase.cjs.map +0 -1
- package/dist/production/string-utilities/kebabCase.js +0 -8
- package/dist/production/string-utilities/kebabCase.js.map +0 -1
- package/dist/types/assert-types/AssertionError.d.ts +0 -4
- package/dist/types/assert-types/AssertionError.d.ts.map +0 -1
- package/dist/types/assert-types/Predicates.d.ts +0 -2
- package/dist/types/assert-types/Predicates.d.ts.map +0 -1
- package/dist/types/assert-types/assert.d.ts +0 -3
- package/dist/types/assert-types/assert.d.ts.map +0 -1
- package/dist/types/assert-types/types.d.ts +0 -2
- package/dist/types/assert-types/types.d.ts.map +0 -1
- package/dist/types/css-utilities/index.d.ts +0 -2
- package/dist/types/css-utilities/index.d.ts.map +0 -1
- package/dist/types/css-utilities/px.d.ts +0 -8
- package/dist/types/css-utilities/px.d.ts.map +0 -1
- package/dist/types/data-utilities/dateToStringWithoutTimezone.d.ts +0 -4
- package/dist/types/data-utilities/dateToStringWithoutTimezone.d.ts.map +0 -1
- package/dist/types/data-utilities/index.d.ts +0 -2
- package/dist/types/data-utilities/index.d.ts.map +0 -1
- package/dist/types/dom/getElementDimensions.d.ts +0 -14
- package/dist/types/dom/getElementDimensions.d.ts.map +0 -1
- package/dist/types/dom/getSizeFromResizeObserverEntry.d.ts +0 -5
- package/dist/types/dom/getSizeFromResizeObserverEntry.d.ts.map +0 -1
- package/dist/types/dom/shouldCancelStart.d.ts +0 -4
- package/dist/types/dom/shouldCancelStart.d.ts.map +0 -1
- package/dist/types/dom/stateDataAttributes.d.ts +0 -4
- package/dist/types/dom/stateDataAttributes.d.ts.map +0 -1
- package/dist/types/events/index.d.ts +0 -2
- package/dist/types/events/index.d.ts.map +0 -1
- package/dist/types/events/isSpecialLinkClick.d.ts +0 -2
- package/dist/types/events/isSpecialLinkClick.d.ts.map +0 -1
- package/dist/types/functional/index.d.ts +0 -4
- package/dist/types/functional/index.d.ts.map +0 -1
- package/dist/types/functional/omit.d.ts +0 -2
- package/dist/types/functional/omit.d.ts.map +0 -1
- package/dist/types/functional/pick.d.ts +0 -2
- package/dist/types/functional/pick.d.ts.map +0 -1
- package/dist/types/functional/range.d.ts +0 -9
- package/dist/types/functional/range.d.ts.map +0 -1
- package/dist/types/string-utilities/index.d.ts +0 -2
- package/dist/types/string-utilities/index.d.ts.map +0 -1
- package/dist/types/string-utilities/kebabCase.d.ts +0 -2
- package/dist/types/string-utilities/kebabCase.d.ts.map +0 -1
- package/dist/types/types/PolymorphicRefs.d.ts +0 -47
- package/dist/types/types/PolymorphicRefs.d.ts.map +0 -1
- package/src/assert-types/AssertionError.ts +0 -5
- package/src/assert-types/Predicates.ts +0 -3
- package/src/assert-types/assert.ts +0 -15
- package/src/assert-types/types.ts +0 -1
- package/src/css-utilities/index.ts +0 -1
- package/src/css-utilities/px.ts +0 -9
- package/src/data-utilities/dateToStringWithoutTimezone.ts +0 -18
- package/src/data-utilities/index.ts +0 -1
- package/src/dom/getElementDimensions.ts +0 -36
- package/src/dom/getSizeFromResizeObserverEntry.ts +0 -26
- package/src/dom/shouldCancelStart.ts +0 -32
- package/src/dom/stateDataAttributes.ts +0 -8
- package/src/events/index.ts +0 -1
- package/src/events/isSpecialLinkClick.ts +0 -1
- package/src/functional/index.ts +0 -3
- package/src/functional/omit.ts +0 -13
- package/src/functional/pick.ts +0 -13
- package/src/functional/range.ts +0 -11
- package/src/string-utilities/index.ts +0 -1
- package/src/string-utilities/kebabCase.ts +0 -5
- package/src/types/PolymorphicRefs.ts +0 -70
- /package/dist/development/{assert-types → src/assert-types}/assertNever.cjs +0 -0
- /package/dist/development/{assert-types → src/assert-types}/assertNever.js +0 -0
- /package/dist/development/{dom → src/dom}/dataAttribute.cjs +0 -0
- /package/dist/development/{dom → src/dom}/dataAttribute.js +0 -0
- /package/dist/development/{dom → src/dom}/svgSizeProps.cjs +0 -0
- /package/dist/development/{dom → src/dom}/svgSizeProps.js +0 -0
- /package/dist/production/{assert-types → src/assert-types}/assertNever.cjs +0 -0
- /package/dist/production/{assert-types → src/assert-types}/assertNever.js +0 -0
- /package/dist/production/{deprecate → src/deprecate}/deprecate.cjs +0 -0
- /package/dist/production/{deprecate → src/deprecate}/deprecate.js +0 -0
- /package/dist/production/{dom → src/dom}/dataAttribute.cjs +0 -0
- /package/dist/production/{dom → src/dom}/dataAttribute.js +0 -0
- /package/dist/production/{dom → src/dom}/svgSizeProps.cjs +0 -0
- /package/dist/production/{dom → src/dom}/svgSizeProps.js +0 -0
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const AssertionError = require("./AssertionError.cjs");
|
|
4
|
-
function assert(that = void 0, value, predicate) {
|
|
5
|
-
if (!predicate(value)) {
|
|
6
|
-
throw new AssertionError.AssertionError(value, that);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
exports.assert = assert;
|
|
10
|
-
//# sourceMappingURL=assert.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assert.cjs","sources":["../../../src/assert-types/assert.ts"],"sourcesContent":["import { AssertionError } from './AssertionError'\nimport { Predicate } from './types'\n\nexport function assert<\n\tIn,\n\tOut extends In\n>(\n\tthat: string | undefined = undefined,\n\tvalue: In,\n\tpredicate: Predicate<In, Out>, // (value: In) => value is Out,\n): asserts value is Out {\n\tif (!predicate(value)) {\n\t\tthrow new AssertionError(value, that)\n\t}\n}\n"],"names":["AssertionError"],"mappings":";;;AAGO,SAAS,OAIf,OAA2B,QAC3B,OACA,WACuB;AACnB,MAAA,CAAC,UAAU,KAAK,GAAG;AAChB,UAAA,IAAIA,eAAe,eAAA,OAAO,IAAI;AAAA,EACrC;AACD;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assert.js","sources":["../../../src/assert-types/assert.ts"],"sourcesContent":["import { AssertionError } from './AssertionError'\nimport { Predicate } from './types'\n\nexport function assert<\n\tIn,\n\tOut extends In\n>(\n\tthat: string | undefined = undefined,\n\tvalue: In,\n\tpredicate: Predicate<In, Out>, // (value: In) => value is Out,\n): asserts value is Out {\n\tif (!predicate(value)) {\n\t\tthrow new AssertionError(value, that)\n\t}\n}\n"],"names":[],"mappings":";AAGO,SAAS,OAIf,OAA2B,QAC3B,OACA,WACuB;AACnB,MAAA,CAAC,UAAU,KAAK,GAAG;AAChB,UAAA,IAAI,eAAe,OAAO,IAAI;AAAA,EACrC;AACD;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assertNever.cjs","sources":["../../../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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assertNever.js","sources":["../../../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,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
function px(value) {
|
|
4
|
-
return typeof value === "number" && !(isNaN(value) || value === Infinity || value === -Infinity) ? value + "px" : "";
|
|
5
|
-
}
|
|
6
|
-
exports.px = px;
|
|
7
|
-
//# sourceMappingURL=px.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"px.cjs","sources":["../../../src/css-utilities/px.ts"],"sourcesContent":["/**\n * Converts a value to a string in the format '10px'\n *\n * @param value - The value to convert to a string.\n * @returns Returns a string in the format '10px' or '' when value is falsy.\n */\nexport function px<V extends number | false | null | undefined>(value?: V): string {\n\treturn typeof value === 'number' && !(isNaN(value) || value === Infinity || value === -Infinity) ? value + 'px' : ''\n}\n"],"names":[],"mappings":";;AAMO,SAAS,GAAgD,OAAmB;AAClF,SAAO,OAAO,UAAU,YAAY,EAAE,MAAM,KAAK,KAAK,UAAU,YAAY,UAAU,aAAa,QAAQ,OAAO;AACnH;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"px.js","sources":["../../../src/css-utilities/px.ts"],"sourcesContent":["/**\n * Converts a value to a string in the format '10px'\n *\n * @param value - The value to convert to a string.\n * @returns Returns a string in the format '10px' or '' when value is falsy.\n */\nexport function px<V extends number | false | null | undefined>(value?: V): string {\n\treturn typeof value === 'number' && !(isNaN(value) || value === Infinity || value === -Infinity) ? value + 'px' : ''\n}\n"],"names":[],"mappings":"AAMO,SAAS,GAAgD,OAAmB;AAClF,SAAO,OAAO,UAAU,YAAY,EAAE,MAAM,KAAK,KAAK,UAAU,YAAY,UAAU,aAAa,QAAQ,OAAO;AACnH;"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const dateToStringWithoutTimezone = (date, { includeTime } = {}) => {
|
|
4
|
-
const [year, month, day] = [
|
|
5
|
-
date.getFullYear(),
|
|
6
|
-
(date.getMonth() + 1).toFixed(0).padStart(2, "0"),
|
|
7
|
-
date.getDate().toFixed(0).padStart(2, "0")
|
|
8
|
-
];
|
|
9
|
-
let serialized = `${year}-${month}-${day}`;
|
|
10
|
-
if (includeTime) {
|
|
11
|
-
const [hours, minutes] = [
|
|
12
|
-
date.getHours().toFixed(0).padStart(2, "0"),
|
|
13
|
-
date.getMinutes().toFixed(0).padStart(2, "0")
|
|
14
|
-
];
|
|
15
|
-
serialized += ` ${hours}:${minutes}`;
|
|
16
|
-
}
|
|
17
|
-
return serialized;
|
|
18
|
-
};
|
|
19
|
-
exports.dateToStringWithoutTimezone = dateToStringWithoutTimezone;
|
|
20
|
-
//# sourceMappingURL=dateToStringWithoutTimezone.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dateToStringWithoutTimezone.cjs","sources":["../../../src/data-utilities/dateToStringWithoutTimezone.ts"],"sourcesContent":["export const dateToStringWithoutTimezone = (date: Date, { includeTime }: { includeTime?: boolean } = {}): string => {\n\tconst [year, month, day] = [\n\t\tdate.getFullYear(),\n\t\t(date.getMonth() + 1).toFixed(0).padStart(2, '0'),\n\t\tdate.getDate().toFixed(0).padStart(2, '0'),\n\t]\n\tlet serialized = `${year}-${month}-${day}`\n\n\tif (includeTime) {\n\t\tconst [hours, minutes] = [\n\t\t\tdate.getHours().toFixed(0).padStart(2, '0'),\n\t\t\tdate.getMinutes().toFixed(0).padStart(2, '0'),\n\t\t]\n\t\tserialized += ` ${hours}:${minutes}`\n\t}\n\n\treturn serialized\n}\n"],"names":[],"mappings":";;AAAO,MAAM,8BAA8B,CAAC,MAAY,EAAE,YAAY,IAA+B,CAAA,MAAe;AACnH,QAAM,CAAC,MAAM,OAAO,GAAG,IAAI;AAAA,IAC1B,KAAK,YAAY;AAAA,KAChB,KAAK,SAAa,IAAA,GAAG,QAAQ,CAAC,EAAE,SAAS,GAAG,GAAG;AAAA,IAChD,KAAK,UAAU,QAAQ,CAAC,EAAE,SAAS,GAAG,GAAG;AAAA,EAAA;AAE1C,MAAI,aAAa,GAAG,IAAI,IAAI,KAAK,IAAI,GAAG;AAExC,MAAI,aAAa;AACV,UAAA,CAAC,OAAO,OAAO,IAAI;AAAA,MACxB,KAAK,WAAW,QAAQ,CAAC,EAAE,SAAS,GAAG,GAAG;AAAA,MAC1C,KAAK,aAAa,QAAQ,CAAC,EAAE,SAAS,GAAG,GAAG;AAAA,IAAA;AAE/B,kBAAA,IAAI,KAAK,IAAI,OAAO;AAAA,EACnC;AAEO,SAAA;AACR;;"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const dateToStringWithoutTimezone = (date, { includeTime } = {}) => {
|
|
2
|
-
const [year, month, day] = [
|
|
3
|
-
date.getFullYear(),
|
|
4
|
-
(date.getMonth() + 1).toFixed(0).padStart(2, "0"),
|
|
5
|
-
date.getDate().toFixed(0).padStart(2, "0")
|
|
6
|
-
];
|
|
7
|
-
let serialized = `${year}-${month}-${day}`;
|
|
8
|
-
if (includeTime) {
|
|
9
|
-
const [hours, minutes] = [
|
|
10
|
-
date.getHours().toFixed(0).padStart(2, "0"),
|
|
11
|
-
date.getMinutes().toFixed(0).padStart(2, "0")
|
|
12
|
-
];
|
|
13
|
-
serialized += ` ${hours}:${minutes}`;
|
|
14
|
-
}
|
|
15
|
-
return serialized;
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
dateToStringWithoutTimezone
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=dateToStringWithoutTimezone.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dateToStringWithoutTimezone.js","sources":["../../../src/data-utilities/dateToStringWithoutTimezone.ts"],"sourcesContent":["export const dateToStringWithoutTimezone = (date: Date, { includeTime }: { includeTime?: boolean } = {}): string => {\n\tconst [year, month, day] = [\n\t\tdate.getFullYear(),\n\t\t(date.getMonth() + 1).toFixed(0).padStart(2, '0'),\n\t\tdate.getDate().toFixed(0).padStart(2, '0'),\n\t]\n\tlet serialized = `${year}-${month}-${day}`\n\n\tif (includeTime) {\n\t\tconst [hours, minutes] = [\n\t\t\tdate.getHours().toFixed(0).padStart(2, '0'),\n\t\t\tdate.getMinutes().toFixed(0).padStart(2, '0'),\n\t\t]\n\t\tserialized += ` ${hours}:${minutes}`\n\t}\n\n\treturn serialized\n}\n"],"names":[],"mappings":"AAAO,MAAM,8BAA8B,CAAC,MAAY,EAAE,YAAY,IAA+B,CAAA,MAAe;AACnH,QAAM,CAAC,MAAM,OAAO,GAAG,IAAI;AAAA,IAC1B,KAAK,YAAY;AAAA,KAChB,KAAK,SAAa,IAAA,GAAG,QAAQ,CAAC,EAAE,SAAS,GAAG,GAAG;AAAA,IAChD,KAAK,UAAU,QAAQ,CAAC,EAAE,SAAS,GAAG,GAAG;AAAA,EAAA;AAE1C,MAAI,aAAa,GAAG,IAAI,IAAI,KAAK,IAAI,GAAG;AAExC,MAAI,aAAa;AACV,UAAA,CAAC,OAAO,OAAO,IAAI;AAAA,MACxB,KAAK,WAAW,QAAQ,CAAC,EAAE,SAAS,GAAG,GAAG;AAAA,MAC1C,KAAK,aAAa,QAAQ,CAAC,EAAE,SAAS,GAAG,GAAG;AAAA,IAAA;AAE/B,kBAAA,IAAI,KAAK,IAAI,OAAO;AAAA,EACnC;AAEO,SAAA;AACR;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deprecate.cjs","sources":["../../../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,+BAAgB,wCAAwC;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,MACzK;AAAA,IACD;AAAA,EACD;AACD;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deprecate.js","sources":["../../../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,+BAAgB,wCAAwC;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,MACzK;AAAA,IACD;AAAA,EACD;AACD;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dataAttribute.cjs","sources":["../../../src/dom/dataAttribute.ts"],"sourcesContent":["export 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":";;AAAO,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,EACpB;AACD;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dataAttribute.js","sources":["../../../src/dom/dataAttribute.ts"],"sourcesContent":["export 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":"AAAO,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,EACpB;AACD;"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
function getElementDimensionsCallback(element, callback) {
|
|
4
|
-
const observer = new IntersectionObserver((entries, observer2) => {
|
|
5
|
-
if (entries.length === 1) {
|
|
6
|
-
callback(entries[0].boundingClientRect);
|
|
7
|
-
} else {
|
|
8
|
-
const entry = entries.find((entry2) => entry2.boundingClientRect.width > 0 || entry2.boundingClientRect.height > 0) || entries[0];
|
|
9
|
-
callback(entry.boundingClientRect);
|
|
10
|
-
}
|
|
11
|
-
observer2.disconnect();
|
|
12
|
-
});
|
|
13
|
-
observer.observe(element);
|
|
14
|
-
}
|
|
15
|
-
function getElementDimensions(element) {
|
|
16
|
-
return new Promise((resolve) => {
|
|
17
|
-
getElementDimensionsCallback(element, resolve);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
exports.getElementDimensions = getElementDimensions;
|
|
21
|
-
exports.getElementDimensionsCallback = getElementDimensionsCallback;
|
|
22
|
-
//# sourceMappingURL=getElementDimensions.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getElementDimensions.cjs","sources":["../../../src/dom/getElementDimensions.ts"],"sourcesContent":["/**\n * Calls the callback with the element's dimensions.\n *\n * @param element - The element to observe for dimensions\n * @param callback - The callback to call with the element's dimensions\n */\nexport function getElementDimensionsCallback(\n\telement: HTMLElement,\n\tcallback: (dimensions: DOMRectReadOnly) => void,\n) {\n\tconst observer = new IntersectionObserver((entries, observer) => {\n\t\tif (entries.length === 1) {\n\t\t\tcallback(entries[0].boundingClientRect)\n\t\t} else {\n\t\t\tconst entry = entries.find(entry => entry.boundingClientRect.width > 0 || entry.boundingClientRect.height > 0) || entries[0]\n\t\t\tcallback(entry.boundingClientRect)\n\t\t}\n\n\t\tobserver.disconnect()\n\t})\n\n\tobserver.observe(element)\n}\n\n/**\n * Returns a promise that resolves with the element's dimensions.\n * @param element - The element to observe for dimensions\n * @returns A promise that resolves with the element's dimensions\n */\nexport function getElementDimensions(\n\telement: HTMLElement,\n): Promise<DOMRectReadOnly> {\n\treturn new Promise(resolve => {\n\t\tgetElementDimensionsCallback(element, resolve)\n\t})\n}\n"],"names":["observer","entry"],"mappings":";;AAMgB,SAAA,6BACf,SACA,UACC;AACD,QAAM,WAAW,IAAI,qBAAqB,CAAC,SAASA,cAAa;AAC5D,QAAA,QAAQ,WAAW,GAAG;AAChB,eAAA,QAAQ,CAAC,EAAE,kBAAkB;AAAA,IAAA,OAChC;AACN,YAAM,QAAQ,QAAQ,KAAK,CAAAC,WAASA,OAAM,mBAAmB,QAAQ,KAAKA,OAAM,mBAAmB,SAAS,CAAC,KAAK,QAAQ,CAAC;AAC3H,eAAS,MAAM,kBAAkB;AAAA,IAClC;AAEAD,cAAS,WAAW;AAAA,EAAA,CACpB;AAED,WAAS,QAAQ,OAAO;AACzB;AAOO,SAAS,qBACf,SAC2B;AACpB,SAAA,IAAI,QAAQ,CAAW,YAAA;AAC7B,iCAA6B,SAAS,OAAO;AAAA,EAAA,CAC7C;AACF;;;"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
function getElementDimensionsCallback(element, callback) {
|
|
2
|
-
const observer = new IntersectionObserver((entries, observer2) => {
|
|
3
|
-
if (entries.length === 1) {
|
|
4
|
-
callback(entries[0].boundingClientRect);
|
|
5
|
-
} else {
|
|
6
|
-
const entry = entries.find((entry2) => entry2.boundingClientRect.width > 0 || entry2.boundingClientRect.height > 0) || entries[0];
|
|
7
|
-
callback(entry.boundingClientRect);
|
|
8
|
-
}
|
|
9
|
-
observer2.disconnect();
|
|
10
|
-
});
|
|
11
|
-
observer.observe(element);
|
|
12
|
-
}
|
|
13
|
-
function getElementDimensions(element) {
|
|
14
|
-
return new Promise((resolve) => {
|
|
15
|
-
getElementDimensionsCallback(element, resolve);
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
getElementDimensions,
|
|
20
|
-
getElementDimensionsCallback
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=getElementDimensions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getElementDimensions.js","sources":["../../../src/dom/getElementDimensions.ts"],"sourcesContent":["/**\n * Calls the callback with the element's dimensions.\n *\n * @param element - The element to observe for dimensions\n * @param callback - The callback to call with the element's dimensions\n */\nexport function getElementDimensionsCallback(\n\telement: HTMLElement,\n\tcallback: (dimensions: DOMRectReadOnly) => void,\n) {\n\tconst observer = new IntersectionObserver((entries, observer) => {\n\t\tif (entries.length === 1) {\n\t\t\tcallback(entries[0].boundingClientRect)\n\t\t} else {\n\t\t\tconst entry = entries.find(entry => entry.boundingClientRect.width > 0 || entry.boundingClientRect.height > 0) || entries[0]\n\t\t\tcallback(entry.boundingClientRect)\n\t\t}\n\n\t\tobserver.disconnect()\n\t})\n\n\tobserver.observe(element)\n}\n\n/**\n * Returns a promise that resolves with the element's dimensions.\n * @param element - The element to observe for dimensions\n * @returns A promise that resolves with the element's dimensions\n */\nexport function getElementDimensions(\n\telement: HTMLElement,\n): Promise<DOMRectReadOnly> {\n\treturn new Promise(resolve => {\n\t\tgetElementDimensionsCallback(element, resolve)\n\t})\n}\n"],"names":["observer","entry"],"mappings":"AAMgB,SAAA,6BACf,SACA,UACC;AACD,QAAM,WAAW,IAAI,qBAAqB,CAAC,SAASA,cAAa;AAC5D,QAAA,QAAQ,WAAW,GAAG;AAChB,eAAA,QAAQ,CAAC,EAAE,kBAAkB;AAAA,IAAA,OAChC;AACN,YAAM,QAAQ,QAAQ,KAAK,CAAAC,WAASA,OAAM,mBAAmB,QAAQ,KAAKA,OAAM,mBAAmB,SAAS,CAAC,KAAK,QAAQ,CAAC;AAC3H,eAAS,MAAM,kBAAkB;AAAA,IAClC;AAEAD,cAAS,WAAW;AAAA,EAAA,CACpB;AAED,WAAS,QAAQ,OAAO;AACzB;AAOO,SAAS,qBACf,SAC2B;AACpB,SAAA,IAAI,QAAQ,CAAW,YAAA;AAC7B,iCAA6B,SAAS,OAAO;AAAA,EAAA,CAC7C;AACF;"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
function getSizeFromResizeObserverEntryFactory(box) {
|
|
4
|
-
return function getSizeFromResizeObserverEntry(entry) {
|
|
5
|
-
const boxSize = box === "border-box" ? entry.borderBoxSize : box === "content-box" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;
|
|
6
|
-
if (boxSize) {
|
|
7
|
-
const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize];
|
|
8
|
-
return formatBoxSize.reduce(
|
|
9
|
-
(previous, { inlineSize, blockSize }) => ({
|
|
10
|
-
width: previous.width + inlineSize,
|
|
11
|
-
height: previous.height + blockSize
|
|
12
|
-
}),
|
|
13
|
-
{ height: 0, width: 0 }
|
|
14
|
-
);
|
|
15
|
-
} else {
|
|
16
|
-
return {
|
|
17
|
-
width: entry.contentRect.width,
|
|
18
|
-
height: entry.contentRect.height
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
exports.getSizeFromResizeObserverEntryFactory = getSizeFromResizeObserverEntryFactory;
|
|
24
|
-
//# sourceMappingURL=getSizeFromResizeObserverEntry.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSizeFromResizeObserverEntry.cjs","sources":["../../../src/dom/getSizeFromResizeObserverEntry.ts"],"sourcesContent":["export function getSizeFromResizeObserverEntryFactory(box: ResizeObserverOptions['box']) {\n\treturn function getSizeFromResizeObserverEntry(entry: ResizeObserverEntry): { height: number, width: number } {\n\t\tconst boxSize = box === 'border-box'\n\t\t\t? entry.borderBoxSize\n\t\t\t: box === 'content-box'\n\t\t\t\t? entry.contentBoxSize\n\t\t\t\t: entry.devicePixelContentBoxSize\n\n\t\tif (boxSize) {\n\t\t\tconst formatBoxSize: ResizeObserverSize[] = Array.isArray(boxSize) ? boxSize : [boxSize]\n\n\t\t\treturn formatBoxSize.reduce(\n\t\t\t\t(previous, { inlineSize, blockSize }) => ({\n\t\t\t\t\twidth: previous.width + inlineSize,\n\t\t\t\t\theight: previous.height + blockSize,\n\t\t\t\t}),\n\t\t\t\t{ height: 0, width: 0 },\n\t\t\t)\n\t\t} else {\n\t\t\treturn {\n\t\t\t\twidth: entry.contentRect.width,\n\t\t\t\theight: entry.contentRect.height,\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAAO,SAAS,sCAAsC,KAAmC;AACjF,SAAA,SAAS,+BAA+B,OAA+D;AACvG,UAAA,UAAU,QAAQ,eACrB,MAAM,gBACN,QAAQ,gBACP,MAAM,iBACN,MAAM;AAEV,QAAI,SAAS;AACZ,YAAM,gBAAsC,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO;AAEvF,aAAO,cAAc;AAAA,QACpB,CAAC,UAAU,EAAE,YAAY,iBAAiB;AAAA,UACzC,OAAO,SAAS,QAAQ;AAAA,UACxB,QAAQ,SAAS,SAAS;AAAA,QAAA;AAAA,QAE3B,EAAE,QAAQ,GAAG,OAAO,EAAE;AAAA,MAAA;AAAA,IACvB,OACM;AACC,aAAA;AAAA,QACN,OAAO,MAAM,YAAY;AAAA,QACzB,QAAQ,MAAM,YAAY;AAAA,MAAA;AAAA,IAE5B;AAAA,EAAA;AAEF;;"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
function getSizeFromResizeObserverEntryFactory(box) {
|
|
2
|
-
return function getSizeFromResizeObserverEntry(entry) {
|
|
3
|
-
const boxSize = box === "border-box" ? entry.borderBoxSize : box === "content-box" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;
|
|
4
|
-
if (boxSize) {
|
|
5
|
-
const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize];
|
|
6
|
-
return formatBoxSize.reduce(
|
|
7
|
-
(previous, { inlineSize, blockSize }) => ({
|
|
8
|
-
width: previous.width + inlineSize,
|
|
9
|
-
height: previous.height + blockSize
|
|
10
|
-
}),
|
|
11
|
-
{ height: 0, width: 0 }
|
|
12
|
-
);
|
|
13
|
-
} else {
|
|
14
|
-
return {
|
|
15
|
-
width: entry.contentRect.width,
|
|
16
|
-
height: entry.contentRect.height
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export {
|
|
22
|
-
getSizeFromResizeObserverEntryFactory
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=getSizeFromResizeObserverEntry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSizeFromResizeObserverEntry.js","sources":["../../../src/dom/getSizeFromResizeObserverEntry.ts"],"sourcesContent":["export function getSizeFromResizeObserverEntryFactory(box: ResizeObserverOptions['box']) {\n\treturn function getSizeFromResizeObserverEntry(entry: ResizeObserverEntry): { height: number, width: number } {\n\t\tconst boxSize = box === 'border-box'\n\t\t\t? entry.borderBoxSize\n\t\t\t: box === 'content-box'\n\t\t\t\t? entry.contentBoxSize\n\t\t\t\t: entry.devicePixelContentBoxSize\n\n\t\tif (boxSize) {\n\t\t\tconst formatBoxSize: ResizeObserverSize[] = Array.isArray(boxSize) ? boxSize : [boxSize]\n\n\t\t\treturn formatBoxSize.reduce(\n\t\t\t\t(previous, { inlineSize, blockSize }) => ({\n\t\t\t\t\twidth: previous.width + inlineSize,\n\t\t\t\t\theight: previous.height + blockSize,\n\t\t\t\t}),\n\t\t\t\t{ height: 0, width: 0 },\n\t\t\t)\n\t\t} else {\n\t\t\treturn {\n\t\t\t\twidth: entry.contentRect.width,\n\t\t\t\theight: entry.contentRect.height,\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAAO,SAAS,sCAAsC,KAAmC;AACjF,SAAA,SAAS,+BAA+B,OAA+D;AACvG,UAAA,UAAU,QAAQ,eACrB,MAAM,gBACN,QAAQ,gBACP,MAAM,iBACN,MAAM;AAEV,QAAI,SAAS;AACZ,YAAM,gBAAsC,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO;AAEvF,aAAO,cAAc;AAAA,QACpB,CAAC,UAAU,EAAE,YAAY,iBAAiB;AAAA,UACzC,OAAO,SAAS,QAAQ;AAAA,UACxB,QAAQ,SAAS,SAAS;AAAA,QAAA;AAAA,QAE3B,EAAE,QAAQ,GAAG,OAAO,EAAE;AAAA,MAAA;AAAA,IACvB,OACM;AACC,aAAA;AAAA,QACN,OAAO,MAAM,YAAY;AAAA,QACzB,QAAQ,MAAM,YAAY;AAAA,MAAA;AAAA,IAE5B;AAAA,EAAA;AAEF;"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const interactiveElements = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT", "OPTION", "BUTTON"]);
|
|
4
|
-
const shouldCancelStart = (event) => {
|
|
5
|
-
if (!(event.target instanceof Element)) {
|
|
6
|
-
return true;
|
|
7
|
-
}
|
|
8
|
-
let el = event.target;
|
|
9
|
-
while (el) {
|
|
10
|
-
if (el instanceof Element) {
|
|
11
|
-
if (interactiveElements.has(el.tagName)) {
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
if (el.sortableHandle === true) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
if (el.getAttribute("data-slate-void") === "true") {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
if (el instanceof HTMLElement && el.contentEditable === "true") {
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
el = el.parentNode;
|
|
25
|
-
}
|
|
26
|
-
return false;
|
|
27
|
-
};
|
|
28
|
-
exports.shouldCancelStart = shouldCancelStart;
|
|
29
|
-
//# sourceMappingURL=shouldCancelStart.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shouldCancelStart.cjs","sources":["../../../src/dom/shouldCancelStart.ts"],"sourcesContent":["const interactiveElements = new Set(['INPUT', 'TEXTAREA', 'SELECT', 'OPTION', 'BUTTON'])\n\n// This is almost completely copied from the defaultShouldCancelStart.js from react-sortable-hoc.\n// We just needed to add support for slate void elements as well as some additional checks.\nexport const shouldCancelStart = (event: {target?: unknown}): boolean => {\n\t// Cancel sorting if the event target is an `input`, `textarea`, `select` or `option`\n\tif (!(event.target instanceof Element)) {\n\t\treturn true\n\t}\n\n\tlet el: Node | null = event.target\n\n\twhile (el) {\n\t\tif (el instanceof Element) {\n\t\t\tif (interactiveElements.has(el.tagName)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif ((el as any).sortableHandle === true) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif (el.getAttribute('data-slate-void') === 'true') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif (el instanceof HTMLElement && el.contentEditable === 'true') {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\tel = el.parentNode\n\t}\n\n\treturn false\n}\n"],"names":[],"mappings":";;AAAA,MAAM,0CAA0B,IAAI,CAAC,SAAS,YAAY,UAAU,UAAU,QAAQ,CAAC;AAI1E,MAAA,oBAAoB,CAAC,UAAuC;AAEpE,MAAA,EAAE,MAAM,kBAAkB,UAAU;AAChC,WAAA;AAAA,EACR;AAEA,MAAI,KAAkB,MAAM;AAE5B,SAAO,IAAI;AACV,QAAI,cAAc,SAAS;AAC1B,UAAI,oBAAoB,IAAI,GAAG,OAAO,GAAG;AACjC,eAAA;AAAA,MACR;AACK,UAAA,GAAW,mBAAmB,MAAM;AACjC,eAAA;AAAA,MACR;AACA,UAAI,GAAG,aAAa,iBAAiB,MAAM,QAAQ;AAC3C,eAAA;AAAA,MACR;AACA,UAAI,cAAc,eAAe,GAAG,oBAAoB,QAAQ;AACxD,eAAA;AAAA,MACR;AAAA,IACD;AACA,SAAK,GAAG;AAAA,EACT;AAEO,SAAA;AACR;;"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const interactiveElements = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT", "OPTION", "BUTTON"]);
|
|
2
|
-
const shouldCancelStart = (event) => {
|
|
3
|
-
if (!(event.target instanceof Element)) {
|
|
4
|
-
return true;
|
|
5
|
-
}
|
|
6
|
-
let el = event.target;
|
|
7
|
-
while (el) {
|
|
8
|
-
if (el instanceof Element) {
|
|
9
|
-
if (interactiveElements.has(el.tagName)) {
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
|
-
if (el.sortableHandle === true) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
if (el.getAttribute("data-slate-void") === "true") {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
if (el instanceof HTMLElement && el.contentEditable === "true") {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
el = el.parentNode;
|
|
23
|
-
}
|
|
24
|
-
return false;
|
|
25
|
-
};
|
|
26
|
-
export {
|
|
27
|
-
shouldCancelStart
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=shouldCancelStart.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shouldCancelStart.js","sources":["../../../src/dom/shouldCancelStart.ts"],"sourcesContent":["const interactiveElements = new Set(['INPUT', 'TEXTAREA', 'SELECT', 'OPTION', 'BUTTON'])\n\n// This is almost completely copied from the defaultShouldCancelStart.js from react-sortable-hoc.\n// We just needed to add support for slate void elements as well as some additional checks.\nexport const shouldCancelStart = (event: {target?: unknown}): boolean => {\n\t// Cancel sorting if the event target is an `input`, `textarea`, `select` or `option`\n\tif (!(event.target instanceof Element)) {\n\t\treturn true\n\t}\n\n\tlet el: Node | null = event.target\n\n\twhile (el) {\n\t\tif (el instanceof Element) {\n\t\t\tif (interactiveElements.has(el.tagName)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif ((el as any).sortableHandle === true) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif (el.getAttribute('data-slate-void') === 'true') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif (el instanceof HTMLElement && el.contentEditable === 'true') {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\tel = el.parentNode\n\t}\n\n\treturn false\n}\n"],"names":[],"mappings":"AAAA,MAAM,0CAA0B,IAAI,CAAC,SAAS,YAAY,UAAU,UAAU,QAAQ,CAAC;AAI1E,MAAA,oBAAoB,CAAC,UAAuC;AAEpE,MAAA,EAAE,MAAM,kBAAkB,UAAU;AAChC,WAAA;AAAA,EACR;AAEA,MAAI,KAAkB,MAAM;AAE5B,SAAO,IAAI;AACV,QAAI,cAAc,SAAS;AAC1B,UAAI,oBAAoB,IAAI,GAAG,OAAO,GAAG;AACjC,eAAA;AAAA,MACR;AACK,UAAA,GAAW,mBAAmB,MAAM;AACjC,eAAA;AAAA,MACR;AACA,UAAI,GAAG,aAAa,iBAAiB,MAAM,QAAQ;AAC3C,eAAA;AAAA,MACR;AACA,UAAI,cAAc,eAAe,GAAG,oBAAoB,QAAQ;AACxD,eAAA;AAAA,MACR;AAAA,IACD;AACA,SAAK,GAAG;AAAA,EACT;AAEO,SAAA;AACR;"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const dataAttribute = require("./dataAttribute.cjs");
|
|
4
|
-
const kebabCase = require("../string-utilities/kebabCase.cjs");
|
|
5
|
-
function stateDataAttributes(state) {
|
|
6
|
-
return Object.fromEntries(Object.entries(state).map(
|
|
7
|
-
([key, value]) => [`data-${kebabCase.toKebabCase(key).toLowerCase()}`, dataAttribute.dataAttribute(value)]
|
|
8
|
-
));
|
|
9
|
-
}
|
|
10
|
-
exports.stateDataAttributes = stateDataAttributes;
|
|
11
|
-
//# sourceMappingURL=stateDataAttributes.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stateDataAttributes.cjs","sources":["../../../src/dom/stateDataAttributes.ts"],"sourcesContent":["import { toKebabCase } from '../string-utilities'\nimport { dataAttribute } from './dataAttribute'\n\nexport function stateDataAttributes(state: Record<string, unknown>) {\n\treturn Object.fromEntries(Object.entries(state).map(\n\t\t([key, value]) => [`data-${toKebabCase(key).toLowerCase()}`, dataAttribute(value)],\n\t))\n}\n"],"names":["toKebabCase","dataAttribute"],"mappings":";;;;AAGO,SAAS,oBAAoB,OAAgC;AACnE,SAAO,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE;AAAA,IAC/C,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,QAAQA,UAAAA,YAAY,GAAG,EAAE,YAAa,CAAA,IAAIC,cAAA,cAAc,KAAK,CAAC;AAAA,EAAA,CACjF;AACF;;"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { dataAttribute } from "./dataAttribute.js";
|
|
2
|
-
import { toKebabCase } from "../string-utilities/kebabCase.js";
|
|
3
|
-
function stateDataAttributes(state) {
|
|
4
|
-
return Object.fromEntries(Object.entries(state).map(
|
|
5
|
-
([key, value]) => [`data-${toKebabCase(key).toLowerCase()}`, dataAttribute(value)]
|
|
6
|
-
));
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
stateDataAttributes
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=stateDataAttributes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stateDataAttributes.js","sources":["../../../src/dom/stateDataAttributes.ts"],"sourcesContent":["import { toKebabCase } from '../string-utilities'\nimport { dataAttribute } from './dataAttribute'\n\nexport function stateDataAttributes(state: Record<string, unknown>) {\n\treturn Object.fromEntries(Object.entries(state).map(\n\t\t([key, value]) => [`data-${toKebabCase(key).toLowerCase()}`, dataAttribute(value)],\n\t))\n}\n"],"names":[],"mappings":";;AAGO,SAAS,oBAAoB,OAAgC;AACnE,SAAO,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE;AAAA,IAC/C,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,QAAQ,YAAY,GAAG,EAAE,YAAa,CAAA,IAAI,cAAc,KAAK,CAAC;AAAA,EAAA,CACjF;AACF;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"svgSizeProps.cjs","sources":["../../../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,EAAA;AAEnE;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"svgSizeProps.js","sources":["../../../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,EAAA;AAEnE;"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const isSpecialLinkClick = (e) => e.metaKey || e.altKey || e.ctrlKey || e.shiftKey;
|
|
4
|
-
exports.isSpecialLinkClick = isSpecialLinkClick;
|
|
5
|
-
//# sourceMappingURL=isSpecialLinkClick.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isSpecialLinkClick.cjs","sources":["../../../src/events/isSpecialLinkClick.ts"],"sourcesContent":["export const isSpecialLinkClick = (e: MouseEvent): boolean => e.metaKey || e.altKey || e.ctrlKey || e.shiftKey\n"],"names":[],"mappings":";;AAAa,MAAA,qBAAqB,CAAC,MAA2B,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isSpecialLinkClick.js","sources":["../../../src/events/isSpecialLinkClick.ts"],"sourcesContent":["export const isSpecialLinkClick = (e: MouseEvent): boolean => e.metaKey || e.altKey || e.ctrlKey || e.shiftKey\n"],"names":[],"mappings":"AAAa,MAAA,qBAAqB,CAAC,MAA2B,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE;"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
function omit(object, properties, strict = false) {
|
|
4
|
-
const next = { ...object };
|
|
5
|
-
for (let key of properties) {
|
|
6
|
-
if (key in object) {
|
|
7
|
-
delete next[key];
|
|
8
|
-
} else if (strict) {
|
|
9
|
-
throw new Error(`Key "${String(key)}" does not exist in object ${JSON.stringify(object)}`);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
return next;
|
|
13
|
-
}
|
|
14
|
-
exports.omit = omit;
|
|
15
|
-
//# sourceMappingURL=omit.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"omit.cjs","sources":["../../../src/functional/omit.ts"],"sourcesContent":["export function omit<T extends Object, K extends keyof T>(object: T, properties: ReadonlyArray<K>, strict: boolean = false): Omit<T, K> {\n const next: Partial<T> = { ...object }\n\n for (let key of properties) {\n if (key in object) {\n delete next[key]\n } else if (strict) {\n throw new Error(`Key \"${String(key)}\" does not exist in object ${JSON.stringify(object)}`)\n }\n }\n\n return next as Omit<T, K>\n}\n"],"names":[],"mappings":";;AAAO,SAAS,KAA0C,QAAW,YAA8B,SAAkB,OAAmB;AAChI,QAAA,OAAmB,EAAE,GAAG;AAE9B,WAAS,OAAO,YAAY;AAC1B,QAAI,OAAO,QAAQ;AACjB,aAAO,KAAK,GAAG;AAAA,eACN,QAAQ;AACX,YAAA,IAAI,MAAM,QAAQ,OAAO,GAAG,CAAC,8BAA8B,KAAK,UAAU,MAAM,CAAC,EAAE;AAAA,IAC3F;AAAA,EACF;AAEO,SAAA;AACT;;"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
function omit(object, properties, strict = false) {
|
|
2
|
-
const next = { ...object };
|
|
3
|
-
for (let key of properties) {
|
|
4
|
-
if (key in object) {
|
|
5
|
-
delete next[key];
|
|
6
|
-
} else if (strict) {
|
|
7
|
-
throw new Error(`Key "${String(key)}" does not exist in object ${JSON.stringify(object)}`);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
return next;
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
omit
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=omit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"omit.js","sources":["../../../src/functional/omit.ts"],"sourcesContent":["export function omit<T extends Object, K extends keyof T>(object: T, properties: ReadonlyArray<K>, strict: boolean = false): Omit<T, K> {\n const next: Partial<T> = { ...object }\n\n for (let key of properties) {\n if (key in object) {\n delete next[key]\n } else if (strict) {\n throw new Error(`Key \"${String(key)}\" does not exist in object ${JSON.stringify(object)}`)\n }\n }\n\n return next as Omit<T, K>\n}\n"],"names":[],"mappings":"AAAO,SAAS,KAA0C,QAAW,YAA8B,SAAkB,OAAmB;AAChI,QAAA,OAAmB,EAAE,GAAG;AAE9B,WAAS,OAAO,YAAY;AAC1B,QAAI,OAAO,QAAQ;AACjB,aAAO,KAAK,GAAG;AAAA,eACN,QAAQ;AACX,YAAA,IAAI,MAAM,QAAQ,OAAO,GAAG,CAAC,8BAA8B,KAAK,UAAU,MAAM,CAAC,EAAE;AAAA,IAC3F;AAAA,EACF;AAEO,SAAA;AACT;"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
function pick(object, properties) {
|
|
4
|
-
const next = {};
|
|
5
|
-
for (let key of properties) {
|
|
6
|
-
if (key in object) {
|
|
7
|
-
next[key] = object[key];
|
|
8
|
-
} else {
|
|
9
|
-
throw new Error(`Key "${String(key)}" does not exist in object ${JSON.stringify(object)}`);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
return next;
|
|
13
|
-
}
|
|
14
|
-
exports.pick = pick;
|
|
15
|
-
//# sourceMappingURL=pick.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pick.cjs","sources":["../../../src/functional/pick.ts"],"sourcesContent":["export function pick<T extends Object, K extends keyof T>(object: T, properties: ReadonlyArray<K>): Pick<T, K> {\n\tconst next: Partial<Pick<T, K>> = {}\n\n\tfor (let key of properties) {\n\t\tif (key in object) {\n\t\t\tnext[key] = object[key]\n\t\t} else {\n\t\t\tthrow new Error(`Key \"${String(key)}\" does not exist in object ${JSON.stringify(object)}`)\n\t\t}\n\t}\n\n\treturn next as Pick<T, K>\n}\n"],"names":[],"mappings":";;AAAgB,SAAA,KAA0C,QAAW,YAA0C;AAC9G,QAAM,OAA4B,CAAA;AAElC,WAAS,OAAO,YAAY;AAC3B,QAAI,OAAO,QAAQ;AACb,WAAA,GAAG,IAAI,OAAO,GAAG;AAAA,IAAA,OAChB;AACA,YAAA,IAAI,MAAM,QAAQ,OAAO,GAAG,CAAC,8BAA8B,KAAK,UAAU,MAAM,CAAC,EAAE;AAAA,IAC1F;AAAA,EACD;AAEO,SAAA;AACR;;"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
function pick(object, properties) {
|
|
2
|
-
const next = {};
|
|
3
|
-
for (let key of properties) {
|
|
4
|
-
if (key in object) {
|
|
5
|
-
next[key] = object[key];
|
|
6
|
-
} else {
|
|
7
|
-
throw new Error(`Key "${String(key)}" does not exist in object ${JSON.stringify(object)}`);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
return next;
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
pick
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=pick.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pick.js","sources":["../../../src/functional/pick.ts"],"sourcesContent":["export function pick<T extends Object, K extends keyof T>(object: T, properties: ReadonlyArray<K>): Pick<T, K> {\n\tconst next: Partial<Pick<T, K>> = {}\n\n\tfor (let key of properties) {\n\t\tif (key in object) {\n\t\t\tnext[key] = object[key]\n\t\t} else {\n\t\t\tthrow new Error(`Key \"${String(key)}\" does not exist in object ${JSON.stringify(object)}`)\n\t\t}\n\t}\n\n\treturn next as Pick<T, K>\n}\n"],"names":[],"mappings":"AAAgB,SAAA,KAA0C,QAAW,YAA0C;AAC9G,QAAM,OAA4B,CAAA;AAElC,WAAS,OAAO,YAAY;AAC3B,QAAI,OAAO,QAAQ;AACb,WAAA,GAAG,IAAI,OAAO,GAAG;AAAA,IAAA,OAChB;AACA,YAAA,IAAI,MAAM,QAAQ,OAAO,GAAG,CAAC,8BAA8B,KAAK,UAAU,MAAM,CAAC,EAAE;AAAA,IAC1F;AAAA,EACD;AAEO,SAAA;AACR;"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
function range(start, end, step = 1) {
|
|
4
|
-
return Array.from({ length: Math.floor(Math.abs(end - start) / step) + 1 }, (_, i) => start + i * (end > start ? 1 : -1) * Math.abs(step));
|
|
5
|
-
}
|
|
6
|
-
exports.range = range;
|
|
7
|
-
//# sourceMappingURL=range.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"range.cjs","sources":["../../../src/functional/range.ts"],"sourcesContent":["\n/**\n * Get a list of numbers between start and end, inclusive, with the given step size (defaulting to 1)\n * @param start - The starting number.\n * @param end - The ending number.\n * @param step - The step size, optional, defaults to 1.\n * @returns A list of numbers between start and end, inclusive, with the given step size (defaulting to 1)\n */\nexport function range(start: number, end: number, step = 1): number[] {\n\treturn Array.from({ length: Math.floor(Math.abs(end - start) / step) + 1 }, (_, i) => start + i * (end > start ? 1 : -1) * Math.abs(step))\n}\n"],"names":[],"mappings":";;AAQO,SAAS,MAAM,OAAe,KAAa,OAAO,GAAa;AAC9D,SAAA,MAAM,KAAK,EAAE,QAAQ,KAAK,MAAM,KAAK,IAAI,MAAM,KAAK,IAAI,IAAI,IAAI,EAAE,GAAG,CAAC,GAAG,MAAM,QAAQ,KAAK,MAAM,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,CAAC;AAC1I;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"range.js","sources":["../../../src/functional/range.ts"],"sourcesContent":["\n/**\n * Get a list of numbers between start and end, inclusive, with the given step size (defaulting to 1)\n * @param start - The starting number.\n * @param end - The ending number.\n * @param step - The step size, optional, defaults to 1.\n * @returns A list of numbers between start and end, inclusive, with the given step size (defaulting to 1)\n */\nexport function range(start: number, end: number, step = 1): number[] {\n\treturn Array.from({ length: Math.floor(Math.abs(end - start) / step) + 1 }, (_, i) => start + i * (end > start ? 1 : -1) * Math.abs(step))\n}\n"],"names":[],"mappings":"AAQO,SAAS,MAAM,OAAe,KAAa,OAAO,GAAa;AAC9D,SAAA,MAAM,KAAK,EAAE,QAAQ,KAAK,MAAM,KAAK,IAAI,MAAM,KAAK,IAAI,IAAI,IAAI,EAAE,GAAG,CAAC,GAAG,MAAM,QAAQ,KAAK,MAAM,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,CAAC;AAC1I;"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const UPPER_CASE_REG_EXP = /([A-Z])/g;
|
|
4
|
-
function toKebabCase(value) {
|
|
5
|
-
return value.replace(UPPER_CASE_REG_EXP, "-$1").toLowerCase();
|
|
6
|
-
}
|
|
7
|
-
exports.toKebabCase = toKebabCase;
|
|
8
|
-
//# sourceMappingURL=kebabCase.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kebabCase.cjs","sources":["../../../src/string-utilities/kebabCase.ts"],"sourcesContent":["const UPPER_CASE_REG_EXP = /([A-Z])/g\n\nexport function toKebabCase(value: string) {\n\treturn value.replace(UPPER_CASE_REG_EXP, '-$1').toLowerCase()\n}\n"],"names":[],"mappings":";;AAAA,MAAM,qBAAqB;AAEpB,SAAS,YAAY,OAAe;AAC1C,SAAO,MAAM,QAAQ,oBAAoB,KAAK,EAAE,YAAY;AAC7D;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kebabCase.js","sources":["../../../src/string-utilities/kebabCase.ts"],"sourcesContent":["const UPPER_CASE_REG_EXP = /([A-Z])/g\n\nexport function toKebabCase(value: string) {\n\treturn value.replace(UPPER_CASE_REG_EXP, '-$1').toLowerCase()\n}\n"],"names":[],"mappings":"AAAA,MAAM,qBAAqB;AAEpB,SAAS,YAAY,OAAe;AAC1C,SAAO,MAAM,QAAQ,oBAAoB,KAAK,EAAE,YAAY;AAC7D;"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
class AssertionError extends Error {
|
|
4
|
-
constructor(value, that = "value to pass assertion") {
|
|
5
|
-
super(`Expecting ${that}, ${JSON.stringify(value)} given`);
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
exports.AssertionError = AssertionError;
|
|
9
|
-
//# sourceMappingURL=AssertionError.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AssertionError.cjs","sources":["../../../src/assert-types/AssertionError.ts"],"sourcesContent":["export class AssertionError extends Error {\n\tconstructor(value: unknown, that: string = 'value to pass assertion') {\n\t\tsuper(`Expecting ${that}, ${JSON.stringify(value)} given`)\n\t}\n}\n"],"names":[],"mappings":";;AAAO,MAAM,uBAAuB,MAAM;AAAA,EACzC,YAAY,OAAgB,OAAe,2BAA2B;AACrE,UAAM,aAAa,IAAI,KAAK,KAAK,UAAU,KAAK,CAAC,QAAQ;AAAA,EAC1D;AACD;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AssertionError.js","sources":["../../../src/assert-types/AssertionError.ts"],"sourcesContent":["export class AssertionError extends Error {\n\tconstructor(value: unknown, that: string = 'value to pass assertion') {\n\t\tsuper(`Expecting ${that}, ${JSON.stringify(value)} given`)\n\t}\n}\n"],"names":[],"mappings":"AAAO,MAAM,uBAAuB,MAAM;AAAA,EACzC,YAAY,OAAgB,OAAe,2BAA2B;AACrE,UAAM,aAAa,IAAI,KAAK,KAAK,UAAU,KAAK,CAAC,QAAQ;AAAA,EAC1D;AACD;"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
function isNonNegativeNumber(value) {
|
|
4
|
-
return typeof value === "number" && value >= 0;
|
|
5
|
-
}
|
|
6
|
-
exports.isNonNegativeNumber = isNonNegativeNumber;
|
|
7
|
-
//# sourceMappingURL=Predicates.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Predicates.cjs","sources":["../../../src/assert-types/Predicates.ts"],"sourcesContent":["export function isNonNegativeNumber(value: unknown): value is number {\n\treturn typeof value === 'number' && value >= 0\n}\n"],"names":[],"mappings":";;AAAO,SAAS,oBAAoB,OAAiC;AAC7D,SAAA,OAAO,UAAU,YAAY,SAAS;AAC9C;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Predicates.js","sources":["../../../src/assert-types/Predicates.ts"],"sourcesContent":["export function isNonNegativeNumber(value: unknown): value is number {\n\treturn typeof value === 'number' && value >= 0\n}\n"],"names":[],"mappings":"AAAO,SAAS,oBAAoB,OAAiC;AAC7D,SAAA,OAAO,UAAU,YAAY,SAAS;AAC9C;"}
|