| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 16bbbac commit 4c12e6e
9 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -270,6 +270,7 @@ overrides: | |||
| 270 | 270 | - ./cluster.js | |
| 271 | 271 | - ./console.js | |
| 272 | 272 | - ./constants.js | |
| 273 | + - ./fs.js | ||
| 273 | 274 | - ./internal/assert.js | |
| 274 | 275 | - ./internal/child_process/*.js | |
| 275 | 276 | - ./internal/cli_table.js | |
@@ -278,6 +279,7 @@ overrides: | |||
| 278 | 279 | - ./internal/events/*.js | |
| 279 | 280 | - ./internal/fixed_queue.js | |
| 280 | 281 | - ./internal/freelist.js | |
| 282 | + - ./internal/fs/*.js | ||
| 281 | 283 | - ./internal/heap_utils.js | |
| 282 | 284 | - ./internal/http.js | |
| 283 | 285 | - ./internal/idna.js | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,7 +53,7 @@ const { | |||
| 53 | 53 | W_OK, | |
| 54 | 54 | X_OK, | |
| 55 | 55 | O_WRONLY, | |
| 56 | - O_SYMLINK | ||
| 56 | + O_SYMLINK, | ||
| 57 | 57 | } = constants; | |
| 58 | 58 | ||
| 59 | 59 | const pathModule = require('path'); | |
@@ -75,7 +75,7 @@ const { | |||
| 75 | 75 | }, | |
| 76 | 76 | AbortError, | |
| 77 | 77 | uvErrmapGet, | |
| 78 | - uvException | ||
| 78 | + uvException, | ||
| 79 | 79 | } = require('internal/errors'); | |
| 80 | 80 | ||
| 81 | 81 | const { FSReqCallback } = binding; | |
@@ -122,7 +122,7 @@ const { | |||
| 122 | 122 | validateRmOptionsSync, | |
| 123 | 123 | validateRmdirOptions, | |
| 124 | 124 | validateStringAfterArrayBufferView, | |
| 125 | - warnOnNonPortableTemplate | ||
| 125 | + warnOnNonPortableTemplate, | ||
| 126 | 126 | } = require('internal/fs/utils'); | |
| 127 | 127 | const { | |
| 128 | 128 | CHAR_FORWARD_SLASH, | |
@@ -978,7 +978,7 @@ function writev(fd, buffers, position, callback) { | |||
| 978 | 978 | ObjectDefineProperty(writev, kCustomPromisifyArgsSymbol, { | |
| 979 | 979 | __proto__: null, | |
| 980 | 980 | value: ['bytesWritten', 'buffer'], | |
| 981 | - enumerable: false | ||
| 981 | + enumerable: false, | ||
| 982 | 982 | }); | |
| 983 | 983 | ||
| 984 | 984 | /** | |
@@ -2404,7 +2404,7 @@ function watchFile(filename, options, listener) { | |||
| 2404 | 2404 | // behavioral changes to a minimum. | |
| 2405 | 2405 | interval: 5007, | |
| 2406 | 2406 | persistent: true, | |
| 2407 | - ...options | ||
| 2407 | + ...options, | ||
| 2408 | 2408 | }; | |
| 2409 | 2409 | ||
| 2410 | 2410 | validateFunction(listener, 'listener'); | |
@@ -3122,7 +3122,7 @@ module.exports = fs = { | |||
| 3122 | 3122 | }, | |
| 3123 | 3123 | ||
| 3124 | 3124 | // For tests | |
| 3125 | - _toUnixTimestamp: toUnixTimestamp | ||
| 3125 | + _toUnixTimestamp: toUnixTimestamp, | ||
| 3126 | 3126 | }; | |
| 3127 | 3127 | ||
| 3128 | 3128 | defineLazyProperties( | |
@@ -3140,7 +3140,7 @@ ObjectDefineProperties(fs, { | |||
| 3140 | 3140 | __proto__: null, | |
| 3141 | 3141 | configurable: false, | |
| 3142 | 3142 | enumerable: true, | |
| 3143 | - value: constants | ||
| 3143 | + value: constants, | ||
| 3144 | 3144 | }, | |
| 3145 | 3145 | promises: { | |
| 3146 | 3146 | __proto__: null, | |
@@ -3149,6 +3149,6 @@ ObjectDefineProperties(fs, { | |||
| 3149 | 3149 | get() { | |
| 3150 | 3150 | promises ??= require('internal/fs/promises').exports; | |
| 3151 | 3151 | return promises; | |
| 3152 | - } | ||
| 3153 | - } | ||
| 3152 | + }, | ||
| 3153 | + }, | ||
| 3154 | 3154 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,8 +18,8 @@ const { | |||
| 18 | 18 | codes: { | |
| 19 | 19 | ERR_DIR_CLOSED, | |
| 20 | 20 | ERR_DIR_CONCURRENT_OPERATION, | |
| 21 | - ERR_MISSING_ARGS | ||
| 22 | - } | ||
| 21 | + ERR_MISSING_ARGS, | ||
| 22 | + }, | ||
| 23 | 23 | } = require('internal/errors'); | |
| 24 | 24 | ||
| 25 | 25 | const { FSReqCallback } = binding; | |
@@ -28,11 +28,11 @@ const { | |||
| 28 | 28 | getDirent, | |
| 29 | 29 | getOptions, | |
| 30 | 30 | getValidatedPath, | |
| 31 | - handleErrorFromBinding | ||
| 31 | + handleErrorFromBinding, | ||
| 32 | 32 | } = require('internal/fs/utils'); | |
| 33 | 33 | const { | |
| 34 | 34 | validateFunction, | |
| 35 | - validateUint32 | ||
| 35 | + validateUint32, | ||
| 36 | 36 | } = require('internal/validators'); | |
| 37 | 37 | ||
| 38 | 38 | const kDirHandle = Symbol('kDirHandle'); | |
@@ -60,8 +60,8 @@ class Dir { | |||
| 60 | 60 | this[kDirOptions] = { | |
| 61 | 61 | bufferSize: 32, | |
| 62 | 62 | ...getOptions(options, { | |
| 63 | - encoding: 'utf8' | ||
| 64 | - }) | ||
| 63 | + encoding: 'utf8', | ||
| 64 | + }), | ||
| 65 | 65 | }; | |
| 66 | 66 | ||
| 67 | 67 | validateUint32(this[kDirOptions].bufferSize, 'options.bufferSize', true); | |
@@ -239,7 +239,7 @@ function opendir(path, options, callback) { | |||
| 239 | 239 | ||
| 240 | 240 | path = getValidatedPath(path); | |
| 241 | 241 | options = getOptions(options, { | |
| 242 | - encoding: 'utf8' | ||
| 242 | + encoding: 'utf8', | ||
| 243 | 243 | }); | |
| 244 | 244 | ||
| 245 | 245 | function opendirCallback(error, handle) { | |
@@ -263,7 +263,7 @@ function opendir(path, options, callback) { | |||
| 263 | 263 | function opendirSync(path, options) { | |
| 264 | 264 | path = getValidatedPath(path); | |
| 265 | 265 | options = getOptions(options, { | |
| 266 | - encoding: 'utf8' | ||
| 266 | + encoding: 'utf8', | ||
| 267 | 267 | }); | |
| 268 | 268 | ||
| 269 | 269 | const ctx = { path }; | |
@@ -281,5 +281,5 @@ function opendirSync(path, options) { | |||
| 281 | 281 | module.exports = { | |
| 282 | 282 | Dir, | |
| 283 | 283 | opendir, | |
| 284 | - opendirSync | ||
| 284 | + opendirSync, | ||
| 285 | 285 | }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,7 @@ const { | |||
| 22 | 22 | O_SYMLINK, | |
| 23 | 23 | O_WRONLY, | |
| 24 | 24 | S_IFMT, | |
| 25 | - S_IFREG | ||
| 25 | + S_IFREG, | ||
| 26 | 26 | } = constants; | |
| 27 | 27 | ||
| 28 | 28 | const binding = internalBinding('fs'); | |
@@ -107,7 +107,7 @@ const kLocked = Symbol('kLocked'); | |||
| 107 | 107 | const { kUsePromises } = binding; | |
| 108 | 108 | const { Interface } = require('internal/readline/interface'); | |
| 109 | 109 | const { | |
| 110 | - JSTransferable, kDeserialize, kTransfer, kTransferList | ||
| 110 | + JSTransferable, kDeserialize, kTransfer, kTransferList, | ||
| 111 | 111 | } = require('internal/worker/js_transferable'); | |
| 112 | 112 | ||
| 113 | 113 | const getDirectoryEntriesPromise = promisify(getDirents); | |
@@ -323,7 +323,7 @@ class FileHandle extends EventEmitterMixin(JSTransferable) { | |||
| 323 | 323 | ||
| 324 | 324 | return { | |
| 325 | 325 | data: { handle }, | |
| 326 | - deserializeInfo: 'internal/fs/promises:FileHandle' | ||
| 326 | + deserializeInfo: 'internal/fs/promises:FileHandle', | ||
| 327 | 327 | }; | |
| 328 | 328 | } | |
| 329 | 329 | ||
@@ -715,7 +715,7 @@ async function mkdir(path, options) { | |||
| 715 | 715 | } | |
| 716 | 716 | const { | |
| 717 | 717 | recursive = false, | |
| 718 | - mode = 0o777 | ||
| 718 | + mode = 0o777, | ||
| 719 | 719 | } = options || kEmptyObject; | |
| 720 | 720 | path = getValidatedPath(path); | |
| 721 | 721 | validateBoolean(recursive, 'options.recursive'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,7 +10,7 @@ const { | |||
| 10 | 10 | constants: { | |
| 11 | 11 | kReadFileBufferLength, | |
| 12 | 12 | kReadFileUnknownBufferLength, | |
| 13 | - } | ||
| 13 | + }, | ||
| 14 | 14 | } = require('internal/fs/utils'); | |
| 15 | 15 | ||
| 16 | 16 | const { Buffer } = require('buffer'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,7 @@ const { | |||
| 26 | 26 | stat, | |
| 27 | 27 | statSync, | |
| 28 | 28 | unlink, | |
| 29 | - unlinkSync | ||
| 29 | + unlinkSync, | ||
| 30 | 30 | } = fs; | |
| 31 | 31 | const { sep } = require('path'); | |
| 32 | 32 | const { setTimeout } = require('timers'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -104,7 +104,7 @@ const FileHandleOperations = (handle) => { | |||
| 104 | 104 | PromisePrototypeThen(handle.writev(buffers, pos), | |
| 105 | 105 | (r) => cb(null, r.bytesWritten, r.buffers), | |
| 106 | 106 | (err) => cb(err, 0, buffers)); | |
| 107 | - } | ||
| 107 | + }, | ||
| 108 | 108 | }; | |
| 109 | 109 | }; | |
| 110 | 110 | ||
@@ -221,7 +221,7 @@ ObjectDefineProperty(ReadStream.prototype, 'autoClose', { | |||
| 221 | 221 | }, | |
| 222 | 222 | set(val) { | |
| 223 | 223 | this._readableState.autoDestroy = val; | |
| 224 | - } | ||
| 224 | + }, | ||
| 225 | 225 | }); | |
| 226 | 226 | ||
| 227 | 227 | const openReadFs = deprecate(function() { | |
@@ -301,7 +301,7 @@ ReadStream.prototype.close = function(cb) { | |||
| 301 | 301 | ObjectDefineProperty(ReadStream.prototype, 'pending', { | |
| 302 | 302 | __proto__: null, | |
| 303 | 303 | get() { return this.fd === null; }, | |
| 304 | - configurable: true | ||
| 304 | + configurable: true, | ||
| 305 | 305 | }); | |
| 306 | 306 | ||
| 307 | 307 | function WriteStream(path, options) { | |
@@ -382,7 +382,7 @@ ObjectDefineProperty(WriteStream.prototype, 'autoClose', { | |||
| 382 | 382 | }, | |
| 383 | 383 | set(val) { | |
| 384 | 384 | this._writableState.autoDestroy = val; | |
| 385 | - } | ||
| 385 | + }, | ||
| 386 | 386 | }); | |
| 387 | 387 | ||
| 388 | 388 | const openWriteFs = deprecate(function() { | |
@@ -487,10 +487,10 @@ WriteStream.prototype.destroySoon = WriteStream.prototype.end; | |||
| 487 | 487 | ObjectDefineProperty(WriteStream.prototype, 'pending', { | |
| 488 | 488 | __proto__: null, | |
| 489 | 489 | get() { return this.fd === null; }, | |
| 490 | - configurable: true | ||
| 490 | + configurable: true, | ||
| 491 | 491 | }); | |
| 492 | 492 | ||
| 493 | 493 | module.exports = { | |
| 494 | 494 | ReadStream, | |
| 495 | - WriteStream | ||
| 495 | + WriteStream, | ||
| 496 | 496 | }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,10 +31,10 @@ const { | |||
| 31 | 31 | ERR_INCOMPATIBLE_OPTION_PAIR, | |
| 32 | 32 | ERR_INVALID_ARG_TYPE, | |
| 33 | 33 | ERR_INVALID_ARG_VALUE, | |
| 34 | - ERR_OUT_OF_RANGE | ||
| 34 | + ERR_OUT_OF_RANGE, | ||
| 35 | 35 | }, | |
| 36 | 36 | hideStackFrames, | |
| 37 | - uvException | ||
| 37 | + uvException, | ||
| 38 | 38 | } = require('internal/errors'); | |
| 39 | 39 | const { | |
| 40 | 40 | isArrayBufferView, | |
@@ -95,13 +95,13 @@ const { | |||
| 95 | 95 | UV_DIRENT_FIFO, | |
| 96 | 96 | UV_DIRENT_SOCKET, | |
| 97 | 97 | UV_DIRENT_CHAR, | |
| 98 | - UV_DIRENT_BLOCK | ||
| 98 | + UV_DIRENT_BLOCK, | ||
| 99 | 99 | }, | |
| 100 | 100 | os: { | |
| 101 | 101 | errno: { | |
| 102 | - EISDIR | ||
| 103 | - } | ||
| 104 | - } | ||
| 102 | + EISDIR, | ||
| 103 | + }, | ||
| 104 | + }, | ||
| 105 | 105 | } = internalBinding('constants'); | |
| 106 | 106 | ||
| 107 | 107 | // The access modes can be any of F_OK, R_OK, W_OK or X_OK. Some might not be | |
@@ -753,7 +753,7 @@ const defaultRmOptions = { | |||
| 753 | 753 | recursive: false, | |
| 754 | 754 | force: false, | |
| 755 | 755 | retryDelay: 100, | |
| 756 | - maxRetries: 0 | ||
| 756 | + maxRetries: 0, | ||
| 757 | 757 | }; | |
| 758 | 758 | ||
| 759 | 759 | const defaultRmdirOptions = { | |
@@ -804,7 +804,7 @@ const validateRmOptions = hideStackFrames((path, options, expectDir, cb) => { | |||
| 804 | 804 | message: 'is a directory', | |
| 805 | 805 | path, | |
| 806 | 806 | syscall: 'rm', | |
| 807 | - errno: EISDIR | ||
| 807 | + errno: EISDIR, | ||
| 808 | 808 | })); | |
| 809 | 809 | } | |
| 810 | 810 | return cb(null, options); | |
@@ -829,7 +829,7 @@ const validateRmOptionsSync = hideStackFrames((path, options, expectDir) => { | |||
| 829 | 829 | message: 'is a directory', | |
| 830 | 830 | path, | |
| 831 | 831 | syscall: 'rm', | |
| 832 | - errno: EISDIR | ||
| 832 | + errno: EISDIR, | ||
| 833 | 833 | }); | |
| 834 | 834 | } | |
| 835 | 835 | } | |
@@ -946,5 +946,5 @@ module.exports = { | |||
| 946 | 946 | validateRmOptionsSync, | |
| 947 | 947 | validateRmdirOptions, | |
| 948 | 948 | validateStringAfterArrayBufferView, | |
| 949 | - warnOnNonPortableTemplate | ||
| 949 | + warnOnNonPortableTemplate, | ||
| 950 | 950 | }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,7 @@ const { | |||
| 21 | 21 | ||
| 22 | 22 | const { | |
| 23 | 23 | kFsStatsFieldsNumber, | |
| 24 | - StatWatcher: _StatWatcher | ||
| 24 | + StatWatcher: _StatWatcher, | ||
| 25 | 25 | } = internalBinding('fs'); | |
| 26 | 26 | ||
| 27 | 27 | const { FSEvent } = internalBinding('fs_event_wrap'); | |
@@ -30,12 +30,12 @@ const { EventEmitter } = require('events'); | |||
| 30 | 30 | ||
| 31 | 31 | const { | |
| 32 | 32 | getStatsFromBinding, | |
| 33 | - getValidatedPath | ||
| 33 | + getValidatedPath, | ||
| 34 | 34 | } = require('internal/fs/utils'); | |
| 35 | 35 | ||
| 36 | 36 | const { | |
| 37 | 37 | defaultTriggerAsyncIdScope, | |
| 38 | - symbols: { owner_symbol } | ||
| 38 | + symbols: { owner_symbol }, | ||
| 39 | 39 | } = require('internal/async_hooks'); | |
| 40 | 40 | ||
| 41 | 41 | const { toNamespacedPath } = require('path'); | |
@@ -122,7 +122,7 @@ StatWatcher.prototype[kFSStatWatcherStart] = function(filename, | |||
| 122 | 122 | const error = uvException({ | |
| 123 | 123 | errno: err, | |
| 124 | 124 | syscall: 'watch', | |
| 125 | - path: filename | ||
| 125 | + path: filename, | ||
| 126 | 126 | }); | |
| 127 | 127 | error.filename = filename; | |
| 128 | 128 | throw error; | |
@@ -207,7 +207,7 @@ function FSWatcher() { | |||
| 207 | 207 | const error = uvException({ | |
| 208 | 208 | errno: status, | |
| 209 | 209 | syscall: 'watch', | |
| 210 | - path: filename | ||
| 210 | + path: filename, | ||
| 211 | 211 | }); | |
| 212 | 212 | error.filename = filename; | |
| 213 | 213 | this.emit('error', error); | |
@@ -249,7 +249,7 @@ FSWatcher.prototype[kFSWatchStart] = function(filename, | |||
| 249 | 249 | syscall: 'watch', | |
| 250 | 250 | path: filename, | |
| 251 | 251 | message: err === UV_ENOSPC ? | |
| 252 | - 'System limit for number of file watchers reached' : '' | ||
| 252 | + 'System limit for number of file watchers reached' : '', | ||
| 253 | 253 | }); | |
| 254 | 254 | error.filename = filename; | |
| 255 | 255 | throw error; | |
@@ -296,7 +296,7 @@ function emitCloseNT(self) { | |||
| 296 | 296 | ObjectDefineProperty(FSEvent.prototype, 'owner', { | |
| 297 | 297 | __proto__: null, | |
| 298 | 298 | get() { return this[owner_symbol]; }, | |
| 299 | - set(v) { return this[owner_symbol] = v; } | ||
| 299 | + set(v) { return this[owner_symbol] = v; }, | ||
| 300 | 300 | }); | |
| 301 | 301 | ||
| 302 | 302 | async function* watch(filename, options = kEmptyObject) { | |
@@ -336,7 +336,7 @@ async function* watch(filename, options = kEmptyObject) { | |||
| 336 | 336 | const error = uvException({ | |
| 337 | 337 | errno: status, | |
| 338 | 338 | syscall: 'watch', | |
| 339 | - path: filename | ||
| 339 | + path: filename, | ||
| 340 | 340 | }); | |
| 341 | 341 | error.filename = filename; | |
| 342 | 342 | handle.close(); | |
@@ -354,7 +354,7 @@ async function* watch(filename, options = kEmptyObject) { | |||
| 354 | 354 | syscall: 'watch', | |
| 355 | 355 | path: filename, | |
| 356 | 356 | message: err === UV_ENOSPC ? | |
| 357 | - 'System limit for number of file watchers reached' : '' | ||
| 357 | + 'System limit for number of file watchers reached' : '', | ||
| 358 | 358 | }); | |
| 359 | 359 | error.filename = filename; | |
| 360 | 360 | handle.close(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments