Skip to content

Commit bb9f1cc

Browse files
toshi1127targos
authored andcommittedMar 30, 2019
fs: reduce usage of require('util')
PR-URL: #26783 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
1 parent 5d9f819 commit bb9f1cc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

‎lib/internal/fs/utils.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ const {
99
ERR_INVALID_OPT_VALUE_ENCODING,
1010
ERR_OUT_OF_RANGE
1111
} = require('internal/errors').codes;
12-
const { isUint8Array, isArrayBufferView } = require('internal/util/types');
12+
const {
13+
isUint8Array,
14+
isArrayBufferView,
15+
isDate
16+
} = require('internal/util/types');
1317
const { once } = require('internal/util');
1418
const pathModule = require('path');
15-
const util = require('util');
1619
const kType = Symbol('type');
1720
const kStats = Symbol('stats');
1821

@@ -392,7 +395,7 @@ function toUnixTimestamp(time, name = 'time') {
392395
}
393396
return time;
394397
}
395-
if (util.isDate(time)) {
398+
if (isDate(time)) {
396399
// Convert to 123.456 UNIX timestamp
397400
return time.getTime() / 1000;
398401
}

0 commit comments

Comments
 (0)
Please sign in to comment.