@mapbox/mapbox-gl-style-spec 13.24.0-alpha.3 → 13.24.0-alpha.6

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.es.js CHANGED
@@ -10680,7 +10680,7 @@ class In {
10680
10680
  evaluate(ctx) {
10681
10681
  const needle = this.needle.evaluate(ctx);
10682
10682
  const haystack = this.haystack.evaluate(ctx);
10683
- if (!haystack)
10683
+ if (haystack == null)
10684
10684
  return false;
10685
10685
  if (!isValidNativeType(needle, [
10686
10686
  'boolean',
@@ -13613,7 +13613,7 @@ function diffStyles(before, after) {
13613
13613
  const beforeLayers = [];
13614
13614
  if (before.layers) {
13615
13615
  before.layers.forEach(layer => {
13616
- if (sourcesRemoved[layer.source]) {
13616
+ if (layer.source && sourcesRemoved[layer.source]) {
13617
13617
  commands.push({
13618
13618
  command: operations.removeLayer,
13619
13619
  args: [layer.id]
@@ -13671,16 +13671,6 @@ class ParsingError$1 {
13671
13671
  }
13672
13672
  }
13673
13673
 
13674
- function validateConstants(options) {
13675
- const key = options.key;
13676
- const constants = options.value;
13677
- if (constants) {
13678
- return [new ValidationError(key, constants, 'constants have been deprecated as of v8')];
13679
- } else {
13680
- return [];
13681
- }
13682
- }
13683
-
13684
13674
  function validateObject(options) {
13685
13675
  const key = options.key;
13686
13676
  const object = options.value;
@@ -14636,7 +14626,6 @@ const VALIDATORS = {
14636
14626
  'boolean': validateBoolean,
14637
14627
  'number': validateNumber,
14638
14628
  'color': validateColor,
14639
- 'constants': validateConstants,
14640
14629
  'enum': validateEnum,
14641
14630
  'filter': validateFilter,
14642
14631
  'function': validateFunction,
@@ -14682,9 +14671,8 @@ function validateGlyphsURL (options) {
14682
14671
  return errors;
14683
14672
  }
14684
14673
 
14685
- function validateStyleMin(style, styleSpec = v8) {
14686
- let errors = [];
14687
- errors = errors.concat(validate({
14674
+ function validateStyle(style, styleSpec = v8) {
14675
+ const errors = validate({
14688
14676
  key: '',
14689
14677
  value: style,
14690
14678
  valueSpec: styleSpec.$root,
@@ -14692,38 +14680,13 @@ function validateStyleMin(style, styleSpec = v8) {
14692
14680
  style,
14693
14681
  objectElementValidators: {
14694
14682
  glyphs: validateGlyphsURL,
14695
- '*'() {
14696
- return [];
14697
- }
14683
+ '*': () => []
14698
14684
  }
14699
- }));
14700
- if (style.constants) {
14701
- errors = errors.concat(validateConstants({
14702
- key: 'constants',
14703
- value: style.constants,
14704
- style,
14705
- styleSpec
14706
- }));
14707
- }
14685
+ });
14708
14686
  return sortErrors(errors);
14709
14687
  }
14710
- validateStyleMin.source = wrapCleanErrors(validateSource);
14711
- validateStyleMin.light = wrapCleanErrors(validateLight);
14712
- validateStyleMin.terrain = wrapCleanErrors(validateTerrain);
14713
- validateStyleMin.fog = wrapCleanErrors(validateFog);
14714
- validateStyleMin.layer = wrapCleanErrors(validateLayer);
14715
- validateStyleMin.filter = wrapCleanErrors(validateFilter);
14716
- validateStyleMin.paintProperty = wrapCleanErrors(validatePaintProperty);
14717
- validateStyleMin.layoutProperty = wrapCleanErrors(validateLayoutProperty);
14718
14688
  function sortErrors(errors) {
14719
- return [].concat(errors).sort((a, b) => {
14720
- return a.line - b.line;
14721
- });
14722
- }
14723
- function wrapCleanErrors(inner) {
14724
- return function (...args) {
14725
- return sortErrors(inner.apply(this, args));
14726
- };
14689
+ return errors.slice().sort((a, b) => a.line - b.line);
14727
14690
  }
14728
14691
 
14729
14692
  /* parser generated by jison 0.4.15 */
@@ -15396,14 +15359,14 @@ function readStyle(style) {
15396
15359
  return style;
15397
15360
  }
15398
15361
 
15399
- function validateStyle(style, styleSpec = v8) {
15362
+ function validateStyle$1(style, styleSpec = v8) {
15400
15363
  let s = style;
15401
15364
  try {
15402
15365
  s = readStyle(s);
15403
15366
  } catch (e) {
15404
15367
  return [e];
15405
15368
  }
15406
- return validateStyleMin(s, styleSpec);
15369
+ return validateStyle(s, styleSpec);
15407
15370
  }
15408
15371
 
15409
15372
  const SUPPORTED_SPEC_VERSION = 8;
@@ -15512,7 +15475,7 @@ function validateMapboxApiSupported(style) {
15512
15475
  } catch (e) {
15513
15476
  return [e];
15514
15477
  }
15515
- let errors = validateStyleMin(s, v8).concat(getRootErrors(s, Object.keys(v8.$root)));
15478
+ let errors = validateStyle(s, v8).concat(getRootErrors(s, Object.keys(v8.$root)));
15516
15479
  if (s.sources) {
15517
15480
  errors = errors.concat(getSourcesErrors(s.sources));
15518
15481
  }
@@ -15540,8 +15503,6 @@ const visit = {
15540
15503
  eachLayer,
15541
15504
  eachProperty
15542
15505
  };
15543
- validateStyle.parsed = validateStyle;
15544
- validateStyle.latest = validateStyle;
15545
15506
 
15546
- export { Color, ParsingError$1 as ParsingError, ValidationError, composite, convertFilter$1 as convertFilter, derefLayers, diffStyles as diff, expression$1 as expression, createFilter as featureFilter, format, styleFunction as function, v8 as latest, migrate, v8, validateStyle as validate, validateMapboxApiSupported, visit };
15507
+ export { Color, ParsingError$1 as ParsingError, ValidationError, composite, convertFilter$1 as convertFilter, derefLayers, diffStyles as diff, expression$1 as expression, createFilter as featureFilter, format, styleFunction as function, v8 as latest, migrate, v8, validateStyle$1 as validate, validateMapboxApiSupported, visit };
15547
15508
  //# sourceMappingURL=index.es.js.map