unnestcss
Version:
A library for un-nesting CSS
1 lines • 1.17 kB
Source Map (JSON)
{"mappings":"AAEA,OAAO,cAAM,aAAc,eAAe;AAE1C,OAAO,cAAMA,eAAe,GAAG;AAE/B,OAAO,cAAM,SAAU,eAAe;AAGtC,OAAO,cAAM,OAAQ,eAAe;AAiBpC,OAAO,cAAM,YAAa","names":["charCodeFrom: (...codes: number[]) => string"],"sources":["../../../../src/lib/stylis/utility.ts"],"sourcesContent":["import { NULL_CHARACTER } from \"./enum.ts\";\n\nexport const charCodeAt = (value: string, index = 0): number => value.charCodeAt(index) | 0;\n\nexport const charCodeFrom: (...codes: number[]) => string = String.fromCharCode;\n\nexport const charOr = (value: string, fallback: string): string =>\n value === NULL_CHARACTER ? fallback : value;\n\nexport const hash = (value: string, length: number): number => {\n if (charCodeAt(value, 0) ^ 45) {\n let hashValue = length << 2;\n hashValue ^= charCodeAt(value, 0);\n hashValue <<= 2;\n hashValue ^= charCodeAt(value, 1);\n hashValue <<= 2;\n hashValue ^= charCodeAt(value, 2);\n hashValue <<= 2;\n hashValue ^= charCodeAt(value, 3);\n return hashValue;\n }\n return 0;\n};\n\nconst hexRe = /^[[\\da-fA-F]$/;\n\nexport const isHexChar = (value: string): boolean => hexRe.test(value);\n"],"version":3,"file":"utility.d.ts"}