MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / parseUnitDSL

Function parseUnitDSL

src/compute-engine/numerics/unit-data.ts:621–629  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

619 let hasPos = false;
620 let hasNeg = false;
621 for (const sym of members) {
622 const e = result.get(sym)!;
623 if (e > 0) hasPos = true;
624 else if (e < 0) hasNeg = true;
625 }
626 if (!hasPos || !hasNeg) continue;
627
628 // Representative = member with the largest scale.
629 let rep = members[0];
630 let repScale = getUnitScale(rep);
631 if (repScale === null) return null;
632 for (const sym of members) {

Callers 3

units.test.tsFile · 0.90
units.tsFile · 0.90
resolveUnitTextFunction · 0.90

Calls 1

parseDSLGroupFunction · 0.85

Tested by

no test coverage detected