MCPcopy Create free account
hub / github.com/KaTeX/KaTeX / scriptFromCodepoint

Function scriptFromCodepoint

src/unicodeScripts.ts:89–100  ·  view source on GitHub ↗
(codepoint: number)

Source from the content-addressed store, hash-verified

87 * it is from, or null if it is not part of a known block
88 */
89export function scriptFromCodepoint(codepoint: number): string | null | undefined {
90 for (let i = 0; i < scriptData.length; i++) {
91 const script = scriptData[i];
92 for (let i = 0; i < script.blocks.length; i++) {
93 const block = script.blocks[i];
94 if (codepoint >= block[0] && codepoint <= block[1]) {
95 return script.name;
96 }
97 }
98 }
99 return null;
100}
101
102/**
103 * A flattened version of all the supported blocks in a single array.

Callers 2

unicode-spec.tsFile · 0.90
constructorMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected