aboutsummaryrefslogtreecommitdiffstats
path: root/vanilla/node_modules/css-tree/lib/definition-syntax/generate.js
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-14 14:46:37 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-14 14:46:37 -0800
commitafa87af01c79a9baa539f2992d32154d2a4739bd (patch)
tree92c7416db734270a2fee1d72ee9cc119379ff8e1 /vanilla/node_modules/css-tree/lib/definition-syntax/generate.js
parent3b927e84d200402281f68181cd4253bc77e5528d (diff)
downloadneko-afa87af01c79a9baa539f2992d32154d2a4739bd.tar.gz
neko-afa87af01c79a9baa539f2992d32154d2a4739bd.tar.bz2
neko-afa87af01c79a9baa539f2992d32154d2a4739bd.zip
task: delete vanilla js prototype\n\n- Removed vanilla/ directory and web/dist/vanilla directory\n- Updated Makefile, Dockerfile, and CI workflow to remove vanilla references\n- Cleaned up web/web.go to remove vanilla embed and routes\n- Verified build and tests pass\n\nCloses NK-2tcnmq
Diffstat (limited to 'vanilla/node_modules/css-tree/lib/definition-syntax/generate.js')
-rw-r--r--vanilla/node_modules/css-tree/lib/definition-syntax/generate.js135
1 files changed, 0 insertions, 135 deletions
diff --git a/vanilla/node_modules/css-tree/lib/definition-syntax/generate.js b/vanilla/node_modules/css-tree/lib/definition-syntax/generate.js
deleted file mode 100644
index b2636d1..0000000
--- a/vanilla/node_modules/css-tree/lib/definition-syntax/generate.js
+++ /dev/null
@@ -1,135 +0,0 @@
-function noop(value) {
- return value;
-}
-
-function generateMultiplier(multiplier) {
- const { min, max, comma } = multiplier;
-
- if (min === 0 && max === 0) {
- return comma ? '#?' : '*';
- }
-
- if (min === 0 && max === 1) {
- return '?';
- }
-
- if (min === 1 && max === 0) {
- return comma ? '#' : '+';
- }
-
- if (min === 1 && max === 1) {
- return '';
- }
-
- return (
- (comma ? '#' : '') +
- (min === max
- ? '{' + min + '}'
- : '{' + min + ',' + (max !== 0 ? max : '') + '}'
- )
- );
-}
-
-function generateTypeOpts(node) {
- switch (node.type) {
- case 'Range':
- return (
- ' [' +
- (node.min === null ? '-∞' : node.min) +
- ',' +
- (node.max === null ? '∞' : node.max) +
- ']'
- );
-
- default:
- throw new Error('Unknown node type `' + node.type + '`');
- }
-}
-
-function generateSequence(node, decorate, forceBraces, compact) {
- const combinator = node.combinator === ' ' || compact ? node.combinator : ' ' + node.combinator + ' ';
- const result = node.terms
- .map(term => internalGenerate(term, decorate, forceBraces, compact))
- .join(combinator);
-
- if (node.explicit || forceBraces) {
- return (compact || result[0] === ',' ? '[' : '[ ') + result + (compact ? ']' : ' ]');
- }
-
- return result;
-}
-
-function internalGenerate(node, decorate, forceBraces, compact) {
- let result;
-
- switch (node.type) {
- case 'Group':
- result =
- generateSequence(node, decorate, forceBraces, compact) +
- (node.disallowEmpty ? '!' : '');
- break;
-
- case 'Multiplier':
- // return since node is a composition
- return (
- internalGenerate(node.term, decorate, forceBraces, compact) +
- decorate(generateMultiplier(node), node)
- );
-
- case 'Boolean':
- result = '<boolean-expr[' + internalGenerate(node.term, decorate, forceBraces, compact) + ']>';
- break;
-
- case 'Type':
- result = '<' + node.name + (node.opts ? decorate(generateTypeOpts(node.opts), node.opts) : '') + '>';
- break;
-
- case 'Property':
- result = '<\'' + node.name + '\'>';
- break;
-
- case 'Keyword':
- result = node.name;
- break;
-
- case 'AtKeyword':
- result = '@' + node.name;
- break;
-
- case 'Function':
- result = node.name + '(';
- break;
-
- case 'String':
- case 'Token':
- result = node.value;
- break;
-
- case 'Comma':
- result = ',';
- break;
-
- default:
- throw new Error('Unknown node type `' + node.type + '`');
- }
-
- return decorate(result, node);
-}
-
-export function generate(node, options) {
- let decorate = noop;
- let forceBraces = false;
- let compact = false;
-
- if (typeof options === 'function') {
- decorate = options;
- } else if (options) {
- forceBraces = Boolean(options.forceBraces);
- compact = Boolean(options.compact);
- if (typeof options.decorate === 'function') {
- decorate = options.decorate;
- }
- }
-
- return internalGenerate(node, decorate, forceBraces, compact);
-};