Spaces:
Paused
Paused
Download node_modules/@plotly/mapbox-gl/src/style/validate_style.js from Leon4gr45/UserSyncFrontend: direct link, hf CLI and curl.
- Browser
- Download file 1.28 kB
-
https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/mapbox-gl/src/style/validate_style.js
- Command line
-
hf download hf://spaces/Leon4gr45/UserSyncFrontend/node_modules/@plotly/mapbox-gl/src/style/validate_style.js
-
curl -L -o validate_style.js https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/mapbox-gl/src/style/validate_style.js
1.28 kB
| // @flow | |
| import validateStyleMin from '../style-spec/validate_style.min'; | |
| import {ErrorEvent} from '../util/evented'; | |
| import type {Evented} from '../util/evented'; | |
| type ValidationError = { | |
| message: string, | |
| line: number, | |
| identifier?: string | |
| }; | |
| export type Validator = (Object) => $ReadOnlyArray<ValidationError>; | |
| type ValidateStyle = { | |
| (Object, ?Object): $ReadOnlyArray<ValidationError>, | |
| source: Validator, | |
| layer: Validator, | |
| light: Validator, | |
| filter: Validator, | |
| paintProperty: Validator, | |
| layoutProperty: Validator | |
| }; | |
| export const validateStyle = (validateStyleMin: ValidateStyle); | |
| export const validateSource = validateStyle.source; | |
| export const validateLight = validateStyle.light; | |
| export const validateFilter = validateStyle.filter; | |
| export const validatePaintProperty = validateStyle.paintProperty; | |
| export const validateLayoutProperty = validateStyle.layoutProperty; | |
| export function emitValidationErrors(emitter: Evented, errors: ?$ReadOnlyArray<{message: string, identifier?: string}>): boolean { | |
| let hasErrors = false; | |
| if (errors && errors.length) { | |
| for (const error of errors) { | |
| emitter.fire(new ErrorEvent(new Error(error.message))); | |
| hasErrors = true; | |
| } | |
| } | |
| return hasErrors; | |
| } | |