MCPcopy Index your code
hub / github.com/JavaScriptRegenerated/yieldparser / NaturalDateParser

Function NaturalDateParser

src/natural-dates.test.ts:93–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

91 }
92
93 function* NaturalDateParser(): ParseGenerator<Result> {
94 yield whitespaceOptional;
95 const { weekdays, repeats } = yield WeekdaysParser;
96 yield whitespaceOptional;
97
98 yield whitespaceOptional;
99 const timespan = yield optional(TimespanParser);
100 yield whitespaceOptional;
101
102 return { repeats: repeats ? 'weekly' : undefined, weekdays, ...(timespan as any) };
103 }
104
105 function parseNaturalDate(input: string) {
106 input = input.toLowerCase();

Callers 1

parseNaturalDateFunction · 0.85

Calls 1

optionalFunction · 0.90

Tested by

no test coverage detected