Skip to content

Commit

Permalink
fs: reduce usage of require('util')
Browse files Browse the repository at this point in the history
PR-URL: #26783
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
  • Loading branch information
toshi1127 authored and targos committed Mar 30, 2019
1 parent 5d9f819 commit bb9f1cc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/internal/fs/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ const {
ERR_INVALID_OPT_VALUE_ENCODING,
ERR_OUT_OF_RANGE
} = require('internal/errors').codes;
const { isUint8Array, isArrayBufferView } = require('internal/util/types');
const {
isUint8Array,
isArrayBufferView,
isDate
} = require('internal/util/types');
const { once } = require('internal/util');
const pathModule = require('path');
const util = require('util');
const kType = Symbol('type');
const kStats = Symbol('stats');

Expand Down Expand Up @@ -392,7 +395,7 @@ function toUnixTimestamp(time, name = 'time') {
}
return time;
}
if (util.isDate(time)) {
if (isDate(time)) {
// Convert to 123.456 UNIX timestamp
return time.getTime() / 1000;
}
Expand Down

0 comments on commit bb9f1cc

Please sign in to comment.