summaryrefslogtreecommitdiff
path: root/node_modules/fs-extra/lib/fs
diff options
context:
space:
mode:
authorLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 23:08:57 +0300
committerLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 23:08:57 +0300
commit726b81b19251674e149ccfbb1abacbd837fc6db0 (patch)
treefbdbb227dc01357eb76e8222d76185bc124c5ca6 /node_modules/fs-extra/lib/fs
parent34f0890e175698940d49238097579f44e4d78c89 (diff)
downloadFlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.gz
FlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.zst
Removed files that should not have been included in git
Diffstat (limited to 'node_modules/fs-extra/lib/fs')
-rw-r--r--node_modules/fs-extra/lib/fs/index.js107
1 files changed, 0 insertions, 107 deletions
diff --git a/node_modules/fs-extra/lib/fs/index.js b/node_modules/fs-extra/lib/fs/index.js
deleted file mode 100644
index 1821fd0..0000000
--- a/node_modules/fs-extra/lib/fs/index.js
+++ /dev/null
@@ -1,107 +0,0 @@
-// This is adapted from https://github.com/normalize/mz
-// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors
-const u = require('universalify').fromCallback
-const fs = require('graceful-fs')
-
-const api = [
- 'access',
- 'appendFile',
- 'chmod',
- 'chown',
- 'close',
- 'copyFile',
- 'fchmod',
- 'fchown',
- 'fdatasync',
- 'fstat',
- 'fsync',
- 'ftruncate',
- 'futimes',
- 'lchown',
- 'link',
- 'lstat',
- 'mkdir',
- 'mkdtemp',
- 'open',
- 'readFile',
- 'readdir',
- 'readlink',
- 'realpath',
- 'rename',
- 'rmdir',
- 'stat',
- 'symlink',
- 'truncate',
- 'unlink',
- 'utimes',
- 'writeFile'
-].filter(key => {
- // Some commands are not available on some systems. Ex:
- // fs.copyFile was added in Node.js v8.5.0
- // fs.mkdtemp was added in Node.js v5.10.0
- // fs.lchown is not available on at least some Linux
- return typeof fs[key] === 'function'
-})
-
-// Export all keys:
-Object.keys(fs).forEach(key => {
- exports[key] = fs[key]
-})
-
-// Universalify async methods:
-api.forEach(method => {
- exports[method] = u(fs[method])
-})
-
-// We differ from mz/fs in that we still ship the old, broken, fs.exists()
-// since we are a drop-in replacement for the native module
-exports.exists = function (filename, callback) {
- if (typeof callback === 'function') {
- return fs.exists(filename, callback)
- }
- return new Promise(resolve => {
- return fs.exists(filename, resolve)
- })
-}
-
-// fs.read() & fs.write need special treatment due to multiple callback args
-
-exports.read = function (fd, buffer, offset, length, position, callback) {
- if (typeof callback === 'function') {
- return fs.read(fd, buffer, offset, length, position, callback)
- }
- return new Promise((resolve, reject) => {
- fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {
- if (err) return reject(err)
- resolve({ bytesRead, buffer })
- })
- })
-}
-
-// Function signature can be
-// fs.write(fd, buffer[, offset[, length[, position]]], callback)
-// OR
-// fs.write(fd, string[, position[, encoding]], callback)
-// so we need to handle both cases
-exports.write = function (fd, buffer, a, b, c, callback) {
- if (typeof arguments[arguments.length - 1] === 'function') {
- return fs.write(fd, buffer, a, b, c, callback)
- }
-
- // Check for old, depricated fs.write(fd, string[, position[, encoding]], callback)
- if (typeof buffer === 'string') {
- return new Promise((resolve, reject) => {
- fs.write(fd, buffer, a, b, (err, bytesWritten, buffer) => {
- if (err) return reject(err)
- resolve({ bytesWritten, buffer })
- })
- })
- }
-
- return new Promise((resolve, reject) => {
- fs.write(fd, buffer, a, b, c, (err, bytesWritten, buffer) => {
- if (err) return reject(err)
- resolve({ bytesWritten, buffer })
- })
- })
-}