Skip to content

Commit 5d4c0db

Browse files
toshi1127BethGriggs
authored andcommitted
fs: reduce usage of require('util')
PR-URL: #26783 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
1 parent 802c76a commit 5d4c0db

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/internal/fs/utils.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ const {
1212
},
1313
hideStackFrames
1414
} = require('internal/errors');
15-
const { isUint8Array, isArrayBufferView } = require('internal/util/types');
15+
const {
16+
isUint8Array,
17+
isArrayBufferView,
18+
isDate
19+
} = require('internal/util/types');
1620
const { once } = require('internal/util');
1721
const pathModule = require('path');
18-
const util = require('util');
1922
const kType = Symbol('type');
2023
const kStats = Symbol('stats');
2124

@@ -383,7 +386,7 @@ function toUnixTimestamp(time, name = 'time') {
383386
}
384387
return time;
385388
}
386-
if (util.isDate(time)) {
389+
if (isDate(time)) {
387390
// Convert to 123.456 UNIX timestamp
388391
return time.getTime() / 1000;
389392
}

0 commit comments

Comments
 (0)