MCPcopy Create free account
hub / github.com/chhoumann/quickadd / normalizeDateUnit

Function normalizeDateUnit

src/utils/dateModifiers.ts:55–64  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

53 * self-correcting error on anything unrecognised.
54 */
55export function normalizeDateUnit(raw: string): StartOf {
56 const key = raw.trim().toLowerCase();
57 const unit = UNIT_ALIASES[key];
58 if (!unit) {
59 throw new Error(
60 `Unknown date unit "${raw.trim()}". Valid units: ${VALID_DATE_SNAP_UNITS}.`,
61 );
62 }
63 return unit;
64}
65
66/**
67 * Parses a single pipe segment (already stripped of its leading `|`), e.g.

Callers 3

parseVDateOptionsFunction · 0.90
parseDateSnapSegmentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected