Socket
Socket
Sign inDemoInstall

webpack

Package Overview
Dependencies
78
Maintainers
2
Versions
834
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.69.1 to 5.70.0

lib/dependencies/ImportMetaContextDependency.js

150

lib/asset/AssetGenerator.js

@@ -116,2 +116,3 @@ /*

const JS_AND_ASSET_TYPES = new Set(["javascript", "asset"]);
const DEFAULT_ENCODING = "base64";

@@ -136,2 +137,61 @@ class AssetGenerator extends Generator {

/**
* @param {NormalModule} module module
* @param {RuntimeTemplate} runtimeTemplate runtime template
* @returns {string} source file name
*/
getSourceFileName(module, runtimeTemplate) {
return makePathsRelative(
runtimeTemplate.compilation.compiler.context,
module.matchResource || module.resource,
runtimeTemplate.compilation.compiler.root
).replace(/^\.\//, "");
}
/**
* @param {NormalModule} module module
* @returns {string} mime type
*/
getMimeType(module) {
if (typeof this.dataUrlOptions === "function") {
throw new Error(
"This method must not be called when dataUrlOptions is a function"
);
}
let mimeType = this.dataUrlOptions.mimetype;
if (mimeType === undefined) {
const ext = path.extname(module.nameForCondition());
if (
module.resourceResolveData &&
module.resourceResolveData.mimetype !== undefined
) {
mimeType =
module.resourceResolveData.mimetype +
module.resourceResolveData.parameters;
} else if (ext) {
mimeType = mimeTypes.lookup(ext);
if (typeof mimeType !== "string") {
throw new Error(
"DataUrl can't be generated automatically, " +
`because there is no mimetype for "${ext}" in mimetype database. ` +
'Either pass a mimetype via "generator.mimetype" or ' +
'use type: "asset/resource" to create a resource file instead of a DataUrl'
);
}
}
}
if (typeof mimeType !== "string") {
throw new Error(
"DataUrl can't be generated automatically. " +
'Either pass a mimetype via "generator.mimetype" or ' +
'use type: "asset/resource" to create a resource file instead of a DataUrl'
);
}
return mimeType;
}
/**
* @param {NormalModule} module module for which the code should be generated

@@ -175,27 +235,5 @@ * @param {GenerateContext} generateContext context for generate

if (encoding === undefined) {
encoding = "base64";
encoding = DEFAULT_ENCODING;
}
let ext;
let mimeType = this.dataUrlOptions.mimetype;
if (mimeType === undefined) {
ext = path.extname(module.nameForCondition());
if (
module.resourceResolveData &&
module.resourceResolveData.mimetype !== undefined
) {
mimeType =
module.resourceResolveData.mimetype +
module.resourceResolveData.parameters;
} else if (ext) {
mimeType = mimeTypes.lookup(ext);
}
}
if (typeof mimeType !== "string") {
throw new Error(
"DataUrl can't be generated automatically, " +
`because there is no mimetype for "${ext}" in mimetype database. ` +
'Either pass a mimetype via "generator.mimetype" or ' +
'use type: "asset/resource" to create a resource file instead of a DataUrl'
);
}
const mimeType = this.getMimeType(module);

@@ -244,7 +282,6 @@ let encodedContent;

module.buildInfo.fullContentHash = fullHash;
const sourceFilename = makePathsRelative(
runtimeTemplate.compilation.compiler.context,
module.matchResource || module.resource,
runtimeTemplate.compilation.compiler.root
).replace(/^\.\//, "");
const sourceFilename = this.getSourceFileName(
module,
runtimeTemplate
);
let { path: filename, info: assetInfo } =

@@ -375,4 +412,55 @@ runtimeTemplate.compilation.getAssetPathWithInfo(

*/
updateHash(hash, { module }) {
hash.update(module.buildInfo.dataUrl ? "data-url" : "resource");
updateHash(hash, { module, runtime, runtimeTemplate, chunkGraph }) {
if (module.buildInfo.dataUrl) {
hash.update("data-url");
// this.dataUrlOptions as function should be pure and only depend on input source and filename
// therefore it doesn't need to be hashed
if (typeof this.dataUrlOptions === "function") {
const ident = /** @type {{ ident?: string }} */ (this.dataUrlOptions)
.ident;
if (ident) hash.update(ident);
} else {
if (
this.dataUrlOptions.encoding &&
this.dataUrlOptions.encoding !== DEFAULT_ENCODING
) {
hash.update(this.dataUrlOptions.encoding);
}
if (this.dataUrlOptions.mimetype)
hash.update(this.dataUrlOptions.mimetype);
// computed mimetype depends only on module filename which is already part of the hash
}
} else {
hash.update("resource");
const pathData = {
module,
runtime,
filename: this.getSourceFileName(module, runtimeTemplate),
chunkGraph,
contentHash: runtimeTemplate.contentHashReplacement
};
if (typeof this.publicPath === "function") {
hash.update("path");
const assetInfo = {};
hash.update(this.publicPath(pathData, assetInfo));
hash.update(JSON.stringify(assetInfo));
} else if (this.publicPath) {
hash.update("path");
hash.update(this.publicPath);
} else {
hash.update("no-path");
}
const assetModuleFilename =
this.filename || runtimeTemplate.outputOptions.assetModuleFilename;
const { path: filename, info } =
runtimeTemplate.compilation.getAssetPathWithInfo(
assetModuleFilename,
pathData
);
hash.update(filename);
hash.update(JSON.stringify(info));
}
}

@@ -379,0 +467,0 @@ }

@@ -80,2 +80,3 @@ /*

);
const cache = new WeakMap();

@@ -106,6 +107,11 @@ compiler.hooks.compilation.tap("BannerPlugin", compilation => {

compilation.updateAsset(
file,
old => new ConcatSource(comment, "\n", old)
);
compilation.updateAsset(file, old => {
let cached = cache.get(old);
if (!cached || cached.comment !== comment) {
const source = new ConcatSource(comment, "\n", old);
cache.set(old, { source, comment });
return source;
}
return cached.source;
});
}

@@ -112,0 +118,0 @@ }

@@ -131,2 +131,9 @@ /*

};
let yieldResult;
let withYield = false;
if (typeof newResolveContext.yield === "function") {
yieldResult = [];
withYield = true;
newResolveContext.yield = obj => yieldResult.push(obj);
}
const propagate = key => {

@@ -159,11 +166,18 @@ if (resolveContext[key]) {

if (err) return callback(err);
const resolveResult = withYield ? yieldResult : result;
// since we intercept resolve hook
// we still can get result in callback
if (withYield && result) yieldResult.push(result);
if (!snapshot) {
if (result) return callback(null, result);
if (resolveResult) return callback(null, resolveResult);
return callback();
}
itemCache.store(new CacheEntry(result, snapshot), storeErr => {
if (storeErr) return callback(storeErr);
if (result) return callback(null, result);
callback();
});
itemCache.store(
new CacheEntry(resolveResult, snapshot),
storeErr => {
if (storeErr) return callback(storeErr);
if (resolveResult) return callback(null, resolveResult);
callback();
}
);
}

@@ -178,2 +192,4 @@ );

const activeRequests = new Map();
/** @type {Map<string, [function(Error=, Object=): void, function(Error=, Object=): void][]>} */
const activeRequestsWithYield = new Map();
hook.tap(

@@ -203,25 +219,63 @@ "ResolverCachePlugin",

}
const identifier = `${type}${optionsIdent}${objectToString(
request,
!cacheWithContext
)}`;
const activeRequest = activeRequests.get(identifier);
if (activeRequest) {
activeRequest.push(callback);
return;
const withYield = typeof resolveContext.yield === "function";
const identifier = `${type}${
withYield ? "|yield" : "|default"
}${optionsIdent}${objectToString(request, !cacheWithContext)}`;
if (withYield) {
const activeRequest = activeRequestsWithYield.get(identifier);
if (activeRequest) {
activeRequest[0].push(callback);
activeRequest[1].push(resolveContext.yield);
return;
}
} else {
const activeRequest = activeRequests.get(identifier);
if (activeRequest) {
activeRequest.push(callback);
return;
}
}
const itemCache = cache.getItemCache(identifier, null);
let callbacks;
const done = (err, result) => {
if (callbacks === undefined) {
callback(err, result);
callbacks = false;
} else {
for (const callback of callbacks) {
callback(err, result);
}
activeRequests.delete(identifier);
callbacks = false;
}
};
let callbacks, yields;
const done = withYield
? (err, result) => {
if (callbacks === undefined) {
if (err) {
callback(err);
} else {
if (result)
for (const r of result) resolveContext.yield(r);
callback(null, null);
}
yields = undefined;
callbacks = false;
} else {
if (err) {
for (const cb of callbacks) cb(err);
} else {
for (let i = 0; i < callbacks.length; i++) {
const cb = callbacks[i];
const yield_ = yields[i];
if (result) for (const r of result) yield_(r);
cb(null, null);
}
}
activeRequestsWithYield.delete(identifier);
yields = undefined;
callbacks = false;
}
}
: (err, result) => {
if (callbacks === undefined) {
callback(err, result);
callbacks = false;
} else {
for (const callback of callbacks) {
callback(err, result);
}
activeRequests.delete(identifier);
callbacks = false;
}
};
/**

@@ -283,4 +337,11 @@ * @param {Error=} err error if any

itemCache.get(processCacheResult);
if (callbacks === undefined) {
if (withYield && callbacks === undefined) {
callbacks = [callback];
yields = [resolveContext.yield];
activeRequestsWithYield.set(
identifier,
/** @type {[any, any]} */ ([callbacks, yields])
);
} else if (callbacks === undefined) {
callbacks = [callback];
activeRequests.set(identifier, callbacks);

@@ -287,0 +348,0 @@ }

