mirror of
https://github.com/mapbox/expression-jamsession.git
synced 2026-01-25 14:48:22 +00:00
* Update build deps, jsep and jsep plugin * Resolve external deps * Update style spec, add new expression operators * Loosen up some validation on console logs * Stop throwing on non-array literals, handle objects * Support objects on the other end * Add some nested examples * Bump travis node version to 14 * Remove blocklist * Rename * Update changelog * Insert spaces in stringified objects
25 lines
580 B
JavaScript
Executable File
25 lines
580 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
'use strict';
|
|
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
const styleSpec = require('@mapbox/mapbox-gl-style-spec');
|
|
|
|
const expressions = Object.keys(styleSpec.v8.expression_name.values);
|
|
|
|
const fileContent = `// DO NOT MODIFY DIRECTLY!
|
|
// This file is generated by scripts/build-operator-list.js
|
|
// from the Mapbox GL Style Spec.
|
|
|
|
const operators = new Set();
|
|
|
|
${expressions.map(x => `operators.add('${x}');`).join('\n')}
|
|
|
|
export default operators;
|
|
`;
|
|
|
|
fs.writeFileSync(
|
|
path.join(__dirname, '../src/expression-operators.js'),
|
|
fileContent
|
|
);
|