GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — opencode/packages/codemode/src/stdlib/string.ts at dev · koji/opencode Expand file tree/ Copy pathstring.tsMore file actions 52 lines (50 loc) · 1.15 KB / Copy pathstring.tsFile metadata and controls52 lines (50 loc) · 1.15 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 export const stringMethods = new Set([ "toLowerCase", "toUpperCase", "trim", "trimStart", "trimEnd", "trimLeft", "trimRight", "split", "slice", "substring", "substr", "includes", "startsWith", "endsWith", "indexOf", "lastIndexOf", "replace", "replaceAll", "repeat", "padStart", "padEnd", "charAt", "charCodeAt", "codePointAt", "at", "concat", "toString", "match", "matchAll", "search", "localeCompare", "normalize", ]) export const stringStatics = new Set(["fromCharCode", "fromCodePoint"]) export const invokeStringStatic = (name: string, args: Array<unknown>, node: AstNode): unknown => { const codes = args.map((arg) => { if (typeof arg !== "number") throw new InterpreterRuntimeError(`String.${name} expects number arguments.`, node) return arg }) switch (name) { case "fromCharCode": return String.fromCharCode(...codes) case "fromCodePoint": return String.fromCodePoint(...codes) default: throw new InterpreterRuntimeError(`String.${name} is not available in CodeMode.`, node) } } import { type AstNode, InterpreterRuntimeError } from "../interpreter/model.js" |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |