MCPcopy Create free account
hub / github.com/ProNextJS/declarative-routing / parseBoolean

Function parseBoolean

examples/nextjs/finished/src/routes/utils.ts:165–174  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

163}
164
165function parseBoolean(str: string): ParsedData<boolean> {
166 switch (str) {
167 case "true":
168 return { data: true };
169 case "false":
170 return { data: false };
171 default:
172 return { error: `${str} is not a boolean` };
173 }
174}
175
176function parseArray<T>(
177 values: string[],

Callers 1

parseValuesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected