css-calipers 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -25
- package/dist/cjs/factory.js +0 -3
- package/dist/esm/factory.d.ts +0 -2
- package/dist/esm/factory.d.ts.map +1 -1
- package/dist/esm/factory.js +0 -3
- package/package.json +5 -18
- package/RELEASING.md +0 -62
- package/dist/cjs/comparisons/index.js +0 -25
- package/dist/cjs/containerQueries/containerQueries.js +0 -115
- package/dist/cjs/containerQueries/factory.js +0 -123
- package/dist/cjs/containerQueries/helpers.js +0 -95
- package/dist/cjs/containerQueries/index.js +0 -16
- package/dist/cjs/containerQueries/linting/aspectRatio.js +0 -24
- package/dist/cjs/containerQueries/linting/block.js +0 -23
- package/dist/cjs/containerQueries/linting/core.js +0 -25
- package/dist/cjs/containerQueries/linting/custom.js +0 -11
- package/dist/cjs/containerQueries/linting/inline.js +0 -23
- package/dist/cjs/containerQueries/linting/resolution.js +0 -12
- package/dist/cjs/containerQueries/linting/style.js +0 -28
- package/dist/cjs/containerQueries/linting.js +0 -24
- package/dist/cjs/containerQueries/moduleRegistry.js +0 -5
- package/dist/cjs/containerQueries/modules/aspectRatio.js +0 -51
- package/dist/cjs/containerQueries/modules/block.js +0 -53
- package/dist/cjs/containerQueries/modules/custom.js +0 -43
- package/dist/cjs/containerQueries/modules/index.js +0 -21
- package/dist/cjs/containerQueries/modules/inline.js +0 -53
- package/dist/cjs/containerQueries/modules/size.js +0 -2
- package/dist/cjs/containerQueries/modules/style.js +0 -36
- package/dist/cjs/containerQueries/types.js +0 -2
- package/dist/cjs/containerQueries/validation.js +0 -191
- package/dist/cjs/fraction.js +0 -139
- package/dist/cjs/internal/createComponentQueriesApi.js +0 -56
- package/dist/cjs/internal/createMediaQueriesApi.js +0 -73
- package/dist/cjs/internal/normalizeToArray.js +0 -9
- package/dist/cjs/libraryHelpers/vanilla-extract.js +0 -11
- package/dist/cjs/logicalOperators/index.js +0 -18
- package/dist/cjs/mediaQueries/factory.js +0 -187
- package/dist/cjs/mediaQueries/helpers.js +0 -97
- package/dist/cjs/mediaQueries/index.js +0 -23
- package/dist/cjs/mediaQueries/libraryHelpers/vanilla-extract.js +0 -77
- package/dist/cjs/mediaQueries/linting/core.js +0 -19
- package/dist/cjs/mediaQueries/linting/resolution.js +0 -11
- package/dist/cjs/mediaQueries/linting.js +0 -24
- package/dist/cjs/mediaQueries/mediaQueries.js +0 -53
- package/dist/cjs/mediaQueries/mediaQueryFactory.js +0 -120
- package/dist/cjs/mediaQueries/moduleRegistry.js +0 -5
- package/dist/cjs/mediaQueries/modules/custom.js +0 -26
- package/dist/cjs/mediaQueries/modules/dimensions.js +0 -61
- package/dist/cjs/mediaQueries/modules/display.js +0 -20
- package/dist/cjs/mediaQueries/modules/environment.js +0 -20
- package/dist/cjs/mediaQueries/modules/index.js +0 -23
- package/dist/cjs/mediaQueries/modules/interaction.js +0 -26
- package/dist/cjs/mediaQueries/modules/preferences.js +0 -26
- package/dist/cjs/mediaQueries/modules/resolution.js +0 -31
- package/dist/cjs/mediaQueries/types.js +0 -2
- package/dist/cjs/mediaQueries/validation.js +0 -134
- package/dist/cjs/sciNotation.js +0 -74
- package/dist/cjs/types.js +0 -2
- package/dist/cjs/validation.js +0 -20
- package/dist/esm/comparisons/index.d.ts +0 -23
- package/dist/esm/comparisons/index.d.ts.map +0 -1
- package/dist/esm/comparisons/index.js +0 -22
- package/dist/esm/containerQueries/containerQueries.d.ts +0 -36
- package/dist/esm/containerQueries/containerQueries.d.ts.map +0 -1
- package/dist/esm/containerQueries/containerQueries.js +0 -109
- package/dist/esm/containerQueries/factory.d.ts +0 -20
- package/dist/esm/containerQueries/factory.d.ts.map +0 -1
- package/dist/esm/containerQueries/factory.js +0 -119
- package/dist/esm/containerQueries/helpers.d.ts +0 -53
- package/dist/esm/containerQueries/helpers.d.ts.map +0 -1
- package/dist/esm/containerQueries/helpers.js +0 -82
- package/dist/esm/containerQueries/index.d.ts +0 -10
- package/dist/esm/containerQueries/index.d.ts.map +0 -1
- package/dist/esm/containerQueries/index.js +0 -4
- package/dist/esm/containerQueries/linting/aspectRatio.d.ts +0 -4
- package/dist/esm/containerQueries/linting/aspectRatio.d.ts.map +0 -1
- package/dist/esm/containerQueries/linting/aspectRatio.js +0 -19
- package/dist/esm/containerQueries/linting/block.d.ts +0 -4
- package/dist/esm/containerQueries/linting/block.d.ts.map +0 -1
- package/dist/esm/containerQueries/linting/block.js +0 -18
- package/dist/esm/containerQueries/linting/core.d.ts +0 -4
- package/dist/esm/containerQueries/linting/core.d.ts.map +0 -1
- package/dist/esm/containerQueries/linting/core.js +0 -20
- package/dist/esm/containerQueries/linting/custom.d.ts +0 -3
- package/dist/esm/containerQueries/linting/custom.d.ts.map +0 -1
- package/dist/esm/containerQueries/linting/custom.js +0 -7
- package/dist/esm/containerQueries/linting/inline.d.ts +0 -4
- package/dist/esm/containerQueries/linting/inline.d.ts.map +0 -1
- package/dist/esm/containerQueries/linting/inline.js +0 -18
- package/dist/esm/containerQueries/linting/resolution.d.ts +0 -1
- package/dist/esm/containerQueries/linting/resolution.d.ts.map +0 -1
- package/dist/esm/containerQueries/linting/resolution.js +0 -12
- package/dist/esm/containerQueries/linting/style.d.ts +0 -3
- package/dist/esm/containerQueries/linting/style.d.ts.map +0 -1
- package/dist/esm/containerQueries/linting/style.js +0 -24
- package/dist/esm/containerQueries/linting.d.ts +0 -4
- package/dist/esm/containerQueries/linting.d.ts.map +0 -1
- package/dist/esm/containerQueries/linting.js +0 -20
- package/dist/esm/containerQueries/moduleRegistry.d.ts +0 -25
- package/dist/esm/containerQueries/moduleRegistry.d.ts.map +0 -1
- package/dist/esm/containerQueries/moduleRegistry.js +0 -1
- package/dist/esm/containerQueries/modules/aspectRatio.d.ts +0 -17
- package/dist/esm/containerQueries/modules/aspectRatio.d.ts.map +0 -1
- package/dist/esm/containerQueries/modules/aspectRatio.js +0 -47
- package/dist/esm/containerQueries/modules/block.d.ts +0 -20
- package/dist/esm/containerQueries/modules/block.d.ts.map +0 -1
- package/dist/esm/containerQueries/modules/block.js +0 -49
- package/dist/esm/containerQueries/modules/custom.d.ts +0 -13
- package/dist/esm/containerQueries/modules/custom.d.ts.map +0 -1
- package/dist/esm/containerQueries/modules/custom.js +0 -39
- package/dist/esm/containerQueries/modules/index.d.ts +0 -6
- package/dist/esm/containerQueries/modules/index.d.ts.map +0 -1
- package/dist/esm/containerQueries/modules/index.js +0 -5
- package/dist/esm/containerQueries/modules/inline.d.ts +0 -20
- package/dist/esm/containerQueries/modules/inline.d.ts.map +0 -1
- package/dist/esm/containerQueries/modules/inline.js +0 -49
- package/dist/esm/containerQueries/modules/size.d.ts +0 -41
- package/dist/esm/containerQueries/modules/size.d.ts.map +0 -1
- package/dist/esm/containerQueries/modules/size.js +0 -1
- package/dist/esm/containerQueries/modules/style.d.ts +0 -11
- package/dist/esm/containerQueries/modules/style.d.ts.map +0 -1
- package/dist/esm/containerQueries/modules/style.js +0 -32
- package/dist/esm/containerQueries/types.d.ts +0 -81
- package/dist/esm/containerQueries/types.d.ts.map +0 -1
- package/dist/esm/containerQueries/types.js +0 -1
- package/dist/esm/containerQueries/validation.d.ts +0 -41
- package/dist/esm/containerQueries/validation.d.ts.map +0 -1
- package/dist/esm/containerQueries/validation.js +0 -187
- package/dist/esm/fraction.d.ts +0 -23
- package/dist/esm/fraction.d.ts.map +0 -1
- package/dist/esm/fraction.js +0 -129
- package/dist/esm/internal/createComponentQueriesApi.d.ts +0 -34
- package/dist/esm/internal/createComponentQueriesApi.d.ts.map +0 -1
- package/dist/esm/internal/createComponentQueriesApi.js +0 -52
- package/dist/esm/internal/createMediaQueriesApi.d.ts +0 -35
- package/dist/esm/internal/createMediaQueriesApi.d.ts.map +0 -1
- package/dist/esm/internal/createMediaQueriesApi.js +0 -69
- package/dist/esm/internal/normalizeToArray.d.ts +0 -2
- package/dist/esm/internal/normalizeToArray.d.ts.map +0 -1
- package/dist/esm/internal/normalizeToArray.js +0 -5
- package/dist/esm/libraryHelpers/vanilla-extract.d.ts +0 -4
- package/dist/esm/libraryHelpers/vanilla-extract.d.ts.map +0 -1
- package/dist/esm/libraryHelpers/vanilla-extract.js +0 -6
- package/dist/esm/logicalOperators/index.d.ts +0 -2
- package/dist/esm/logicalOperators/index.d.ts.map +0 -1
- package/dist/esm/logicalOperators/index.js +0 -17
- package/dist/esm/mediaQueries/factory.d.ts +0 -45
- package/dist/esm/mediaQueries/factory.d.ts.map +0 -1
- package/dist/esm/mediaQueries/factory.js +0 -183
- package/dist/esm/mediaQueries/helpers.d.ts +0 -40
- package/dist/esm/mediaQueries/helpers.d.ts.map +0 -1
- package/dist/esm/mediaQueries/helpers.js +0 -87
- package/dist/esm/mediaQueries/index.d.ts +0 -8
- package/dist/esm/mediaQueries/index.d.ts.map +0 -1
- package/dist/esm/mediaQueries/index.js +0 -7
- package/dist/esm/mediaQueries/libraryHelpers/vanilla-extract.d.ts +0 -5
- package/dist/esm/mediaQueries/libraryHelpers/vanilla-extract.d.ts.map +0 -1
- package/dist/esm/mediaQueries/libraryHelpers/vanilla-extract.js +0 -71
- package/dist/esm/mediaQueries/linting/core.d.ts +0 -5
- package/dist/esm/mediaQueries/linting/core.d.ts.map +0 -1
- package/dist/esm/mediaQueries/linting/core.js +0 -14
- package/dist/esm/mediaQueries/linting/resolution.d.ts +0 -3
- package/dist/esm/mediaQueries/linting/resolution.d.ts.map +0 -1
- package/dist/esm/mediaQueries/linting/resolution.js +0 -7
- package/dist/esm/mediaQueries/linting.d.ts +0 -4
- package/dist/esm/mediaQueries/linting.d.ts.map +0 -1
- package/dist/esm/mediaQueries/linting.js +0 -20
- package/dist/esm/mediaQueries/mediaQueries.d.ts +0 -23
- package/dist/esm/mediaQueries/mediaQueries.d.ts.map +0 -1
- package/dist/esm/mediaQueries/mediaQueries.js +0 -48
- package/dist/esm/mediaQueries/moduleRegistry.d.ts +0 -27
- package/dist/esm/mediaQueries/moduleRegistry.d.ts.map +0 -1
- package/dist/esm/mediaQueries/moduleRegistry.js +0 -1
- package/dist/esm/mediaQueries/modules/custom.d.ts +0 -10
- package/dist/esm/mediaQueries/modules/custom.d.ts.map +0 -1
- package/dist/esm/mediaQueries/modules/custom.js +0 -22
- package/dist/esm/mediaQueries/modules/dimensions.d.ts +0 -19
- package/dist/esm/mediaQueries/modules/dimensions.d.ts.map +0 -1
- package/dist/esm/mediaQueries/modules/dimensions.js +0 -57
- package/dist/esm/mediaQueries/modules/display.d.ts +0 -9
- package/dist/esm/mediaQueries/modules/display.d.ts.map +0 -1
- package/dist/esm/mediaQueries/modules/display.js +0 -16
- package/dist/esm/mediaQueries/modules/environment.d.ts +0 -9
- package/dist/esm/mediaQueries/modules/environment.d.ts.map +0 -1
- package/dist/esm/mediaQueries/modules/environment.js +0 -16
- package/dist/esm/mediaQueries/modules/index.d.ts +0 -8
- package/dist/esm/mediaQueries/modules/index.d.ts.map +0 -1
- package/dist/esm/mediaQueries/modules/index.js +0 -7
- package/dist/esm/mediaQueries/modules/interaction.d.ts +0 -11
- package/dist/esm/mediaQueries/modules/interaction.d.ts.map +0 -1
- package/dist/esm/mediaQueries/modules/interaction.js +0 -22
- package/dist/esm/mediaQueries/modules/preferences.d.ts +0 -11
- package/dist/esm/mediaQueries/modules/preferences.d.ts.map +0 -1
- package/dist/esm/mediaQueries/modules/preferences.js +0 -22
- package/dist/esm/mediaQueries/modules/resolution.d.ts +0 -12
- package/dist/esm/mediaQueries/modules/resolution.d.ts.map +0 -1
- package/dist/esm/mediaQueries/modules/resolution.js +0 -27
- package/dist/esm/mediaQueries/types.d.ts +0 -117
- package/dist/esm/mediaQueries/types.d.ts.map +0 -1
- package/dist/esm/mediaQueries/types.js +0 -1
- package/dist/esm/mediaQueries/validation.d.ts +0 -33
- package/dist/esm/mediaQueries/validation.d.ts.map +0 -1
- package/dist/esm/mediaQueries/validation.js +0 -130
- package/dist/esm/sciNotation.d.ts +0 -14
- package/dist/esm/sciNotation.d.ts.map +0 -1
- package/dist/esm/sciNotation.js +0 -69
- package/dist/esm/types.d.ts +0 -35
- package/dist/esm/types.d.ts.map +0 -1
- package/dist/esm/types.js +0 -1
- package/dist/esm/validation.d.ts +0 -10
- package/dist/esm/validation.d.ts.map +0 -1
- package/dist/esm/validation.js +0 -15
- package/dist/examples/containerQueries.example.js +0 -54
- package/dist/examples/examples/containerQueries.example.js +0 -54
- package/dist/examples/examples/factory-wrapper.example.js +0 -33
- package/dist/examples/examples/lineHeight-normalizer.example.js +0 -81
- package/dist/examples/examples/mediaQueries-multipleInstances.example.js +0 -127
- package/dist/examples/examples/mixedQueries.example.js +0 -55
- package/dist/examples/examples/validation-and-runtime-checks.example.js +0 -85
- package/dist/examples/examples/validation-unit-tests.example.js +0 -35
- package/dist/examples/factory-wrapper.example.js +0 -33
- package/dist/examples/lineHeight-normalizer.example.js +0 -81
- package/dist/examples/mediaQueries-multipleInstances.example.js +0 -127
- package/dist/examples/mixedQueries.example.js +0 -60
- package/dist/examples/src/comparisons/index.js +0 -25
- package/dist/examples/src/containerQueries/containerQueries.js +0 -96
- package/dist/examples/src/containerQueries/factory.js +0 -123
- package/dist/examples/src/containerQueries/helpers.js +0 -94
- package/dist/examples/src/containerQueries/index.js +0 -16
- package/dist/examples/src/containerQueries/linting/aspectRatio.js +0 -20
- package/dist/examples/src/containerQueries/linting/block.js +0 -20
- package/dist/examples/src/containerQueries/linting/core.js +0 -19
- package/dist/examples/src/containerQueries/linting/custom.js +0 -11
- package/dist/examples/src/containerQueries/linting/inline.js +0 -20
- package/dist/examples/src/containerQueries/linting/style.js +0 -28
- package/dist/examples/src/containerQueries/linting.js +0 -24
- package/dist/examples/src/containerQueries/moduleRegistry.js +0 -5
- package/dist/examples/src/containerQueries/modules/aspectRatio.js +0 -33
- package/dist/examples/src/containerQueries/modules/block.js +0 -44
- package/dist/examples/src/containerQueries/modules/custom.js +0 -31
- package/dist/examples/src/containerQueries/modules/index.js +0 -21
- package/dist/examples/src/containerQueries/modules/inline.js +0 -44
- package/dist/examples/src/containerQueries/modules/style.js +0 -36
- package/dist/examples/src/containerQueries/types.js +0 -2
- package/dist/examples/src/containerQueries/validation.js +0 -177
- package/dist/examples/src/core.js +0 -16
- package/dist/examples/src/factory.js +0 -21
- package/dist/examples/src/index.js +0 -30
- package/dist/examples/src/internal/buildMeasurementCreationError.js +0 -16
- package/dist/examples/src/internal/createCoreApi.js +0 -336
- package/dist/examples/src/internal/createMediaQueriesApi.js +0 -74
- package/dist/examples/src/internal/createUnitsApi.js +0 -18
- package/dist/examples/src/internal/errors.js +0 -130
- package/dist/examples/src/libraryHelpers/vanilla-extract.js +0 -11
- package/dist/examples/src/mediaQueries/factory.js +0 -163
- package/dist/examples/src/mediaQueries/helpers.js +0 -88
- package/dist/examples/src/mediaQueries/index.js +0 -23
- package/dist/examples/src/mediaQueries/linting/core.js +0 -19
- package/dist/examples/src/mediaQueries/linting/resolution.js +0 -11
- package/dist/examples/src/mediaQueries/linting.js +0 -24
- package/dist/examples/src/mediaQueries/mediaQueries.js +0 -53
- package/dist/examples/src/mediaQueries/moduleRegistry.js +0 -5
- package/dist/examples/src/mediaQueries/modules/custom.js +0 -26
- package/dist/examples/src/mediaQueries/modules/dimensions.js +0 -61
- package/dist/examples/src/mediaQueries/modules/display.js +0 -20
- package/dist/examples/src/mediaQueries/modules/environment.js +0 -20
- package/dist/examples/src/mediaQueries/modules/index.js +0 -23
- package/dist/examples/src/mediaQueries/modules/interaction.js +0 -26
- package/dist/examples/src/mediaQueries/modules/preferences.js +0 -26
- package/dist/examples/src/mediaQueries/modules/resolution.js +0 -31
- package/dist/examples/src/mediaQueries/types.js +0 -2
- package/dist/examples/src/mediaQueries/validation.js +0 -128
- package/dist/examples/src/ratio.js +0 -141
- package/dist/examples/src/types.js +0 -2
- package/dist/examples/src/unitDefinitions.js +0 -67
- package/dist/examples/src/units/absolute.js +0 -11
- package/dist/examples/src/units/angle.js +0 -8
- package/dist/examples/src/units/container.js +0 -10
- package/dist/examples/src/units/font-relative.js +0 -16
- package/dist/examples/src/units/frequency.js +0 -6
- package/dist/examples/src/units/grid.js +0 -5
- package/dist/examples/src/units/percent.js +0 -7
- package/dist/examples/src/units/resolution.js +0 -7
- package/dist/examples/src/units/time.js +0 -6
- package/dist/examples/src/units/viewport-dynamic.js +0 -10
- package/dist/examples/src/units/viewport-large.js +0 -10
- package/dist/examples/src/units/viewport-small.js +0 -10
- package/dist/examples/src/units/viewport.js +0 -10
- package/dist/examples/src/validation.js +0 -20
- package/dist/examples/validation-and-runtime-checks.example.js +0 -85
- package/dist/examples/validation-unit-tests.example.js +0 -35
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.emitCustomFeatures = void 0;
|
|
4
|
-
const helpers_1 = require("../helpers");
|
|
5
|
-
const validation_1 = require("../validation");
|
|
6
|
-
const linting_1 = require("../linting");
|
|
7
|
-
const custom_1 = require("../linting/custom");
|
|
8
|
-
const emitCustomFeatures = (props, helpers, validate) => {
|
|
9
|
-
const { runContainerQueryValidation, validateCustomFeatures, } = validation_1.defaultContainerQueryValidation;
|
|
10
|
-
if (!runContainerQueryValidation(props, helpers, validateCustomFeatures, "custom", "custom features must be valid and non-empty")) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
if (!(0, linting_1.runContainerQueryLint)(props, helpers, custom_1.lintCustomFeatures, "customFeatures should not be empty")) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
if (!(0, helpers_1.applyContainerQueryValidation)(props, helpers, validate, "custom")) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const { addFeature } = helpers;
|
|
20
|
-
if (!props.customFeatures)
|
|
21
|
-
return;
|
|
22
|
-
Object.entries(props.customFeatures).forEach(([name, value]) => {
|
|
23
|
-
if (value === undefined || value === null)
|
|
24
|
-
return;
|
|
25
|
-
const trimmedName = name.trim();
|
|
26
|
-
if (!trimmedName)
|
|
27
|
-
return;
|
|
28
|
-
addFeature(trimmedName, value);
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
exports.emitCustomFeatures = emitCustomFeatures;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./aspectRatio"), exports);
|
|
18
|
-
__exportStar(require("./block"), exports);
|
|
19
|
-
__exportStar(require("./custom"), exports);
|
|
20
|
-
__exportStar(require("./inline"), exports);
|
|
21
|
-
__exportStar(require("./style"), exports);
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.emitInlineSizeFeatures = void 0;
|
|
4
|
-
const helpers_1 = require("../helpers");
|
|
5
|
-
const validation_1 = require("../validation");
|
|
6
|
-
const linting_1 = require("../linting");
|
|
7
|
-
const inline_1 = require("../linting/inline");
|
|
8
|
-
const emitInlineComparison = (name, comparison, addCondition) => {
|
|
9
|
-
addCondition((0, helpers_1.formatContainerQueryComparison)(name, comparison.operator, comparison.value));
|
|
10
|
-
};
|
|
11
|
-
const emitInlineRange = (name, range, addCondition) => {
|
|
12
|
-
const min = (0, helpers_1.formatContainerQueryValue)(range.min);
|
|
13
|
-
const max = (0, helpers_1.formatContainerQueryValue)(range.max);
|
|
14
|
-
if ("minOperator" in range) {
|
|
15
|
-
addCondition(`(${min} ${range.minOperator} ${name})`);
|
|
16
|
-
addCondition(`(${name} <= ${max})`);
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
addCondition(`(${min} <= ${name})`);
|
|
20
|
-
addCondition(`(${name} ${range.maxOperator} ${max})`);
|
|
21
|
-
};
|
|
22
|
-
const emitInlineSizeFeatures = (props, helpers, validate) => {
|
|
23
|
-
const { runContainerQueryValidation, validateInlineSizeValues, } = validation_1.defaultContainerQueryValidation;
|
|
24
|
-
if (!runContainerQueryValidation(props, helpers, validateInlineSizeValues, "inline", "inline size values must be valid measurements greater than 0")) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
if (!(0, linting_1.runContainerQueryLint)(props, helpers, inline_1.lintInlineRedundancy, "inlineSize should not be combined with inlineSizeRange")) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (!(0, linting_1.runContainerQueryLint)(props, helpers, inline_1.lintInlineRangeCollapse, "inlineSizeRange min and max are equal; use inlineSize instead")) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (!(0, helpers_1.applyContainerQueryValidation)(props, helpers, validate, "inline")) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const { addCondition } = helpers;
|
|
37
|
-
if (props.inlineSize) {
|
|
38
|
-
emitInlineComparison("inline-size", props.inlineSize, addCondition);
|
|
39
|
-
}
|
|
40
|
-
if (props.inlineSizeRange) {
|
|
41
|
-
emitInlineRange("inline-size", props.inlineSizeRange, addCondition);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
exports.emitInlineSizeFeatures = emitInlineSizeFeatures;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.emitStyleFeatures = void 0;
|
|
4
|
-
const helpers_1 = require("../helpers");
|
|
5
|
-
const validation_1 = require("../validation");
|
|
6
|
-
const linting_1 = require("../linting");
|
|
7
|
-
const style_1 = require("../linting/style");
|
|
8
|
-
const emitStyleFeatures = (props, helpers, validate) => {
|
|
9
|
-
const { runContainerQueryValidation, validateStyleValues, } = validation_1.defaultContainerQueryValidation;
|
|
10
|
-
if (!runContainerQueryValidation(props, helpers, validateStyleValues, "style", "style conditions must be valid and non-empty")) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
if (!(0, linting_1.runContainerQueryLint)(props, helpers, style_1.lintStyleCondition, "style conditions must be valid and non-empty")) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
if (!(0, helpers_1.applyContainerQueryValidation)(props, helpers, validate, "style")) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
if (!props.style)
|
|
20
|
-
return;
|
|
21
|
-
const { addCondition } = helpers;
|
|
22
|
-
Object.entries(props.style).forEach(([name, value]) => {
|
|
23
|
-
if (value === undefined || value === null)
|
|
24
|
-
return;
|
|
25
|
-
if (Array.isArray(value)) {
|
|
26
|
-
value.forEach((entry) => {
|
|
27
|
-
if (entry === undefined || entry === null)
|
|
28
|
-
return;
|
|
29
|
-
addCondition(`(style(${name}: ${(0, helpers_1.formatContainerQueryValue)(entry)}))`);
|
|
30
|
-
});
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
addCondition(`(style(${name}: ${(0, helpers_1.formatContainerQueryValue)(value)}))`);
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
exports.emitStyleFeatures = emitStyleFeatures;
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultContainerQueryValidation = exports.validateCustomFeatures = exports.validateStyleValues = exports.validateAspectRatioValues = exports.validateBlockSizeValues = exports.validateInlineSizeValues = exports.validateHeightValuesPositive = exports.validateMinMaxHeight = exports.validateWidthValuesPositive = exports.validateMinMaxWidth = exports.runContainerQueryValidation = exports.createContainerQueryValidation = void 0;
|
|
4
|
-
const helpers_1 = require("./helpers");
|
|
5
|
-
const core_1 = require("../core");
|
|
6
|
-
const validation_1 = require("../validation");
|
|
7
|
-
const ratio_1 = require("../ratio");
|
|
8
|
-
const isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
|
|
9
|
-
const assertMeasurement = (value, label) => {
|
|
10
|
-
(0, core_1.assertCondition)((0, core_1.isMeasurement)(value), `${label} must be a measurement`);
|
|
11
|
-
};
|
|
12
|
-
const assertMeasurementPositive = (value, label) => {
|
|
13
|
-
(0, core_1.assertCondition)(value.getValue() > 0, `${label} must be greater than 0`);
|
|
14
|
-
};
|
|
15
|
-
const assertRatio = (value, label) => {
|
|
16
|
-
(0, core_1.assertCondition)((0, core_1.isRatio)(value), `${label} must be a ratio created with r()`);
|
|
17
|
-
};
|
|
18
|
-
const assertRatioPositive = (value, label) => {
|
|
19
|
-
(0, core_1.assertCondition)(value.numerator() > 0, `${label} numerator must be greater than 0`);
|
|
20
|
-
(0, core_1.assertCondition)(value.denominator() > 0, `${label} denominator must be greater than 0`);
|
|
21
|
-
};
|
|
22
|
-
const isStyleValue = (value) => {
|
|
23
|
-
if (typeof value === "string")
|
|
24
|
-
return true;
|
|
25
|
-
if (isFiniteNumber(value))
|
|
26
|
-
return true;
|
|
27
|
-
if ((0, core_1.hasCssMethod)(value))
|
|
28
|
-
return true;
|
|
29
|
-
return false;
|
|
30
|
-
};
|
|
31
|
-
const createContainerQueryValidation = (core) => {
|
|
32
|
-
const assertCondition = core.assertCondition;
|
|
33
|
-
const assertMatchingUnits = core.assertMatchingUnits;
|
|
34
|
-
const runContainerQueryValidation = (config, helpers, check, context, fallbackMessage = "Invalid container query configuration") => {
|
|
35
|
-
if (!check)
|
|
36
|
-
return true;
|
|
37
|
-
try {
|
|
38
|
-
check(config);
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
const result = (0, validation_1.toValidationResult)(error, fallbackMessage);
|
|
43
|
-
return (0, helpers_1.applyContainerQueryValidation)(config, helpers, () => result, context);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
const validateMinMaxWidth = (props) => {
|
|
47
|
-
if (!props.minWidth || !props.maxWidth)
|
|
48
|
-
return;
|
|
49
|
-
assertMatchingUnits(props.minWidth, props.maxWidth, "containerQueries.minMaxWidth");
|
|
50
|
-
assertCondition(props.minWidth.getValue() <= props.maxWidth.getValue(), "minWidth must be less than or equal to maxWidth");
|
|
51
|
-
};
|
|
52
|
-
const validateWidthValuesPositive = (props) => {
|
|
53
|
-
if (props.minWidth) {
|
|
54
|
-
assertMeasurement(props.minWidth, "minWidth");
|
|
55
|
-
assertMeasurementPositive(props.minWidth, "minWidth");
|
|
56
|
-
}
|
|
57
|
-
if (props.maxWidth) {
|
|
58
|
-
assertMeasurement(props.maxWidth, "maxWidth");
|
|
59
|
-
assertMeasurementPositive(props.maxWidth, "maxWidth");
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
const validateMinMaxHeight = (props) => {
|
|
63
|
-
if (!props.minHeight || !props.maxHeight)
|
|
64
|
-
return;
|
|
65
|
-
assertMatchingUnits(props.minHeight, props.maxHeight, "containerQueries.minMaxHeight");
|
|
66
|
-
assertCondition(props.minHeight.getValue() <= props.maxHeight.getValue(), "minHeight must be less than or equal to maxHeight");
|
|
67
|
-
};
|
|
68
|
-
const validateHeightValuesPositive = (props) => {
|
|
69
|
-
if (props.minHeight) {
|
|
70
|
-
assertMeasurement(props.minHeight, "minHeight");
|
|
71
|
-
assertMeasurementPositive(props.minHeight, "minHeight");
|
|
72
|
-
}
|
|
73
|
-
if (props.maxHeight) {
|
|
74
|
-
assertMeasurement(props.maxHeight, "maxHeight");
|
|
75
|
-
assertMeasurementPositive(props.maxHeight, "maxHeight");
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
const validateInlineSizeValues = (props) => {
|
|
79
|
-
if (props.inlineSize) {
|
|
80
|
-
assertMeasurement(props.inlineSize.value, "inlineSize");
|
|
81
|
-
assertMeasurementPositive(props.inlineSize.value, "inlineSize");
|
|
82
|
-
}
|
|
83
|
-
if (props.inlineSizeRange) {
|
|
84
|
-
assertMeasurement(props.inlineSizeRange.min, "inlineSizeRange.min");
|
|
85
|
-
assertMeasurement(props.inlineSizeRange.max, "inlineSizeRange.max");
|
|
86
|
-
assertMeasurementPositive(props.inlineSizeRange.min, "inlineSizeRange.min");
|
|
87
|
-
assertMeasurementPositive(props.inlineSizeRange.max, "inlineSizeRange.max");
|
|
88
|
-
assertMatchingUnits(props.inlineSizeRange.min, props.inlineSizeRange.max, "containerQueries.inlineSizeRangeUnits");
|
|
89
|
-
assertCondition(props.inlineSizeRange.min.getValue() <=
|
|
90
|
-
props.inlineSizeRange.max.getValue(), "inlineSizeRange min must be less than or equal to max");
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
const validateBlockSizeValues = (props) => {
|
|
94
|
-
if (props.blockSize) {
|
|
95
|
-
assertMeasurement(props.blockSize.value, "blockSize");
|
|
96
|
-
assertMeasurementPositive(props.blockSize.value, "blockSize");
|
|
97
|
-
}
|
|
98
|
-
if (props.blockSizeRange) {
|
|
99
|
-
assertMeasurement(props.blockSizeRange.min, "blockSizeRange.min");
|
|
100
|
-
assertMeasurement(props.blockSizeRange.max, "blockSizeRange.max");
|
|
101
|
-
assertMeasurementPositive(props.blockSizeRange.min, "blockSizeRange.min");
|
|
102
|
-
assertMeasurementPositive(props.blockSizeRange.max, "blockSizeRange.max");
|
|
103
|
-
assertMatchingUnits(props.blockSizeRange.min, props.blockSizeRange.max, "containerQueries.blockSizeRangeUnits");
|
|
104
|
-
assertCondition(props.blockSizeRange.min.getValue() <=
|
|
105
|
-
props.blockSizeRange.max.getValue(), "blockSizeRange min must be less than or equal to max");
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
const validateAspectRatioValues = (props) => {
|
|
109
|
-
if (props.aspectRatio) {
|
|
110
|
-
assertRatio(props.aspectRatio, "aspectRatio");
|
|
111
|
-
assertRatioPositive(props.aspectRatio, "aspectRatio");
|
|
112
|
-
}
|
|
113
|
-
if (props.minAspectRatio) {
|
|
114
|
-
assertRatio(props.minAspectRatio, "minAspectRatio");
|
|
115
|
-
assertRatioPositive(props.minAspectRatio, "minAspectRatio");
|
|
116
|
-
}
|
|
117
|
-
if (props.maxAspectRatio) {
|
|
118
|
-
assertRatio(props.maxAspectRatio, "maxAspectRatio");
|
|
119
|
-
assertRatioPositive(props.maxAspectRatio, "maxAspectRatio");
|
|
120
|
-
}
|
|
121
|
-
if (props.minAspectRatio && props.maxAspectRatio) {
|
|
122
|
-
const minValue = (0, ratio_1.ratioToFloat)(props.minAspectRatio);
|
|
123
|
-
const maxValue = (0, ratio_1.ratioToFloat)(props.maxAspectRatio);
|
|
124
|
-
assertCondition(minValue <= maxValue, "minAspectRatio must be less than or equal to maxAspectRatio");
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
const validateStyleValues = (props) => {
|
|
128
|
-
if (!props.style)
|
|
129
|
-
return;
|
|
130
|
-
const entries = Object.entries(props.style);
|
|
131
|
-
assertCondition(entries.length > 0, "style conditions must not be empty.");
|
|
132
|
-
entries.forEach(([name, value]) => {
|
|
133
|
-
if (value === undefined || value === null)
|
|
134
|
-
return;
|
|
135
|
-
if (Array.isArray(value)) {
|
|
136
|
-
assertCondition(value.length > 0, `style.${name} must not be empty`);
|
|
137
|
-
value.forEach((entry, index) => {
|
|
138
|
-
assertCondition(isStyleValue(entry), `style.${name}[${index}] must be a primitive or measurement`);
|
|
139
|
-
});
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
assertCondition(isStyleValue(value), `style.${name} must be a primitive or measurement`);
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
const validateCustomFeatures = (props) => {
|
|
146
|
-
if (!props.customFeatures)
|
|
147
|
-
return;
|
|
148
|
-
const entries = Object.entries(props.customFeatures);
|
|
149
|
-
assertCondition(entries.length > 0, "customFeatures should not be empty.");
|
|
150
|
-
entries.forEach(([name, value]) => {
|
|
151
|
-
const trimmedName = name.trim();
|
|
152
|
-
assertCondition(trimmedName.length > 0, "Custom feature name must be non-empty.");
|
|
153
|
-
if (value === undefined || value === null)
|
|
154
|
-
return;
|
|
155
|
-
assertCondition(isStyleValue(value), `Custom feature "${trimmedName}" must be a primitive or a measurement.`);
|
|
156
|
-
});
|
|
157
|
-
};
|
|
158
|
-
return {
|
|
159
|
-
runContainerQueryValidation,
|
|
160
|
-
validateMinMaxWidth,
|
|
161
|
-
validateWidthValuesPositive,
|
|
162
|
-
validateMinMaxHeight,
|
|
163
|
-
validateHeightValuesPositive,
|
|
164
|
-
validateInlineSizeValues,
|
|
165
|
-
validateBlockSizeValues,
|
|
166
|
-
validateAspectRatioValues,
|
|
167
|
-
validateStyleValues,
|
|
168
|
-
validateCustomFeatures,
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
exports.createContainerQueryValidation = createContainerQueryValidation;
|
|
172
|
-
const defaultContainerQueryValidation = (0, exports.createContainerQueryValidation)({
|
|
173
|
-
assertCondition: core_1.assertCondition,
|
|
174
|
-
assertMatchingUnits: core_1.assertMatchingUnits,
|
|
175
|
-
});
|
|
176
|
-
exports.defaultContainerQueryValidation = defaultContainerQueryValidation;
|
|
177
|
-
exports.runContainerQueryValidation = defaultContainerQueryValidation.runContainerQueryValidation, exports.validateMinMaxWidth = defaultContainerQueryValidation.validateMinMaxWidth, exports.validateWidthValuesPositive = defaultContainerQueryValidation.validateWidthValuesPositive, exports.validateMinMaxHeight = defaultContainerQueryValidation.validateMinMaxHeight, exports.validateHeightValuesPositive = defaultContainerQueryValidation.validateHeightValuesPositive, exports.validateInlineSizeValues = defaultContainerQueryValidation.validateInlineSizeValues, exports.validateBlockSizeValues = defaultContainerQueryValidation.validateBlockSizeValues, exports.validateAspectRatioValues = defaultContainerQueryValidation.validateAspectRatioValues, exports.validateStyleValues = defaultContainerQueryValidation.validateStyleValues, exports.validateCustomFeatures = defaultContainerQueryValidation.validateCustomFeatures;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.simplifyRatio = exports.reduceRatio = exports.r = exports.parseRatio = exports.normalizeRatio = exports.isRatio = exports.ratioToFloat = exports.setErrorConfig = exports.getErrorConfig = exports.assertCondition = exports.assertUnit = exports.hasCssMethod = exports.makeUnitAssert = exports.makeUnitGuard = exports.makeUnitHelperFromDefinition = exports.makeUnitHelper = exports.measurementUnitMetadata = exports.measurementMax = exports.measurementMin = exports.assertMatchingUnits = exports.isMeasurement = exports.m = void 0;
|
|
4
|
-
const createCoreApi_1 = require("./internal/createCoreApi");
|
|
5
|
-
const errors_1 = require("./internal/errors");
|
|
6
|
-
const ratio_1 = require("./ratio");
|
|
7
|
-
Object.defineProperty(exports, "isRatio", { enumerable: true, get: function () { return ratio_1.isRatio; } });
|
|
8
|
-
Object.defineProperty(exports, "normalizeRatio", { enumerable: true, get: function () { return ratio_1.normalizeRatio; } });
|
|
9
|
-
Object.defineProperty(exports, "parseRatio", { enumerable: true, get: function () { return ratio_1.parseRatio; } });
|
|
10
|
-
Object.defineProperty(exports, "r", { enumerable: true, get: function () { return ratio_1.r; } });
|
|
11
|
-
Object.defineProperty(exports, "ratioToFloat", { enumerable: true, get: function () { return ratio_1.ratioToFloat; } });
|
|
12
|
-
Object.defineProperty(exports, "reduceRatio", { enumerable: true, get: function () { return ratio_1.reduceRatio; } });
|
|
13
|
-
Object.defineProperty(exports, "simplifyRatio", { enumerable: true, get: function () { return ratio_1.simplifyRatio; } });
|
|
14
|
-
const defaultErrorStore = (0, errors_1.createErrorConfigStore)();
|
|
15
|
-
const coreApi = (0, createCoreApi_1.createCoreApi)(defaultErrorStore);
|
|
16
|
-
exports.m = coreApi.m, exports.isMeasurement = coreApi.isMeasurement, exports.assertMatchingUnits = coreApi.assertMatchingUnits, exports.measurementMin = coreApi.measurementMin, exports.measurementMax = coreApi.measurementMax, exports.measurementUnitMetadata = coreApi.measurementUnitMetadata, exports.makeUnitHelper = coreApi.makeUnitHelper, exports.makeUnitHelperFromDefinition = coreApi.makeUnitHelperFromDefinition, exports.makeUnitGuard = coreApi.makeUnitGuard, exports.makeUnitAssert = coreApi.makeUnitAssert, exports.hasCssMethod = coreApi.hasCssMethod, exports.assertUnit = coreApi.assertUnit, exports.assertCondition = coreApi.assertCondition, exports.getErrorConfig = coreApi.getErrorConfig, exports.setErrorConfig = coreApi.setErrorConfig;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createCalipers = void 0;
|
|
4
|
-
const errors_1 = require("./internal/errors");
|
|
5
|
-
const createCoreApi_1 = require("./internal/createCoreApi");
|
|
6
|
-
const createUnitsApi_1 = require("./internal/createUnitsApi");
|
|
7
|
-
const createMediaQueriesApi_1 = require("./internal/createMediaQueriesApi");
|
|
8
|
-
const createCalipers = (config = {}) => {
|
|
9
|
-
var _a;
|
|
10
|
-
const errorStore = (0, errors_1.createErrorConfigStore)((_a = config.errorConfig) !== null && _a !== void 0 ? _a : {});
|
|
11
|
-
const core = (0, createCoreApi_1.createCoreApi)(errorStore);
|
|
12
|
-
const units = (0, createUnitsApi_1.createUnitsApi)(core);
|
|
13
|
-
const mediaQueries = (0, createMediaQueriesApi_1.createMediaQueriesApi)(core);
|
|
14
|
-
return {
|
|
15
|
-
...core,
|
|
16
|
-
...units,
|
|
17
|
-
mediaQueries,
|
|
18
|
-
units,
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
exports.createCalipers = createCalipers;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./core"), exports);
|
|
18
|
-
__exportStar(require("./units/percent"), exports);
|
|
19
|
-
__exportStar(require("./units/absolute"), exports);
|
|
20
|
-
__exportStar(require("./units/font-relative"), exports);
|
|
21
|
-
__exportStar(require("./units/viewport"), exports);
|
|
22
|
-
__exportStar(require("./units/viewport-small"), exports);
|
|
23
|
-
__exportStar(require("./units/viewport-large"), exports);
|
|
24
|
-
__exportStar(require("./units/viewport-dynamic"), exports);
|
|
25
|
-
__exportStar(require("./units/container"), exports);
|
|
26
|
-
__exportStar(require("./units/angle"), exports);
|
|
27
|
-
__exportStar(require("./units/time"), exports);
|
|
28
|
-
__exportStar(require("./units/frequency"), exports);
|
|
29
|
-
__exportStar(require("./units/resolution"), exports);
|
|
30
|
-
__exportStar(require("./units/grid"), exports);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildMeasurementCreationError = void 0;
|
|
4
|
-
const buildMeasurementCreationError = (value, unit, helper, context) => {
|
|
5
|
-
const code = 'CALIPERS_E_NONFINITE';
|
|
6
|
-
return {
|
|
7
|
-
message: `Non-finite measurement value: ${value}`,
|
|
8
|
-
context,
|
|
9
|
-
details: {
|
|
10
|
-
code,
|
|
11
|
-
helper,
|
|
12
|
-
inputSummary: `value=${value}, unit=${unit}`,
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
exports.buildMeasurementCreationError = buildMeasurementCreationError;
|