vite-svgi-plugin adds a Vite transform for imports like:
import HomeIcon from './icons/home.svg?sprite' vite-svgi-plugin adds a Vite transform for imports like:
import HomeIcon from './icons/home.svg?sprite' A simple CLI tool for extracting tables from PDF files and saving them as CSV files.
type AA = Partial<Record<'next' | 'back' | 'hideOthers', string>> type BB = Record<'next' | 'back' | 'hideOthers', string>
const aa: AA = { next: 'adads' }
type FN = (a: Record<string, string>) => void
const fx: FN = (bb) => console.log(bb)
| type CamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}` | |
| ? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}` | |
| : Lowercase<S> | |
| type KeysToCamelCase<T> = { | |
| [K in keyof T as CamelCase<string & K>]: T[K] | |
| } | |
| type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ? |
| const fx = (fn, start, ...xn) => { | |
| const FF = class { | |
| constructor (...rn) { | |
| const ww = (...wn) => { return new FF(...rn, ...wn)} | |
| ww.valueOf = () => this.valueOf() | |
| ww.toString = () => this.toString() | |
| this.items = rn |
| const toDigit = (...values) => { | |
| const isValue = x => x != null && !isNaN(x) && isFinite(x); | |
| return +values.find(isValue) || 0; | |
| } | |
| const toDigit = (...values) => +values.find(x => x != null && !isNaN(x) && isFinite(x)) || 0; | |
| // const freezeFn = fn => (c => x => c[x] != null ? c[x] : c[x] = fn(x))({}) | |
| const freezeFn = fn => (c => {return function cached(x){if (c[x] != null) {c[x] = fn(x, cached)}; return c[x]}})({}) | |
| const fibFn = (x, fn) => fn(x - 1) + fn(x - 2) | |
| const fibArgs = (x, fn) => +!parseInt(x) || +(x == 0) || +(x == 1) || fibFn(parseInt(x), fn) | |
| const fibonacci = freezeFn(fibArgs) | |
| const facFn = (x, fn) => x * fn(x - 1) | |
| const facArgs = (x, fn) => +!parseInt(x) || +(x == 0) || +(x == 1) || facFn(parseInt(x), fn) | |
| const factorial = freezeFn(facArgs) |
| const fnBy = fn => x => y => !fn || !Math[fn] || !x || !y ? 0 : y < 0 ? 0 : y > x ? x : Math[fn] (10 * y / x) * x / 10; | |
| // const ceilBy = max => y => !max || !y ? 0 : y < 0 ? 0 : y > max ? max : Math.ceil (10 * y / max) * max / 10; | |
| const ceilBy = fnBy('ceil'); | |
| const roundBy = fnBy('round'); | |
| const floorBy = fnBy('floor'); | |
| const fiveStarRating = ceilBy(5); | |
| const oneHundredPoints = roundBy(100); | |
| // Example |
| <script id="nb-loader-script"> | |
| (function(url) { | |
| // document.currentScript works on most browsers, but not all | |
| var where = document.currentScript || document.getElementById("nb-loader-script"), | |
| promoted = false, | |
| LOADER_TIMEOUT = 3000, | |
| IDPREFIX = "__nb-script"; | |
| // function to promote a preload link node to an async script node |