From 07af0f02d7bcf1a1bd872307951676574e2c4a08 Mon Sep 17 00:00:00 2001 From: toshi1127 Date: Mon, 25 Mar 2019 12:43:05 +0900 Subject: [PATCH] fs: reduce usage of require('util') PR-URL: https://github.com/nodejs/node/pull/26783 Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater Reviewed-By: Yongsheng Zhang --- lib/internal/fs/utils.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index 0c5ce1ecb76b91..66c28bea746b21 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -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'); @@ -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; }