File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -3,15 +3,12 @@ import parse from 'parse-duration'
33parse [ '' ] = parse [ 's' ] !
44parse [ 'mo' ] = parse [ 'M' ] = parse [ 'month' ] !
55
6- const defaultUnitValue = parse [ '' ] !
7-
86export const parseDuration = ( duration : string , defaultUnit ?: parse . Units ) => {
7+ const defaultUnitValue = parse [ '' ] !
98 if ( defaultUnit ) parse [ '' ] = parse [ defaultUnit ] !
10- return (
11- // biome-ignore lint/suspicious/noAssignInExpressions: Expression is ignored
12- // biome-ignore lint/style/noCommaOperator: The last expression (parse call) is returned, it is not confusing
13- ( parse [ '' ] = defaultUnitValue ) , parse ( duration , 'ms' ) ?? Number . NaN
14- )
9+ const result = parse ( duration , 'ms' ) ?? Number . NaN
10+ parse [ '' ] = defaultUnitValue
11+ return result
1512}
1613
1714export const durationToString = ( duration : number ) => {
You can’t perform that action at this time.
0 commit comments