Comparing version 3.3.0 to 3.4.0
@@ -0,1 +1,8 @@ | ||
# [3.4.0](https://github.com/streamich/memfs/compare/v3.3.0...v3.4.0) (2021-11-24) | ||
### Features | ||
* support the `throwIfNoEntry` option ([80cf803](https://github.com/streamich/memfs/commit/80cf80380757b1cb08c5ae6af828b8aff1b8cb93)) | ||
# [3.3.0](https://github.com/streamich/memfs/compare/v3.2.4...v3.3.0) (2021-09-19) | ||
@@ -2,0 +9,0 @@ |
@@ -39,3 +39,3 @@ "use strict"; | ||
_this[kCode] = key; | ||
_this.name = _super.prototype.name + " [" + _this[kCode] + "]"; | ||
_this.name = "".concat(_super.prototype.name, " [").concat(_this[kCode], "]"); | ||
return _this; | ||
@@ -58,4 +58,4 @@ } | ||
else { | ||
_this = _super.call(this, util.inspect(options.actual).slice(0, 128) + " " + | ||
(options.operator + " " + util.inspect(options.expected).slice(0, 128))) || this; | ||
_this = _super.call(this, "".concat(util.inspect(options.actual).slice(0, 128), " ") + | ||
"".concat(options.operator, " ").concat(util.inspect(options.expected).slice(0, 128))) || this; | ||
} | ||
@@ -78,3 +78,3 @@ _this.generatedMessage = !options.message; | ||
var msg = messages[key]; | ||
assert(msg, "An invalid error message key was used: " + key + "."); | ||
assert(msg, "An invalid error message key was used: ".concat(key, ".")); | ||
var fmt; | ||
@@ -121,6 +121,6 @@ if (typeof msg === 'function') { | ||
E('ERR_CPU_USAGE', 'Unable to obtain cpu usage %s'); | ||
E('ERR_DNS_SET_SERVERS_FAILED', function (err, servers) { return "c-ares failed to set servers: \"" + err + "\" [" + servers + "]"; }); | ||
E('ERR_DNS_SET_SERVERS_FAILED', function (err, servers) { return "c-ares failed to set servers: \"".concat(err, "\" [").concat(servers, "]"); }); | ||
E('ERR_FALSY_VALUE_REJECTION', 'Promise was rejected with falsy value'); | ||
E('ERR_ENCODING_NOT_SUPPORTED', function (enc) { return "The \"" + enc + "\" encoding is not supported"; }); | ||
E('ERR_ENCODING_INVALID_ENCODED_DATA', function (enc) { return "The encoded data was not valid for encoding " + enc; }); | ||
E('ERR_ENCODING_NOT_SUPPORTED', function (enc) { return "The \"".concat(enc, "\" encoding is not supported"); }); | ||
E('ERR_ENCODING_INVALID_ENCODED_DATA', function (enc) { return "The encoded data was not valid for encoding ".concat(enc); }); | ||
E('ERR_HTTP_HEADERS_SENT', 'Cannot render headers after they are sent to the client'); | ||
@@ -133,3 +133,3 @@ E('ERR_HTTP_INVALID_STATUS_CODE', 'Invalid status code: %s'); | ||
assert.strictEqual(typeof actual, 'number'); | ||
return "The array \"" + name + "\" (length " + actual + ") must be of length " + len + "."; | ||
return "The array \"".concat(name, "\" (length ").concat(actual, ") must be of length ").concat(len, "."); | ||
}); | ||
@@ -146,5 +146,5 @@ E('ERR_INVALID_BUFFER_SIZE', 'Buffer size must be a multiple of %s'); | ||
E('ERR_INVALID_OPT_VALUE', function (name, value) { | ||
return "The value \"" + String(value) + "\" is invalid for option \"" + name + "\""; | ||
return "The value \"".concat(String(value), "\" is invalid for option \"").concat(name, "\""); | ||
}); | ||
E('ERR_INVALID_OPT_VALUE_ENCODING', function (value) { return "The value \"" + String(value) + "\" is invalid for option \"encoding\""; }); | ||
E('ERR_INVALID_OPT_VALUE_ENCODING', function (value) { return "The value \"".concat(String(value), "\" is invalid for option \"encoding\""); }); | ||
E('ERR_INVALID_REPL_EVAL_CONFIG', 'Cannot specify both "breakEvalOnSigint" and "eval" for REPL'); | ||
@@ -155,3 +155,3 @@ E('ERR_INVALID_SYNC_FORK_INPUT', 'Asynchronous forks do not support Buffer, Uint8Array or string input: %s'); | ||
E('ERR_INVALID_URL', 'Invalid URL: %s'); | ||
E('ERR_INVALID_URL_SCHEME', function (expected) { return "The URL must be " + oneOf(expected, 'scheme'); }); | ||
E('ERR_INVALID_URL_SCHEME', function (expected) { return "The URL must be ".concat(oneOf(expected, 'scheme')); }); | ||
E('ERR_IPC_CHANNEL_CLOSED', 'Channel closed'); | ||
@@ -178,3 +178,3 @@ E('ERR_IPC_DISCONNECTED', 'IPC channel is already disconnected'); | ||
E('ERR_TLS_CERT_ALTNAME_INVALID', "Hostname/IP does not match certificate's altnames: %s"); | ||
E('ERR_TLS_DH_PARAM_SIZE', function (size) { return "DH parameter size " + size + " is less than 2048"; }); | ||
E('ERR_TLS_DH_PARAM_SIZE', function (size) { return "DH parameter size ".concat(size, " is less than 2048"); }); | ||
E('ERR_TLS_HANDSHAKE_TIMEOUT', 'TLS handshake timeout'); | ||
@@ -204,16 +204,16 @@ E('ERR_TLS_RENEGOTIATION_FAILED', 'Failed to renegotiate'); | ||
if (Array.isArray(name)) { | ||
var names = name.map(function (val) { return "\"" + val + "\""; }).join(', '); | ||
msg = "The " + names + " arguments " + determiner + " " + oneOf(expected, 'type'); | ||
var names = name.map(function (val) { return "\"".concat(val, "\""); }).join(', '); | ||
msg = "The ".concat(names, " arguments ").concat(determiner, " ").concat(oneOf(expected, 'type')); | ||
} | ||
else if (name.includes(' argument')) { | ||
// for the case like 'first argument' | ||
msg = "The " + name + " " + determiner + " " + oneOf(expected, 'type'); | ||
msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); | ||
} | ||
else { | ||
var type = name.includes('.') ? 'property' : 'argument'; | ||
msg = "The \"" + name + "\" " + type + " " + determiner + " " + oneOf(expected, 'type'); | ||
msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); | ||
} | ||
// if actual value received, output it | ||
if (arguments.length >= 3) { | ||
msg += ". Received type " + (actual !== null ? typeof actual : 'null'); | ||
msg += ". Received type ".concat(actual !== null ? typeof actual : 'null'); | ||
} | ||
@@ -230,16 +230,16 @@ return msg; | ||
var len = args.length; | ||
args = args.map(function (a) { return "\"" + a + "\""; }); | ||
args = args.map(function (a) { return "\"".concat(a, "\""); }); | ||
switch (len) { | ||
case 1: | ||
msg += args[0] + " argument"; | ||
msg += "".concat(args[0], " argument"); | ||
break; | ||
case 2: | ||
msg += args[0] + " and " + args[1] + " arguments"; | ||
msg += "".concat(args[0], " and ").concat(args[1], " arguments"); | ||
break; | ||
default: | ||
msg += args.slice(0, len - 1).join(', '); | ||
msg += ", and " + args[len - 1] + " arguments"; | ||
msg += ", and ".concat(args[len - 1], " arguments"); | ||
break; | ||
} | ||
return msg + " must be specified"; | ||
return "".concat(msg, " must be specified"); | ||
} | ||
@@ -255,13 +255,13 @@ function oneOf(expected, thing) { | ||
if (len > 2) { | ||
return "one of " + thing + " " + expected.slice(0, len - 1).join(', ') + ", or " + expected[len - 1]; | ||
return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1]; | ||
} | ||
else if (len === 2) { | ||
return "one of " + thing + " " + expected[0] + " or " + expected[1]; | ||
return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); | ||
} | ||
else { | ||
return "of " + thing + " " + expected[0]; | ||
return "of ".concat(thing, " ").concat(expected[0]); | ||
} | ||
} | ||
else { | ||
return "of " + thing + " " + String(expected); | ||
return "of ".concat(thing, " ").concat(String(expected)); | ||
} | ||
@@ -274,4 +274,4 @@ } | ||
else { | ||
return "\"" + name + "\" is outside of buffer bounds"; | ||
return "\"".concat(name, "\" is outside of buffer bounds"); | ||
} | ||
} |
@@ -39,3 +39,3 @@ "use strict"; | ||
// tslint:disable-next-line:no-console | ||
console.warn("" + type + (type ? ': ' : '') + message); | ||
console.warn("".concat(type).concat(type ? ': ' : '').concat(message)); | ||
}; | ||
@@ -42,0 +42,0 @@ if (!p.env) |
/// <reference types="node" /> | ||
import { Volume, TData, TMode, TFlags, TFlagsCopy, TTime, IOptions, IAppendFileOptions, IMkdirOptions, IReaddirOptions, IReadFileOptions, IRealpathOptions, IWriteFileOptions, IStatOptions, IRmOptions } from './volume'; | ||
import { Volume, TData, TMode, TFlags, TFlagsCopy, TTime, IOptions, IAppendFileOptions, IMkdirOptions, IReaddirOptions, IReadFileOptions, IRealpathOptions, IWriteFileOptions, IStatOptions, IRmOptions, IFStatOptions } from './volume'; | ||
import Stats from './Stats'; | ||
@@ -70,3 +70,3 @@ import Dirent from './Dirent'; | ||
readFile(options?: IReadFileOptions | string): Promise<TDataOut>; | ||
stat(options?: IStatOptions): Promise<Stats>; | ||
stat(options?: IFStatOptions): Promise<Stats>; | ||
sync(): Promise<void>; | ||
@@ -73,0 +73,0 @@ truncate(len?: number): Promise<void>; |
@@ -43,3 +43,3 @@ "use strict"; | ||
var store = new ObjectStore(LS); | ||
var key = function (type, id) { return "memfs." + namespace + "." + type + "." + id; }; | ||
var key = function (type, id) { return "memfs.".concat(namespace, ".").concat(type, ".").concat(id); }; | ||
var NodeLocalStorage = /** @class */ (function (_super) { | ||
@@ -46,0 +46,0 @@ __extends(NodeLocalStorage, _super); |
@@ -102,3 +102,7 @@ /// <reference types="node" /> | ||
bigint?: boolean; | ||
throwIfNoEntry?: boolean; | ||
} | ||
export interface IFStatOptions { | ||
bigint?: boolean; | ||
} | ||
export declare function pathToFilename(path: PathLike): string; | ||
@@ -237,19 +241,51 @@ export declare function filenameToSteps(filename: string, base?: string): string[]; | ||
lstatSync(path: PathLike, options: { | ||
throwIfNoEntry?: true | undefined; | ||
}): Stats<number>; | ||
lstatSync(path: PathLike, options: { | ||
bigint: false; | ||
throwIfNoEntry?: true | undefined; | ||
}): Stats<number>; | ||
lstatSync(path: PathLike, options: { | ||
bigint: true; | ||
throwIfNoEntry?: true | undefined; | ||
}): Stats<bigint>; | ||
lstat(path: PathLike, callback: TCallback<Stats>): any; | ||
lstat(path: PathLike, options: IStatOptions, callback: TCallback<Stats>): any; | ||
lstatSync(path: PathLike, options: { | ||
throwIfNoEntry: false; | ||
}): Stats<number> | undefined; | ||
lstatSync(path: PathLike, options: { | ||
bigint: false; | ||
throwIfNoEntry: false; | ||
}): Stats<number> | undefined; | ||
lstatSync(path: PathLike, options: { | ||
bigint: true; | ||
throwIfNoEntry: false; | ||
}): Stats<bigint> | undefined; | ||
lstat(path: PathLike, callback: TCallback<Stats>): void; | ||
lstat(path: PathLike, options: IStatOptions, callback: TCallback<Stats>): void; | ||
private statBase; | ||
statSync(path: PathLike): Stats<number>; | ||
statSync(path: PathLike, options: { | ||
throwIfNoEntry?: true; | ||
}): Stats<number>; | ||
statSync(path: PathLike, options: { | ||
throwIfNoEntry: false; | ||
}): Stats<number> | undefined; | ||
statSync(path: PathLike, options: { | ||
bigint: false; | ||
throwIfNoEntry?: true; | ||
}): Stats<number>; | ||
statSync(path: PathLike, options: { | ||
bigint: true; | ||
throwIfNoEntry?: true; | ||
}): Stats<bigint>; | ||
stat(path: PathLike, callback: TCallback<Stats>): any; | ||
stat(path: PathLike, options: IStatOptions, callback: TCallback<Stats>): any; | ||
statSync(path: PathLike, options: { | ||
bigint: false; | ||
throwIfNoEntry: false; | ||
}): Stats<number> | undefined; | ||
statSync(path: PathLike, options: { | ||
bigint: true; | ||
throwIfNoEntry: false; | ||
}): Stats<bigint> | undefined; | ||
stat(path: PathLike, callback: TCallback<Stats>): void; | ||
stat(path: PathLike, options: IStatOptions, callback: TCallback<Stats>): void; | ||
private fstatBase; | ||
@@ -263,4 +299,4 @@ fstatSync(fd: number): Stats<number>; | ||
}): Stats<bigint>; | ||
fstat(fd: number, callback: TCallback<Stats>): any; | ||
fstat(fd: number, options: IStatOptions, callback: TCallback<Stats>): any; | ||
fstat(fd: number, callback: TCallback<Stats>): void; | ||
fstat(fd: number, options: IFStatOptions, callback: TCallback<Stats>): void; | ||
private renameBase; | ||
@@ -267,0 +303,0 @@ renameSync(oldPath: PathLike, newPath: PathLike): void; |
{ | ||
"name": "memfs", | ||
"version": "3.3.0", | ||
"version": "3.4.0", | ||
"description": "In-memory file-system with Node's fs API.", | ||
@@ -29,19 +29,19 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@types/jest": "27.0.1", | ||
"@types/jest": "27.0.3", | ||
"@types/node": "10.17.60", | ||
"cpy-cli": "3.1.1", | ||
"husky": "7.0.2", | ||
"jest": "27.2.0", | ||
"husky": "7.0.4", | ||
"jest": "27.3.1", | ||
"prettier": "2.4.1", | ||
"pretty-quick": "3.1.1", | ||
"pretty-quick": "3.1.2", | ||
"rimraf": "3.0.2", | ||
"ts-jest": "27.0.5", | ||
"ts-node": "10.2.1", | ||
"ts-jest": "27.0.7", | ||
"ts-node": "10.4.0", | ||
"tslint": "5.20.1", | ||
"tslint-config-common": "1.6.0", | ||
"typescript": "4.4.3", | ||
"semantic-release": "18.0.0", | ||
"@semantic-release/changelog": "5.0.1", | ||
"@semantic-release/git": "9.0.1", | ||
"@semantic-release/npm": "8.0.0" | ||
"typescript": "4.5.2", | ||
"semantic-release": "18.0.1", | ||
"@semantic-release/changelog": "6.0.1", | ||
"@semantic-release/git": "10.0.1", | ||
"@semantic-release/npm": "8.0.3" | ||
}, | ||
@@ -48,0 +48,0 @@ "config": { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
195384
4389