diff options
author | RaindropsSys <contact@minteck.org> | 2023-06-02 16:31:02 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-06-02 16:31:02 +0200 |
commit | 48afc99d05c7bcd54231f340635f5102a03fbda4 (patch) | |
tree | bdad312490ee42b84dde71d5c49266f1b7fc792e /includes/external/chvfs/node_modules/node-watch/lib/is.js | |
parent | 82ef2e6f4fadb6ed721a0de79ec4d2fcfdc3f426 (diff) | |
download | pluralconnect-48afc99d05c7bcd54231f340635f5102a03fbda4.tar.gz pluralconnect-48afc99d05c7bcd54231f340635f5102a03fbda4.tar.bz2 pluralconnect-48afc99d05c7bcd54231f340635f5102a03fbda4.zip |
Updated 7 files, added error.php and deleted 39 files (automated)
Diffstat (limited to 'includes/external/chvfs/node_modules/node-watch/lib/is.js')
-rw-r--r-- | includes/external/chvfs/node_modules/node-watch/lib/is.js | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/includes/external/chvfs/node_modules/node-watch/lib/is.js b/includes/external/chvfs/node_modules/node-watch/lib/is.js deleted file mode 100644 index ebe0600..0000000 --- a/includes/external/chvfs/node_modules/node-watch/lib/is.js +++ /dev/null @@ -1,78 +0,0 @@ -var fs = require('fs'); -var path = require('path'); -var os = require('os'); - -function matchObject(item, str) { - return Object.prototype.toString.call(item) - === '[object ' + str + ']'; -} - -function checkStat(name, fn) { - try { - return fn(name); - } catch (err) { - if (/^(ENOENT|EPERM|EACCES)$/.test(err.code)) { - if (err.code !== 'ENOENT') { - console.warn('Warning: Cannot access %s', name); - } - return false; - } - throw err; - } -} - -var is = { - nil: function(item) { - return item == null; - }, - array: function(item) { - return Array.isArray(item); - }, - emptyObject: function(item) { - for (var key in item) { - return false; - } - return true; - }, - buffer: function(item) { - return Buffer.isBuffer(item); - }, - regExp: function(item) { - return matchObject(item, 'RegExp'); - }, - string: function(item) { - return matchObject(item, 'String'); - }, - func: function(item) { - return typeof item === 'function'; - }, - number: function(item) { - return matchObject(item, 'Number'); - }, - exists: function(name) { - return fs.existsSync(name); - }, - file: function(name) { - return checkStat(name, function(n) { - return fs.statSync(n).isFile() - }); - }, - samePath: function(a, b) { - return path.resolve(a) === path.resolve(b); - }, - directory: function(name) { - return checkStat(name, function(n) { - return fs.statSync(n).isDirectory() - }); - }, - symbolicLink: function(name) { - return checkStat(name, function(n) { - return fs.lstatSync(n).isSymbolicLink(); - }); - }, - windows: function() { - return os.platform() === 'win32'; - } -}; - -module.exports = is; |