Skip to content
Permalink
Browse files

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>
  • Loading branch information...
toshi1127 authored and ZYSzys committed Mar 25, 2019
1 parent 5de804e commit 51256e5d78d8cbb4c532c9d7226ae5ad08d09020
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/internal/fs/utils.js
@@ -12,10 +12,13 @@ const {
},
hideStackFrames
} = require('internal/errors');
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');

@@ -383,7 +386,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;
}

0 comments on commit 51256e5

Please sign in to comment.
You can’t perform that action at this time.