@mapbox/mapbox-gl-style-spec 14.14.0-beta.2 → 14.15.0-alpha.ffa987fef46

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.
Files changed (44) hide show
  1. package/composite.ts +5 -8
  2. package/dist/index.cjs +53 -27
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.ts +48 -24
  5. package/dist/index.es.js +53 -27
  6. package/dist/index.es.js.map +1 -1
  7. package/expression/compound_expression.ts +1 -1
  8. package/expression/definitions/config.ts +1 -1
  9. package/expression/definitions/distance.ts +2 -3
  10. package/expression/definitions/image.ts +1 -1
  11. package/expression/definitions/index.ts +4 -20
  12. package/expression/definitions/interpolate.ts +6 -9
  13. package/expression/definitions/within.ts +14 -15
  14. package/expression/evaluation_context.ts +3 -1
  15. package/expression/index.ts +18 -11
  16. package/expression/parsing_context.ts +7 -3
  17. package/group_by_layout.ts +3 -6
  18. package/migrate.ts +6 -8
  19. package/package.json +1 -1
  20. package/read_style.ts +1 -2
  21. package/reference/v8.json +26 -0
  22. package/types.ts +35 -13
  23. package/util/geometry_util.ts +1 -2
  24. package/validate/validate.ts +5 -6
  25. package/validate/validate_array.ts +2 -2
  26. package/validate/validate_enum.ts +2 -2
  27. package/validate/validate_expression.ts +1 -2
  28. package/validate/validate_filter.ts +3 -4
  29. package/validate/validate_fog.ts +2 -5
  30. package/validate/validate_function.ts +6 -10
  31. package/validate/validate_iconset.ts +1 -2
  32. package/validate/validate_layer.ts +1 -2
  33. package/validate/validate_light.ts +1 -4
  34. package/validate/validate_lights.ts +1 -7
  35. package/validate/validate_model.ts +1 -4
  36. package/validate/validate_projection.ts +1 -2
  37. package/validate/validate_property.ts +3 -7
  38. package/validate/validate_rain.ts +1 -4
  39. package/validate/validate_snow.ts +1 -4
  40. package/validate/validate_source.ts +2 -3
  41. package/validate/validate_terrain.ts +1 -5
  42. package/validate_mapbox_api_supported.ts +2 -4
  43. package/validate_style.ts +1 -2
  44. package/visit.ts +2 -4
@@ -11,18 +11,15 @@ export default function validateTerrain(options: ValidationOptions): Array<Valid
11
11
  const style = options.style;
12
12
  const styleSpec = options.styleSpec;
13
13
  const terrainSpec = styleSpec.terrain;
14
- let errors = [];
14
+ let errors: ValidationError[] = [];
15
15
 
16
16
  const rootType = getType(terrain);
17
17
  if (terrain === undefined) {
18
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
19
18
  return errors;
20
19
  } else if (rootType === 'null') {
21
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
22
20
  return errors;
23
21
  } else if (rootType !== 'object') {
24
22
  errors = errors.concat([new ValidationError('terrain', terrain, `object expected, ${rootType} found`)]);
25
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
26
23
  return errors;
27
24
  }
28
25
 
@@ -71,6 +68,5 @@ export default function validateTerrain(options: ValidationOptions): Array<Valid
71
68
  }
72
69
  }
73
70
 
74
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
75
71
  return errors;
76
72
  }
@@ -139,7 +139,7 @@ function getImportErrors(imports: ImportSpecification[] = []): {errors: Array<Va
139
139
  }
140
140
 
141
141
  function getRootErrors(style: MapboxStyleSpecification, specKeys: string[]): Array<ValidationError> {
142
- const errors = [];
142
+ const errors: ValidationError[] = [];
143
143
 
144
144
  /*
145
145
  * The following keys are optional but fully managed by the Mapbox Styles
@@ -204,7 +204,6 @@ function getRootErrors(style: MapboxStyleSpecification, specKeys: string[]): Arr
204
204
  errors.push(new ValidationError('protected', style.protected, 'Style protection must be true or false'));
205
205
  }
206
206
 
207
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
208
207
  return errors;
209
208
  }
210
209
 
@@ -223,8 +222,7 @@ export default function validateMapboxApiSupported(style: MapboxStyleSpecificati
223
222
  try {
224
223
  s = readStyle(s);
225
224
  } catch (e) {
226
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
227
- return [e];
225
+ return [e] as ValidationErrors;
228
226
  }
229
227
 
230
228
  let errors = validateStyle(s, styleSpec)
package/validate_style.ts CHANGED
@@ -28,8 +28,7 @@ export default function validateStyle(style: StyleSpecification | string | Buffe
28
28
  try {
29
29
  s = readStyle(s);
30
30
  } catch (e) {
31
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
32
- return [e];
31
+ return [e] as ValidationErrors;
33
32
  }
34
33
 
35
34
  return validateStyleMin(s, styleSpec);
package/visit.ts CHANGED
@@ -11,14 +11,12 @@ import type {
11
11
  function getPropertyReference(propertyName: string): StylePropertySpecification {
12
12
  for (let i = 0; i < Reference.layout.length; i++) {
13
13
  for (const key in Reference[Reference.layout[i]]) {
14
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
15
- if (key === propertyName) return Reference[Reference.layout[i]][key];
14
+ if (key === propertyName) return Reference[Reference.layout[i]][key] as StylePropertySpecification;
16
15
  }
17
16
  }
18
17
  for (let i = 0; i < Reference.paint.length; i++) {
19
18
  for (const key in Reference[Reference.paint[i]]) {
20
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
21
- if (key === propertyName) return Reference[Reference.paint[i]][key];
19
+ if (key === propertyName) return Reference[Reference.paint[i]][key] as StylePropertySpecification;
22
20
  }
23
21
  }
24
22