@mapbox/mapbox-gl-style-spec 14.26.0 → 14.27.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +8 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +12459 -2252
- package/dist/index.es.js +8 -7
- package/dist/index.es.js.map +1 -1
- package/expression/definitions/number_format.ts +2 -2
- package/expression/index.ts +1 -1
- package/expression/parsing_context.ts +1 -1
- package/expression/scope.ts +2 -4
- package/package.json +2 -2
- package/rollup.config.dts.ts +17 -0
- package/validate/validate_import.ts +4 -4
package/dist/index.es.js
CHANGED
|
@@ -12439,7 +12439,7 @@ let ParsingError$1 = class ParsingError extends Error {
|
|
|
12439
12439
|
class Scope {
|
|
12440
12440
|
constructor(parent, bindings = []) {
|
|
12441
12441
|
this.parent = parent;
|
|
12442
|
-
this.bindings =
|
|
12442
|
+
this.bindings = /* @__PURE__ */ Object.create(null);
|
|
12443
12443
|
for (const [name, expression] of bindings) {
|
|
12444
12444
|
this.bindings[name] = expression;
|
|
12445
12445
|
}
|
|
@@ -15713,7 +15713,7 @@ class ParsingContext {
|
|
|
15713
15713
|
if (expr.length === 0) {
|
|
15714
15714
|
return this.error(`Expected an array with at least one element. If you wanted a literal array, use ["literal", []].`);
|
|
15715
15715
|
}
|
|
15716
|
-
const Expr = typeof expr[0] === "string" ? this.registry[expr[0]] : void 0;
|
|
15716
|
+
const Expr = typeof expr[0] === "string" && Object.hasOwn(this.registry, expr[0]) ? this.registry[expr[0]] : void 0;
|
|
15717
15717
|
if (Expr) {
|
|
15718
15718
|
let parsed = Expr.parse(expr, this);
|
|
15719
15719
|
if (!parsed) return null;
|
|
@@ -17020,12 +17020,12 @@ class NumberFormat {
|
|
|
17020
17020
|
if (!unit) return null;
|
|
17021
17021
|
}
|
|
17022
17022
|
let minFractionDigits = null;
|
|
17023
|
-
if (options["min-fraction-digits"]) {
|
|
17023
|
+
if (options["min-fraction-digits"] !== void 0) {
|
|
17024
17024
|
minFractionDigits = context.parseObjectValue(options["min-fraction-digits"], 2, "min-fraction-digits", NumberType);
|
|
17025
17025
|
if (!minFractionDigits) return null;
|
|
17026
17026
|
}
|
|
17027
17027
|
let maxFractionDigits = null;
|
|
17028
|
-
if (options["max-fraction-digits"]) {
|
|
17028
|
+
if (options["max-fraction-digits"] !== void 0) {
|
|
17029
17029
|
maxFractionDigits = context.parseObjectValue(options["max-fraction-digits"], 2, "max-fraction-digits", NumberType);
|
|
17030
17030
|
if (!maxFractionDigits) return null;
|
|
17031
17031
|
}
|
|
@@ -18114,7 +18114,7 @@ class StyleExpression {
|
|
|
18114
18114
|
}
|
|
18115
18115
|
}
|
|
18116
18116
|
function isExpression(expression) {
|
|
18117
|
-
return Array.isArray(expression) && expression.length > 0 && typeof expression[0] === "string" && expression[0]
|
|
18117
|
+
return Array.isArray(expression) && expression.length > 0 && typeof expression[0] === "string" && Object.hasOwn(expressions, expression[0]);
|
|
18118
18118
|
}
|
|
18119
18119
|
function createExpression(expression, propertySpec, scope, options, iconImageUseTheme) {
|
|
18120
18120
|
const parser = new ParsingContext(expressions, [], propertySpec ? getExpectedType(propertySpec) : void 0, void 0, void 0, scope, options, iconImageUseTheme);
|
|
@@ -19542,9 +19542,10 @@ function validateImport(options) {
|
|
|
19542
19542
|
const key2 = `${options.key}.id`;
|
|
19543
19543
|
errors.push(new ValidationError(key2, importSpec, `import id can't be an empty string`));
|
|
19544
19544
|
}
|
|
19545
|
-
|
|
19545
|
+
const importId = unbundle(importSpec.id);
|
|
19546
|
+
if (importId === "__proto__" || importId === "constructor" || importId === "prototype") {
|
|
19546
19547
|
const key2 = `${options.key}.id`;
|
|
19547
|
-
errors.push(new ValidationError(key2, importSpec, `import id can't be "
|
|
19548
|
+
errors.push(new ValidationError(key2, importSpec, `import id can't be "${String(importId)}"`));
|
|
19548
19549
|
}
|
|
19549
19550
|
if (data) {
|
|
19550
19551
|
const key2 = `${options.key}.data`;
|