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

Function validUnit

src/units.ts:43–48  ·  view source on GitHub ↗
(unit: string | Measurement)

Source from the content-addressed store, hash-verified

41 * or a "size" parse node containing a unit field) is valid.
42 */
43export const validUnit = function(unit: string | Measurement): boolean {
44 if (typeof unit !== "string") {
45 unit = unit.unit;
46 }
47 return (unit in ptPerUnit || unit in relativeUnit || unit === "ex");
48};
49
50/*
51 * Convert a "size" parse node (with numeric "number" and string "unit" fields,

Callers 2

parseSizeGroupMethod · 0.90
sizeDataFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected