File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -169,9 +169,9 @@ Convert to string.
169169> ` ` ` typescript
170170> string(0.5); // "0.5"
171171> string(true); // "true"
172+ > string(new Date('2025-01-01')); // "2025-01-01T00:00:00.000Z"
172173> string({ key: 'value' }); // '{"key":"value"}'
173174> string(['test']); // '["test"]'
174- > string(new Date('2025-01-01')); // "2025-01-01T00:00:00.000Z"
175175> string(null); // "null"
176176> string(undefined); // "undefined"
177177> ` ` `
Original file line number Diff line number Diff line change @@ -27,12 +27,12 @@ export const typof = (value: unknown): Types[] => {
2727
2828 if ( value === 'true' || value === 'false' ) types . push ( 'boolean' ) ;
2929
30+ if ( isISODate ( value ) ) types . push ( 'date' ) ;
31+
3032 if ( isObject ( value ) && ! Array . isArray ( JSON . parse ( value ) ) ) types . push ( 'object' ) ;
3133
3234 if ( isObject ( value ) && Array . isArray ( JSON . parse ( value ) ) ) types . push ( 'array' ) ;
3335
34- if ( isISODate ( value ) ) types . push ( 'date' ) ;
35-
3636 if ( value === 'null' ) types . push ( 'null' ) ;
3737
3838 if ( value === 'undefined' ) types . push ( 'undefined' ) ;
You can’t perform that action at this time.
0 commit comments