swc/bundler/tests/.cache/deno/67fa057027926f904a72e7874735dda744c2e039.ts
강동윤 bbaf619f63
fix(bundler): Fix bugs (#1437)
swc_bundler:
 - [x] Fix wrapped esms. (denoland/deno#9307)
 - [x] Make test secure.
2021-03-02 17:33:03 +09:00

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;
};