| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d2692c6 commit efc2409
9 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -258,6 +258,7 @@ overrides: | |||
| 258 | 258 | - ./cluster.js | |
| 259 | 259 | - ./console.js | |
| 260 | 260 | - ./constants.js | |
| 261 | + - ./fs.js | ||
| 261 | 262 | - ./internal/assert.js | |
| 262 | 263 | - ./internal/child_process/*.js | |
| 263 | 264 | - ./internal/cli_table.js | |
@@ -266,6 +267,7 @@ overrides: | |||
| 266 | 267 | - ./internal/events/*.js | |
| 267 | 268 | - ./internal/fixed_queue.js | |
| 268 | 269 | - ./internal/freelist.js | |
| 270 | + - ./internal/fs/*.js | ||
| 269 | 271 | - ./internal/heap_utils.js | |
| 270 | 272 | - ./internal/http.js | |
| 271 | 273 | - ./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'); | |
@@ -73,7 +73,7 @@ const { | |||
| 73 | 73 | }, | |
| 74 | 74 | AbortError, | |
| 75 | 75 | uvErrmapGet, | |
| 76 | - uvException | ||
| 76 | + uvException, | ||
| 77 | 77 | } = require('internal/errors'); | |
| 78 | 78 | ||
| 79 | 79 | const { FSReqCallback } = binding; | |
@@ -121,12 +121,12 @@ const { | |||
| 121 | 121 | validateRmdirOptions, | |
| 122 | 122 | validateStringAfterArrayBufferView, | |
| 123 | 123 | validatePrimitiveStringAfterArrayBufferView, | |
| 124 | - warnOnNonPortableTemplate | ||
| 124 | + warnOnNonPortableTemplate, | ||
| 125 | 125 | } = require('internal/fs/utils'); | |
| 126 | 126 | const { | |
| 127 | 127 | Dir, | |
| 128 | 128 | opendir, | |
| 129 | - opendirSync | ||
| 129 | + opendirSync, | ||
| 130 | 130 | } = require('internal/fs/dir'); | |
| 131 | 131 | const { | |
| 132 | 132 | CHAR_FORWARD_SLASH, | |
@@ -974,7 +974,7 @@ function writev(fd, buffers, position, callback) { | |||
| 974 | 974 | ObjectDefineProperty(writev, kCustomPromisifyArgsSymbol, { | |
| 975 | 975 | __proto__: null, | |
| 976 | 976 | value: ['bytesWritten', 'buffer'], | |
| 977 | - enumerable: false | ||
| 977 | + enumerable: false, | ||
| 978 | 978 | }); | |
| 979 | 979 | ||
| 980 | 980 | /** | |
@@ -2396,7 +2396,7 @@ function watchFile(filename, options, listener) { | |||
| 2396 | 2396 | // behavioral changes to a minimum. | |
| 2397 | 2397 | interval: 5007, | |
| 2398 | 2398 | persistent: true, | |
| 2399 | - ...options | ||
| 2399 | + ...options, | ||
| 2400 | 2400 | }; | |
| 2401 | 2401 | ||
| 2402 | 2402 | validateFunction(listener, 'listener'); | |
@@ -3116,7 +3116,7 @@ module.exports = fs = { | |||
| 3116 | 3116 | }, | |
| 3117 | 3117 | ||
| 3118 | 3118 | // For tests | |
| 3119 | - _toUnixTimestamp: toUnixTimestamp | ||
| 3119 | + _toUnixTimestamp: toUnixTimestamp, | ||
| 3120 | 3120 | }; | |
| 3121 | 3121 | ||
| 3122 | 3122 | ObjectDefineProperties(fs, { | |
@@ -3128,7 +3128,7 @@ ObjectDefineProperties(fs, { | |||
| 3128 | 3128 | __proto__: null, | |
| 3129 | 3129 | configurable: false, | |
| 3130 | 3130 | enumerable: true, | |
| 3131 | - value: constants | ||
| 3131 | + value: constants, | ||
| 3132 | 3132 | }, | |
| 3133 | 3133 | promises: { | |
| 3134 | 3134 | __proto__: null, | |
@@ -3137,6 +3137,6 @@ ObjectDefineProperties(fs, { | |||
| 3137 | 3137 | get() { | |
| 3138 | 3138 | promises ??= require('internal/fs/promises').exports; | |
| 3139 | 3139 | return promises; | |
| 3140 | - } | ||
| 3141 | - } | ||
| 3140 | + }, | ||
| 3141 | + }, | ||
| 3142 | 3142 | }); | |
| 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'); | |
@@ -105,7 +105,7 @@ const kLocked = Symbol('kLocked'); | |||
| 105 | 105 | const { kUsePromises } = binding; | |
| 106 | 106 | const { Interface } = require('internal/readline/interface'); | |
| 107 | 107 | const { | |
| 108 | - JSTransferable, kDeserialize, kTransfer, kTransferList | ||
| 108 | + JSTransferable, kDeserialize, kTransfer, kTransferList, | ||
| 109 | 109 | } = require('internal/worker/js_transferable'); | |
| 110 | 110 | ||
| 111 | 111 | const { | |
@@ -321,7 +321,7 @@ class FileHandle extends EventEmitterMixin(JSTransferable) { | |||
| 321 | 321 | ||
| 322 | 322 | return { | |
| 323 | 323 | data: { handle }, | |
| 324 | - deserializeInfo: 'internal/fs/promises:FileHandle' | ||
| 324 | + deserializeInfo: 'internal/fs/promises:FileHandle', | ||
| 325 | 325 | }; | |
| 326 | 326 | } | |
| 327 | 327 | ||
@@ -710,7 +710,7 @@ async function mkdir(path, options) { | |||
| 710 | 710 | } | |
| 711 | 711 | const { | |
| 712 | 712 | recursive = false, | |
| 713 | - mode = 0o777 | ||
| 713 | + mode = 0o777, | ||
| 714 | 714 | } = options || kEmptyObject; | |
| 715 | 715 | path = getValidatedPath(path); | |
| 716 | 716 | 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 | |
|---|---|---|---|
@@ -32,10 +32,10 @@ const { | |||
| 32 | 32 | ERR_INCOMPATIBLE_OPTION_PAIR, | |
| 33 | 33 | ERR_INVALID_ARG_TYPE, | |
| 34 | 34 | ERR_INVALID_ARG_VALUE, | |
| 35 | - ERR_OUT_OF_RANGE | ||
| 35 | + ERR_OUT_OF_RANGE, | ||
| 36 | 36 | }, | |
| 37 | 37 | hideStackFrames, | |
| 38 | - uvException | ||
| 38 | + uvException, | ||
| 39 | 39 | } = require('internal/errors'); | |
| 40 | 40 | const { | |
| 41 | 41 | isArrayBufferView, | |
@@ -96,13 +96,13 @@ const { | |||
| 96 | 96 | UV_DIRENT_FIFO, | |
| 97 | 97 | UV_DIRENT_SOCKET, | |
| 98 | 98 | UV_DIRENT_CHAR, | |
| 99 | - UV_DIRENT_BLOCK | ||
| 99 | + UV_DIRENT_BLOCK, | ||
| 100 | 100 | }, | |
| 101 | 101 | os: { | |
| 102 | 102 | errno: { | |
| 103 | - EISDIR | ||
| 104 | - } | ||
| 105 | - } | ||
| 103 | + EISDIR, | ||
| 104 | + }, | ||
| 105 | + }, | ||
| 106 | 106 | } = internalBinding('constants'); | |
| 107 | 107 | ||
| 108 | 108 | // The access modes can be any of F_OK, R_OK, W_OK or X_OK. Some might not be | |
@@ -754,7 +754,7 @@ const defaultRmOptions = { | |||
| 754 | 754 | recursive: false, | |
| 755 | 755 | force: false, | |
| 756 | 756 | retryDelay: 100, | |
| 757 | - maxRetries: 0 | ||
| 757 | + maxRetries: 0, | ||
| 758 | 758 | }; | |
| 759 | 759 | ||
| 760 | 760 | const defaultRmdirOptions = { | |
@@ -805,7 +805,7 @@ const validateRmOptions = hideStackFrames((path, options, expectDir, cb) => { | |||
| 805 | 805 | message: 'is a directory', | |
| 806 | 806 | path, | |
| 807 | 807 | syscall: 'rm', | |
| 808 | - errno: EISDIR | ||
| 808 | + errno: EISDIR, | ||
| 809 | 809 | })); | |
| 810 | 810 | } | |
| 811 | 811 | return cb(null, options); | |
@@ -830,7 +830,7 @@ const validateRmOptionsSync = hideStackFrames((path, options, expectDir) => { | |||
| 830 | 830 | message: 'is a directory', | |
| 831 | 831 | path, | |
| 832 | 832 | syscall: 'rm', | |
| 833 | - errno: EISDIR | ||
| 833 | + errno: EISDIR, | ||
| 834 | 834 | }); | |
| 835 | 835 | } | |
| 836 | 836 | } | |
| 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