From 11d37d5d9b91d545410bb96d340bd7c8f20aef8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Wed, 7 Oct 2020 00:07:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96exists?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 7 ++----- index.mjs | 7 ++----- package.json | 10 ++++++++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/index.js b/index.js index cee6147..e1f4a02 100644 --- a/index.js +++ b/index.js @@ -21,10 +21,7 @@ class Stats { } } -const VERSION = +process.versions.node - .split('.') - .slice(0, 2) - .join('.') +const VERSION = +process.versions.node.split('.').slice(0, 2).join('.') const EMPTY_STAT = new Stats() @@ -288,7 +285,7 @@ const Iofs = { * @param {String} file [目标路径] */ exists(file) { - return this.is(file, FS.constants.R_OK) + return this.is(file, FS.constants.F_OK) }, // 是否可读写 diff --git a/index.mjs b/index.mjs index 3f1762e..1bfb143 100644 --- a/index.mjs +++ b/index.mjs @@ -21,10 +21,7 @@ class STATS { } } -const VERSION = +process.versions.node - .split('.') - .slice(0, 2) - .join('.') +const VERSION = +process.versions.node.split('.').slice(0, 2).join('.') const EMPTY_STAT = new STATS() @@ -288,7 +285,7 @@ export default { * @param {String} file [目标路径] */ exists(file) { - return this.is(file, FS.constants.R_OK) + return this.is(file, FS.constants.F_OK) }, // 是否可读写 diff --git a/package.json b/package.json index 38cf20a..2a2748f 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,19 @@ { "name": "iofs", - "version": "1.5.0", + "version": "1.5.1", "description": "iofs是一个基于原生fs模块封装的工具, 旨在提供更加方便实用一些常用的API方法(同步), API习惯参考了bash shell。", "main": "index.js", "repository": { "type": "git", "url": "https://github.com/bytedo/iofs.git" }, - "keywords": ["fivejs", "fs", "iofs", "fs.io", "file"], + "keywords": [ + "fivejs", + "fs", + "iofs", + "fs.io", + "file" + ], "author": "yutent", "license": "MIT" }