mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 14:43:33 +03:00
bbaf619f63
swc_bundler: - [x] Fix wrapped esms. (denoland/deno#9307) - [x] Make test secure.
11 lines
267 B
TypeScript
11 lines
267 B
TypeScript
// Loaded from https://deno.land/x/segno@v1.1.0/lib/helpers/toDate.ts
|
|
|
|
|
|
import { assertString } from './assertString.ts';
|
|
|
|
export const toDate = (str: string) => {
|
|
assertString(str);
|
|
const date = Date.parse(str);
|
|
return !isNaN(date) ? new Date(date) : null;
|
|
};
|