fs: reduce usage of require('util')
PR-URL: https://github.com/nodejs/node/pull/26783 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
This commit is contained in:
parent
5de804e636
commit
51256e5d78
@ -12,10 +12,13 @@ const {
|
|||||||
},
|
},
|
||||||
hideStackFrames
|
hideStackFrames
|
||||||
} = require('internal/errors');
|
} = require('internal/errors');
|
||||||
const { isUint8Array, isArrayBufferView } = require('internal/util/types');
|
const {
|
||||||
|
isUint8Array,
|
||||||
|
isArrayBufferView,
|
||||||
|
isDate
|
||||||
|
} = require('internal/util/types');
|
||||||
const { once } = require('internal/util');
|
const { once } = require('internal/util');
|
||||||
const pathModule = require('path');
|
const pathModule = require('path');
|
||||||
const util = require('util');
|
|
||||||
const kType = Symbol('type');
|
const kType = Symbol('type');
|
||||||
const kStats = Symbol('stats');
|
const kStats = Symbol('stats');
|
||||||
|
|
||||||
@ -383,7 +386,7 @@ function toUnixTimestamp(time, name = 'time') {
|
|||||||
}
|
}
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
if (util.isDate(time)) {
|
if (isDate(time)) {
|
||||||
// Convert to 123.456 UNIX timestamp
|
// Convert to 123.456 UNIX timestamp
|
||||||
return time.getTime() / 1000;
|
return time.getTime() / 1000;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user