@mapbox/mapbox-gl-style-spec 14.12.0-beta.1 → 14.12.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/composite.ts +2 -0
- package/deref.ts +5 -5
- package/diff.ts +18 -20
- package/dist/index.cjs +143 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +41 -7
- package/dist/index.es.js +143 -13
- package/dist/index.es.js.map +1 -1
- package/error/validation_error.ts +1 -3
- package/expression/definitions/assertion.ts +2 -1
- package/expression/definitions/at.ts +1 -1
- package/expression/definitions/at_interpolated.ts +1 -1
- package/expression/definitions/case.ts +3 -1
- package/expression/definitions/coalesce.ts +1 -0
- package/expression/definitions/coercion.ts +3 -1
- package/expression/definitions/collator.ts +2 -1
- package/expression/definitions/comparison.ts +15 -1
- package/expression/definitions/config.ts +3 -0
- package/expression/definitions/distance.ts +6 -4
- package/expression/definitions/format.ts +1 -1
- package/expression/definitions/index.ts +21 -0
- package/expression/definitions/index_of.ts +1 -0
- package/expression/definitions/interpolate.ts +5 -1
- package/expression/definitions/let.ts +1 -0
- package/expression/definitions/literal.ts +2 -2
- package/expression/definitions/match.ts +3 -1
- package/expression/definitions/number_format.ts +3 -4
- package/expression/definitions/slice.ts +1 -0
- package/expression/definitions/step.ts +1 -0
- package/expression/definitions/var.ts +1 -0
- package/expression/definitions/within.ts +6 -2
- package/expression/expression.ts +3 -0
- package/expression/index.ts +17 -3
- package/expression/types/image_variant.ts +2 -2
- package/expression/types.ts +1 -0
- package/feature_filter/convert.ts +13 -6
- package/feature_filter/index.ts +16 -0
- package/format.ts +1 -0
- package/function/convert.ts +5 -1
- package/function/index.ts +28 -0
- package/group_by_layout.ts +17 -8
- package/migrate/expressions.ts +2 -2
- package/migrate/v8.ts +9 -0
- package/migrate/v9.ts +1 -0
- package/migrate.ts +1 -0
- package/package.json +1 -1
- package/read_style.ts +1 -0
- package/reference/latest.ts +1 -0
- package/reference/v8.json +116 -11
- package/types.ts +12 -1
- package/union-to-intersection.ts +1 -0
- package/util/extend.ts +1 -0
- package/util/geometry_util.ts +7 -8
- package/validate/validate.ts +6 -0
- package/validate/validate_array.ts +2 -0
- package/validate/validate_enum.ts +1 -0
- package/validate/validate_expression.ts +4 -0
- package/validate/validate_filter.ts +4 -2
- package/validate/validate_fog.ts +3 -0
- package/validate/validate_function.ts +7 -2
- package/validate/validate_iconset.ts +1 -0
- package/validate/validate_layer.ts +1 -0
- package/validate/validate_light.ts +3 -0
- package/validate/validate_lights.ts +6 -0
- package/validate/validate_model.ts +4 -0
- package/validate/validate_object.ts +2 -2
- package/validate/validate_projection.ts +1 -0
- package/validate/validate_property.ts +4 -0
- package/validate/validate_rain.ts +3 -0
- package/validate/validate_snow.ts +3 -0
- package/validate/validate_source.ts +8 -6
- package/validate/validate_terrain.ts +4 -0
- package/validate_mapbox_api_supported.ts +30 -19
- package/validate_style.ts +1 -0
- package/visit.ts +3 -1
package/composite.ts
CHANGED
|
@@ -21,6 +21,7 @@ export default function (style) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
if (styleIDs.length < 2)
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
24
25
|
return style;
|
|
25
26
|
|
|
26
27
|
styleIDs.forEach((id) => {
|
|
@@ -48,5 +49,6 @@ export default function (style) {
|
|
|
48
49
|
}
|
|
49
50
|
});
|
|
50
51
|
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
51
53
|
return style;
|
|
52
54
|
}
|
package/deref.ts
CHANGED
|
@@ -3,7 +3,7 @@ import refProperties from './util/ref_properties';
|
|
|
3
3
|
import type {LayerSpecification} from './types';
|
|
4
4
|
|
|
5
5
|
function deref(layer: LayerSpecification, parent: LayerSpecification): LayerSpecification {
|
|
6
|
-
const result
|
|
6
|
+
const result = {} as LayerSpecification;
|
|
7
7
|
|
|
8
8
|
for (const k in layer) {
|
|
9
9
|
if (k !== 'ref') {
|
|
@@ -13,11 +13,11 @@ function deref(layer: LayerSpecification, parent: LayerSpecification): LayerSpec
|
|
|
13
13
|
|
|
14
14
|
refProperties.forEach((k) => {
|
|
15
15
|
if (k in parent) {
|
|
16
|
-
result[k] =
|
|
16
|
+
result[k] = parent[k];
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
return result
|
|
20
|
+
return result;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/**
|
|
@@ -36,14 +36,14 @@ function deref(layer: LayerSpecification, parent: LayerSpecification): LayerSpec
|
|
|
36
36
|
export default function derefLayers(layers: Array<LayerSpecification>): Array<LayerSpecification> {
|
|
37
37
|
layers = layers.slice();
|
|
38
38
|
|
|
39
|
-
const map:
|
|
39
|
+
const map: Record<string, LayerSpecification> = Object.create(null);
|
|
40
40
|
for (let i = 0; i < layers.length; i++) {
|
|
41
41
|
map[layers[i].id] = layers[i];
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
for (let i = 0; i < layers.length; i++) {
|
|
45
45
|
if ('ref' in layers[i]) {
|
|
46
|
-
layers[i] = deref(layers[i], map[(layers[i] as
|
|
46
|
+
layers[i] = deref(layers[i], map[(layers[i] as LayerSpecification & {ref: string}).ref]);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
package/diff.ts
CHANGED
|
@@ -8,7 +8,7 @@ type Sources = {
|
|
|
8
8
|
|
|
9
9
|
type Command = {
|
|
10
10
|
command: string;
|
|
11
|
-
args:
|
|
11
|
+
args: unknown[];
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export const operations = {
|
|
@@ -240,7 +240,16 @@ function diffSources(before: Sources, after: Sources, commands: Array<Command>,
|
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
function diffLayerPropertyChanges(before:
|
|
243
|
+
function diffLayerPropertyChanges(before: LayerSpecification['layout'], after: LayerSpecification['layout'], commands: Array<Command>, layerId: string, klass: string | null | undefined, command: string): void;
|
|
244
|
+
function diffLayerPropertyChanges(before: LayerSpecification['paint'], after: LayerSpecification['paint'], commands: Array<Command>, layerId: string, klass: string | null | undefined, command: string): void;
|
|
245
|
+
function diffLayerPropertyChanges(
|
|
246
|
+
before: LayerSpecification['paint'] | LayerSpecification['layout'],
|
|
247
|
+
after: LayerSpecification['paint'] | LayerSpecification['layout'],
|
|
248
|
+
commands: Command[],
|
|
249
|
+
layerId: string,
|
|
250
|
+
klass: string | null | undefined,
|
|
251
|
+
command: string
|
|
252
|
+
) {
|
|
244
253
|
before = before || {};
|
|
245
254
|
after = after || {};
|
|
246
255
|
|
|
@@ -260,22 +269,11 @@ function diffLayerPropertyChanges(before: any, after: any, commands: Array<Comma
|
|
|
260
269
|
}
|
|
261
270
|
}
|
|
262
271
|
|
|
263
|
-
function pluckId<T extends {
|
|
264
|
-
id: string;
|
|
265
|
-
}>(item: T): string {
|
|
272
|
+
function pluckId<T extends {id: string}>(item: T): string {
|
|
266
273
|
return item.id;
|
|
267
274
|
}
|
|
268
275
|
|
|
269
|
-
function indexById<T extends {
|
|
270
|
-
id: string;
|
|
271
|
-
}>(
|
|
272
|
-
group: {
|
|
273
|
-
[key: string]: T;
|
|
274
|
-
},
|
|
275
|
-
item: T,
|
|
276
|
-
): {
|
|
277
|
-
[id: string]: T;
|
|
278
|
-
} {
|
|
276
|
+
function indexById<T extends {id: string}>(group: {[key: string]: T}, item: T): {[id: string]: T} {
|
|
279
277
|
group[item.id] = item;
|
|
280
278
|
return group;
|
|
281
279
|
}
|
|
@@ -289,14 +287,14 @@ function diffLayers(before: Array<LayerSpecification>, after: Array<LayerSpecifi
|
|
|
289
287
|
const afterOrder = after.map(pluckId);
|
|
290
288
|
|
|
291
289
|
// index of layer by id
|
|
292
|
-
const beforeIndex = before.reduce
|
|
293
|
-
const afterIndex = after.reduce
|
|
290
|
+
const beforeIndex = before.reduce(indexById, {});
|
|
291
|
+
const afterIndex = after.reduce(indexById, {});
|
|
294
292
|
|
|
295
293
|
// track order of layers as if they have been mutated
|
|
296
294
|
const tracker = beforeOrder.slice();
|
|
297
295
|
|
|
298
296
|
// layers that have been added do not need to be diffed
|
|
299
|
-
const clean
|
|
297
|
+
const clean = Object.create(null);
|
|
300
298
|
|
|
301
299
|
let i, d, layerId, beforeLayer: LayerSpecification, afterLayer: LayerSpecification, insertBeforeLayerId, prop;
|
|
302
300
|
|
|
@@ -401,8 +399,8 @@ export function diffImports(before: Array<ImportSpecification> | null | undefine
|
|
|
401
399
|
const afterOrder = after.map(pluckId);
|
|
402
400
|
|
|
403
401
|
// index imports by id
|
|
404
|
-
const beforeIndex = before.reduce
|
|
405
|
-
const afterIndex = after.reduce
|
|
402
|
+
const beforeIndex = before.reduce(indexById, {});
|
|
403
|
+
const afterIndex = after.reduce(indexById, {});
|
|
406
404
|
|
|
407
405
|
// track order of imports as if they have been mutated
|
|
408
406
|
const tracker = beforeOrder.slice();
|
package/dist/index.cjs
CHANGED
|
@@ -794,6 +794,16 @@
|
|
|
794
794
|
],
|
|
795
795
|
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
|
796
796
|
},
|
|
797
|
+
extra_bounds: {
|
|
798
|
+
type: "array",
|
|
799
|
+
value: {
|
|
800
|
+
type: "array",
|
|
801
|
+
value: "number",
|
|
802
|
+
length: 4,
|
|
803
|
+
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`."
|
|
804
|
+
},
|
|
805
|
+
doc: "An array of additional discrete geographic regions where tiles are available. When used alongside the `bounds` property, these regions act as an additional filter - Mapbox GL will only request tiles that are both within the `bounds` and any of the regions defined in `extra_bounds`. When used independently (without `bounds`), Mapbox GL will request tiles that fall within any of the regions in `extra_bounds`. This allows for more fine-grained control over tile requests, particularly when dealing with sparse data coverage."
|
|
806
|
+
},
|
|
797
807
|
scheme: {
|
|
798
808
|
type: "enum",
|
|
799
809
|
values: {
|
|
@@ -873,6 +883,16 @@
|
|
|
873
883
|
],
|
|
874
884
|
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
|
875
885
|
},
|
|
886
|
+
extra_bounds: {
|
|
887
|
+
type: "array",
|
|
888
|
+
value: {
|
|
889
|
+
type: "array",
|
|
890
|
+
value: "number",
|
|
891
|
+
length: 4,
|
|
892
|
+
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`."
|
|
893
|
+
},
|
|
894
|
+
doc: "An array of additional discrete geographic regions where tiles are available. When used alongside the `bounds` property, these regions act as an additional filter - Mapbox GL will only request tiles that are both within the `bounds` and any of the regions defined in `extra_bounds`. When used independently (without `bounds`), Mapbox GL will request tiles that fall within any of the regions in `extra_bounds`. This allows for more fine-grained control over tile requests, particularly when dealing with sparse data coverage."
|
|
895
|
+
},
|
|
876
896
|
minzoom: {
|
|
877
897
|
type: "number",
|
|
878
898
|
"default": 0,
|
|
@@ -954,6 +974,16 @@
|
|
|
954
974
|
],
|
|
955
975
|
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
|
956
976
|
},
|
|
977
|
+
extra_bounds: {
|
|
978
|
+
type: "array",
|
|
979
|
+
value: {
|
|
980
|
+
type: "array",
|
|
981
|
+
value: "number",
|
|
982
|
+
length: 4,
|
|
983
|
+
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`."
|
|
984
|
+
},
|
|
985
|
+
doc: "An array of additional discrete geographic regions where tiles are available. When used alongside the `bounds` property, these regions act as an additional filter - Mapbox GL will only request tiles that are both within the `bounds` and any of the regions defined in `extra_bounds`. When used independently (without `bounds`), Mapbox GL will request tiles that fall within any of the regions in `extra_bounds`. This allows for more fine-grained control over tile requests, particularly when dealing with sparse data coverage."
|
|
986
|
+
},
|
|
957
987
|
minzoom: {
|
|
958
988
|
type: "number",
|
|
959
989
|
"default": 0,
|
|
@@ -1036,6 +1066,16 @@
|
|
|
1036
1066
|
],
|
|
1037
1067
|
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
|
|
1038
1068
|
},
|
|
1069
|
+
extra_bounds: {
|
|
1070
|
+
type: "array",
|
|
1071
|
+
value: {
|
|
1072
|
+
type: "array",
|
|
1073
|
+
value: "number",
|
|
1074
|
+
length: 4,
|
|
1075
|
+
doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`."
|
|
1076
|
+
},
|
|
1077
|
+
doc: "An array of additional discrete geographic regions where tiles are available. When used alongside the `bounds` property, these regions act as an additional filter - Mapbox GL will only request tiles that are both within the `bounds` and any of the regions defined in `extra_bounds`. When used independently (without `bounds`), Mapbox GL will request tiles that fall within any of the regions in `extra_bounds`. This allows for more fine-grained control over tile requests, particularly when dealing with sparse data coverage."
|
|
1078
|
+
},
|
|
1039
1079
|
minzoom: {
|
|
1040
1080
|
type: "number",
|
|
1041
1081
|
"default": 0,
|
|
@@ -6450,6 +6490,30 @@
|
|
|
6450
6490
|
},
|
|
6451
6491
|
"property-type": "data-driven"
|
|
6452
6492
|
},
|
|
6493
|
+
"fill-pattern-cross-fade": {
|
|
6494
|
+
type: "number",
|
|
6495
|
+
"property-type": "data-constant",
|
|
6496
|
+
"default": 0,
|
|
6497
|
+
minimum: 0,
|
|
6498
|
+
maximum: 1,
|
|
6499
|
+
expression: {
|
|
6500
|
+
interpolated: true,
|
|
6501
|
+
parameters: [
|
|
6502
|
+
"zoom",
|
|
6503
|
+
"measure-light"
|
|
6504
|
+
]
|
|
6505
|
+
},
|
|
6506
|
+
requires: [
|
|
6507
|
+
"line-pattern"
|
|
6508
|
+
],
|
|
6509
|
+
"sdk-support": {
|
|
6510
|
+
"basic functionality": {
|
|
6511
|
+
js: "3.12.0"
|
|
6512
|
+
}
|
|
6513
|
+
},
|
|
6514
|
+
doc: "Controls the transition progress between the image variants of fill-pattern. Zero means the first variant is used, one is the second, and in between they are blended together.",
|
|
6515
|
+
transition: true
|
|
6516
|
+
},
|
|
6453
6517
|
"fill-emissive-strength": {
|
|
6454
6518
|
type: "number",
|
|
6455
6519
|
"default": 0,
|
|
@@ -7034,6 +7098,30 @@
|
|
|
7034
7098
|
},
|
|
7035
7099
|
"property-type": "data-driven"
|
|
7036
7100
|
},
|
|
7101
|
+
"line-pattern-cross-fade": {
|
|
7102
|
+
type: "number",
|
|
7103
|
+
"property-type": "data-constant",
|
|
7104
|
+
"default": 0,
|
|
7105
|
+
minimum: 0,
|
|
7106
|
+
maximum: 1,
|
|
7107
|
+
expression: {
|
|
7108
|
+
interpolated: true,
|
|
7109
|
+
parameters: [
|
|
7110
|
+
"zoom",
|
|
7111
|
+
"measure-light"
|
|
7112
|
+
]
|
|
7113
|
+
},
|
|
7114
|
+
requires: [
|
|
7115
|
+
"line-pattern"
|
|
7116
|
+
],
|
|
7117
|
+
"sdk-support": {
|
|
7118
|
+
"basic functionality": {
|
|
7119
|
+
js: "3.12.0"
|
|
7120
|
+
}
|
|
7121
|
+
},
|
|
7122
|
+
doc: "Controls the transition progress between the image variants of line-pattern. Zero means the first variant is used, one is the second, and in between they are blended together.",
|
|
7123
|
+
transition: true
|
|
7124
|
+
},
|
|
7037
7125
|
"line-gradient": {
|
|
7038
7126
|
type: "color",
|
|
7039
7127
|
doc: "A gradient used to color a line feature at various distances along its length. Defined using a `step` or `interpolate` expression which outputs a color for each corresponding `line-progress` input value. `line-progress` is a percentage of the line feature's total length as measured on the webmercator projected coordinate plane (a `number` between `0` and `1`). Can only be used with GeoJSON sources that specify `\"lineMetrics\": true`.",
|
|
@@ -8112,7 +8200,7 @@
|
|
|
8112
8200
|
},
|
|
8113
8201
|
"icon-image-cross-fade": {
|
|
8114
8202
|
type: "number",
|
|
8115
|
-
"property-type": "data-
|
|
8203
|
+
"property-type": "data-constant",
|
|
8116
8204
|
"default": 0,
|
|
8117
8205
|
minimum: 0,
|
|
8118
8206
|
maximum: 1,
|
|
@@ -8120,8 +8208,6 @@
|
|
|
8120
8208
|
interpolated: true,
|
|
8121
8209
|
parameters: [
|
|
8122
8210
|
"zoom",
|
|
8123
|
-
"feature",
|
|
8124
|
-
"feature-state",
|
|
8125
8211
|
"measure-light"
|
|
8126
8212
|
]
|
|
8127
8213
|
},
|
|
@@ -8133,11 +8219,6 @@
|
|
|
8133
8219
|
js: "3.0.0",
|
|
8134
8220
|
android: "11.0.0",
|
|
8135
8221
|
ios: "11.0.0"
|
|
8136
|
-
},
|
|
8137
|
-
"data-driven styling": {
|
|
8138
|
-
js: "3.0.0",
|
|
8139
|
-
android: "11.0.0",
|
|
8140
|
-
ios: "11.0.0"
|
|
8141
8222
|
}
|
|
8142
8223
|
},
|
|
8143
8224
|
doc: "Controls the transition progress between the image variants of icon-image. Zero means the first variant is used, one is the second, and in between they are blended together.",
|
|
@@ -10258,6 +10339,30 @@
|
|
|
10258
10339
|
},
|
|
10259
10340
|
"property-type": "data-driven"
|
|
10260
10341
|
},
|
|
10342
|
+
"fill-extrusion-pattern-cross-fade": {
|
|
10343
|
+
type: "number",
|
|
10344
|
+
"property-type": "data-constant",
|
|
10345
|
+
"default": 0,
|
|
10346
|
+
minimum: 0,
|
|
10347
|
+
maximum: 1,
|
|
10348
|
+
expression: {
|
|
10349
|
+
interpolated: true,
|
|
10350
|
+
parameters: [
|
|
10351
|
+
"zoom",
|
|
10352
|
+
"measure-light"
|
|
10353
|
+
]
|
|
10354
|
+
},
|
|
10355
|
+
requires: [
|
|
10356
|
+
"line-pattern"
|
|
10357
|
+
],
|
|
10358
|
+
"sdk-support": {
|
|
10359
|
+
"basic functionality": {
|
|
10360
|
+
js: "3.12.0"
|
|
10361
|
+
}
|
|
10362
|
+
},
|
|
10363
|
+
doc: "Controls the transition progress between the image variants of fill-extrusion-pattern. Zero means the first variant is used, one is the second, and in between they are blended together.",
|
|
10364
|
+
transition: true
|
|
10365
|
+
},
|
|
10261
10366
|
"fill-extrusion-height": {
|
|
10262
10367
|
type: "number",
|
|
10263
10368
|
"default": 0,
|
|
@@ -12925,8 +13030,8 @@
|
|
|
12925
13030
|
])
|
|
12926
13031
|
});
|
|
12927
13032
|
}
|
|
12928
|
-
scaleSelf(factor) {
|
|
12929
|
-
this.options.transform.scaleSelf(factor);
|
|
13033
|
+
scaleSelf(factor, yFactor) {
|
|
13034
|
+
this.options.transform.scaleSelf(factor, yFactor);
|
|
12930
13035
|
return this;
|
|
12931
13036
|
}
|
|
12932
13037
|
}
|
|
@@ -13221,6 +13326,7 @@
|
|
|
13221
13326
|
}
|
|
13222
13327
|
return new Assertion(type, parsed);
|
|
13223
13328
|
}
|
|
13329
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13224
13330
|
evaluate(ctx) {
|
|
13225
13331
|
for (let i = 0; i < this.args.length; i++) {
|
|
13226
13332
|
const value = this.args[i].evaluate(ctx);
|
|
@@ -13640,6 +13746,7 @@
|
|
|
13640
13746
|
}
|
|
13641
13747
|
return new Coercion(type, parsed);
|
|
13642
13748
|
}
|
|
13749
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13643
13750
|
evaluate(ctx) {
|
|
13644
13751
|
if (this.type.kind === 'boolean') {
|
|
13645
13752
|
return Boolean(this.args[0].evaluate(ctx));
|
|
@@ -15776,6 +15883,7 @@
|
|
|
15776
15883
|
}
|
|
15777
15884
|
return new Config(type, toString(configKey.value));
|
|
15778
15885
|
}
|
|
15886
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15779
15887
|
evaluate(ctx) {
|
|
15780
15888
|
const FQIDSeparator = '\x1F';
|
|
15781
15889
|
const configKey = [
|
|
@@ -15920,6 +16028,7 @@
|
|
|
15920
16028
|
}
|
|
15921
16029
|
return new Var(name, context.scope.get(name));
|
|
15922
16030
|
}
|
|
16031
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15923
16032
|
evaluate(ctx) {
|
|
15924
16033
|
return this.boundExpression.evaluate(ctx);
|
|
15925
16034
|
}
|
|
@@ -16185,6 +16294,7 @@
|
|
|
16185
16294
|
}
|
|
16186
16295
|
return new Step(outputType, input, stops);
|
|
16187
16296
|
}
|
|
16297
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16188
16298
|
evaluate(ctx) {
|
|
16189
16299
|
const labels = this.labels;
|
|
16190
16300
|
const outputs = this.outputs;
|
|
@@ -16587,6 +16697,7 @@
|
|
|
16587
16697
|
const needsAnnotation = expectedType && parsedArgs.some(arg => checkSubtype(expectedType, arg.type));
|
|
16588
16698
|
return needsAnnotation ? new Coalesce(ValueType, parsedArgs) : new Coalesce(outputType, parsedArgs);
|
|
16589
16699
|
}
|
|
16700
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16590
16701
|
evaluate(ctx) {
|
|
16591
16702
|
let result = null;
|
|
16592
16703
|
let argCount = 0;
|
|
@@ -16629,6 +16740,7 @@
|
|
|
16629
16740
|
this.bindings = [].concat(bindings);
|
|
16630
16741
|
this.result = result;
|
|
16631
16742
|
}
|
|
16743
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16632
16744
|
evaluate(ctx) {
|
|
16633
16745
|
return this.result.evaluate(ctx);
|
|
16634
16746
|
}
|
|
@@ -16871,6 +16983,7 @@
|
|
|
16871
16983
|
return new IndexOf(needle, haystack);
|
|
16872
16984
|
}
|
|
16873
16985
|
}
|
|
16986
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16874
16987
|
evaluate(ctx) {
|
|
16875
16988
|
const needle = this.needle.evaluate(ctx);
|
|
16876
16989
|
const haystack = this.haystack.evaluate(ctx);
|
|
@@ -16987,6 +17100,7 @@
|
|
|
16987
17100
|
}
|
|
16988
17101
|
return new Match(inputType, outputType, input, cases, outputs, otherwise);
|
|
16989
17102
|
}
|
|
17103
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16990
17104
|
evaluate(ctx) {
|
|
16991
17105
|
const input = this.input.evaluate(ctx);
|
|
16992
17106
|
const output = typeOf(input) === this.inputType && this.outputs[this.cases[input]] || this.otherwise;
|
|
@@ -17068,6 +17182,7 @@
|
|
|
17068
17182
|
return null;
|
|
17069
17183
|
return new Case(outputType, branches, otherwise);
|
|
17070
17184
|
}
|
|
17185
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17071
17186
|
evaluate(ctx) {
|
|
17072
17187
|
for (const [test, expression] of this.branches) {
|
|
17073
17188
|
if (test.evaluate(ctx)) {
|
|
@@ -17126,6 +17241,7 @@
|
|
|
17126
17241
|
return new Slice(input.type, input, beginIndex);
|
|
17127
17242
|
}
|
|
17128
17243
|
}
|
|
17244
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17129
17245
|
evaluate(ctx) {
|
|
17130
17246
|
const input = this.input.evaluate(ctx);
|
|
17131
17247
|
const beginIndex = this.beginIndex.evaluate(ctx);
|
|
@@ -17646,6 +17762,7 @@
|
|
|
17646
17762
|
overloads: [
|
|
17647
17763
|
[
|
|
17648
17764
|
[StringType],
|
|
17765
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17649
17766
|
(ctx, [key]) => get(key.evaluate(ctx), ctx.properties())
|
|
17650
17767
|
],
|
|
17651
17768
|
[
|
|
@@ -17653,6 +17770,7 @@
|
|
|
17653
17770
|
StringType,
|
|
17654
17771
|
ObjectType
|
|
17655
17772
|
],
|
|
17773
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17656
17774
|
(ctx, [key, obj]) => get(key.evaluate(ctx), obj.evaluate(ctx))
|
|
17657
17775
|
]
|
|
17658
17776
|
]
|
|
@@ -17660,6 +17778,7 @@
|
|
|
17660
17778
|
'feature-state': [
|
|
17661
17779
|
ValueType,
|
|
17662
17780
|
[StringType],
|
|
17781
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17663
17782
|
(ctx, [key]) => get(key.evaluate(ctx), ctx.featureState || {})
|
|
17664
17783
|
],
|
|
17665
17784
|
'properties': [
|
|
@@ -17857,11 +17976,13 @@
|
|
|
17857
17976
|
'min': [
|
|
17858
17977
|
NumberType,
|
|
17859
17978
|
varargs(NumberType),
|
|
17979
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17860
17980
|
(ctx, args) => Math.min(...args.map(arg => arg.evaluate(ctx)))
|
|
17861
17981
|
],
|
|
17862
17982
|
'max': [
|
|
17863
17983
|
NumberType,
|
|
17864
17984
|
varargs(NumberType),
|
|
17985
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
17865
17986
|
(ctx, args) => Math.max(...args.map(arg => arg.evaluate(ctx)))
|
|
17866
17987
|
],
|
|
17867
17988
|
'abs': [
|
|
@@ -18035,6 +18156,7 @@
|
|
|
18035
18156
|
BooleanType,
|
|
18036
18157
|
BooleanType
|
|
18037
18158
|
],
|
|
18159
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18038
18160
|
(ctx, [a, b]) => a.evaluate(ctx) && b.evaluate(ctx)
|
|
18039
18161
|
],
|
|
18040
18162
|
[
|
|
@@ -18057,6 +18179,7 @@
|
|
|
18057
18179
|
BooleanType,
|
|
18058
18180
|
BooleanType
|
|
18059
18181
|
],
|
|
18182
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18060
18183
|
(ctx, [a, b]) => a.evaluate(ctx) || b.evaluate(ctx)
|
|
18061
18184
|
],
|
|
18062
18185
|
[
|
|
@@ -18091,11 +18214,13 @@
|
|
|
18091
18214
|
'upcase': [
|
|
18092
18215
|
StringType,
|
|
18093
18216
|
[StringType],
|
|
18217
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18094
18218
|
(ctx, [s]) => s.evaluate(ctx).toUpperCase()
|
|
18095
18219
|
],
|
|
18096
18220
|
'downcase': [
|
|
18097
18221
|
StringType,
|
|
18098
18222
|
[StringType],
|
|
18223
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18099
18224
|
(ctx, [s]) => s.evaluate(ctx).toLowerCase()
|
|
18100
18225
|
],
|
|
18101
18226
|
'concat': [
|
|
@@ -18106,6 +18231,7 @@
|
|
|
18106
18231
|
'resolved-locale': [
|
|
18107
18232
|
StringType,
|
|
18108
18233
|
[CollatorType],
|
|
18234
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18109
18235
|
(ctx, [collator]) => collator.evaluate(ctx).resolvedLocale()
|
|
18110
18236
|
],
|
|
18111
18237
|
'random': [
|
|
@@ -18253,6 +18379,7 @@
|
|
|
18253
18379
|
kind: 'composite',
|
|
18254
18380
|
interpolationType,
|
|
18255
18381
|
interpolationFactor: Interpolate.interpolationFactor.bind(void 0, interpolationType),
|
|
18382
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18256
18383
|
zoomStops: featureFunctionStops.map(s => s[0]),
|
|
18257
18384
|
evaluate({zoom}, properties) {
|
|
18258
18385
|
return evaluateExponentialFunction({
|
|
@@ -18270,7 +18397,9 @@
|
|
|
18270
18397
|
kind: 'camera',
|
|
18271
18398
|
interpolationType,
|
|
18272
18399
|
interpolationFactor: Interpolate.interpolationFactor.bind(void 0, interpolationType),
|
|
18400
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18273
18401
|
zoomStops: parameters.stops.map(s => s[0]),
|
|
18402
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18274
18403
|
evaluate: ({zoom}) => innerFun(parameters, propertySpec, zoom, hashedStops, categoricalKeyType)
|
|
18275
18404
|
};
|
|
18276
18405
|
} else {
|
|
@@ -19376,7 +19505,8 @@ ${ JSON.stringify(filterExp, null, 2) }
|
|
|
19376
19505
|
negate
|
|
19377
19506
|
];
|
|
19378
19507
|
}
|
|
19379
|
-
return [negate ? 'all' : 'any'].concat(
|
|
19508
|
+
return [negate ? 'all' : 'any'].concat(// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19509
|
+
values.map(v => [
|
|
19380
19510
|
negate ? '!=' : '==',
|
|
19381
19511
|
get,
|
|
19382
19512
|
v
|
|
@@ -22632,7 +22762,7 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
22632
22762
|
return !!value.match(regex);
|
|
22633
22763
|
}
|
|
22634
22764
|
function getSourceCount(source) {
|
|
22635
|
-
if (source
|
|
22765
|
+
if ('url' in source) {
|
|
22636
22766
|
return source.url.split(',').length;
|
|
22637
22767
|
} else {
|
|
22638
22768
|
return 0;
|
|
@@ -22671,7 +22801,7 @@ Use an identity property function instead: ${ example }.`)];
|
|
|
22671
22801
|
errors.push(new ValidationError(`sources[${ i }].type`, source.type, `Expected one of [${ Array.from(acceptedSourceTypes).join(', ') }]`));
|
|
22672
22802
|
}
|
|
22673
22803
|
const sourceUrlPattern = /^mapbox:\/\/([^/]*)$/;
|
|
22674
|
-
if (!
|
|
22804
|
+
if (!('url' in source) || !isValid(source.url, sourceUrlPattern)) {
|
|
22675
22805
|
errors.push(new ValidationError(`sources[${ i }].url`, source.url, 'Expected a valid Mapbox tileset url'));
|
|
22676
22806
|
}
|
|
22677
22807
|
return errors;
|