mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
lib: add trailing commas to all public core modules
PR-URL: https://github.com/nodejs/node/pull/46848 Reviewed-By: Debadree Chatterjee <debadree333@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
This commit is contained in:
parent
1101713cc2
commit
9dbb1623ff
30 changed files with 212 additions and 243 deletions
|
@ -69,7 +69,7 @@ const {
|
|||
swap32: _swap32,
|
||||
swap64: _swap64,
|
||||
kMaxLength,
|
||||
kStringMaxLength
|
||||
kStringMaxLength,
|
||||
} = internalBinding('buffer');
|
||||
const {
|
||||
constants: {
|
||||
|
@ -93,7 +93,7 @@ const {
|
|||
isTypedArray,
|
||||
} = require('internal/util/types');
|
||||
const {
|
||||
inspect: utilInspect
|
||||
inspect: utilInspect,
|
||||
} = require('internal/util/inspect');
|
||||
const { encodings } = internalBinding('string_decoder');
|
||||
|
||||
|
@ -105,7 +105,7 @@ const {
|
|||
ERR_INVALID_BUFFER_SIZE,
|
||||
ERR_OUT_OF_RANGE,
|
||||
ERR_MISSING_ARGS,
|
||||
ERR_UNKNOWN_ENCODING
|
||||
ERR_UNKNOWN_ENCODING,
|
||||
},
|
||||
genericNodeError,
|
||||
hideStackFrames,
|
||||
|
@ -125,7 +125,7 @@ const {
|
|||
FastBuffer,
|
||||
markAsUntransferable,
|
||||
addBufferPrototypeMethods,
|
||||
createUnsafeBuffer
|
||||
createUnsafeBuffer,
|
||||
} = require('internal/buffer');
|
||||
|
||||
FastBuffer.prototype.constructor = Buffer;
|
||||
|
@ -137,14 +137,14 @@ const constants = ObjectDefineProperties({}, {
|
|||
__proto__: null,
|
||||
value: kMaxLength,
|
||||
writable: false,
|
||||
enumerable: true
|
||||
enumerable: true,
|
||||
},
|
||||
MAX_STRING_LENGTH: {
|
||||
__proto__: null,
|
||||
value: kStringMaxLength,
|
||||
writable: false,
|
||||
enumerable: true
|
||||
}
|
||||
enumerable: true,
|
||||
},
|
||||
});
|
||||
|
||||
Buffer.poolSize = 8 * 1024;
|
||||
|
@ -289,7 +289,7 @@ ObjectDefineProperty(Buffer, SymbolSpecies, {
|
|||
__proto__: null,
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
get() { return FastBuffer; }
|
||||
get() { return FastBuffer; },
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -639,7 +639,7 @@ const encodingOps = {
|
|||
write: (buf, string, offset, len) => buf.utf8Write(string, offset, len),
|
||||
slice: (buf, start, end) => buf.utf8Slice(start, end),
|
||||
indexOf: (buf, val, byteOffset, dir) =>
|
||||
indexOfString(buf, val, byteOffset, encodingsMap.utf8, dir)
|
||||
indexOfString(buf, val, byteOffset, encodingsMap.utf8, dir),
|
||||
},
|
||||
ucs2: {
|
||||
encoding: 'ucs2',
|
||||
|
@ -648,7 +648,7 @@ const encodingOps = {
|
|||
write: (buf, string, offset, len) => buf.ucs2Write(string, offset, len),
|
||||
slice: (buf, start, end) => buf.ucs2Slice(start, end),
|
||||
indexOf: (buf, val, byteOffset, dir) =>
|
||||
indexOfString(buf, val, byteOffset, encodingsMap.utf16le, dir)
|
||||
indexOfString(buf, val, byteOffset, encodingsMap.utf16le, dir),
|
||||
},
|
||||
utf16le: {
|
||||
encoding: 'utf16le',
|
||||
|
@ -657,7 +657,7 @@ const encodingOps = {
|
|||
write: (buf, string, offset, len) => buf.ucs2Write(string, offset, len),
|
||||
slice: (buf, start, end) => buf.ucs2Slice(start, end),
|
||||
indexOf: (buf, val, byteOffset, dir) =>
|
||||
indexOfString(buf, val, byteOffset, encodingsMap.utf16le, dir)
|
||||
indexOfString(buf, val, byteOffset, encodingsMap.utf16le, dir),
|
||||
},
|
||||
latin1: {
|
||||
encoding: 'latin1',
|
||||
|
@ -666,7 +666,7 @@ const encodingOps = {
|
|||
write: (buf, string, offset, len) => buf.latin1Write(string, offset, len),
|
||||
slice: (buf, start, end) => buf.latin1Slice(start, end),
|
||||
indexOf: (buf, val, byteOffset, dir) =>
|
||||
indexOfString(buf, val, byteOffset, encodingsMap.latin1, dir)
|
||||
indexOfString(buf, val, byteOffset, encodingsMap.latin1, dir),
|
||||
},
|
||||
ascii: {
|
||||
encoding: 'ascii',
|
||||
|
@ -679,7 +679,7 @@ const encodingOps = {
|
|||
fromStringFast(val, encodingOps.ascii),
|
||||
byteOffset,
|
||||
encodingsMap.ascii,
|
||||
dir)
|
||||
dir),
|
||||
},
|
||||
base64: {
|
||||
encoding: 'base64',
|
||||
|
@ -692,7 +692,7 @@ const encodingOps = {
|
|||
fromStringFast(val, encodingOps.base64),
|
||||
byteOffset,
|
||||
encodingsMap.base64,
|
||||
dir)
|
||||
dir),
|
||||
},
|
||||
base64url: {
|
||||
encoding: 'base64url',
|
||||
|
@ -706,7 +706,7 @@ const encodingOps = {
|
|||
fromStringFast(val, encodingOps.base64url),
|
||||
byteOffset,
|
||||
encodingsMap.base64url,
|
||||
dir)
|
||||
dir),
|
||||
},
|
||||
hex: {
|
||||
encoding: 'hex',
|
||||
|
@ -719,8 +719,8 @@ const encodingOps = {
|
|||
fromStringFast(val, encodingOps.hex),
|
||||
byteOffset,
|
||||
encodingsMap.hex,
|
||||
dir)
|
||||
}
|
||||
dir),
|
||||
},
|
||||
};
|
||||
function getEncodingOps(encoding) {
|
||||
encoding += '';
|
||||
|
@ -806,7 +806,7 @@ ObjectDefineProperty(Buffer.prototype, 'parent', {
|
|||
if (!(this instanceof Buffer))
|
||||
return undefined;
|
||||
return this.buffer;
|
||||
}
|
||||
},
|
||||
});
|
||||
ObjectDefineProperty(Buffer.prototype, 'offset', {
|
||||
__proto__: null,
|
||||
|
@ -815,7 +815,7 @@ ObjectDefineProperty(Buffer.prototype, 'offset', {
|
|||
if (!(this instanceof Buffer))
|
||||
return undefined;
|
||||
return this.byteOffset;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Buffer.prototype.copy =
|
||||
|
@ -902,7 +902,7 @@ Buffer.prototype[customInspectSymbol] = function inspect(recurseTimes, ctx) {
|
|||
str += StringPrototypeSlice(utilInspect(obj, {
|
||||
...ctx,
|
||||
breakLength: Infinity,
|
||||
compact: true
|
||||
compact: true,
|
||||
}), 27, -2);
|
||||
}
|
||||
}
|
||||
|
@ -1235,7 +1235,7 @@ let transcode;
|
|||
if (internalBinding('config').hasIntl) {
|
||||
const {
|
||||
icuErrName,
|
||||
transcode: _transcode
|
||||
transcode: _transcode,
|
||||
} = internalBinding('icu');
|
||||
|
||||
// Transcodes the Buffer from one encoding to another, returning a new
|
||||
|
@ -1394,15 +1394,15 @@ ObjectDefineProperties(module.exports, {
|
|||
__proto__: null,
|
||||
configurable: false,
|
||||
enumerable: true,
|
||||
value: constants
|
||||
value: constants,
|
||||
},
|
||||
INSPECT_MAX_BYTES: {
|
||||
__proto__: null,
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get() { return INSPECT_MAX_BYTES; },
|
||||
set(val) { INSPECT_MAX_BYTES = val; }
|
||||
}
|
||||
set(val) { INSPECT_MAX_BYTES = val; },
|
||||
},
|
||||
});
|
||||
|
||||
defineLazyProperties(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue