Spaces:
Paused
Paused
Download node_modules/@plotly/mapbox-gl/src/style-spec/bin/gl-style-validate from Leon4gr45/nova-header-nav: direct link, hf CLI and curl.
- Browser
- Download file 1.36 kB
-
https://huggingface.co/spaces/Leon4gr45/nova-header-nav/resolve/main/node_modules/%40plotly/mapbox-gl/src/style-spec/bin/gl-style-validate
- Command line
-
hf download hf://spaces/Leon4gr45/nova-header-nav/node_modules/@plotly/mapbox-gl/src/style-spec/bin/gl-style-validate
-
curl -L -o gl-style-validate https://huggingface.co/spaces/Leon4gr45/nova-header-nav/resolve/main/node_modules/%40plotly/mapbox-gl/src/style-spec/bin/gl-style-validate
1.36 kB
| #!/usr/bin/env node | |
| var argv = require('minimist')(process.argv.slice(2), { | |
| boolean: 'json', | |
| boolean: 'mapbox-api-supported' | |
| }), | |
| validate = require('../').validate, | |
| validateMapboxApiSupported = require('../').validateMapboxApiSupported | |
| rw = require('rw'), | |
| status = 0; | |
| if (argv.help || argv.h || (!argv._.length && process.stdin.isTTY)) { | |
| return help(); | |
| } | |
| if (!argv._.length) { | |
| argv._.push('/dev/stdin'); | |
| } | |
| argv._.forEach(function(file) { | |
| var errors; | |
| if (argv['mapbox-api-supported']) { | |
| errors = validateMapboxApiSupported(rw.readFileSync(file, 'utf8')); | |
| } else { | |
| errors = validate(rw.readFileSync(file, 'utf8')); | |
| } | |
| if (errors.length) { | |
| if (argv.json) { | |
| process.stdout.write(JSON.stringify(errors, null, 2)); | |
| } else { | |
| errors.forEach(function (e) { | |
| console.log('%s:%d: %s', file, e.line, e.message); | |
| }); | |
| } | |
| status = 1; | |
| } | |
| }); | |
| process.exit(status); | |
| function help() { | |
| console.log('usage:'); | |
| console.log(' gl-style-validate file.json'); | |
| console.log(' gl-style-validate < file.json'); | |
| console.log(''); | |
| console.log('options:'); | |
| console.log('--json output errors as json'); | |
| console.log('--mapbox-api-supported validate compatibility with Mapbox Styles API'); | |
| } | |