MCPcopy Create free account
hub / github.com/TruthHun/BookStack / scriptFromCodepoint

Function scriptFromCodepoint

static/katex/katex.mjs:532–546  ·  view source on GitHub ↗

* Given a codepoint, return the name of the script or script family * it is from, or null if it is not part of a known block

(codepoint)

Source from the content-addressed store, hash-verified

530 */
531
532function scriptFromCodepoint(codepoint) {
533 for (let i = 0; i < scriptData.length; i++) {
534 const script = scriptData[i];
535
536 for (let i = 0; i < script.blocks.length; i++) {
537 const block = script.blocks[i];
538
539 if (codepoint >= block[0] && codepoint <= block[1]) {
540 return script.name;
541 }
542 }
543 }
544
545 return null;
546}
547/**
548 * A flattened version of all the supported blocks in a single array.
549 * This is an optimization to make supportedCodepoint() fast.

Callers 1

constructorMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected