(str: string, full: boolean)
| 41 | } |
| 42 | |
| 43 | export function isTime(str: string, full: boolean): boolean { |
| 44 | const matches = str.match(TIME); |
| 45 | if (!matches) return false; |
| 46 | |
| 47 | const hour = +matches[1]; |
| 48 | const minute = +matches[2]; |
| 49 | const second = +matches[3]; |
| 50 | const timeZone = matches[5]; |
| 51 | return hour <= 23 && minute <= 59 && second <= 59 && (!full || !!timeZone); |
| 52 | } |
| 53 | |
| 54 | const DATE_TIME_SEPARATOR = /t|\s/i; |
| 55 | export function isDateTime(str: string): boolean { |
no outgoing calls
no test coverage detected
searching dependent graphs…