@mapbox/mapbox-gl-style-spec
Advanced tools
Comparing version 14.0.0-rc.1 to 14.0.0-rc.2
{ | ||
"name": "@mapbox/mapbox-gl-style-spec", | ||
"description": "a specification for mapbox gl styles", | ||
"version": "14.0.0-rc.1", | ||
"version": "14.0.0-rc.2", | ||
"author": "Mapbox", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -7,2 +7,3 @@ // @flow | ||
import ValidationError from '../error/validation_error.js'; | ||
import {unbundle} from '../util/unbundle_jsonlint.js'; | ||
@@ -26,2 +27,8 @@ import type {ValidationOptions} from './validate.js'; | ||
// Empty string is reserved for the root style id | ||
if (unbundle(importSpec.id) === '') { | ||
const key = `${options.key}.id`; | ||
errors.push(new ValidationError(key, importSpec, `import id can't be an empty string`)); | ||
} | ||
if (data) { | ||
@@ -28,0 +35,0 @@ const key = `${options.key}.data`; |
@@ -69,9 +69,13 @@ // @flow | ||
for (const propertyKey in properties) { | ||
errors = errors.concat(validate({ | ||
key: propertyKey, | ||
value: properties[propertyKey], | ||
valueSpec: lightPropertySpec[propertyKey], | ||
style, | ||
styleSpec | ||
})); | ||
if (!lightPropertySpec[propertyKey]) { | ||
errors = errors.concat([new ValidationWarning(options.key, properties[propertyKey], `unknown property "${propertyKey}"`)]); | ||
} else { | ||
errors = errors.concat(validate({ | ||
key: propertyKey, | ||
value: properties[propertyKey], | ||
valueSpec: lightPropertySpec[propertyKey], | ||
style, | ||
styleSpec | ||
})); | ||
} | ||
} | ||
@@ -78,0 +82,0 @@ } else { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4014052
62442