Comparing version 5.92.1 to 5.93.0
@@ -193,4 +193,6 @@ /* | ||
_prettyRegExp(regexString, stripSlash = true) { | ||
const str = (regexString + "").replace(/!/g, "%21").replace(/\|/g, "%7C"); | ||
return stripSlash ? str.substring(1, str.length - 1) : str; | ||
const str = stripSlash | ||
? regexString.source + regexString.flags | ||
: regexString + ""; | ||
return str.replace(/!/g, "%21").replace(/\|/g, "%7C"); | ||
} | ||
@@ -197,0 +199,0 @@ |
@@ -13,3 +13,2 @@ /* | ||
const Template = require("../Template"); | ||
const { cssExportConvention } = require("../util/conventions"); | ||
@@ -139,16 +138,14 @@ /** @typedef {import("webpack-sources").Source} Source */ | ||
for (const [name, v] of cssExportsData.exports) { | ||
for (let k of cssExportConvention(name, this.convention)) { | ||
let identifier = Template.toIdentifier(k); | ||
let i = 0; | ||
while (usedIdentifiers.has(identifier)) { | ||
identifier = Template.toIdentifier(k + i); | ||
} | ||
usedIdentifiers.add(identifier); | ||
generateContext.concatenationScope.registerExport(k, identifier); | ||
source.add( | ||
`${ | ||
generateContext.runtimeTemplate.supportsConst() ? "const" : "var" | ||
} ${identifier} = ${JSON.stringify(v)};\n` | ||
); | ||
let identifier = Template.toIdentifier(name); | ||
let i = 0; | ||
while (usedIdentifiers.has(identifier)) { | ||
identifier = Template.toIdentifier(name + i); | ||
} | ||
usedIdentifiers.add(identifier); | ||
generateContext.concatenationScope.registerExport(name, identifier); | ||
source.add( | ||
`${ | ||
generateContext.runtimeTemplate.supportsConst() ? "const" : "var" | ||
} ${identifier} = ${JSON.stringify(v)};\n` | ||
); | ||
} | ||
@@ -168,7 +165,5 @@ return source; | ||
} | ||
const newExports = []; | ||
for (let [k, v] of cssExportsData.exports) { | ||
for (let name of cssExportConvention(k, this.convention)) { | ||
newExports.push(`\t${JSON.stringify(name)}: ${JSON.stringify(v)}`); | ||
} | ||
const exports = []; | ||
for (let [name, v] of cssExportsData.exports) { | ||
exports.push(`\t${JSON.stringify(name)}: ${JSON.stringify(v)}`); | ||
} | ||
@@ -178,3 +173,3 @@ return new RawSource( | ||
module.moduleArgument | ||
}.exports = {\n${newExports.join(",\n")}\n}${needNsObj ? ")" : ""};` | ||
}.exports = {\n${exports.join(",\n")}\n}${needNsObj ? ")" : ""};` | ||
); | ||
@@ -205,5 +200,7 @@ } | ||
*/ | ||
updateHash(hash, { module }) {} | ||
updateHash(hash, { module }) { | ||
hash.update(this.esModule.toString()); | ||
} | ||
} | ||
module.exports = CssExportsGenerator; |
@@ -12,3 +12,2 @@ /* | ||
const RuntimeGlobals = require("../RuntimeGlobals"); | ||
const { cssExportConvention } = require("../util/conventions"); | ||
@@ -110,11 +109,2 @@ /** @typedef {import("webpack-sources").Source} Source */ | ||
if (cssExportsData.exports.size > 0) { | ||
const newExports = new Map(); | ||
for (let [name, v] of cssExportsData.exports) { | ||
for (let newName of cssExportConvention(name, this.convention)) { | ||
newExports.set(newName, v); | ||
} | ||
} | ||
cssExportsData.exports = newExports; | ||
} | ||
const data = generateContext.getData(); | ||
@@ -153,5 +143,7 @@ data.set("css-exports", cssExportsData); | ||
*/ | ||
updateHash(hash, { module }) {} | ||
updateHash(hash, { module }) { | ||
hash.update(this.esModule.toString()); | ||
} | ||
} | ||
module.exports = CssGenerator; |
@@ -275,3 +275,3 @@ /* | ||
logger.log(`Replaced "${key}" with "${strCode}"`); | ||
logger.debug(`Replaced "${key}" with "${strCode}"`); | ||
@@ -278,0 +278,0 @@ return strCode; |
@@ -8,2 +8,3 @@ /* | ||
const { cssExportConvention } = require("../util/conventions"); | ||
const makeSerializable = require("../util/makeSerializable"); | ||
@@ -13,8 +14,14 @@ const NullDependency = require("./NullDependency"); | ||
/** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ | ||
/** @typedef {import("../../declarations/WebpackOptions").CssGeneratorExportsConvention} CssGeneratorExportsConvention */ | ||
/** @typedef {import("../CssModule")} CssModule */ | ||
/** @typedef {import("../Dependency")} Dependency */ | ||
/** @typedef {import("../Dependency").ExportsSpec} ExportsSpec */ | ||
/** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */ | ||
/** @typedef {import("../DependencyTemplate").CssDependencyTemplateContext} DependencyTemplateContext */ | ||
/** @typedef {import("../ModuleGraph")} ModuleGraph */ | ||
/** @typedef {import("../css/CssExportsGenerator")} CssExportsGenerator */ | ||
/** @typedef {import("../css/CssGenerator")} CssGenerator */ | ||
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ | ||
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ | ||
/** @typedef {import("../util/Hash")} Hash */ | ||
@@ -37,2 +44,15 @@ class CssExportDependency extends NullDependency { | ||
/** | ||
* @param {string} name export name | ||
* @param {CssGeneratorExportsConvention} convention convention of the export name | ||
* @returns {string[]} convention results | ||
*/ | ||
getExportsConventionNames(name, convention) { | ||
if (this._conventionNames) { | ||
return this._conventionNames; | ||
} | ||
this._conventionNames = cssExportConvention(name, convention); | ||
return this._conventionNames; | ||
} | ||
/** | ||
* Returns the exported names | ||
@@ -43,10 +63,12 @@ * @param {ModuleGraph} moduleGraph module graph | ||
getExports(moduleGraph) { | ||
const name = this.name; | ||
const module = /** @type {CssModule} */ (moduleGraph.getParentModule(this)); | ||
const convention = /** @type {CssGenerator | CssExportsGenerator} */ ( | ||
module.generator | ||
).convention; | ||
const names = this.getExportsConventionNames(this.name, convention); | ||
return { | ||
exports: [ | ||
{ | ||
name, | ||
canMangle: true | ||
} | ||
], | ||
exports: names.map(name => ({ | ||
name, | ||
canMangle: true | ||
})), | ||
dependencies: undefined | ||
@@ -57,2 +79,23 @@ }; | ||
/** | ||
* Update the hash | ||
* @param {Hash} hash hash to be updated | ||
* @param {UpdateHashContext} context context | ||
* @returns {void} | ||
*/ | ||
updateHash(hash, { chunkGraph }) { | ||
const module = /** @type {CssModule} */ ( | ||
chunkGraph.moduleGraph.getParentModule(this) | ||
); | ||
const generator = /** @type {CssGenerator | CssExportsGenerator} */ ( | ||
module.generator | ||
); | ||
const names = this.getExportsConventionNames( | ||
this.name, | ||
generator.convention | ||
); | ||
hash.update(`exportsConvention`); | ||
hash.update(JSON.stringify(names)); | ||
} | ||
/** | ||
* @param {ObjectSerializerContext} context context | ||
@@ -87,5 +130,25 @@ */ | ||
*/ | ||
apply(dependency, source, { cssExportsData }) { | ||
apply( | ||
dependency, | ||
source, | ||
{ cssExportsData, module: m, runtime, moduleGraph } | ||
) { | ||
const dep = /** @type {CssExportDependency} */ (dependency); | ||
cssExportsData.exports.set(dep.name, dep.value); | ||
const module = /** @type {CssModule} */ (m); | ||
const convention = /** @type {CssGenerator | CssExportsGenerator} */ ( | ||
module.generator | ||
).convention; | ||
const names = dep.getExportsConventionNames(dep.name, convention); | ||
const usedNames = /** @type {string[]} */ ( | ||
names | ||
.map(name => | ||
moduleGraph.getExportInfo(module, name).getUsedName(name, runtime) | ||
) | ||
.filter(Boolean) | ||
); | ||
if (usedNames.length === 0) return; | ||
for (const used of usedNames) { | ||
cssExportsData.exports.set(used, dep.value); | ||
} | ||
} | ||
@@ -92,0 +155,0 @@ }; |
@@ -8,2 +8,3 @@ /* | ||
const { cssExportConvention } = require("../util/conventions"); | ||
const createHash = require("../util/createHash"); | ||
@@ -21,2 +22,3 @@ const { makePathsRelative } = require("../util/identifier"); | ||
/** @typedef {import("../Dependency").ExportsSpec} ExportsSpec */ | ||
/** @typedef {import("../Dependency").UpdateHashContext} UpdateHashContext */ | ||
/** @typedef {import("../DependencyTemplate").CssDependencyTemplateContext} DependencyTemplateContext */ | ||
@@ -30,2 +32,3 @@ /** @typedef {import("../ModuleGraph")} ModuleGraph */ | ||
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ | ||
/** @typedef {import("../util/Hash")} Hash */ | ||
@@ -95,2 +98,15 @@ /** | ||
/** | ||
* @param {string} name export name | ||
* @param {CssGeneratorExportsConvention} convention convention of the export name | ||
* @returns {string[]} convention results | ||
*/ | ||
getExportsConventionNames(name, convention) { | ||
if (this._conventionNames) { | ||
return this._conventionNames; | ||
} | ||
this._conventionNames = cssExportConvention(this.name, convention); | ||
return this._conventionNames; | ||
} | ||
/** | ||
* Returns the exported names | ||
@@ -101,10 +117,12 @@ * @param {ModuleGraph} moduleGraph module graph | ||
getExports(moduleGraph) { | ||
const name = this.name; | ||
const module = /** @type {CssModule} */ (moduleGraph.getParentModule(this)); | ||
const convention = /** @type {CssGenerator | CssExportsGenerator} */ ( | ||
module.generator | ||
).convention; | ||
const names = this.getExportsConventionNames(this.name, convention); | ||
return { | ||
exports: [ | ||
{ | ||
name, | ||
canMangle: true | ||
} | ||
], | ||
exports: names.map(name => ({ | ||
name, | ||
canMangle: true | ||
})), | ||
dependencies: undefined | ||
@@ -115,2 +133,25 @@ }; | ||
/** | ||
* Update the hash | ||
* @param {Hash} hash hash to be updated | ||
* @param {UpdateHashContext} context context | ||
* @returns {void} | ||
*/ | ||
updateHash(hash, { chunkGraph }) { | ||
const module = /** @type {CssModule} */ ( | ||
chunkGraph.moduleGraph.getParentModule(this) | ||
); | ||
const generator = /** @type {CssGenerator | CssExportsGenerator} */ ( | ||
module.generator | ||
); | ||
const names = this.getExportsConventionNames( | ||
this.name, | ||
generator.convention | ||
); | ||
hash.update(`exportsConvention`); | ||
hash.update(JSON.stringify(names)); | ||
hash.update(`localIdentName`); | ||
hash.update(generator.localIdentName); | ||
} | ||
/** | ||
* @param {ObjectSerializerContext} context context | ||
@@ -167,3 +208,3 @@ */ | ||
{ | ||
module, | ||
module: m, | ||
moduleGraph, | ||
@@ -177,16 +218,20 @@ chunkGraph, | ||
const dep = /** @type {CssLocalIdentifierDependency} */ (dependency); | ||
const used = moduleGraph | ||
.getExportInfo(module, dep.name) | ||
.getUsedName(dep.name, runtime); | ||
const module = /** @type {CssModule} */ (m); | ||
const convention = /** @type {CssGenerator | CssExportsGenerator} */ ( | ||
module.generator | ||
).convention; | ||
const names = dep.getExportsConventionNames(dep.name, convention); | ||
const usedNames = /** @type {string[]} */ ( | ||
names | ||
.map(name => | ||
moduleGraph.getExportInfo(module, name).getUsedName(name, runtime) | ||
) | ||
.filter(Boolean) | ||
); | ||
if (usedNames.length === 0) return; | ||
if (!used) return; | ||
// use the first usedName to generate localIdent, it's shorter when mangle exports enabled | ||
const localIdent = | ||
dep.prefix + | ||
getLocalIdent( | ||
used, | ||
/** @type {CssModule} */ (module), | ||
chunkGraph, | ||
runtimeTemplate | ||
); | ||
getLocalIdent(usedNames[0], module, chunkGraph, runtimeTemplate); | ||
source.replace( | ||
@@ -197,3 +242,5 @@ dep.range[0], | ||
); | ||
if (used) cssExportsData.exports.set(used, localIdent); | ||
for (const used of usedNames) { | ||
cssExportsData.exports.set(used, localIdent); | ||
} | ||
} | ||
@@ -200,0 +247,0 @@ }; |
@@ -347,2 +347,3 @@ /* | ||
if (dep.referencedPropertiesInDestructuring) { | ||
const prefixedIds = ids[0] === "default" ? ids.slice(1) : ids; | ||
for (let { | ||
@@ -353,4 +354,3 @@ id, | ||
} of dep.referencedPropertiesInDestructuring) { | ||
const concatedIds = ids.concat([id]); | ||
if (concatedIds[0] === "default") concatedIds.shift(); | ||
const concatedIds = prefixedIds.concat([id]); | ||
const module = moduleGraph.getModule(dep); | ||
@@ -357,0 +357,0 @@ const used = moduleGraph |
@@ -19,2 +19,3 @@ /* | ||
const { updateHashForEntryStartup } = require("../javascript/StartupHelpers"); | ||
const { getUndoPath } = require("../util/identifier"); | ||
@@ -90,7 +91,5 @@ /** @typedef {import("../Chunk")} Chunk */ | ||
) | ||
.replace(/^\/+/g, "") | ||
.split("/"); | ||
// remove filename, we only need the directory | ||
currentOutputName.pop(); | ||
/** | ||
@@ -113,8 +112,9 @@ * @param {Chunk} chunk the chunk | ||
) | ||
.replace(/^\/+/g, "") | ||
.split("/"); | ||
// remove common parts | ||
// remove common parts except filename | ||
while ( | ||
baseOutputName.length > 0 && | ||
chunkOutputName.length > 0 && | ||
baseOutputName.length > 1 && | ||
chunkOutputName.length > 1 && | ||
baseOutputName[0] === chunkOutputName[0] | ||
@@ -125,7 +125,6 @@ ) { | ||
} | ||
const last = chunkOutputName.join("/"); | ||
// create final path | ||
return ( | ||
(baseOutputName.length > 0 | ||
? "../".repeat(baseOutputName.length) | ||
: "./") + chunkOutputName.join("/") | ||
getUndoPath(baseOutputName.join("/"), last, true) + last | ||
); | ||
@@ -132,0 +131,0 @@ }; |
@@ -36,2 +36,3 @@ /* | ||
set.add(RuntimeGlobals.onChunksLoaded); | ||
set.add(RuntimeGlobals.exports); | ||
set.add(RuntimeGlobals.require); | ||
@@ -38,0 +39,0 @@ } |
@@ -11,2 +11,3 @@ /* | ||
const Template = require("../Template"); | ||
const { getUndoPath } = require("../util/identifier"); | ||
const { | ||
@@ -83,2 +84,3 @@ getChunkFilenameTemplate, | ||
) | ||
.replace(/^\/+/g, "") | ||
.split("/"); | ||
@@ -96,11 +98,9 @@ const runtimeOutputName = compilation | ||
) | ||
.replace(/^\/+/g, "") | ||
.split("/"); | ||
// remove filename, we only need the directory | ||
currentOutputName.pop(); | ||
// remove common parts | ||
while ( | ||
currentOutputName.length > 0 && | ||
runtimeOutputName.length > 0 && | ||
currentOutputName.length > 1 && | ||
runtimeOutputName.length > 1 && | ||
currentOutputName[0] === runtimeOutputName[0] | ||
@@ -111,8 +111,6 @@ ) { | ||
} | ||
const last = runtimeOutputName.join("/"); | ||
// create final path | ||
const runtimePath = | ||
(currentOutputName.length > 0 | ||
? "../".repeat(currentOutputName.length) | ||
: "./") + runtimeOutputName.join("/"); | ||
getUndoPath(currentOutputName.join("/"), last, true) + last; | ||
@@ -119,0 +117,0 @@ const entrySource = new ConcatSource(); |
@@ -438,2 +438,3 @@ /* | ||
set.add(RuntimeGlobals.onChunksLoaded); | ||
set.add(RuntimeGlobals.exports); | ||
set.add(RuntimeGlobals.require); | ||
@@ -825,3 +826,7 @@ } | ||
const startupSource = new ConcatSource(); | ||
startupSource.add(`var ${RuntimeGlobals.exports} = {};\n`); | ||
if (runtimeRequirements.has(RuntimeGlobals.exports)) { | ||
startupSource.add(`var ${RuntimeGlobals.exports} = {};\n`); | ||
} | ||
const renamedInlinedModule = this.renameInlineModule( | ||
@@ -828,0 +833,0 @@ allModules, |
@@ -359,3 +359,3 @@ /* | ||
runtimeRequirements(chunk, set, libraryContext) { | ||
// we don't need to return exports from runtime | ||
set.add(RuntimeGlobals.exports); | ||
} | ||
@@ -362,0 +362,0 @@ |
@@ -81,3 +81,4 @@ /* | ||
type, | ||
nsObjectUsed: type !== "module" | ||
nsObjectUsed: !["module", "modern-module"].includes(type), | ||
runtimeExportsUsed: type !== "modern-module" | ||
}).apply(compiler); | ||
@@ -242,2 +243,10 @@ }; | ||
} | ||
case "modern-module": { | ||
enableExportProperty(); | ||
const ModernModuleLibraryPlugin = require("./ModernModuleLibraryPlugin"); | ||
new ModernModuleLibraryPlugin({ | ||
type | ||
}).apply(compiler); | ||
break; | ||
} | ||
default: | ||
@@ -244,0 +253,0 @@ throw new Error(`Unsupported library type ${type}. |
@@ -33,2 +33,3 @@ /* | ||
* @property {boolean} nsObjectUsed the namespace object is used | ||
* @property {boolean} runtimeExportsUsed runtime exports are used | ||
*/ | ||
@@ -43,3 +44,3 @@ /** | ||
*/ | ||
constructor({ type, nsObjectUsed }) { | ||
constructor({ type, nsObjectUsed, runtimeExportsUsed }) { | ||
super({ | ||
@@ -50,2 +51,3 @@ pluginName: "ExportPropertyLibraryPlugin", | ||
this.nsObjectUsed = nsObjectUsed; | ||
this.runtimeExportsUsed = runtimeExportsUsed; | ||
} | ||
@@ -99,3 +101,7 @@ | ||
*/ | ||
runtimeRequirements(chunk, set, libraryContext) {} | ||
runtimeRequirements(chunk, set, libraryContext) { | ||
if (this.runtimeExportsUsed) { | ||
set.add(RuntimeGlobals.exports); | ||
} | ||
} | ||
@@ -102,0 +108,0 @@ /** |
@@ -870,5 +870,10 @@ /* | ||
const isBinaryModule = | ||
this.generatorOptions && this.generatorOptions.binary !== undefined | ||
? this.generatorOptions.binary | ||
: this.binary; | ||
this._source = this.createSource( | ||
/** @type {string} */ (options.context), | ||
this.binary ? asBuffer(source) : asString(source), | ||
isBinaryModule ? asBuffer(source) : asString(source), | ||
sourceMap, | ||
@@ -875,0 +880,0 @@ compilation.compiler.root |
@@ -10,2 +10,3 @@ /* | ||
const Referencer = require("eslint-scope/lib/referencer"); | ||
const { SyncBailHook } = require("tapable"); | ||
const { | ||
@@ -632,2 +633,10 @@ CachedSource, | ||
/** | ||
* @typedef {object} ConcatenateModuleHooks | ||
* @property {SyncBailHook<[Record<string, string>]>} exportsDefinitions | ||
*/ | ||
/** @type {WeakMap<Compilation, ConcatenateModuleHooks>} */ | ||
const compilationHooksMap = new WeakMap(); | ||
class ConcatenatedModule extends Module { | ||
@@ -638,2 +647,3 @@ /** | ||
* @param {RuntimeSpec} runtime the runtime | ||
* @param {Compilation} compilation the compilation | ||
* @param {object=} associatedObjectForCache object for caching | ||
@@ -647,2 +657,3 @@ * @param {string | HashConstructor=} hashFunction hash function to use | ||
runtime, | ||
compilation, | ||
associatedObjectForCache, | ||
@@ -661,3 +672,4 @@ hashFunction = "md4" | ||
modules, | ||
runtime | ||
runtime, | ||
compilation | ||
}); | ||
@@ -667,2 +679,17 @@ } | ||
/** | ||
* @param {Compilation} compilation the compilation | ||
* @returns {ConcatenateModuleHooks} the attached hooks | ||
*/ | ||
static getCompilationHooks(compilation) { | ||
let hooks = compilationHooksMap.get(compilation); | ||
if (hooks === undefined) { | ||
hooks = { | ||
exportsDefinitions: new SyncBailHook(["definitions"]) | ||
}; | ||
compilationHooksMap.set(compilation, hooks); | ||
} | ||
return hooks; | ||
} | ||
/** | ||
* @param {object} options options | ||
@@ -673,4 +700,5 @@ * @param {string} options.identifier the identifier of the module | ||
* @param {Set<Module>=} options.modules all concatenated modules | ||
* @param {Compilation} options.compilation the compilation | ||
*/ | ||
constructor({ identifier, rootModule, modules, runtime }) { | ||
constructor({ identifier, rootModule, modules, runtime, compilation }) { | ||
super(JAVASCRIPT_MODULE_TYPE_ESM, null, rootModule && rootModule.layer); | ||
@@ -687,2 +715,4 @@ | ||
this.factoryMeta = rootModule && rootModule.factoryMeta; | ||
/** @type {Compilation | undefined} */ | ||
this.compilation = compilation; | ||
} | ||
@@ -1438,2 +1468,4 @@ | ||
const exportsInfo = moduleGraph.getExportsInfo(rootInfo.module); | ||
/** @type {Record<string, string>} */ | ||
const exportsFinalName = {}; | ||
for (const exportInfo of exportsInfo.orderedExports) { | ||
@@ -1463,2 +1495,3 @@ const name = exportInfo.name; | ||
); | ||
exportsFinalName[used] = finalName; | ||
return `/* ${ | ||
@@ -1479,2 +1512,3 @@ exportInfo.isReexport() ? "reexport" : "binding" | ||
// add harmony compatibility flag (must be first because of possible circular dependencies) | ||
let shouldAddHarmonyFlag = false; | ||
if ( | ||
@@ -1484,9 +1518,3 @@ moduleGraph.getExportsInfo(this).otherExportsInfo.getUsed(runtime) !== | ||
) { | ||
result.add(`// ESM COMPAT FLAG\n`); | ||
result.add( | ||
runtimeTemplate.defineEsModuleFlagStatement({ | ||
exportsArgument: this.exportsArgument, | ||
runtimeRequirements | ||
}) | ||
); | ||
shouldAddHarmonyFlag = true; | ||
} | ||
@@ -1496,4 +1524,6 @@ | ||
if (exportsMap.size > 0) { | ||
runtimeRequirements.add(RuntimeGlobals.exports); | ||
runtimeRequirements.add(RuntimeGlobals.definePropertyGetters); | ||
const { exportsDefinitions } = ConcatenatedModule.getCompilationHooks( | ||
this.compilation | ||
); | ||
const definitions = []; | ||
@@ -1507,8 +1537,28 @@ for (const [key, value] of exportsMap) { | ||
} | ||
result.add(`\n// EXPORTS\n`); | ||
result.add( | ||
`${RuntimeGlobals.definePropertyGetters}(${ | ||
this.exportsArgument | ||
}, {${definitions.join(",")}\n});\n` | ||
); | ||
const shouldSkipRenderDefinitions = | ||
exportsDefinitions.call(exportsFinalName); | ||
if (!shouldSkipRenderDefinitions) { | ||
runtimeRequirements.add(RuntimeGlobals.exports); | ||
runtimeRequirements.add(RuntimeGlobals.definePropertyGetters); | ||
if (shouldAddHarmonyFlag) { | ||
result.add(`// ESM COMPAT FLAG\n`); | ||
result.add( | ||
runtimeTemplate.defineEsModuleFlagStatement({ | ||
exportsArgument: this.exportsArgument, | ||
runtimeRequirements | ||
}) | ||
); | ||
} | ||
result.add(`\n// EXPORTS\n`); | ||
result.add( | ||
`${RuntimeGlobals.definePropertyGetters}(${ | ||
this.exportsArgument | ||
}, {${definitions.join(",")}\n});\n` | ||
); | ||
} else { | ||
this.buildMeta.exportsFinalName = exportsFinalName; | ||
} | ||
} | ||
@@ -1930,3 +1980,4 @@ | ||
modules: undefined, | ||
runtime: undefined | ||
runtime: undefined, | ||
compilation: undefined | ||
}); | ||
@@ -1933,0 +1984,0 @@ obj.deserialize(context); |
@@ -401,2 +401,3 @@ /* | ||
// Create a new ConcatenatedModule | ||
ConcatenatedModule.getCompilationHooks(compilation); | ||
let newModule = ConcatenatedModule.create( | ||
@@ -406,2 +407,3 @@ rootModule, | ||
concatConfiguration.runtime, | ||
compilation, | ||
compiler.root, | ||
@@ -408,0 +410,0 @@ compilation.outputOptions.hashFunction |
@@ -38,2 +38,3 @@ /* | ||
set.add(RuntimeGlobals.onChunksLoaded); | ||
set.add(RuntimeGlobals.exports); | ||
compilation.addRuntimeModule( | ||
@@ -40,0 +41,0 @@ chunk, |
@@ -210,22 +210,27 @@ /* | ||
} | ||
let fn = "load"; | ||
const args = [JSON.stringify(shareScope), JSON.stringify(shareKey)]; | ||
const args = [ | ||
JSON.stringify(shareScope), | ||
JSON.stringify(shareKey), | ||
JSON.stringify(eager) | ||
]; | ||
if (requiredVersion) { | ||
if (strictVersion) { | ||
fn += "Strict"; | ||
} | ||
if (singleton) { | ||
fn += "Singleton"; | ||
} | ||
args.push(stringifyHoley(requiredVersion)); | ||
fn += "VersionCheck"; | ||
} else { | ||
if (singleton) { | ||
fn += "Singleton"; | ||
} | ||
} | ||
if (fallbackCode) { | ||
fn += "Fallback"; | ||
args.push(fallbackCode); | ||
} | ||
let fn; | ||
if (requiredVersion) { | ||
if (strictVersion) { | ||
fn = singleton ? "loadStrictSingletonVersion" : "loadStrictVersion"; | ||
} else { | ||
fn = singleton ? "loadSingletonVersion" : "loadVersion"; | ||
} | ||
} else { | ||
fn = singleton ? "loadSingleton" : "load"; | ||
} | ||
const code = runtimeTemplate.returningFunction(`${fn}(${args.join(", ")})`); | ||
@@ -232,0 +237,0 @@ const sources = new Map(); |
@@ -98,59 +98,35 @@ /* | ||
satisfyRuntimeCode(runtimeTemplate), | ||
`var ensureExistence = ${runtimeTemplate.basicFunction("scopeName, key", [ | ||
`var scope = ${RuntimeGlobals.shareScopeMap}[scopeName];`, | ||
`if(!scope || !${RuntimeGlobals.hasOwnProperty}(scope, key)) throw new Error("Shared module " + key + " doesn't exist in shared scope " + scopeName);`, | ||
"return scope;" | ||
`var exists = ${runtimeTemplate.basicFunction("scope, key", [ | ||
`return scope && ${RuntimeGlobals.hasOwnProperty}(scope, key);` | ||
])}`, | ||
`var get = ${runtimeTemplate.basicFunction("entry", [ | ||
"entry.loaded = 1;", | ||
"return entry.get()" | ||
])};`, | ||
`var findVersion = ${runtimeTemplate.basicFunction("scope, key", [ | ||
"var versions = scope[key];", | ||
`var key = Object.keys(versions).reduce(${runtimeTemplate.basicFunction( | ||
"a, b", | ||
["return !a || versionLt(a, b) ? b : a;"] | ||
)}, 0);`, | ||
"return key && versions[key]" | ||
`var eagerOnly = ${runtimeTemplate.basicFunction("versions", [ | ||
`return Object.keys(versions).reduce(${runtimeTemplate.basicFunction( | ||
"filtered, version", | ||
Template.indent([ | ||
"if (versions[version].eager) {", | ||
Template.indent(["filtered[version] = versions[version];"]), | ||
"}", | ||
"return filtered;" | ||
]) | ||
)}, {});` | ||
])};`, | ||
`var findSingletonVersionKey = ${runtimeTemplate.basicFunction( | ||
"scope, key", | ||
`var findLatestVersion = ${runtimeTemplate.basicFunction( | ||
"scope, key, eager", | ||
[ | ||
"var versions = scope[key];", | ||
`return Object.keys(versions).reduce(${runtimeTemplate.basicFunction( | ||
"var versions = eager ? eagerOnly(scope[key]) : scope[key];", | ||
`var key = Object.keys(versions).reduce(${runtimeTemplate.basicFunction( | ||
"a, b", | ||
["return !a || (!versions[a].loaded && versionLt(a, b)) ? b : a;"] | ||
)}, 0);` | ||
["return !a || versionLt(a, b) ? b : a;"] | ||
)}, 0);`, | ||
"return key && versions[key];" | ||
] | ||
)};`, | ||
`var getInvalidSingletonVersionMessage = ${runtimeTemplate.basicFunction( | ||
"scope, key, version, requiredVersion", | ||
`var findSatisfyingVersion = ${runtimeTemplate.basicFunction( | ||
"scope, key, requiredVersion, eager", | ||
[ | ||
`return "Unsatisfied version " + version + " from " + (version && scope[key][version].from) + " of shared singleton module " + key + " (required " + rangeToString(requiredVersion) + ")"` | ||
] | ||
)};`, | ||
`var getSingleton = ${runtimeTemplate.basicFunction( | ||
"scope, scopeName, key, requiredVersion", | ||
[ | ||
"var version = findSingletonVersionKey(scope, key);", | ||
"return get(scope[key][version]);" | ||
] | ||
)};`, | ||
`var getSingletonVersion = ${runtimeTemplate.basicFunction( | ||
"scope, scopeName, key, requiredVersion", | ||
[ | ||
"var version = findSingletonVersionKey(scope, key);", | ||
"if (!satisfy(requiredVersion, version)) warn(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));", | ||
"return get(scope[key][version]);" | ||
] | ||
)};`, | ||
`var getStrictSingletonVersion = ${runtimeTemplate.basicFunction( | ||
"scope, scopeName, key, requiredVersion", | ||
[ | ||
"var version = findSingletonVersionKey(scope, key);", | ||
"if (!satisfy(requiredVersion, version)) " + | ||
"throw new Error(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));", | ||
"return get(scope[key][version]);" | ||
] | ||
)};`, | ||
`var findValidVersion = ${runtimeTemplate.basicFunction( | ||
"scope, key, requiredVersion", | ||
[ | ||
"var versions = scope[key];", | ||
"var versions = eager ? eagerOnly(scope[key]) : scope[key];", | ||
`var key = Object.keys(versions).reduce(${runtimeTemplate.basicFunction( | ||
@@ -166,7 +142,23 @@ "a, b", | ||
)};`, | ||
`var findSingletonVersionKey = ${runtimeTemplate.basicFunction( | ||
"scope, key, eager", | ||
[ | ||
"var versions = eager ? eagerOnly(scope[key]) : scope[key];", | ||
`return Object.keys(versions).reduce(${runtimeTemplate.basicFunction( | ||
"a, b", | ||
["return !a || (!versions[a].loaded && versionLt(a, b)) ? b : a;"] | ||
)}, 0);` | ||
] | ||
)};`, | ||
`var getInvalidSingletonVersionMessage = ${runtimeTemplate.basicFunction( | ||
"scope, key, version, requiredVersion", | ||
[ | ||
'return "Unsatisfied version " + version + " from " + (version && scope[key][version].from) + " of shared singleton module " + key + " (required " + rangeToString(requiredVersion) + ")"' | ||
] | ||
)};`, | ||
`var getInvalidVersionMessage = ${runtimeTemplate.basicFunction( | ||
"scope, scopeName, key, requiredVersion", | ||
"scope, scopeName, key, requiredVersion, eager", | ||
[ | ||
"var versions = scope[key];", | ||
'return "No satisfying version (" + rangeToString(requiredVersion) + ") of shared module " + key + " found in shared scope " + scopeName + ".\\n" +', | ||
'return "No satisfying version (" + rangeToString(requiredVersion) + ")" + (eager ? " for eager consumption" : "") + " of shared module " + key + " found in shared scope " + scopeName + ".\\n" +', | ||
`\t"Available versions: " + Object.keys(versions).map(${runtimeTemplate.basicFunction( | ||
@@ -178,11 +170,9 @@ "key", | ||
)};`, | ||
`var getValidVersion = ${runtimeTemplate.basicFunction( | ||
"scope, scopeName, key, requiredVersion", | ||
[ | ||
"var entry = findValidVersion(scope, key, requiredVersion);", | ||
"if(entry) return get(entry);", | ||
"throw new Error(getInvalidVersionMessage(scope, scopeName, key, requiredVersion));" | ||
] | ||
)};`, | ||
`var warn = ${ | ||
`var fail = ${runtimeTemplate.basicFunction("msg", [ | ||
"throw new Error(msg);" | ||
])}`, | ||
`var failAsNotExist = ${runtimeTemplate.basicFunction("scopeName, key", [ | ||
'return fail("Shared module " + key + " doesn\'t exist in shared scope " + scopeName);' | ||
])}`, | ||
`var warn = /*#__PURE__*/ ${ | ||
compilation.outputOptions.ignoreBrowserWarnings | ||
@@ -194,19 +184,14 @@ ? runtimeTemplate.basicFunction("", "") | ||
};`, | ||
`var warnInvalidVersion = ${runtimeTemplate.basicFunction( | ||
"scope, scopeName, key, requiredVersion", | ||
[ | ||
"warn(getInvalidVersionMessage(scope, scopeName, key, requiredVersion));" | ||
] | ||
)};`, | ||
`var get = ${runtimeTemplate.basicFunction("entry", [ | ||
"entry.loaded = 1;", | ||
"return entry.get()" | ||
])};`, | ||
`var init = ${runtimeTemplate.returningFunction( | ||
Template.asString([ | ||
"function(scopeName, a, b, c) {", | ||
"function(scopeName, key, eager, c, d) {", | ||
Template.indent([ | ||
`var promise = ${RuntimeGlobals.initializeSharing}(scopeName);`, | ||
`if (promise && promise.then) return promise.then(fn.bind(fn, scopeName, ${RuntimeGlobals.shareScopeMap}[scopeName], a, b, c));`, | ||
`return fn(scopeName, ${RuntimeGlobals.shareScopeMap}[scopeName], a, b, c);` | ||
// if we require eager shared, we expect it to be already loaded before it requested, no need to wait the whole scope loaded. | ||
"if (promise && promise.then && !eager) { ", | ||
Template.indent([ | ||
`return promise.then(fn.bind(fn, scopeName, ${RuntimeGlobals.shareScopeMap}[scopeName], key, false, c, d));` | ||
]), | ||
"}", | ||
`return fn(scopeName, ${RuntimeGlobals.shareScopeMap}[scopeName], key, eager, c, d);` | ||
]), | ||
@@ -218,85 +203,67 @@ "}" | ||
"", | ||
`var useFallback = ${runtimeTemplate.basicFunction( | ||
"scopeName, key, fallback", | ||
["return fallback ? fallback() : failAsNotExist(scopeName, key);"] | ||
)}`, | ||
`var load = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key", | ||
"scopeName, scope, key, eager, fallback", | ||
[ | ||
"ensureExistence(scopeName, key);", | ||
"return get(findVersion(scope, key));" | ||
"if (!exists(scope, key)) return useFallback(scopeName, key, fallback);", | ||
"return get(findLatestVersion(scope, key, eager));" | ||
] | ||
)});`, | ||
`var loadFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, fallback", | ||
`var loadVersion = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, eager, requiredVersion, fallback", | ||
[ | ||
`return scope && ${RuntimeGlobals.hasOwnProperty}(scope, key) ? get(findVersion(scope, key)) : fallback();` | ||
"if (!exists(scope, key)) return useFallback(scopeName, key, fallback);", | ||
"var satisfyingVersion = findSatisfyingVersion(scope, key, requiredVersion, eager);", | ||
"if (satisfyingVersion) return get(satisfyingVersion);", | ||
"warn(getInvalidVersionMessage(scope, scopeName, key, requiredVersion, eager))", | ||
"return get(findLatestVersion(scope, key, eager));" | ||
] | ||
)});`, | ||
`var loadVersionCheck = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, version", | ||
`var loadStrictVersion = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, eager, requiredVersion, fallback", | ||
[ | ||
"ensureExistence(scopeName, key);", | ||
"return get(findValidVersion(scope, key, version) || warnInvalidVersion(scope, scopeName, key, version) || findVersion(scope, key));" | ||
"if (!exists(scope, key)) return useFallback(scopeName, key, fallback);", | ||
"var satisfyingVersion = findSatisfyingVersion(scope, key, requiredVersion, eager);", | ||
"if (satisfyingVersion) return get(satisfyingVersion);", | ||
"if (fallback) return fallback();", | ||
"fail(getInvalidVersionMessage(scope, scopeName, key, requiredVersion, eager));" | ||
] | ||
)});`, | ||
`var loadSingleton = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key", | ||
"scopeName, scope, key, eager, fallback", | ||
[ | ||
"ensureExistence(scopeName, key);", | ||
"return getSingleton(scope, scopeName, key);" | ||
"if (!exists(scope, key)) return useFallback(scopeName, key, fallback);", | ||
"var version = findSingletonVersionKey(scope, key, eager);", | ||
"return get(scope[key][version]);" | ||
] | ||
)});`, | ||
`var loadSingletonVersionCheck = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, version", | ||
`var loadSingletonVersion = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, eager, requiredVersion, fallback", | ||
[ | ||
"ensureExistence(scopeName, key);", | ||
"return getSingletonVersion(scope, scopeName, key, version);" | ||
"if (!exists(scope, key)) return useFallback(scopeName, key, fallback);", | ||
"var version = findSingletonVersionKey(scope, key, eager);", | ||
"if (!satisfy(requiredVersion, version)) {", | ||
Template.indent([ | ||
"warn(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));" | ||
]), | ||
"}", | ||
"return get(scope[key][version]);" | ||
] | ||
)});`, | ||
`var loadStrictVersionCheck = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, version", | ||
`var loadStrictSingletonVersion = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, eager, requiredVersion, fallback", | ||
[ | ||
"ensureExistence(scopeName, key);", | ||
"return getValidVersion(scope, scopeName, key, version);" | ||
"if (!exists(scope, key)) return useFallback(scopeName, key, fallback);", | ||
"var version = findSingletonVersionKey(scope, key, eager);", | ||
"if (!satisfy(requiredVersion, version)) {", | ||
Template.indent([ | ||
"fail(getInvalidSingletonVersionMessage(scope, key, version, requiredVersion));" | ||
]), | ||
"}", | ||
"return get(scope[key][version]);" | ||
] | ||
)});`, | ||
`var loadStrictSingletonVersionCheck = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, version", | ||
[ | ||
"ensureExistence(scopeName, key);", | ||
"return getStrictSingletonVersion(scope, scopeName, key, version);" | ||
] | ||
)});`, | ||
`var loadVersionCheckFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, version, fallback", | ||
[ | ||
`if(!scope || !${RuntimeGlobals.hasOwnProperty}(scope, key)) return fallback();`, | ||
"return get(findValidVersion(scope, key, version) || warnInvalidVersion(scope, scopeName, key, version) || findVersion(scope, key));" | ||
] | ||
)});`, | ||
`var loadSingletonFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, fallback", | ||
[ | ||
`if(!scope || !${RuntimeGlobals.hasOwnProperty}(scope, key)) return fallback();`, | ||
"return getSingleton(scope, scopeName, key);" | ||
] | ||
)});`, | ||
`var loadSingletonVersionCheckFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, version, fallback", | ||
[ | ||
`if(!scope || !${RuntimeGlobals.hasOwnProperty}(scope, key)) return fallback();`, | ||
"return getSingletonVersion(scope, scopeName, key, version);" | ||
] | ||
)});`, | ||
`var loadStrictVersionCheckFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, version, fallback", | ||
[ | ||
`var entry = scope && ${RuntimeGlobals.hasOwnProperty}(scope, key) && findValidVersion(scope, key, version);`, | ||
`return entry ? get(entry) : fallback();` | ||
] | ||
)});`, | ||
`var loadStrictSingletonVersionCheckFallback = /*#__PURE__*/ init(${runtimeTemplate.basicFunction( | ||
"scopeName, scope, key, version, fallback", | ||
[ | ||
`if(!scope || !${RuntimeGlobals.hasOwnProperty}(scope, key)) return fallback();`, | ||
"return getStrictSingletonVersion(scope, scopeName, key, version);" | ||
] | ||
)});`, | ||
"var installedModules = {};", | ||
@@ -303,0 +270,0 @@ "var moduleToHandlerMapping = {", |
@@ -15,2 +15,3 @@ /* | ||
/** @typedef {import("../declarations/WebpackOptions").JavascriptParserOptions} JavascriptParserOptions */ | ||
/** @typedef {import("./Compiler")} Compiler */ | ||
@@ -36,4 +37,5 @@ /** @typedef {import("./Dependency").DependencyLocation} DependencyLocation */ | ||
* @param {JavascriptParser} parser the parser | ||
* @param {JavascriptParserOptions} parserOptions the javascript parser options | ||
*/ | ||
const handler = parser => { | ||
const handler = (parser, parserOptions) => { | ||
parser.hooks.program.tap(PLUGIN_NAME, ast => { | ||
@@ -59,2 +61,7 @@ const firstNode = ast.body[0]; | ||
} | ||
if (parserOptions.overrideStrict) { | ||
/** @type {BuildInfo} */ | ||
(parser.state.module.buildInfo).strict = | ||
parserOptions.overrideStrict === "strict"; | ||
} | ||
}); | ||
@@ -61,0 +68,0 @@ }; |
@@ -13,3 +13,3 @@ /* | ||
* @param {CssGeneratorExportsConvention | undefined} convention convention | ||
* @returns {Set<string>} results | ||
* @returns {string[]} results | ||
*/ | ||
@@ -46,3 +46,3 @@ exports.cssExportConvention = (input, convention) => { | ||
} | ||
return set; | ||
return Array.from(set); | ||
}; | ||
@@ -49,0 +49,0 @@ |
@@ -289,2 +289,7 @@ /* | ||
} | ||
if (options.output.enabledLibraryTypes.includes("modern-module")) { | ||
throw new Error( | ||
"library type \"modern-module\" is only allowed when 'experiments.outputModule' is enabled" | ||
); | ||
} | ||
if (options.externalsType === "module") { | ||
@@ -291,0 +296,0 @@ throw new Error( |
{ | ||
"name": "webpack", | ||
"version": "5.92.1", | ||
"version": "5.93.0", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -41,3 +41,3 @@ "description": "Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.", | ||
"@babel/preset-react": "^7.24.7", | ||
"@eslint/js": "^9.4.0", | ||
"@eslint/js": "^9.5.0", | ||
"@types/glob-to-regexp": "^0.4.4", | ||
@@ -60,3 +60,3 @@ "@types/jest": "^29.5.11", | ||
"es6-promise-polyfill": "^1.2.0", | ||
"eslint": "^9.4.0", | ||
"eslint": "^9.5.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
@@ -63,0 +63,0 @@ "eslint-plugin-jest": "^28.6.0", |
@@ -6,2 +6,2 @@ /* | ||
*/ | ||
const t=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;function n(t,{instancePath:r="",parentData:e,parentDataProperty:a,rootData:s=t}={}){let o=null,l=0;const i=l;let p=!1;const u=l;if(l==l)if(t&&"object"==typeof t&&!Array.isArray(t)){const n=l;for(const n in t)if("encoding"!==n&&"mimetype"!==n){const t={params:{additionalProperty:n}};null===o?o=[t]:o.push(t),l++;break}if(n===l){if(void 0!==t.encoding){let n=t.encoding;const r=l;if(!1!==n&&"base64"!==n){const t={params:{}};null===o?o=[t]:o.push(t),l++}var c=r===l}else c=!0;if(c)if(void 0!==t.mimetype){const n=l;if("string"!=typeof t.mimetype){const t={params:{type:"string"}};null===o?o=[t]:o.push(t),l++}c=n===l}else c=!0}}else{const t={params:{type:"object"}};null===o?o=[t]:o.push(t),l++}var f=u===l;if(p=p||f,!p){const n=l;if(!(t instanceof Function)){const t={params:{}};null===o?o=[t]:o.push(t),l++}f=n===l,p=p||f}if(!p){const t={params:{}};return null===o?o=[t]:o.push(t),l++,n.errors=o,!1}return l=i,null!==o&&(i?o.length=i:o=null),n.errors=o,0===l}function r(e,{instancePath:a="",parentData:s,parentDataProperty:o,rootData:l=e}={}){let i=null,p=0;if(0===p){if(!e||"object"!=typeof e||Array.isArray(e))return r.errors=[{params:{type:"object"}}],!1;{const s=p;for(const t in e)if("dataUrl"!==t&&"emit"!==t&&"filename"!==t&&"outputPath"!==t&&"publicPath"!==t)return r.errors=[{params:{additionalProperty:t}}],!1;if(s===p){if(void 0!==e.dataUrl){const t=p;n(e.dataUrl,{instancePath:a+"/dataUrl",parentData:e,parentDataProperty:"dataUrl",rootData:l})||(i=null===i?n.errors:i.concat(n.errors),p=i.length);var u=t===p}else u=!0;if(u){if(void 0!==e.emit){const t=p;if("boolean"!=typeof e.emit)return r.errors=[{params:{type:"boolean"}}],!1;u=t===p}else u=!0;if(u){if(void 0!==e.filename){let n=e.filename;const a=p,s=p;let o=!1;const l=p;if(p===l)if("string"==typeof n){if(n.includes("!")||!1!==t.test(n)){const t={params:{}};null===i?i=[t]:i.push(t),p++}else if(n.length<1){const t={params:{}};null===i?i=[t]:i.push(t),p++}}else{const t={params:{type:"string"}};null===i?i=[t]:i.push(t),p++}var c=l===p;if(o=o||c,!o){const t=p;if(!(n instanceof Function)){const t={params:{}};null===i?i=[t]:i.push(t),p++}c=t===p,o=o||c}if(!o){const t={params:{}};return null===i?i=[t]:i.push(t),p++,r.errors=i,!1}p=s,null!==i&&(s?i.length=s:i=null),u=a===p}else u=!0;if(u){if(void 0!==e.outputPath){let n=e.outputPath;const a=p,s=p;let o=!1;const l=p;if(p===l)if("string"==typeof n){if(n.includes("!")||!1!==t.test(n)){const t={params:{}};null===i?i=[t]:i.push(t),p++}}else{const t={params:{type:"string"}};null===i?i=[t]:i.push(t),p++}var f=l===p;if(o=o||f,!o){const t=p;if(!(n instanceof Function)){const t={params:{}};null===i?i=[t]:i.push(t),p++}f=t===p,o=o||f}if(!o){const t={params:{}};return null===i?i=[t]:i.push(t),p++,r.errors=i,!1}p=s,null!==i&&(s?i.length=s:i=null),u=a===p}else u=!0;if(u)if(void 0!==e.publicPath){let t=e.publicPath;const n=p,a=p;let s=!1;const o=p;if("string"!=typeof t){const t={params:{type:"string"}};null===i?i=[t]:i.push(t),p++}var h=o===p;if(s=s||h,!s){const n=p;if(!(t instanceof Function)){const t={params:{}};null===i?i=[t]:i.push(t),p++}h=n===p,s=s||h}if(!s){const t={params:{}};return null===i?i=[t]:i.push(t),p++,r.errors=i,!1}p=a,null!==i&&(a?i.length=a:i=null),u=n===p}else u=!0}}}}}}return r.errors=i,0===p}function e(t,{instancePath:n="",parentData:a,parentDataProperty:s,rootData:o=t}={}){let l=null,i=0;return r(t,{instancePath:n,parentData:a,parentDataProperty:s,rootData:o})||(l=null===l?r.errors:l.concat(r.errors),i=l.length),e.errors=l,0===i}module.exports=e,module.exports.default=e; | ||
const t=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;function n(t,{instancePath:r="",parentData:e,parentDataProperty:a,rootData:s=t}={}){let o=null,l=0;const i=l;let p=!1;const u=l;if(l==l)if(t&&"object"==typeof t&&!Array.isArray(t)){const n=l;for(const n in t)if("encoding"!==n&&"mimetype"!==n){const t={params:{additionalProperty:n}};null===o?o=[t]:o.push(t),l++;break}if(n===l){if(void 0!==t.encoding){let n=t.encoding;const r=l;if(!1!==n&&"base64"!==n){const t={params:{}};null===o?o=[t]:o.push(t),l++}var c=r===l}else c=!0;if(c)if(void 0!==t.mimetype){const n=l;if("string"!=typeof t.mimetype){const t={params:{type:"string"}};null===o?o=[t]:o.push(t),l++}c=n===l}else c=!0}}else{const t={params:{type:"object"}};null===o?o=[t]:o.push(t),l++}var f=u===l;if(p=p||f,!p){const n=l;if(!(t instanceof Function)){const t={params:{}};null===o?o=[t]:o.push(t),l++}f=n===l,p=p||f}if(!p){const t={params:{}};return null===o?o=[t]:o.push(t),l++,n.errors=o,!1}return l=i,null!==o&&(i?o.length=i:o=null),n.errors=o,0===l}function r(e,{instancePath:a="",parentData:s,parentDataProperty:o,rootData:l=e}={}){let i=null,p=0;if(0===p){if(!e||"object"!=typeof e||Array.isArray(e))return r.errors=[{params:{type:"object"}}],!1;{const s=p;for(const t in e)if("binary"!==t&&"dataUrl"!==t&&"emit"!==t&&"filename"!==t&&"outputPath"!==t&&"publicPath"!==t)return r.errors=[{params:{additionalProperty:t}}],!1;if(s===p){if(void 0!==e.binary){const t=p;if("boolean"!=typeof e.binary)return r.errors=[{params:{type:"boolean"}}],!1;var u=t===p}else u=!0;if(u){if(void 0!==e.dataUrl){const t=p;n(e.dataUrl,{instancePath:a+"/dataUrl",parentData:e,parentDataProperty:"dataUrl",rootData:l})||(i=null===i?n.errors:i.concat(n.errors),p=i.length),u=t===p}else u=!0;if(u){if(void 0!==e.emit){const t=p;if("boolean"!=typeof e.emit)return r.errors=[{params:{type:"boolean"}}],!1;u=t===p}else u=!0;if(u){if(void 0!==e.filename){let n=e.filename;const a=p,s=p;let o=!1;const l=p;if(p===l)if("string"==typeof n){if(n.includes("!")||!1!==t.test(n)){const t={params:{}};null===i?i=[t]:i.push(t),p++}else if(n.length<1){const t={params:{}};null===i?i=[t]:i.push(t),p++}}else{const t={params:{type:"string"}};null===i?i=[t]:i.push(t),p++}var c=l===p;if(o=o||c,!o){const t=p;if(!(n instanceof Function)){const t={params:{}};null===i?i=[t]:i.push(t),p++}c=t===p,o=o||c}if(!o){const t={params:{}};return null===i?i=[t]:i.push(t),p++,r.errors=i,!1}p=s,null!==i&&(s?i.length=s:i=null),u=a===p}else u=!0;if(u){if(void 0!==e.outputPath){let n=e.outputPath;const a=p,s=p;let o=!1;const l=p;if(p===l)if("string"==typeof n){if(n.includes("!")||!1!==t.test(n)){const t={params:{}};null===i?i=[t]:i.push(t),p++}}else{const t={params:{type:"string"}};null===i?i=[t]:i.push(t),p++}var f=l===p;if(o=o||f,!o){const t=p;if(!(n instanceof Function)){const t={params:{}};null===i?i=[t]:i.push(t),p++}f=t===p,o=o||f}if(!o){const t={params:{}};return null===i?i=[t]:i.push(t),p++,r.errors=i,!1}p=s,null!==i&&(s?i.length=s:i=null),u=a===p}else u=!0;if(u)if(void 0!==e.publicPath){let t=e.publicPath;const n=p,a=p;let s=!1;const o=p;if("string"!=typeof t){const t={params:{type:"string"}};null===i?i=[t]:i.push(t),p++}var h=o===p;if(s=s||h,!s){const n=p;if(!(t instanceof Function)){const t={params:{}};null===i?i=[t]:i.push(t),p++}h=n===p,s=s||h}if(!s){const t={params:{}};return null===i?i=[t]:i.push(t),p++,r.errors=i,!1}p=a,null!==i&&(a?i.length=a:i=null),u=n===p}else u=!0}}}}}}}return r.errors=i,0===p}function e(t,{instancePath:n="",parentData:a,parentDataProperty:s,rootData:o=t}={}){let l=null,i=0;return r(t,{instancePath:n,parentData:a,parentDataProperty:s,rootData:o})||(l=null===l?r.errors:l.concat(r.errors),i=l.length),e.errors=l,0===i}module.exports=e,module.exports.default=e; |
@@ -6,2 +6,2 @@ /* | ||
*/ | ||
"use strict";function t(r,{instancePath:a="",parentData:n,parentDataProperty:e,rootData:o=r}={}){let s=null,l=0;const i=l;let p=!1;const c=l;if(l==l)if(r&&"object"==typeof r&&!Array.isArray(r)){const t=l;for(const t in r)if("encoding"!==t&&"mimetype"!==t){const r={params:{additionalProperty:t}};null===s?s=[r]:s.push(r),l++;break}if(t===l){if(void 0!==r.encoding){let t=r.encoding;const a=l;if(!1!==t&&"base64"!==t){const t={params:{}};null===s?s=[t]:s.push(t),l++}var u=a===l}else u=!0;if(u)if(void 0!==r.mimetype){const t=l;if("string"!=typeof r.mimetype){const t={params:{type:"string"}};null===s?s=[t]:s.push(t),l++}u=t===l}else u=!0}}else{const t={params:{type:"object"}};null===s?s=[t]:s.push(t),l++}var f=c===l;if(p=p||f,!p){const t=l;if(!(r instanceof Function)){const t={params:{}};null===s?s=[t]:s.push(t),l++}f=t===l,p=p||f}if(!p){const r={params:{}};return null===s?s=[r]:s.push(r),l++,t.errors=s,!1}return l=i,null!==s&&(i?s.length=i:s=null),t.errors=s,0===l}function r(a,{instancePath:n="",parentData:e,parentDataProperty:o,rootData:s=a}={}){let l=null,i=0;if(0===i){if(!a||"object"!=typeof a||Array.isArray(a))return r.errors=[{params:{type:"object"}}],!1;{const e=i;for(const t in a)if("dataUrl"!==t)return r.errors=[{params:{additionalProperty:t}}],!1;e===i&&void 0!==a.dataUrl&&(t(a.dataUrl,{instancePath:n+"/dataUrl",parentData:a,parentDataProperty:"dataUrl",rootData:s})||(l=null===l?t.errors:l.concat(t.errors),i=l.length))}}return r.errors=l,0===i}function a(t,{instancePath:n="",parentData:e,parentDataProperty:o,rootData:s=t}={}){let l=null,i=0;return r(t,{instancePath:n,parentData:e,parentDataProperty:o,rootData:s})||(l=null===l?r.errors:l.concat(r.errors),i=l.length),a.errors=l,0===i}module.exports=a,module.exports.default=a; | ||
"use strict";function t(r,{instancePath:a="",parentData:e,parentDataProperty:n,rootData:o=r}={}){let s=null,i=0;const l=i;let p=!1;const c=i;if(i==i)if(r&&"object"==typeof r&&!Array.isArray(r)){const t=i;for(const t in r)if("encoding"!==t&&"mimetype"!==t){const r={params:{additionalProperty:t}};null===s?s=[r]:s.push(r),i++;break}if(t===i){if(void 0!==r.encoding){let t=r.encoding;const a=i;if(!1!==t&&"base64"!==t){const t={params:{}};null===s?s=[t]:s.push(t),i++}var u=a===i}else u=!0;if(u)if(void 0!==r.mimetype){const t=i;if("string"!=typeof r.mimetype){const t={params:{type:"string"}};null===s?s=[t]:s.push(t),i++}u=t===i}else u=!0}}else{const t={params:{type:"object"}};null===s?s=[t]:s.push(t),i++}var f=c===i;if(p=p||f,!p){const t=i;if(!(r instanceof Function)){const t={params:{}};null===s?s=[t]:s.push(t),i++}f=t===i,p=p||f}if(!p){const r={params:{}};return null===s?s=[r]:s.push(r),i++,t.errors=s,!1}return i=l,null!==s&&(l?s.length=l:s=null),t.errors=s,0===i}function r(a,{instancePath:e="",parentData:n,parentDataProperty:o,rootData:s=a}={}){let i=null,l=0;if(0===l){if(!a||"object"!=typeof a||Array.isArray(a))return r.errors=[{params:{type:"object"}}],!1;{const n=l;for(const t in a)if("binary"!==t&&"dataUrl"!==t)return r.errors=[{params:{additionalProperty:t}}],!1;if(n===l){if(void 0!==a.binary){const t=l;if("boolean"!=typeof a.binary)return r.errors=[{params:{type:"boolean"}}],!1;var p=t===l}else p=!0;if(p)if(void 0!==a.dataUrl){const r=l;t(a.dataUrl,{instancePath:e+"/dataUrl",parentData:a,parentDataProperty:"dataUrl",rootData:s})||(i=null===i?t.errors:i.concat(t.errors),l=i.length),p=r===l}else p=!0}}}return r.errors=i,0===l}function a(t,{instancePath:e="",parentData:n,parentDataProperty:o,rootData:s=t}={}){let i=null,l=0;return r(t,{instancePath:e,parentData:n,parentDataProperty:o,rootData:s})||(i=null===i?r.errors:i.concat(r.errors),l=i.length),a.errors=i,0===l}module.exports=a,module.exports.default=a; |
@@ -6,2 +6,2 @@ /* | ||
*/ | ||
const t=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;function n(r,{instancePath:e="",parentData:s,parentDataProperty:a,rootData:o=r}={}){let l=null,i=0;if(0===i){if(!r||"object"!=typeof r||Array.isArray(r))return n.errors=[{params:{type:"object"}}],!1;{const e=i;for(const t in r)if("emit"!==t&&"filename"!==t&&"outputPath"!==t&&"publicPath"!==t)return n.errors=[{params:{additionalProperty:t}}],!1;if(e===i){if(void 0!==r.emit){const t=i;if("boolean"!=typeof r.emit)return n.errors=[{params:{type:"boolean"}}],!1;var u=t===i}else u=!0;if(u){if(void 0!==r.filename){let e=r.filename;const s=i,a=i;let o=!1;const c=i;if(i===c)if("string"==typeof e){if(e.includes("!")||!1!==t.test(e)){const t={params:{}};null===l?l=[t]:l.push(t),i++}else if(e.length<1){const t={params:{}};null===l?l=[t]:l.push(t),i++}}else{const t={params:{type:"string"}};null===l?l=[t]:l.push(t),i++}var p=c===i;if(o=o||p,!o){const t=i;if(!(e instanceof Function)){const t={params:{}};null===l?l=[t]:l.push(t),i++}p=t===i,o=o||p}if(!o){const t={params:{}};return null===l?l=[t]:l.push(t),i++,n.errors=l,!1}i=a,null!==l&&(a?l.length=a:l=null),u=s===i}else u=!0;if(u){if(void 0!==r.outputPath){let e=r.outputPath;const s=i,a=i;let o=!1;const p=i;if(i===p)if("string"==typeof e){if(e.includes("!")||!1!==t.test(e)){const t={params:{}};null===l?l=[t]:l.push(t),i++}}else{const t={params:{type:"string"}};null===l?l=[t]:l.push(t),i++}var c=p===i;if(o=o||c,!o){const t=i;if(!(e instanceof Function)){const t={params:{}};null===l?l=[t]:l.push(t),i++}c=t===i,o=o||c}if(!o){const t={params:{}};return null===l?l=[t]:l.push(t),i++,n.errors=l,!1}i=a,null!==l&&(a?l.length=a:l=null),u=s===i}else u=!0;if(u)if(void 0!==r.publicPath){let t=r.publicPath;const e=i,s=i;let a=!1;const o=i;if("string"!=typeof t){const t={params:{type:"string"}};null===l?l=[t]:l.push(t),i++}var f=o===i;if(a=a||f,!a){const n=i;if(!(t instanceof Function)){const t={params:{}};null===l?l=[t]:l.push(t),i++}f=n===i,a=a||f}if(!a){const t={params:{}};return null===l?l=[t]:l.push(t),i++,n.errors=l,!1}i=s,null!==l&&(s?l.length=s:l=null),u=e===i}else u=!0}}}}}return n.errors=l,0===i}function r(t,{instancePath:e="",parentData:s,parentDataProperty:a,rootData:o=t}={}){let l=null,i=0;return n(t,{instancePath:e,parentData:s,parentDataProperty:a,rootData:o})||(l=null===l?n.errors:l.concat(n.errors),i=l.length),r.errors=l,0===i}module.exports=r,module.exports.default=r; | ||
const t=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;function n(r,{instancePath:e="",parentData:a,parentDataProperty:s,rootData:o=r}={}){let l=null,i=0;if(0===i){if(!r||"object"!=typeof r||Array.isArray(r))return n.errors=[{params:{type:"object"}}],!1;{const e=i;for(const t in r)if("binary"!==t&&"emit"!==t&&"filename"!==t&&"outputPath"!==t&&"publicPath"!==t)return n.errors=[{params:{additionalProperty:t}}],!1;if(e===i){if(void 0!==r.binary){const t=i;if("boolean"!=typeof r.binary)return n.errors=[{params:{type:"boolean"}}],!1;var u=t===i}else u=!0;if(u){if(void 0!==r.emit){const t=i;if("boolean"!=typeof r.emit)return n.errors=[{params:{type:"boolean"}}],!1;u=t===i}else u=!0;if(u){if(void 0!==r.filename){let e=r.filename;const a=i,s=i;let o=!1;const f=i;if(i===f)if("string"==typeof e){if(e.includes("!")||!1!==t.test(e)){const t={params:{}};null===l?l=[t]:l.push(t),i++}else if(e.length<1){const t={params:{}};null===l?l=[t]:l.push(t),i++}}else{const t={params:{type:"string"}};null===l?l=[t]:l.push(t),i++}var p=f===i;if(o=o||p,!o){const t=i;if(!(e instanceof Function)){const t={params:{}};null===l?l=[t]:l.push(t),i++}p=t===i,o=o||p}if(!o){const t={params:{}};return null===l?l=[t]:l.push(t),i++,n.errors=l,!1}i=s,null!==l&&(s?l.length=s:l=null),u=a===i}else u=!0;if(u){if(void 0!==r.outputPath){let e=r.outputPath;const a=i,s=i;let o=!1;const p=i;if(i===p)if("string"==typeof e){if(e.includes("!")||!1!==t.test(e)){const t={params:{}};null===l?l=[t]:l.push(t),i++}}else{const t={params:{type:"string"}};null===l?l=[t]:l.push(t),i++}var f=p===i;if(o=o||f,!o){const t=i;if(!(e instanceof Function)){const t={params:{}};null===l?l=[t]:l.push(t),i++}f=t===i,o=o||f}if(!o){const t={params:{}};return null===l?l=[t]:l.push(t),i++,n.errors=l,!1}i=s,null!==l&&(s?l.length=s:l=null),u=a===i}else u=!0;if(u)if(void 0!==r.publicPath){let t=r.publicPath;const e=i,a=i;let s=!1;const o=i;if("string"!=typeof t){const t={params:{type:"string"}};null===l?l=[t]:l.push(t),i++}var c=o===i;if(s=s||c,!s){const n=i;if(!(t instanceof Function)){const t={params:{}};null===l?l=[t]:l.push(t),i++}c=n===i,s=s||c}if(!s){const t={params:{}};return null===l?l=[t]:l.push(t),i++,n.errors=l,!1}i=a,null!==l&&(a?l.length=a:l=null),u=e===i}else u=!0}}}}}}return n.errors=l,0===i}function r(t,{instancePath:e="",parentData:a,parentDataProperty:s,rootData:o=t}={}){let l=null,i=0;return n(t,{instancePath:e,parentData:a,parentDataProperty:s,rootData:o})||(l=null===l?n.errors:l.concat(n.errors),i=l.length),r.errors=l,0===i}module.exports=r,module.exports.default=r; |
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
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
4982773
677
142780