@@ -22,2 +22,3 @@ /*

/** @typedef {(function(string):boolean)|RegExp} IgnoreItem */
/** @typedef {Map<string, number>} Assets */
/** @typedef {function(IgnoreItem): void} AddToIgnoreCallback */

@@ -44,7 +45,21 @@

);
const _10sec = 10 * 1000;
/**
* marge assets map 2 into map 1
* @param {Assets} as1 assets
* @param {Assets} as2 assets
* @returns {void}
*/
const mergeAssets = (as1, as2) => {
for (const [key, value1] of as2) {
const value2 = as1.get(key);
if (!value2 || value1 > value2) as1.set(key, value1);
}
};
/**
* @param {OutputFileSystem} fs filesystem
* @param {string} outputPath output path
* @param {Set<string>} currentAssets filename of the current assets (must not start with .. or ., must only use / as path separator)
* @param {Map<string, number>} currentAssets filename of the current assets (must not start with .. or ., must only use / as path separator)
* @param {function((Error | null)=, Set<string>=): void} callback returns the filenames of the assets that shouldn't be there

@@ -56,3 +71,3 @@ * @returns {void}

// get directories of assets
for (const asset of currentAssets) {
for (const [asset] of currentAssets) {
directories.add(asset.replace(/(^|\/)[^/]*$/, ""));

@@ -97,4 +112,4 @@ }

/**
* @param {Set<string>} currentAssets assets list
* @param {Set<string>} oldAssets old assets list
* @param {Assets} currentAssets assets list
* @param {Assets} oldAssets old assets list
* @returns {Set<string>} diff

@@ -104,3 +119,5 @@ */

