( date: Date, locale: string, options: Intl.DateTimeFormatOptions )
| 185 | } |
| 186 | |
| 187 | function localeDatePart( |
| 188 | date: Date, |
| 189 | locale: string, |
| 190 | options: Intl.DateTimeFormatOptions |
| 191 | ): string { |
| 192 | try { |
| 193 | return date.toLocaleDateString(localeArg(locale), options) |
| 194 | } catch { |
| 195 | return date.toLocaleDateString(undefined, options) |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | function escapeRegex(value: string): string { |
| 200 | return value.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') |
no test coverage detected