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/utils/names.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/utils/names.js')
| -rw-r--r-- | vanilla/node_modules/css-tree/lib/utils/names.js | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/vanilla/node_modules/css-tree/lib/utils/names.js b/vanilla/node_modules/css-tree/lib/utils/names.js deleted file mode 100644 index b4f74b9..0000000 --- a/vanilla/node_modules/css-tree/lib/utils/names.js +++ /dev/null @@ -1,106 +0,0 @@ -const keywords = new Map(); -const properties = new Map(); -const HYPHENMINUS = 45; // '-'.charCodeAt() - -export const keyword = getKeywordDescriptor; -export const property = getPropertyDescriptor; -export const vendorPrefix = getVendorPrefix; -export function isCustomProperty(str, offset) { - offset = offset || 0; - - return str.length - offset >= 2 && - str.charCodeAt(offset) === HYPHENMINUS && - str.charCodeAt(offset + 1) === HYPHENMINUS; -} - -function getVendorPrefix(str, offset) { - offset = offset || 0; - - // verdor prefix should be at least 3 chars length - if (str.length - offset >= 3) { - // vendor prefix starts with hyper minus following non-hyper minus - if (str.charCodeAt(offset) === HYPHENMINUS && - str.charCodeAt(offset + 1) !== HYPHENMINUS) { - // vendor prefix should contain a hyper minus at the ending - const secondDashIndex = str.indexOf('-', offset + 2); - - if (secondDashIndex !== -1) { - return str.substring(offset, secondDashIndex + 1); - } - } - } - - return ''; -} - -function getKeywordDescriptor(keyword) { - if (keywords.has(keyword)) { - return keywords.get(keyword); - } - - const name = keyword.toLowerCase(); - let descriptor = keywords.get(name); - - if (descriptor === undefined) { - const custom = isCustomProperty(name, 0); - const vendor = !custom ? getVendorPrefix(name, 0) : ''; - descriptor = Object.freeze({ - basename: name.substr(vendor.length), - name, - prefix: vendor, - vendor, - custom - }); - } - - keywords.set(keyword, descriptor); - - return descriptor; -} - -function getPropertyDescriptor(property) { - if (properties.has(property)) { - return properties.get(property); - } - - let name = property; - let hack = property[0]; - - if (hack === '/') { - hack = property[1] === '/' ? '//' : '/'; - } else if (hack !== '_' && - hack !== '*' && - hack !== '$' && - hack !== '#' && - hack !== '+' && - hack !== '&') { - hack = ''; - } - - const custom = isCustomProperty(name, hack.length); - - // re-use result when possible (the same as for lower case) - if (!custom) { - name = name.toLowerCase(); - if (properties.has(name)) { - const descriptor = properties.get(name); - properties.set(property, descriptor); - return descriptor; - } - } - - const vendor = !custom ? getVendorPrefix(name, hack.length) : ''; - const prefix = name.substr(0, hack.length + vendor.length); - const descriptor = Object.freeze({ - basename: name.substr(prefix.length), - name: name.substr(hack.length), - hack, - vendor, - prefix, - custom - }); - - properties.set(property, descriptor); - - return descriptor; -} |
