From 066afd1e629d28965de3041e9d94d321f0e301db Mon Sep 17 00:00:00 2001 From: XmiliaH Date: Sun, 5 Feb 2023 21:33:58 +0100 Subject: [PATCH] Release 3.9.14 --- CHANGELOG.md | 4 ++++ lib/resolver-compat.js | 2 +- lib/resolver.js | 12 ++++++------ package.json | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9f703d..9f23000 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +v3.9.14 (2023-02-05) +-------------------- +[new] Support conditional export resolution with custom resolver. (nick-klaviyo) + v3.9.13 (2022-12-08) -------------------- [fix] Fix typescript errors in index.d.ts diff --git a/lib/resolver-compat.js b/lib/resolver-compat.js index a6d6ffc..0ef30ee 100644 --- a/lib/resolver-compat.js +++ b/lib/resolver-compat.js @@ -324,7 +324,7 @@ function resolverFromOptions(vm, options, override, compiler) { if (!resolved) return undefined; if (typeof resolved === 'string') { if (externals) externals.push(new RegExp('^' + escapeRegExp(resolved))); - return resolver.loadAsFileOrDirecotry(resolved, extList); + return resolver.loadAsFileOrDirectory(resolved, extList); } const {module=x, path: resolvedPath} = resolved; if (externals) externals.push(new RegExp('^' + escapeRegExp(resolvedPath))); diff --git a/lib/resolver.js b/lib/resolver.js index d492413..22f9061 100644 --- a/lib/resolver.js +++ b/lib/resolver.js @@ -242,7 +242,7 @@ class DefaultResolver extends Resolver { // 2. If X begins with '/' if (this.pathIsAbsolute(x)) { // a. set Y to be the filesystem root - f = this.loadAsFileOrDirecotry(x, extList); + f = this.loadAsFileOrDirectory(x, extList); if (f) return f; // c. THROW "not found" @@ -256,13 +256,13 @@ class DefaultResolver extends Resolver { for (let i = 0; i < paths.length; i++) { // a. LOAD_AS_FILE(Y + X) // b. LOAD_AS_DIRECTORY(Y + X) - f = this.loadAsFileOrDirecotry(this.pathConcat(paths[i], x), extList); + f = this.loadAsFileOrDirectory(this.pathConcat(paths[i], x), extList); if (f) return f; } } else if (paths === undefined) { // a. LOAD_AS_FILE(Y + X) // b. LOAD_AS_DIRECTORY(Y + X) - f = this.loadAsFileOrDirecotry(this.pathConcat(path, x), extList); + f = this.loadAsFileOrDirectory(this.pathConcat(path, x), extList); if (f) return f; } else { throw new VMError('Invalid options.paths option.'); @@ -270,7 +270,7 @@ class DefaultResolver extends Resolver { } else { // a. LOAD_AS_FILE(Y + X) // b. LOAD_AS_DIRECTORY(Y + X) - f = this.loadAsFileOrDirecotry(this.pathConcat(path, x), extList); + f = this.loadAsFileOrDirectory(this.pathConcat(path, x), extList); if (f) return f; } @@ -315,7 +315,7 @@ class DefaultResolver extends Resolver { return super.resolveFull(mod, x, options, ext, direct); } - loadAsFileOrDirecotry(x, extList) { + loadAsFileOrDirectory(x, extList) { // a. LOAD_AS_FILE(X) const f = this.loadAsFile(x, extList); if (f) return f; @@ -555,7 +555,7 @@ class DefaultResolver extends Resolver { } else { // a. LOAD_AS_FILE(RESOLVED_PATH) // b. LOAD_AS_DIRECTORY(RESOLVED_PATH) - f = this.loadAsFileOrDirecotry(resolvedPath, extList); + f = this.loadAsFileOrDirectory(resolvedPath, extList); } if (f) return f; // 5. THROW "not found" diff --git a/package.json b/package.json index c51274b..1d2a966 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "alcatraz", "contextify" ], - "version": "3.9.13", + "version": "3.9.14", "main": "index.js", "sideEffects": false, "repository": "github:patriksimek/vm2",