MCPcopy Create free account
hub / github.com/deepnote/deepnote / isCustomDateRange

Function isCustomDateRange

packages/blocks/src/blocks/input-blocks.ts:42–50  ·  view source on GitHub ↗
(value: DateRangeInputValue)

Source from the content-addressed store, hash-verified

40] as const
41
42export function isCustomDateRange(value: DateRangeInputValue): value is DateIntervalCustomString {
43 if (typeof value !== 'string') {
44 return false
45 }
46
47 const days = Number.parseInt(value.split('customDays')[1] ?? '0', 10)
48
49 return value.startsWith('customDays') && !Number.isNaN(days) && days >= 0
50}
51
52export function isValidRelativeDateInterval(value: DateRangeInputValue): value is DateIntervalString {
53 return typeof value === 'string' && DATE_RANGE_INPUT_RELATIVE_RANGES.some(range => range.value === value)

Calls

no outgoing calls

Tested by

no test coverage detected