diff options
| author | Adam Mathes <adam@adammathes.com> | 2026-02-14 14:46:37 -0800 |
|---|---|---|
| committer | Adam Mathes <adam@adammathes.com> | 2026-02-14 14:46:37 -0800 |
| commit | afa87af01c79a9baa539f2992d32154d2a4739bd (patch) | |
| tree | 92c7416db734270a2fee1d72ee9cc119379ff8e1 /vanilla/node_modules/css-tree/lib/generator/create.js | |
| parent | 3b927e84d200402281f68181cd4253bc77e5528d (diff) | |
| download | neko-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/generator/create.js')
| -rw-r--r-- | vanilla/node_modules/css-tree/lib/generator/create.js | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/vanilla/node_modules/css-tree/lib/generator/create.js b/vanilla/node_modules/css-tree/lib/generator/create.js deleted file mode 100644 index c542f4f..0000000 --- a/vanilla/node_modules/css-tree/lib/generator/create.js +++ /dev/null @@ -1,97 +0,0 @@ -import { tokenize, Delim, WhiteSpace } from '../tokenizer/index.js'; -import { generateSourceMap } from './sourceMap.js'; -import * as tokenBefore from './token-before.js'; - -const REVERSESOLIDUS = 0x005c; // U+005C REVERSE SOLIDUS (\) - -function processChildren(node, delimeter) { - if (typeof delimeter === 'function') { - let prev = null; - - node.children.forEach(node => { - if (prev !== null) { - delimeter.call(this, prev); - } - - this.node(node); - prev = node; - }); - - return; - } - - node.children.forEach(this.node, this); -} - -function processChunk(chunk) { - tokenize(chunk, (type, start, end) => { - this.token(type, chunk.slice(start, end)); - }); -} - -export function createGenerator(config) { - const types = new Map(); - - for (let [name, item] of Object.entries(config.node)) { - const fn = item.generate || item; - - if (typeof fn === 'function') { - types.set(name, item.generate || item); - } - } - - return function(node, options) { - let buffer = ''; - let prevCode = 0; - let handlers = { - node(node) { - if (types.has(node.type)) { - types.get(node.type).call(publicApi, node); - } else { - throw new Error('Unknown node type: ' + node.type); - } - }, - tokenBefore: tokenBefore.safe, - token(type, value) { - prevCode = this.tokenBefore(prevCode, type, value); - - this.emit(value, type, false); - - if (type === Delim && value.charCodeAt(0) === REVERSESOLIDUS) { - this.emit('\n', WhiteSpace, true); - } - }, - emit(value) { - buffer += value; - }, - result() { - return buffer; - } - }; - - if (options) { - if (typeof options.decorator === 'function') { - handlers = options.decorator(handlers); - } - - if (options.sourceMap) { - handlers = generateSourceMap(handlers); - } - - if (options.mode in tokenBefore) { - handlers.tokenBefore = tokenBefore[options.mode]; - } - } - - const publicApi = { - node: (node) => handlers.node(node), - children: processChildren, - token: (type, value) => handlers.token(type, value), - tokenize: processChunk - }; - - handlers.node(node); - - return handlers.result(); - }; -}; |