const diff = new Set();
for (const asset of oldAssets) {
const now = Date.now();
for (const [asset, ts] of oldAssets) {
if (ts >= now) continue;
if (!currentAssets.has(asset)) diff.add(asset);

@@ -132,3 +149,3 @@ }

* @param {function(string): boolean} isKept check if the entry is ignored
* @param {function(Error=): void} callback callback
* @param {function(Error=, Assets=): void} callback callback
* @returns {void}

@@ -146,3 +163,3 @@ */

/** @type {Job[]} */
const jobs = Array.from(diff, filename => ({
const jobs = Array.from(diff.keys(), filename => ({
type: "check",

@@ -152,2 +169,4 @@ filename,

}));
/** @type {Assets} */
const keptAssets = new Map();
processAsyncTree(

@@ -172,2 +191,3 @@ jobs,

if (isKept(filename)) {
keptAssets.set(filename, 0);
// do not decrement parent entry as we don't want to delete the parent

@@ -259,3 +279,6 @@ log(`${filename} will be kept`);

},
callback
err => {
if (err) return callback(err);
callback(undefined, keptAssets);
}
);

@@ -315,2 +338,3 @@ };

// incremental builds
/** @type {undefined|Assets} */
let oldAssets;

@@ -336,3 +360,5 @@

const currentAssets = new Set();
/** @type {Assets} */
const currentAssets = new Map();
const now = Date.now();
for (const asset of Object.keys(compilation.assets)) {

@@ -350,3 +376,8 @@ if (/^[A-Za-z]:\\|^\/|^\\\\/.test(asset)) continue;

if (normalizedAsset.startsWith("../")) continue;
currentAssets.add(normalizedAsset);
const assetInfo = compilation.assetsInfo.get(asset);
if (assetInfo && assetInfo.hotModuleReplacement) {
currentAssets.set(normalizedAsset, now + _10sec);
} else {
currentAssets.set(normalizedAsset, 0);
}
}

@@ -362,15 +393,30 @@

/**
* @param {Error=} err err
* @param {Set<string>=} diff diff
*/
const diffCallback = (err, diff) => {
if (err) {
oldAssets = undefined;
return callback(err);
callback(err);
return;
}
applyDiff(fs, outputPath, dry, logger, diff, isKept, err => {
if (err) {
oldAssets = undefined;
} else {
oldAssets = currentAssets;
applyDiff(
fs,
outputPath,
dry,
logger,
diff,
isKept,
(err, keptAssets) => {
if (err) {
oldAssets = undefined;
} else {
if (oldAssets) mergeAssets(currentAssets, oldAssets);
oldAssets = currentAssets;
if (keptAssets) mergeAssets(oldAssets, keptAssets);
}
callback(err);
}
callback(err);
});
);
};

@@ -377,0 +423,0 @@

@@ -124,4 +124,3 @@ /*

// kaios: Not supported
// Since Node.js 13.14.0 no warning about usage, but it was added 8.5.0 with some limitations and it was improved in 12.0.0 and 13.2.0
node: [13, 14]
node: [12, 17]
});

@@ -252,4 +251,3 @@

// kaios: Not supported
// Since Node.js 13.14.0 no warning about usage, but it was added 8.5.0 with some limitations and it was improved in 12.0.0 and 13.2.0
node: [13, 14]
node: [12, 17]
}),

@@ -277,3 +275,3 @@ dynamicImport: es6DynamicImport,

// kaios: Unknown support
node: [12, 0]
node: 12
}),

@@ -280,0 +278,0 @@ optionalChaining: rawChecker({

@@ -491,2 +491,3 @@ /*

runtime: value.runtime,
baseUri: value.baseUri,
publicPath: value.publicPath,

@@ -493,0 +494,0 @@ chunkLoading: value.chunkLoading,

@@ -64,3 +64,3 @@ /*

* @typedef {Object} ContextModuleOptionsExtras
* @property {string} resource
* @property {false|string|string[]} resource
* @property {string=} resourceQuery

@@ -96,19 +96,32 @@ * @property {string=} resourceFragment

constructor(resolveDependencies, options) {
const parsed = parseResource(options ? options.resource : "");
const resource = parsed.path;
const resourceQuery = (options && options.resourceQuery) || parsed.query;
const resourceFragment =
(options && options.resourceFragment) || parsed.fragment;
if (!options || typeof options.resource === "string") {
const parsed = parseResource(
options ? /** @type {string} */ (options.resource) : ""
);
const resource = parsed.path;
const resourceQuery = (options && options.resourceQuery) || parsed.query;
const resourceFragment =
(options && options.resourceFragment) || parsed.fragment;
super("javascript/dynamic", resource);
super("javascript/dynamic", resource);
/** @type {ContextModuleOptions} */
this.options = {
...options,
resource,
resourceQuery,
resourceFragment
};
} else {
super("javascript/dynamic");
/** @type {ContextModuleOptions} */
this.options = {
...options,
resource: options.resource,
resourceQuery: options.resourceQuery || "",
resourceFragment: options.resourceFragment || ""
};
}
// Info from Factory
this.resolveDependencies = resolveDependencies;
/** @type {ContextModuleOptions} */
this.options = {
...options,
resource,
resourceQuery,
resourceFragment
};
if (options && options.resolveOptions !== undefined) {

@@ -160,3 +173,8 @@ this.resolveOptions = options.resolveOptions;

_createIdentifier() {
let identifier = this.context;
let identifier =
this.context ||
(typeof this.options.resource === "string" ||
this.options.resource === false
? `${this.options.resource}`
: this.options.resource.join("|"));
if (this.options.resourceQuery) {

@@ -226,3 +244,15 @@ identifier += `|${this.options.resourceQuery}`;

readableIdentifier(requestShortener) {
let identifier = requestShortener.shorten(this.context) + "/";
let identifier;
if (this.context) {
identifier = requestShortener.shorten(this.context) + "/";
} else if (
typeof this.options.resource === "string" ||
this.options.resource === false
) {
identifier = requestShortener.shorten(`${this.options.resource}`) + "/";
} else {
identifier = this.options.resource
.map(r => requestShortener.shorten(r) + "/")
.join(" ");
}
if (this.options.resourceQuery) {

@@ -277,7 +307,26 @@ identifier += ` ${this.options.resourceQuery}`;

libIdent(options) {
let identifier = contextify(
options.context,
this.context,
options.associatedObjectForCache
);
let identifier;
if (this.context) {
identifier = contextify(
options.context,
this.context,
options.associatedObjectForCache
);
} else if (typeof this.options.resource === "string") {
identifier = contextify(
options.context,
this.options.resource,
options.associatedObjectForCache
);
} else if (this.options.resource === false) {
identifier = "false";
} else {
identifier = this.options.resource
.map(res =>
contextify(options.context, res, options.associatedObjectForCache)
)
.join(" ");
}
if (this.layer) identifier = `(${this.layer})/${identifier}`;

@@ -331,4 +380,5 @@ if (this.options.mode) {

// always build when we have no snapshot
if (!this.buildInfo.snapshot) return callback(null, true);
// always build when we have no snapshot and context
if (!this.buildInfo.snapshot)
return callback(null, Boolean(this.context || this.options.resource));

@@ -448,6 +498,12 @@ fileSystemInfo.checkSnapshotValid(this.buildInfo.snapshot, (err, valid) => {

}
if (!this.context && !this.options.resource) return callback();
compilation.fileSystemInfo.createSnapshot(
startTime,
null,
[this.context],
this.context
? [this.context]
: typeof this.options.resource === "string"
? [this.options.resource]
: /** @type {string[]} */ (this.options.resource),
null,

@@ -476,3 +532,11 @@ SNAPSHOT_OPTIONS,

) {
contextDependencies.add(this.context);
if (this.context) {
contextDependencies.add(this.context);
} else if (typeof this.options.resource === "string") {
contextDependencies.add(this.options.resource);
} else if (this.options.resource === false) {
return;
} else {
for (const res of this.options.resource) contextDependencies.add(res);
}
}

@@ -479,0 +543,0 @@

@@ -170,2 +170,5 @@ /*

callback => {
const results = [];
const yield_ = obj => results.push(obj);
contextResolver.resolve(

@@ -178,7 +181,8 @@ {},

missingDependencies,
contextDependencies
contextDependencies,
yield: yield_
},
(err, result) => {
err => {
if (err) return callback(err);
callback(null, result);
callback(null, results);
}

@@ -218,3 +222,8 @@ );

}
let [contextResult, loaderResult] = result;
if (contextResult.length > 1) {
const first = contextResult[0];
contextResult = contextResult.filter(r => r.path);
if (contextResult.length === 0) contextResult.push(first);
}
this.hooks.afterResolve.callAsync(

@@ -224,6 +233,11 @@ {

loadersPrefix +
result[1].join("!") +
(result[1].length > 0 ? "!" : ""),
resource: result[0],
loaderResult.join("!") +
(loaderResult.length > 0 ? "!" : ""),
resource:
contextResult.length > 1
? contextResult.map(r => r.path)
: contextResult[0].path,
resolveDependencies: this.resolveDependencies.bind(this),
resourceQuery: contextResult[0].query,
resourceFragment: contextResult[0].fragment,
...beforeResolveResult

@@ -285,3 +299,4 @@ },

const addDirectoryChecked = (directory, visited, callback) => {
let severalContexts = false;
const addDirectoryChecked = (ctx, directory, visited, callback) => {
fs.realpath(directory, (err, realPath) => {

@@ -292,4 +307,5 @@ if (err) return callback(err);

addDirectory(
ctx,
directory,
(dir, callback) => {
(_, dir, callback) => {
if (recursionStack === undefined) {

@@ -299,3 +315,3 @@ recursionStack = new Set(visited);

}
addDirectoryChecked(dir, recursionStack, callback);
addDirectoryChecked(ctx, dir, recursionStack, callback);
},

@@ -307,3 +323,3 @@ callback

const addDirectory = (directory, addSubDirectory, callback) => {
const addDirectory = (ctx, directory, addSubDirectory, callback) => {
fs.readdir(directory, (err, files) => {

@@ -335,3 +351,3 @@ if (err) return callback(err);

if (!recursive) return callback();
addSubDirectory(subResource, callback);
addSubDirectory(ctx, subResource, callback);
} else if (

@@ -342,6 +358,5 @@ stat.isFile() &&

const obj = {
context: resource,
context: ctx,
request:
"." +
subResource.substr(resource.length).replace(/\\/g, "/")
"." + subResource.substr(ctx.length).replace(/\\/g, "/")
};

@@ -357,4 +372,7 @@

.map(obj => {
const request = severalContexts
? join(fs, obj.context, obj.request)
: obj.request;
const dep = new ContextElementDependency(
obj.request + resourceQuery + resourceFragment,
request + resourceQuery + resourceFragment,
obj.request,

@@ -396,10 +414,36 @@ typePrefix,

if (typeof fs.realpath === "function") {
addDirectoryChecked(resource, new Set(), callback);
const addSubDirectory = (ctx, dir, callback) =>
addDirectory(ctx, dir, addSubDirectory, callback);
const visitResource = (resource, callback) => {
if (typeof fs.realpath === "function") {
addDirectoryChecked(resource, resource, new Set(), callback);
} else {
addDirectory(resource, resource, addSubDirectory, callback);
}
};
if (typeof resource === "string") {
visitResource(resource, callback);
} else {
const addSubDirectory = (dir, callback) =>
addDirectory(dir, addSubDirectory, callback);
addDirectory(resource, addSubDirectory, callback);
severalContexts = true;
asyncLib.map(resource, visitResource, (err, result) => {
if (err) return callback(err);
// result dependencies should have unique userRequest
// ordered by resolve result
const temp = new Set();
const res = [];
for (let i = 0; i < result.length; i++) {
const inner = result[i];
for (const el of inner) {
if (temp.has(el.userRequest)) continue;
res.push(el);
temp.add(el.userRequest);
}
}
callback(null, res);
});
}
}
};

@@ -40,3 +40,3 @@ /*

/** @typedef {Partial<Omit<ContextDependencyOptions, "resource"|"recursive"|"regExp">>} PartialContextDependencyOptions */
/** @typedef {Partial<Omit<ContextDependencyOptions, "resource">>} PartialContextDependencyOptions */

@@ -43,0 +43,0 @@ /** @typedef {{ new(options: ContextDependencyOptions, range: [number, number], valueRange: [number, number]): ContextDependency }} ContextDependencyConstructor */

@@ -10,2 +10,3 @@ /*

const HarmonyImportDependency = require("./HarmonyImportDependency");
const NullDependency = require("./NullDependency");

@@ -32,6 +33,7 @@ /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */

HarmonyAcceptImportDependency.Template = class HarmonyAcceptImportDependencyTemplate extends (
HarmonyImportDependency.Template
) {};
HarmonyAcceptImportDependency.Template =
/** @type {typeof HarmonyImportDependency.Template} */ (
NullDependency.Template
);
module.exports = HarmonyAcceptImportDependency;

@@ -148,3 +148,6 @@ /*

const definitions = [];
for (const [key, value] of this.exportMap) {
const orderedExportMap = Array.from(this.exportMap).sort(([a], [b]) =>
a < b ? -1 : 1
);
for (const [key, value] of orderedExportMap) {
definitions.push(

@@ -151,0 +154,0 @@ `\n/* harmony export */ ${JSON.stringify(

@@ -31,3 +31,2 @@ /*

write(this.range);
write(this.valueRange);

@@ -41,3 +40,2 @@

this.range = read();
this.valueRange = read();

@@ -44,0 +42,0 @@

@@ -35,2 +35,3 @@ /*

* @property {string=} publicPath the target public path
* @property {string=} baseUri target base uri
*/

@@ -203,2 +204,3 @@

entryOptions: {
baseUri: options.baseUri,
publicPath: options.publicPath

@@ -205,0 +207,0 @@ }

@@ -22,18 +22,2 @@ /*

}
serialize(context) {
const { write } = context;
write(this.range);
super.serialize(context);
}
deserialize(context) {
const { read } = context;
this.range = read();
super.deserialize(context);
}
}

@@ -40,0 +24,0 @@

@@ -65,2 +65,3 @@ /*

dependOn: desc.dependOn,
baseUri: desc.baseUri,
publicPath: desc.publicPath,

@@ -67,0 +68,0 @@ chunkLoading: desc.chunkLoading,

@@ -59,10 +59,30 @@ /*

/**
* @private
* @param {Chunk} chunk chunk
* @param {string} rootOutputDir root output directory
* @returns {string} generated code
*/
_generateBaseUri(chunk, rootOutputDir) {
const options = chunk.getEntryOptions();
if (options && options.baseUri) {
return `${RuntimeGlobals.baseURI} = ${JSON.stringify(options.baseUri)};`;
}
const {
compilation: {
outputOptions: { importMetaName }
}
} = this;
return `${RuntimeGlobals.baseURI} = new URL(${JSON.stringify(
rootOutputDir
)}, ${importMetaName}.url);`;
}
/**
* @returns {string} runtime code
*/
generate() {
const { compilation, chunk } = this;
const { compilation, chunk, chunkGraph } = this;
const {
runtimeTemplate,
chunkGraph,
outputOptions: { importFunctionName, importMetaName }
outputOptions: { importFunctionName }
} = compilation;

@@ -106,7 +126,3 @@ const fn = RuntimeGlobals.ensureChunkHandlers;

withBaseURI
? Template.asString([
`${RuntimeGlobals.baseURI} = new URL(${JSON.stringify(
rootOutputDir
)}, ${importMetaName}.url);`
])
? this._generateBaseUri(chunk, rootOutputDir)
: "// no baseURI",

@@ -113,0 +129,0 @@ "",

@@ -41,2 +41,3 @@ /*

* @property {RuntimeSpec} runtime
* @property {RuntimeTemplate=} runtimeTemplate
*/

@@ -43,0 +44,0 @@

@@ -18,2 +18,4 @@ /*

/** @typedef {import("../Chunk")} Chunk */
class ReadFileChunkLoadingRuntimeModule extends RuntimeModule {

@@ -26,2 +28,21 @@ constructor(runtimeRequirements) {

/**
* @private
* @param {Chunk} chunk chunk
* @param {string} rootOutputDir root output directory
* @returns {string} generated code
*/
_generateBaseUri(chunk, rootOutputDir) {
const options = chunk.getEntryOptions();
if (options && options.baseUri) {
return `${RuntimeGlobals.baseURI} = ${JSON.stringify(options.baseUri)};`;
}
return `${RuntimeGlobals.baseURI} = require("url").pathToFileURL(${
rootOutputDir
? `__dirname + ${JSON.stringify("/" + rootOutputDir)}`
: "__filename"
});`;
}
/**
* @returns {string} runtime code

@@ -72,9 +93,3 @@ */

withBaseURI
? Template.asString([
`${RuntimeGlobals.baseURI} = require("url").pathToFileURL(${
rootOutputDir
? `__dirname + ${JSON.stringify("/" + rootOutputDir)}`
: "__filename"
});`
])
? this._generateBaseUri(chunk, rootOutputDir)
: "// no baseURI",

@@ -81,0 +96,0 @@ "",

@@ -18,2 +18,4 @@ /*

/** @typedef {import("../Chunk")} Chunk */
class RequireChunkLoadingRuntimeModule extends RuntimeModule {

@@ -26,2 +28,21 @@ constructor(runtimeRequirements) {

/**
* @private
* @param {Chunk} chunk chunk
* @param {string} rootOutputDir root output directory
* @returns {string} generated code
*/
_generateBaseUri(chunk, rootOutputDir) {
const options = chunk.getEntryOptions();
if (options && options.baseUri) {
return `${RuntimeGlobals.baseURI} = ${JSON.stringify(options.baseUri)};`;
}
return `${RuntimeGlobals.baseURI} = require("url").pathToFileURL(${
rootOutputDir !== "./"
? `__dirname + ${JSON.stringify("/" + rootOutputDir)}`
: "__filename"
});`;
}
/**
* @returns {string} runtime code

@@ -72,9 +93,3 @@ */

withBaseURI
? Template.asString([
`${RuntimeGlobals.baseURI} = require("url").pathToFileURL(${
rootOutputDir !== "./"
? `__dirname + ${JSON.stringify("/" + rootOutputDir)}`
: "__filename"
});`
])
? this._generateBaseUri(chunk, rootOutputDir)
: "// no baseURI",

@@ -81,0 +96,0 @@ "",

@@ -72,2 +72,12 @@ /*

});
parser.hooks.rename.for("global").tap("NodeStuffPlugin", expr => {
const dep = new ConstDependency(
RuntimeGlobals.global,
expr.range,
[RuntimeGlobals.global]
);
dep.loc = expr.loc;
parser.state.module.addPresentationalDependency(dep);
return false;
});
}

@@ -74,0 +84,0 @@

@@ -53,2 +53,3 @@ /*

/** @typedef {import("../declarations/WebpackOptions").Mode} Mode */
/** @typedef {import("../declarations/WebpackOptions").ResolveOptions} ResolveOptions */
/** @typedef {import("../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */

@@ -198,2 +199,21 @@ /** @typedef {import("./ChunkGraph")} ChunkGraph */

/**
* @typedef {Object} NormalModuleCreateData
* @property {string=} layer an optional layer in which the module is
* @property {string} type module type
* @property {string} request request string
* @property {string} userRequest request intended by user (without loaders from config)
* @property {string} rawRequest request without resolving
* @property {LoaderItem[]} loaders list of loaders
* @property {string} resource path + query of the real resource
* @property {Record<string, any>=} resourceResolveData resource resolve data
* @property {string} context context directory for resolving
* @property {string=} matchResource path + query of the matched resource (virtual)
* @property {Parser} parser the parser used
* @property {Record<string, any>=} parserOptions the options of the parser used
* @property {Generator} generator the generator used
* @property {Record<string, any>=} generatorOptions the options of the generator used
* @property {ResolveOptions=} resolveOptions options used for resolving requests from this module
*/
/** @type {WeakMap<Compilation, NormalModuleCompilationHooks>} */

@@ -251,18 +271,3 @@ const compilationHooksMap = new WeakMap();

/**
* @param {Object} options options object
* @param {string=} options.layer an optional layer in which the module is
* @param {string} options.type module type
* @param {string} options.request request string
* @param {string} options.userRequest request intended by user (without loaders from config)
* @param {string} options.rawRequest request without resolving
* @param {LoaderItem[]} options.loaders list of loaders
* @param {string} options.resource path + query of the real resource
* @param {Record<string, any>=} options.resourceResolveData resource resolve data
* @param {string} options.context context directory for resolving
* @param {string | undefined} options.matchResource path + query of the matched resource (virtual)
* @param {Parser} options.parser the parser used
* @param {object} options.parserOptions the options of the parser used
* @param {Generator} options.generator the generator used
* @param {object} options.generatorOptions the options of the generator used
* @param {Object} options.resolveOptions options used for resolving requests from this module
* @param {NormalModuleCreateData} options options object
*/

@@ -269,0 +274,0 @@ constructor({

@@ -37,5 +37,7 @@ /*

/** @typedef {import("../declarations/WebpackOptions").ModuleOptionsNormalized} ModuleOptions */
/** @typedef {import("../declarations/WebpackOptions").RuleSetRule} RuleSetRule */
/** @typedef {import("./Generator")} Generator */
/** @typedef {import("./ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */
/** @typedef {import("./ModuleFactory").ModuleFactoryResult} ModuleFactoryResult */
/** @typedef {import("./NormalModule").NormalModuleCreateData} NormalModuleCreateData */
/** @typedef {import("./Parser")} Parser */

@@ -46,2 +48,5 @@ /** @typedef {import("./ResolverFactory")} ResolverFactory */

/** @typedef {Pick<RuleSetRule, 'type'|'sideEffects'|'parser'|'generator'|'resolve'|'layer'>} ModuleSettings */
/** @typedef {Partial<NormalModuleCreateData & {settings: ModuleSettings}>} CreateData */
/**

@@ -56,3 +61,3 @@ * @typedef {Object} ResolveData

* @property {string} dependencyType
* @property {Object} createData
* @property {CreateData} createData
* @property {LazySet<string>} fileDependencies

@@ -205,3 +210,3 @@ * @property {LazySet<string>} missingDependencies

this.hooks = Object.freeze({
/** @type {AsyncSeriesBailHook<[ResolveData], TODO>} */
/** @type {AsyncSeriesBailHook<[ResolveData], Module | false | void>} */
resolve: new AsyncSeriesBailHook(["resolveData"]),

@@ -216,11 +221,11 @@ /** @type {HookMap<AsyncSeriesBailHook<[ResourceDataWithData, ResolveData], true | void>>} */

),
/** @type {AsyncSeriesBailHook<[ResolveData], TODO>} */
/** @type {AsyncSeriesBailHook<[ResolveData], Module>} */
factorize: new AsyncSeriesBailHook(["resolveData"]),
/** @type {AsyncSeriesBailHook<[ResolveData], TODO>} */
/** @type {AsyncSeriesBailHook<[ResolveData], false | void>} */
beforeResolve: new AsyncSeriesBailHook(["resolveData"]),
/** @type {AsyncSeriesBailHook<[ResolveData], TODO>} */
/** @type {AsyncSeriesBailHook<[ResolveData], false | void>} */
afterResolve: new AsyncSeriesBailHook(["resolveData"]),
/** @type {AsyncSeriesBailHook<[ResolveData["createData"], ResolveData], TODO>} */
/** @type {AsyncSeriesBailHook<[ResolveData["createData"], ResolveData], Module | void>} */
createModule: new AsyncSeriesBailHook(["createData", "resolveData"]),
/** @type {SyncWaterfallHook<[Module, ResolveData["createData"], ResolveData], TODO>} */
/** @type {SyncWaterfallHook<[Module, ResolveData["createData"], ResolveData], Module>} */
module: new SyncWaterfallHook(["module", "createData", "resolveData"]),

@@ -309,3 +314,5 @@ createParser: new HookMap(() => new SyncBailHook(["parserOptions"])),

createdModule = new NormalModule(createData);
createdModule = new NormalModule(
/** @type {NormalModuleCreateData} */ (createData)
);
}

@@ -312,0 +319,0 @@

@@ -534,3 +534,3 @@ /*

interceptHook(compiler.cache.hooks.endIdle, 0.01, "cache", "end idle");
compiler.hooks.initialize.intercept({
compiler.hooks.beforeRun.intercept({
name: "ProgressPlugin",

@@ -541,5 +541,4 @@ call() {

});
interceptHook(compiler.hooks.initialize, 0.01, "setup", "initialize");
interceptHook(compiler.hooks.beforeRun, 0.02, "setup", "before run");
interceptHook(compiler.hooks.run, 0.03, "setup", "run");
interceptHook(compiler.hooks.beforeRun, 0.01, "setup", "before run");
interceptHook(compiler.hooks.run, 0.02, "setup", "run");
interceptHook(compiler.hooks.watchRun, 0.03, "setup", "watch run");

@@ -546,0 +545,0 @@ interceptHook(

@@ -86,2 +86,3 @@ /*

this.globalObject = getGlobalObject(outputOptions.globalObject);
this.contentHashReplacement = "X".repeat(outputOptions.hashDigestLength);
}

@@ -88,0 +89,0 @@

@@ -8,2 +8,3 @@ /*

const EventEmitter = require("events");
const { extname, basename } = require("path");

@@ -23,3 +24,41 @@ const { URL } = require("url");

const getHttps = memoize(() => require("https"));
const proxyFetch = (request, proxy) => (url, options, callback) => {
const eventEmitter = new EventEmitter();
const doRequest = socket =>
request
.get(url, { ...options, ...(socket && { socket }) }, callback)
.on("error", eventEmitter.emit.bind(eventEmitter, "error"));
if (proxy) {
const { hostname: host, port } = new URL(proxy);
getHttp()
.request({
host, // IP address of proxy server
port, // port of proxy server
method: "CONNECT",
path: url.host
})
.on("connect", (res, socket) => {
if (res.statusCode === 200) {
// connected to proxy server
doRequest(socket);
}
})
.on("error", err => {
eventEmitter.emit(
"error",
new Error(
`Failed to connect to proxy server "${proxy}": ${err.message}`
)
);
})
.end();
} else {
doRequest();
}
return eventEmitter;
};
/** @type {(() => void)[] | undefined} */

@@ -279,2 +318,3 @@ let inProgressWrite = undefined;

this._allowedUris = options.allowedUris;
this._proxy = options.proxy;
}

@@ -288,11 +328,12 @@

apply(compiler) {
const proxy =
this._proxy || process.env["http_proxy"] || process.env["HTTP_PROXY"];
const schemes = [
{
scheme: "http",
fetch: (url, options, callback) => getHttp().get(url, options, callback)
fetch: proxyFetch(getHttp(), proxy)
},
{
scheme: "https",
fetch: (url, options, callback) =>
getHttps().get(url, options, callback)
fetch: proxyFetch(getHttps(), proxy)
}

@@ -299,0 +340,0 @@ ];

@@ -129,2 +129,4 @@ /*

require("../dependencies/ImportMetaHotDeclineDependency"),
"dependencies/ImportMetaContextDependency": () =>
require("../dependencies/ImportMetaContextDependency"),
"dependencies/ProvidedDependency": () =>

@@ -131,0 +133,0 @@ require("../dependencies/ProvidedDependency"),

@@ -55,2 +55,16 @@ /*

/**
* @private
* @param {Chunk} chunk chunk
* @returns {string} generated code
*/
_generateBaseUri(chunk) {
const options = chunk.getEntryOptions();
if (options && options.baseUri) {
return `${RuntimeGlobals.baseURI} = ${JSON.stringify(options.baseUri)};`;
} else {
return `${RuntimeGlobals.baseURI} = document.baseURI || self.location.href;`;
}
}
/**
* @returns {string} runtime code

@@ -107,7 +121,3 @@ */

return Template.asString([
withBaseURI
? Template.asString([
`${RuntimeGlobals.baseURI} = document.baseURI || self.location.href;`
])
: "// no baseURI",
withBaseURI ? this._generateBaseUri(chunk) : "// no baseURI",
"",

@@ -114,0 +124,0 @@ "// object to store loaded and loading chunks",

@@ -38,2 +38,3 @@ /*

const HarmonyModulesPlugin = require("./dependencies/HarmonyModulesPlugin");
const ImportMetaContextPlugin = require("./dependencies/ImportMetaContextPlugin");
const ImportMetaPlugin = require("./dependencies/ImportMetaPlugin");

@@ -365,2 +366,3 @@ const ImportPlugin = require("./dependencies/ImportPlugin");

new ImportPlugin().apply(compiler);
new ImportMetaContextPlugin().apply(compiler);
new SystemPlugin().apply(compiler);

@@ -367,0 +369,0 @@ new ImportMetaPlugin().apply(compiler);

@@ -18,2 +18,4 @@ /*

/** @typedef {import("../Chunk")} Chunk */
class ImportScriptsChunkLoadingRuntimeModule extends RuntimeModule {

@@ -27,2 +29,29 @@ constructor(runtimeRequirements, withCreateScriptUrl) {

/**
* @private
* @param {Chunk} chunk chunk
* @returns {string} generated code
*/
_generateBaseUri(chunk) {
const options = chunk.getEntryOptions();
if (options && options.baseUri) {
return `${RuntimeGlobals.baseURI} = ${JSON.stringify(options.baseUri)};`;
}
const outputName = this.compilation.getPath(
getChunkFilenameTemplate(chunk, this.compilation.outputOptions),
{
chunk,
contentHashType: "javascript"
}
);
const rootOutputDir = getUndoPath(
outputName,
this.compilation.outputOptions.path,
false
);
return `${RuntimeGlobals.baseURI} = self.location + ${JSON.stringify(
rootOutputDir ? "/../" + rootOutputDir : ""
)};`;
}
/**
* @returns {string} runtime code

@@ -60,15 +89,2 @@ */

const outputName = this.compilation.getPath(
getChunkFilenameTemplate(chunk, this.compilation.outputOptions),
{
chunk,
contentHashType: "javascript"
}
);
const rootOutputDir = getUndoPath(
outputName,
this.compilation.outputOptions.path,
false
);
const stateExpression = withHmr

@@ -79,9 +95,3 @@ ? `${RuntimeGlobals.hmrRuntimeStatePrefix}_importScripts`

return Template.asString([
withBaseURI
? Template.asString([
`${RuntimeGlobals.baseURI} = self.location + ${JSON.stringify(
rootOutputDir ? "/../" + rootOutputDir : ""
)};`
])
: "// no baseURI",
withBaseURI ? this._generateBaseUri(chunk) : "// no baseURI",
"",

@@ -88,0 +98,0 @@ "// object to store loaded chunks",

@@ -132,2 +132,3 @@ declare namespace webpack {

useInfo: boolean | null | undefined;
canMangle: boolean;
}

@@ -151,2 +152,16 @@

webpackHot: webpack.Hot;
webpackContext: (
request: string,
options?: {
recursive?: boolean;
regExp?: RegExp;
include?: RegExp;
exclude?: RegExp;
preload?: boolean | number;
prefetch?: boolean | number;
chunkName?: string;
exports?: string | string[][];
mode?: "sync" | "eager" | "weak" | "lazy" | "lazy-once";
}
) => webpack.Context;
}

@@ -153,0 +168,0 @@

{
"name": "webpack",
"version": "5.69.1",
"version": "5.70.0",
"author": "Tobias Koppers @sokra",

@@ -17,3 +17,3 @@ "description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",

"chrome-trace-event": "^1.0.2",
"enhanced-resolve": "^5.8.3",
"enhanced-resolve": "^5.9.2",
"es-module-lexer": "^0.9.0",

@@ -20,0 +20,0 @@ "eslint-scope": "5.1.1",

@@ -6,2 +6,2 @@ /*

*/
const r=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;module.exports=n,module.exports.default=n;const t=new RegExp("^https?://","u");function e(n,{instancePath:o="",parentData:s,parentDataProperty:a,rootData:l=n}={}){let i=null,p=0;if(0===p){if(!n||"object"!=typeof n||Array.isArray(n))return e.errors=[{params:{type:"object"}}],!1;{let o;if(void 0===n.allowedUris&&(o="allowedUris"))return e.errors=[{params:{missingProperty:o}}],!1;{const o=p;for(const r in n)if("allowedUris"!==r&&"cacheLocation"!==r&&"frozen"!==r&&"lockfileLocation"!==r&&"upgrade"!==r)return e.errors=[{params:{additionalProperty:r}}],!1;if(o===p){if(void 0!==n.allowedUris){let r=n.allowedUris;const o=p;if(p==p){if(!Array.isArray(r))return e.errors=[{params:{type:"array"}}],!1;{const n=r.length;for(let o=0;o<n;o++){let n=r[o];const s=p,a=p;let l=!1;const f=p;if(!(n instanceof RegExp)){const r={params:{}};null===i?i=[r]:i.push(r),p++}var c=f===p;if(l=l||c,!l){const r=p;if(p===r)if("string"==typeof n){if(!t.test(n)){const r={params:{pattern:"^https?://"}};null===i?i=[r]:i.push(r),p++}}else{const r={params:{type:"string"}};null===i?i=[r]:i.push(r),p++}if(c=r===p,l=l||c,!l){const r=p;if(!(n instanceof Function)){const r={params:{}};null===i?i=[r]:i.push(r),p++}c=r===p,l=l||c}}if(!l){const r={params:{}};return null===i?i=[r]:i.push(r),p++,e.errors=i,!1}if(p=a,null!==i&&(a?i.length=a:i=null),s!==p)break}}}var f=o===p}else f=!0;if(f){if(void 0!==n.cacheLocation){let t=n.cacheLocation;const o=p,s=p;let a=!1;const l=p;if(!1!==t){const r={params:{}};null===i?i=[r]:i.push(r),p++}var u=l===p;if(a=a||u,!a){const e=p;if(p===e)if("string"==typeof t){if(t.includes("!")||!0!==r.test(t)){const r={params:{}};null===i?i=[r]:i.push(r),p++}}else{const r={params:{type:"string"}};null===i?i=[r]:i.push(r),p++}u=e===p,a=a||u}if(!a){const r={params:{}};return null===i?i=[r]:i.push(r),p++,e.errors=i,!1}p=s,null!==i&&(s?i.length=s:i=null),f=o===p}else f=!0;if(f){if(void 0!==n.frozen){const r=p;if("boolean"!=typeof n.frozen)return e.errors=[{params:{type:"boolean"}}],!1;f=r===p}else f=!0;if(f){if(void 0!==n.lockfileLocation){let t=n.lockfileLocation;const o=p;if(p===o){if("string"!=typeof t)return e.errors=[{params:{type:"string"}}],!1;if(t.includes("!")||!0!==r.test(t))return e.errors=[{params:{}}],!1}f=o===p}else f=!0;if(f)if(void 0!==n.upgrade){const r=p;if("boolean"!=typeof n.upgrade)return e.errors=[{params:{type:"boolean"}}],!1;f=r===p}else f=!0}}}}}}}return e.errors=i,0===p}function n(r,{instancePath:t="",parentData:o,parentDataProperty:s,rootData:a=r}={}){let l=null,i=0;const p=i;let c=!1,f=null;const u=i;if(e(r,{instancePath:t,parentData:o,parentDataProperty:s,rootData:a})||(l=null===l?e.errors:l.concat(e.errors),i=l.length),u===i&&(c=!0,f=0),!c){const r={params:{passingSchemas:f}};return null===l?l=[r]:l.push(r),i++,n.errors=l,!1}return i=p,null!==l&&(p?l.length=p:l=null),n.errors=l,0===i}
const r=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;module.exports=n,module.exports.default=n;const t=new RegExp("^https?://","u");function e(n,{instancePath:o="",parentData:s,parentDataProperty:a,rootData:l=n}={}){let i=null,p=0;if(0===p){if(!n||"object"!=typeof n||Array.isArray(n))return e.errors=[{params:{type:"object"}}],!1;{let o;if(void 0===n.allowedUris&&(o="allowedUris"))return e.errors=[{params:{missingProperty:o}}],!1;{const o=p;for(const r in n)if("allowedUris"!==r&&"cacheLocation"!==r&&"frozen"!==r&&"lockfileLocation"!==r&&"proxy"!==r&&"upgrade"!==r)return e.errors=[{params:{additionalProperty:r}}],!1;if(o===p){if(void 0!==n.allowedUris){let r=n.allowedUris;const o=p;if(p==p){if(!Array.isArray(r))return e.errors=[{params:{type:"array"}}],!1;{const n=r.length;for(let o=0;o<n;o++){let n=r[o];const s=p,a=p;let l=!1;const c=p;if(!(n instanceof RegExp)){const r={params:{}};null===i?i=[r]:i.push(r),p++}var f=c===p;if(l=l||f,!l){const r=p;if(p===r)if("string"==typeof n){if(!t.test(n)){const r={params:{pattern:"^https?://"}};null===i?i=[r]:i.push(r),p++}}else{const r={params:{type:"string"}};null===i?i=[r]:i.push(r),p++}if(f=r===p,l=l||f,!l){const r=p;if(!(n instanceof Function)){const r={params:{}};null===i?i=[r]:i.push(r),p++}f=r===p,l=l||f}}if(!l){const r={params:{}};return null===i?i=[r]:i.push(r),p++,e.errors=i,!1}if(p=a,null!==i&&(a?i.length=a:i=null),s!==p)break}}}var c=o===p}else c=!0;if(c){if(void 0!==n.cacheLocation){let t=n.cacheLocation;const o=p,s=p;let a=!1;const l=p;if(!1!==t){const r={params:{}};null===i?i=[r]:i.push(r),p++}var u=l===p;if(a=a||u,!a){const e=p;if(p===e)if("string"==typeof t){if(t.includes("!")||!0!==r.test(t)){const r={params:{}};null===i?i=[r]:i.push(r),p++}}else{const r={params:{type:"string"}};null===i?i=[r]:i.push(r),p++}u=e===p,a=a||u}if(!a){const r={params:{}};return null===i?i=[r]:i.push(r),p++,e.errors=i,!1}p=s,null!==i&&(s?i.length=s:i=null),c=o===p}else c=!0;if(c){if(void 0!==n.frozen){const r=p;if("boolean"!=typeof n.frozen)return e.errors=[{params:{type:"boolean"}}],!1;c=r===p}else c=!0;if(c){if(void 0!==n.lockfileLocation){let t=n.lockfileLocation;const o=p;if(p===o){if("string"!=typeof t)return e.errors=[{params:{type:"string"}}],!1;if(t.includes("!")||!0!==r.test(t))return e.errors=[{params:{}}],!1}c=o===p}else c=!0;if(c){if(void 0!==n.proxy){const r=p;if("string"!=typeof n.proxy)return e.errors=[{params:{type:"string"}}],!1;c=r===p}else c=!0;if(c)if(void 0!==n.upgrade){const r=p;if("boolean"!=typeof n.upgrade)return e.errors=[{params:{type:"boolean"}}],!1;c=r===p}else c=!0}}}}}}}}return e.errors=i,0===p}function n(r,{instancePath:t="",parentData:o,parentDataProperty:s,rootData:a=r}={}){let l=null,i=0;const p=i;let f=!1,c=null;const u=i;if(e(r,{instancePath:t,parentData:o,parentDataProperty:s,rootData:a})||(l=null===l?e.errors:l.concat(e.errors),i=l.length),u===i&&(f=!0,c=0),!f){const r={params:{passingSchemas:c}};return null===l?l=[r]:l.push(r),i++,n.errors=l,!1}return i=p,null!==l&&(p?l.length=p:l=null),n.errors=l,0===i}

@@ -32,2 +32,6 @@ {

},
"proxy": {
"description": "Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.",
"type": "string"
},
"upgrade": {

@@ -34,0 +38,0 @@ "description": "When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc