MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parseTimePeriod

Function parseTimePeriod

console/src/hooks/useTimePeriodSelect.ts:62–72  ·  view source on GitHub ↗
(
  periodString: string | null,
  defaultValue: string,
  timePeriodOptions: TimePeriodOptions,
)

Source from the content-addressed store, hash-verified

60};
61
62const parseTimePeriod = (
63 periodString: string | null,
64 defaultValue: string,
65 timePeriodOptions: TimePeriodOptions,
66) => {
67 const period =
68 periodString && Object.keys(timePeriodOptions).includes(periodString)
69 ? periodString
70 : defaultValue;
71 return parseInt(period);
72};
73
74const timePeriodFromUrl = (
75 defaultValue: string,

Callers 1

timePeriodFromUrlFunction · 0.85

Calls 2

parseIntFunction · 0.85
keysMethod · 0.45

Tested by

no test coverage detected