@mapbox/mapbox-gl-style-spec 14.26.0-rc.1 → 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.cjs
CHANGED
|
@@ -12445,7 +12445,7 @@
|
|
|
12445
12445
|
class Scope {
|
|
12446
12446
|
constructor(parent, bindings = []) {
|
|
12447
12447
|
this.parent = parent;
|
|
12448
|
-
this.bindings =
|
|
12448
|
+
this.bindings = /* @__PURE__ */ Object.create(null);
|
|
12449
12449
|
for (const [name, expression] of bindings) {
|
|
12450
12450
|
this.bindings[name] = expression;
|
|
12451
12451
|
}
|
|
@@ -15719,7 +15719,7 @@
|
|
|
15719
15719
|
if (expr.length === 0) {
|
|
15720
15720
|
return this.error(`Expected an array with at least one element. If you wanted a literal array, use ["literal", []].`);
|
|
15721
15721
|
}
|
|
15722
|
-
const Expr = typeof expr[0] === "string" ? this.registry[expr[0]] : void 0;
|
|
15722
|
+
const Expr = typeof expr[0] === "string" && Object.hasOwn(this.registry, expr[0]) ? this.registry[expr[0]] : void 0;
|
|
15723
15723
|
if (Expr) {
|
|
15724
15724
|
let parsed = Expr.parse(expr, this);
|
|
15725
15725
|
if (!parsed) return null;
|
|
@@ -17026,12 +17026,12 @@
|
|
|
17026
17026
|
if (!unit) return null;
|
|
17027
17027
|
}
|
|
17028
17028
|
let minFractionDigits = null;
|
|
17029
|
-
if (options["min-fraction-digits"]) {
|
|
17029
|
+
if (options["min-fraction-digits"] !== void 0) {
|
|
17030
17030
|
minFractionDigits = context.parseObjectValue(options["min-fraction-digits"], 2, "min-fraction-digits", NumberType);
|
|
17031
17031
|
if (!minFractionDigits) return null;
|
|
17032
17032
|
}
|
|
17033
17033
|
let maxFractionDigits = null;
|
|
17034
|
-
if (options["max-fraction-digits"]) {
|
|
17034
|
+
if (options["max-fraction-digits"] !== void 0) {
|
|
17035
17035
|
maxFractionDigits = context.parseObjectValue(options["max-fraction-digits"], 2, "max-fraction-digits", NumberType);
|
|
17036
17036
|
if (!maxFractionDigits) return null;
|
|
17037
17037
|
}
|
|
@@ -18120,7 +18120,7 @@
|
|
|
18120
18120
|
}
|
|
18121
18121
|
}
|
|
18122
18122
|
function isExpression(expression) {
|
|
18123
|
-
return Array.isArray(expression) && expression.length > 0 && typeof expression[0] === "string" && expression[0]
|
|
18123
|
+
return Array.isArray(expression) && expression.length > 0 && typeof expression[0] === "string" && Object.hasOwn(expressions, expression[0]);
|
|
18124
18124
|
}
|
|
18125
18125
|
function createExpression(expression, propertySpec, scope, options, iconImageUseTheme) {
|
|
18126
18126
|
const parser = new ParsingContext(expressions, [], propertySpec ? getExpectedType(propertySpec) : void 0, void 0, void 0, scope, options, iconImageUseTheme);
|
|
@@ -19548,9 +19548,10 @@ ${JSON.stringify(filterExp, null, 2)}
|
|
|
19548
19548
|
const key2 = `${options.key}.id`;
|
|
19549
19549
|
errors.push(new ValidationError(key2, importSpec, `import id can't be an empty string`));
|
|
19550
19550
|
}
|
|
19551
|
-
|
|
19551
|
+
const importId = unbundle(importSpec.id);
|
|
19552
|
+
if (importId === "__proto__" || importId === "constructor" || importId === "prototype") {
|
|
19552
19553
|
const key2 = `${options.key}.id`;
|
|
19553
|
-
errors.push(new ValidationError(key2, importSpec, `import id can't be "
|
|
19554
|
+
errors.push(new ValidationError(key2, importSpec, `import id can't be "${String(importId)}"`));
|
|
19554
19555
|
}
|
|
19555
19556
|
if (data) {
|
|
19556
19557
|
const key2 = `${options.key}.data`;
|