text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const { SyncWaterfallHook } = require("tapable");
const Compilation = require("../Compilation");
const RuntimeGlobals = require("../RuntimeGlobals");
const Template = require("../Template");
const HelperRuntimeModule = r... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const Template = require("../Template");
const HelperRuntimeModule = require("./HelperRuntimeModule");
/** @typedef {import("../Module").RuntimeRequirements} RuntimeR... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use stric<|fim_suffix|>@type {Compilation} */ (this.compilation);
const { runtimeTemplate } = compilation;
const fn = RuntimeGlobals.makeNamespaceObject;
return Template.asString([
"// define __esModule on exports",
`${fn}... | fim | webpack/webpack | javascript |
<|fim_suffix|> | null} runtime code
*/
generate() {
return `${RuntimeGlobals.scriptNonce} = undefined;`;
}
}
module.exports = NonceRuntimeModule;
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Ivan Kopeykin @vankop
*/
"use strict";
const RuntimeGlobals = require("../Ru... | fim | webpack/webpack | javascript |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const RuntimeModule = require("../RuntimeModule");
const Template = require("../Template");
/** @typedef {import("../Compilation")} Compilation */
class OnChunksLoadedRuntimeModul... | fim | webpack/webpack | javascript |
<|fim_suffix|>Path} PublicPath */
/** @typedef {import("../Compilation")} Compilation */
class PublicPathRuntimeModule extends RuntimeModule {
/**
* @param {PublicPath} publicPath public path
*/
constructor(publicPath) {
super("publicPath", RuntimeModule.STAGE_BASIC);
/** @type {PublicPath} */
this.publicP... | fim | webpack/webpack | javascript |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const Template = require("../Template");
const HelperRuntimeModule = require("./HelperRuntimeModule");
/** @typedef {import("../Compilation")} Compilation */
class RelativeUrlRunt... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const RuntimeModule = require("../RuntimeModule");
/** @typedef {import(<|fim_suffix|>.runtime;
if (typeof runtime !== "string") {
throw new Error("RuntimeIdRunt... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const Template = require("../Template");
const HelperRuntimeModule = require("./HelperRuntimeModule");
/** @typedef {import("../Compilation")} Compilation */
class S... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const StartupChunkDependenciesRuntimeModule = require("./StartupChunkDependenciesRuntimeModule");
const StartupEntrypointRuntimeM<|fim_suffix|>heck
* @returns {boo... | fim | webpack/webpack | javascript |
<|fim_suffix|>map is shorter for 3 or more chunks
`return Promise.all(${JSON.stringify(chunkIds)}.map(${
RuntimeGlobals.ensureChunk
}, ${RuntimeGlobals.require})).then(next);`
]
: [
// calling ensureChunk directly is shorter for 0 - 2 chunks
"return Promise.a... | fim | webpack/webpack | javascript |
<|fim_suffix|>lobals.require}(${RuntimeGlobals.entryModuleId} = moduleId)`
)};`,
...(this.asyncChunkLoading
? [
`return Promise.all(chunkIds.map(${RuntimeGlobals.ensureChunk}, ${
RuntimeGlobals.require
})).then(${runtimeTemplate.basicFunction("", [
`${cst} r = fn();`,
"return ... | fim | webpack/webpack | javascript |
<|fim_suffix|>dule.
* @returns {string | null} runtime code
*/
generate() {
return `${RuntimeGlobals.systemContext} = __system_context__;`;
}
}
module.exports = SystemContextRuntimeModule;
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const RuntimeGlobals =... | fim | webpack/webpack | javascript |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Alexander Akait @alexander-akait
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const RuntimeModule = require("../RuntimeModule");
const Template = require("../Template");
/** @typedef {import("../Compilation")} Compila... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const NormalModule = require("../NormalModule");
const { URIRegEx, decodeDataURI } = require("../util/dataURL");
/** @typedef {import("../Compiler")} Compiler */
const PLUGIN_NAME = "DataU... | fim | webpack/webpack | javascript |
<|fim_suffix|> path;
resourceData.query = query;
resourceData.fragment = fragment;
resourceData.resource = path + query + fragment;
return true;
});
const hooks = NormalModule.getCompilationHooks(compilation);
hooks.readResource
.for(undefined)
.tapAsync(PLUGIN_NAME, (load... | fim | webpack/webpack | javascript |
<|fim_suffix|>dded to lockfile`);
} else if (typeof oldEntry === "string") {
if (typeof entry === "string") {
logger.log(`${url} updated in lockfile: ${oldEntry} -> ${entry}`);
} else {
logger.log(
`${url} updated in lockfile: ${oldEntry} -> ${entry.resolved}`
);
}
... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Natsu @xiaoxiaojx
*/
"use strict";
const { getContext } = require("loader-runner");
const NormalModule = require("../NormalModule");
const ModuleNotFoundError = require("../errors/ModuleNotFoundError");
const { isAbsolute, join ... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
/** @typedef {import("./ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerCon<|fim_suffix|> the provided serializer context.
* @param {AggregateError} obj error
* @param {ObjectSerializerContext} contex... | fim | webpack/webpack | javascript |
<|fim_suffix|>izer context.
* @template T
* @param {ObjectDeserializerContext} context context
* @returns {T[]} array
*/
deserialize(context) {
/** @type {number} */
const length = context.read();
/** @type {T[]} */
const array = [];
for (let i = 0; i < length; i++) {
array.push(context.read());
... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const memoize = require("../util/memoize");
const SerializerMiddleware = require("./SerializerMiddleware");
/** @typedef {import("./types").BufferSerializableType} BufferSerializableType */
/** @typedef {import("./types... | fim | webpack/webpack | javascript |
<|fim_suffix|>is instance into the provided serializer context.
* @param {Date} obj date
* @param {ObjectSerializerContext} context context
*/
serialize(obj, context) {
context.write(obj.getTime());
}
/**
* Restores this instance from the provided deserializer context.
* @param {ObjectDeserializerContex... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
/** @typedef {import("./ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
/** @typedef {import("./ObjectMiddleware").ObjectSerializer<|fim_suffix|>ntext context
* @returns {Error | EvalError | ... | fim | webpack/webpack | javascript |
<|fim_suffix|>ob;
// Rename the index file to disallow access during inconsistent file state
await new Promise(
/**
* Handles the callback logic for this hook.
* @param {(value?: undefined) => void} resolve resolve
*/
(resolve) => {
this.fs.rename(filen... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
/** @typedef {import("./ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
/** @typedef {import("./Obj<|fim_suffix|>xt) {
context.write(obj.size);
for (const key of obj.keys()) {
context.wr... | fim | webpack/webpack | javascript |
<|fim_suffix|> @template {object} T
* @param {ObjectDeserializerContext} context context
* @returns {T} null object
*/
deserialize(context) {
/** @type {T} */
const obj = Object.create(null);
/** @type {Keys} */
const keys = [];
/** @type {Keys[number] | null} */
let key = context.read();
while (ke... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const { DEFAULTS } = require("../config/defaults");
const createHash = require("../util/createHash");
const AggregateErrorSerializer = require("./AggregateErrorSerializer");
const ArraySerializer = require("./ArraySerial... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT Lic<|fim_suffix|>rContext */
/** @typedef {import("./ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
/** @typedef {EXPECTED_FUNCTION} CacheAssoc */
/**
* Defines the shared type used by this module.
* @template T
* @typedef {WeakMap<CacheAssoc, ObjectStructure<T>>}
*/
... | fim | webpack/webpack | javascript |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
/** @typedef {import("./ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
/** @typedef {import("./ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
class RegExpObjectSerializer {
/**
*... | fim | webpack/webpack | javascript |
<|fim_suffix|>are.deserialize(data, ctx)
)
: middleware.deserialize(current, ctx);
}
return /** @type {Promise<DeserializedValue>} */ (current);
}
}
module.exports = Serializer;
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
/**
* Defines the serial... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const memoize = require("../util/memoize");
const LAZY_TARGET = Symbol("lazy serialization target");
const LAZY_SERIALIZED_VALUE = Symbol("lazy serialization data");
/** @typedef {SerializerMiddleware<EXPECTED_ANY, EXP... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/<|fim_suffix|>* @param {Set<T>} obj set
* @param {ObjectSerializerContext} context context
*/
serialize(obj, context) {
context.write(obj.size);
for (const value of obj) {
context.write(value);
}
}
/**
* Restores this instance from the provided ... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const SerializerMiddleware = require("./SerializerMiddleware");
/** @typedef {EXPECTED_ANY} DeserializedType */
/** @typedef {EXPECTED_ANY[]} SerializedType */
/** @typedef {EXPECTED_OBJECT} C<|fim_suffix|>t object
* ... | fim | webpack/webpack | javascript |
<|fim_suffix|>alizableType[] | Promise<PrimitiveSerializableType[]>)} PrimitiveSerializableType */
/** @typedef {Buffer | (() => BufferSerializableType[] | Promise<BufferSerializableType[]>)} BufferSerializableType */
module.exports = {};
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.ph... | fim | webpack/webpack | javascript |
<|fim_suffix|>e of ConsumeSharedFallbackDependency.
* @param {string} request the request
*/
constructor(request) {
super(request);
}
get type() {
return "consume shared fallback";
}
get category() {
return "esm";
}
}
makeSerializable(
ConsumeSharedFallbackDependency,
"webpack/lib/sharing/ConsumeSh... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { RawSource } = require("webpack-sources");
const AsyncDependenciesBlock = require("../AsyncDependenciesBlock");
const Module = require("../Module");
const {
CONSUME_SHARED_TYPES,
JA... | fim | webpack/webpack | javascript |
<|fim_suffix|>});
}
}
})
);
normalModuleFactory.hooks.createModule.tapPromise(
PLUGIN_NAME,
({ resource }, { context, dependencies }) => {
if (
dependencies[0] instanceof ConsumeSharedFallbackDependency ||
dependencies[0] instanceof ProvideForSharedDependency
... | fim | webpack/webpack | javascript |
<|fim_suffix|>] = ${runtimeTemplate.basicFunction("module", [
"// Handle case when module is used sync",
"installedModules[id] = 0;",
`delete ${RuntimeGlobals.moduleCache}[id];`,
`${cst} factory = moduleToHandlerMapping[id]();`,
'if(typeof factory !== "function") throw new Error(... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ModuleDependency = require("../dependencies/ModuleDependency");
const makeSerializable = require("../util/makeSerializable");
class ProvideForSharedDependency extends ModuleDependency... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Dependency = require("../Dependency");
const makeSerializable = require("../util/makeSerializ<|fim_suffix|>ersion version
* @param {string} request request
* @param {boolean} eager... | fim | webpack/webpack | javascript |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy
*/
"use strict";
const AsyncDependenciesBlock = require("../AsyncDependenciesBlock");
const Module = require("../Module");
const { SHARED_INIT_TYPES } = require("../ModuleSourceTypeCon... | fim | webpack/webpack | javascript |
<|fim_suffix|>allback */
/** @typedef {import("../ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */
/** @typedef {import("./ProvideSharedDependency")} ProvideSharedDependency */
class ProvideSharedModuleFactory extends ModuleFactory {
/**
* Processes the provided data.
* @param {ModuleFactoryCre... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy
*/
"use strict";
const { parseOptions } = require("../container/options");
const WebpackError = require("../errors/WebpackError");
const ProvideForSharedDependency = requ... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra and Zackary Jackson @ScriptedAlchemy
*/
"use strict";
const { parseOptions } = require("../container/options");
const ConsumeSharedPlugin = require("./ConsumeSharedPlugin");
const ProvideSharedPlugin = requi... | fim | webpack/webpack | javascript |
<|fim_suffix|>s = ShareRuntimeModule;
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const RuntimeModule = require("../RuntimeModule");
const Template = require("../Template");
const {... | fim | webpack/webpack | javascript |
<|fim_suffix|>th("/")) {
// module request prefix
prefixed.set(request, config);
} else {
// module request
unresolved.set(request, config);
}
})
).then(() => {
compilation.contextDependencies.addAll(
/** @type {FileSystemDependencies} */
(resolveContext.contextDependencies)
);
comp... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { dirname, join, readJson } = require("../util/fs");
/** @typedef {import("../util/fs").InputFileSystem} InputFileSystem */
/** @typedef {import("../util/fs").JsonObject} JsonObject *... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const util = require("util");
const { WEBPACK_MODULE_TYPE_RUNTIME } = require("../ModuleTypeConstants");
const ModuleDependency = require("../dependencies/ModuleDependency");
const { LogType... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const RequestShortener = require("../RequestShortener");
/** @typedef {import("../../declarations/WebpackOptions").StatsOptions} StatsOptions */
/** @typedef {import("../../declarations/Web... | fim | webpack/webpack | javascript |
<|fim_suffix|>tFlag("compared for emit")) : undefined,
"asset.cached": (cached, { green, formatFlag }) =>
cached ? green(formatFlag("cached")) : undefined,
"asset.isOverSizeLimit": (isOverSizeLimit, { yellow, formatFlag }) =>
isOverSizeLimit ? yellow(formatFlag("big")) : undefined,
"asset.info.immutable": (immu... | fim | webpack/webpack | javascript |
<|fim_suffix|>ime
* @property {(compilation: Compilation) => Error[]} cachedGetErrors
* @property {(compilation: Compilation) => Error[]} cachedGetWarnings
*/
/** @typedef {KnownStatsFactoryContext & Record<string, EXPECTED_ANY>} StatsFactoryContext */
// StatsLogging StatsLoggingEntry
/**
* Defines the stats ob... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { HookMap, SyncBailHook, SyncWaterfallHook } = require("tapable");
/** @typedef {import("./DefaultStatsFactoryPlugin").StatsAsset} StatsAsset */
/** @typedef {import("./DefaultStatsFa... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Alexander Akait @alexander-akait
*/
"use strict";
const mod = require("module");
const {
JAVASCRIPT_MODULE_TYPE_AUTO,
JAVASCRIPT_MODULE_TYPE_DYNAMIC,
JAVASCRIPT_MODULE_TYPE_ESM
} = require("../ModuleTypeConstants");
const Norm... | fim | webpack/webpack | javascript |
<|fim_suffix|>result);
return result;
};
class URLParserPlugin {
/**
* Creates an instance of URLParserPlugin.
* @param {JavascriptParserOptions} options options
*/
constructor(options) {
/** @type {JavascriptParserOptions} */
this.options = options;
}
/**
* Applies the plugin by registering its hoo... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/**
* Compare two arrays or strings by performing strict equality check for each value.
* @template T
* @param {ArrayLike<T>} a Array of values to be compared
* @param {ArrayLike<T>} b A... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/**
* FIFO queue backed by arrays with a reversed dequeue buffer to avoid the cost
* of repeated `Array#shift` operations.
* @template T
*/
class ArrayQueue {
/**
* Seeds the queue wi... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { AsyncSeriesHook, SyncHook } = require("tapable");
const { makeWebpackError } = require("../errors/HookWebpackError");
const WebpackError = require("../errors/WebpackError");
const Ar... | fim | webpack/webpack | javascript |
<|fim_suffix|>am {string | Buffer} data data
* @param {Encoding=} inputEncoding data encoding
* @returns {Hash} updated hash
*/
update(data, inputEncoding) {
const AbstractMethodError = require("../errors/AbstractMethodError");
throw new AbstractMethodError();
}
/* istanbul ignore next */
/**
* Calcul... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/**
* Returns last item.
* @template T
* @param {Iterable<T>} set a set
* @returns {T | undefined} last item
*/
const last = (set) => {
/** @type {T | undefined} */
let last;
for (co... | fim | webpack/webpack | javascript |
<|fim_suffix|>);
return {
next: () => {
const res = currentIterator.next();
if (res.done) {
if (iterators.length === 0) return res;
currentIterator = /** @type {Iterator<T>} */ (iterators.pop());
return currentIterator.next();
}
return res;
}
};
}
}
module.exports = LazyBucket... | fim | webpack/webpack | javascript |
<|fim_suffix|>ort("../serialization/ObjectMiddleware").ObjectSerializerContext} context context
*/
serialize({ write }) {
if (this._needMerge) this._merge();
write(this._set.size);
for (const item of this._set) write(item);
}
/**
* Restores a `LazySet` from serialized item data.
* @template T
* @param... | fim | webpack/webpack | javascript |
<|fim_suffix|>is.pos`
// sits on one we're already on the line containing it; only
// newlines strictly **before** `this.pos` and at-or-after
// `pos` represent crossed line boundaries.
let i = this._input.lastIndexOf("\n", this.pos - 1);
while (i >= pos) {
this.line--;
i = i > 0 ? this._i... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/**
* getOrInsert is a helper functio<|fim_suffix|> value doesn't
* exist, it will be computed by the provided function.
* @template K
* @template V
* @param {Map<K, V>} map The map obj... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const binarySearchBounds = require("./binarySearchBounds");
/** @typedef {(value: number) => void} Callback */
class ParallelismFactorCalculator {
constructor() {
/** @type {number[]} *... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/**
* FIFO queue that keeps items unique by storing them in insertion order inside
* a `Set`.
* @template T
*/
class Queue {
/**
* Seeds the queue with an optional iterable of initial... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/**
* Simple counting semaphore used to limit how many asynchronous tasks may run
* concurrently.
*/
class Semaphore {
/**
* Initializes the semaphore with the number of permits that m... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/**
* intersect creates Set containing the intersection of elements between all sets
* @template T
* @param {Set<T>[]} sets an array of sets being checked for shared elements
* @returns ... | fim | webpack/webpack | javascript |
<|fim_suffix|>plate R
* @param {(set: SortableSet<T>) => R} fn function to calculate value
* @returns {R} returns result of fn(this), cached until set changes
*/
getFromUnorderedCache(fn) {
if (this._cacheOrderIndependent === undefined) {
this._cacheOrderIndependent = new Map();
} else {
const result =... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
/**
* Babel-style visitor map keyed by a numeric node-type discriminator; a bucket
* is a function (enter-only) or `{ enter?, exit? }`. `ctx.skipChildren()`
* (enter only) stops the walker descending into the node's c... | fim | webpack/webpack | javascript |
<|fim_suffix|> next() {
let result = current.next();
while (result.done && iterators.length > 0) {
current = /** @type {MapIterator<[K, V]>} */ (iterators.pop());
result = current.next();
}
return result;
}
};
}
}
module.exports = StackedCacheMap;
<|fim_prefix|>/*
MIT License http://... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const TOMBSTONE = Symbol("tombstone");
const UNDEFINED_MARKER = Symbol("undefined");
/**
* Public cell value exposed by `StackedMap`, where `undefined` is preserved as
* a valid stored re... | fim | webpack/webpack | javascript |
<|fim_suffix|> the Module hashes are sorted or not. This is useful because it allows us to avoid sorting the
* Module hashes.
* @example
* ```js
* const xor = new StringXor();
* xor.add('hello');
* xor.add('world');
* console.log(xor.toString());
* ```
* @example
* ```js
* const xor = new StringXor();
* xor... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Tupl<|fim_suffix|> element to add.
* @returns {void}
*/
enqueue(...item) {
this._set.add(...item);
}
/**
* Removes and returns the next queued tuple, rebuilding the iterato... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/**
* Nested map structure used to index tuple prefixes until the final tuple
* element can be stored in a `Set`.
* @template K
* @template V
* @typedef {Map<K, InnerMap<K, V> | Set<V>>... | fim | webpack/webpack | javascript |
<|fim_suffix|> === 0 ||
nextChar === backSlashCharCode ||
nextChar === slashCharCode ||
nextChar === hashCharCode ||
nextChar === queryCharCode
) {
return;
}
}
return specifier.slice(0, i).toLowerCase();
}
/**
* Returns protocol if absolute URL specifier provided.
* @param {string} specifier sp... | fim | webpack/webpack | javascript |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/**
* Strong-key child map used for tuple elements that cannot be stored in a
* `WeakMap`.
* @template {EXPECTED_ANY[]} T
* @template V
* @typedef {Map<EXPECTED_ANY, WeakTupleMap<T, V>>} M
*/
/**
... | fim | webpack/webpack | javascript |
<|fim_suffix|>
} else {
code.push(";if(", predicate, "){i=m;");
}
if (reversed) {
code.push("l=m+1}else{h=m-1}");
} else {
code.push("h=m-1}else{l=m+1}");
}
code.push("}");
if (earlyOut) {
code.push("return -1};");
} else {
code.push("return i};");
}
return code.join("");
};
/**
* Defines the sear... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("../Dependency")} Dependency */
/** @typedef {import("../Module")} Module */
/** @typedef {import("../ModuleGraph")} ModuleGraph */
/** @typedef {import("../javascript/J... | fim | webpack/webpack | javascript |
<|fim_suffix|>template A
* @template B
* @param {A | A[]} a value
* @param {B | B[]} b value
* @param {boolean} internalCaching should parsing of objects and nested merges be cached
* @returns {A & B | (A | B)[] | A | A[] | B | B[]} value
*/
const mergeSingleValue = (a, b, internalCaching) => {
const bType = get... | fim | webpack/webpack | javascript |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { getFullModuleName } = require("../ids/IdHelpers");
const { compareRuntime } = require("./runtime");
/** @typedef {import("../Chunk")} Chunk */
/** @typedef {import("../Chunk").ChunkName} ChunkNam... | fim | webpack/webpack | javascript |
<|fim_suffix|>inishedItems.length === 0 && items.size === 2) {
/** @type {SetIterator<string>} */
const it = items[Symbol.iterator]();
const a = /** @type {string} */ (it.next().value);
const b = /** @type {string} */ (it.next().value);
if (a.length > 0 && b.length > 0 && a.slice(-1) === b.slice(-1)) {
ret... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Template = require("../Template");
/** @typedef {import("estree").Node} Node */
/** @typedef {import("../javascript/JavascriptModulesPlugin").Scope} Scope */
/** @typedef {import("../... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Gengkun He @ahabhgk
*/
"use strict";
/** @typedef {import("../../declarations/WebpackOptions").CssGeneratorExportsConvention} CssGeneratorExportsConvention */
// Copy from css-loader
/**
* Preserve camel case.
* @param {string}... | fim | webpack/webpack | javascript |
<|fim_suffix|> {
createXXHash64 = require("./hash/xxhash64");
if (BatchedHash === undefined) {
BatchedHash = require("./hash/BatchedHash");
}
}
return new /** @type {typeof import("./hash/BatchedHash")} */ (
BatchedHash
)(createXXHash64());
case "md4":
if (createMd4 === undefined) {
... | fim | webpack/webpack | javascript |
<|fim_suffix|>e {number} */ (segment.originalColumn);
encoded += encodeVLQ(segment.sourceIndex - prevSourceIndex);
encoded += encodeVLQ(originalLine - prevOriginalLine);
encoded += encodeVLQ(originalColumn - prevOriginalColumn);
prevSourceIndex = segment.sourceIndex;
prevOriginalLine = originalLine;... | fim | webpack/webpack | javascript |
<|fim_suffix|>ay: 6px 3px" /></svg>`
// so we return original body if we can't `decodeURIComponent`
try {
return Buffer.from(decodeURIComponent(body), "ascii");
} catch (_) {
return Buffer.from(body, "ascii");
}
};
module.exports = {
URIRegEx,
decodeDataURI
};
<|fim_prefix|>/*
MIT License http://www.opensou... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const util = require("util");
/** @type {Map<string, () => void>} */
const deprecationCache = new Map();
/**
* Defines the fake hook marker type used by this module.
* @typedef {object} ... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
// Simulations show these probabilities for a single change
// 93.1% that one group is invalidated
// 4.8% that two groups are invalidated
// 1.1% that 3 groups are invalidated
// 0.1% that ... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Natsu @xiaoxiaojx
*/
"use strict";
const path = require("path");
const urlUtils = require("url");
const { isAbsolute, join } = require("./fs");
/** @typedef {imp<|fim_suffix|> /** @type {string[]} */
const possibleRequests =... | fim | webpack/webpack | javascript |
<|fim_suffix|>${urlAndGlobal}"`);
}
return [urlAndGlobal.slice(index + 1), urlAndGlobal.slice(0, index)];
};
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Sam Chen @chenxsan
*/
"use strict";
/**
* Returns script url and its global variable.
* @param {string} urlAndGlobal... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const NO_MARKER = 0;
const IN_PROGRESS_MARKER = 1;
const DONE_MARKER = 2;
const CANDIDATE_MARKER = 3;
/**
* Defines the nodes type used by this module.
* @template T
* @typedef {Set<Node... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
/** @typedef {import("../Dependency").Sourc<|fim_suffix|> in pos && "column" in pos) {
return `${pos.line}:... | fim | webpack/webpack | javascript |
<|fim_suffix|>oor(Math.log(size) / Math.log(1024));
return `${Number((size / 1024 ** index).toPrecision(3))} ${abbreviations[index]}`;
};
module.exports = formatSize;
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Sean Larkin @thelarkinn
*/
"use strict";
/**
* Returns the... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const path = require("path");
/** @typedef {import("../../declarations/WebpackOptions").WatchOptions} WatchOptions */
/** @typedef {import("watchpack").Entry} Entry */
/** @typedef {import(... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Alexander Akait @alexander-akait
*/
"use strict";
const createHash = require("./createHash");
/**
* Returns generated debug id.
* @param {string | Buffer} content content
* @param {string} file<|fim_suffix|>h("xxhash64").upda... | fim | webpack/webpack | javascript |
<|fim_suffix|>tring" &&
inputEncoding === this.encoding &&
this.string.length + data.length < MAX_SHORT_STRING
) {
this.string += data;
return this;
}
if (this.encoding) {
update(this.hash, this.string, this.encoding);
} else {
update(this.hash, this.string);
}
this.string = un... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Alexander Akait @alexander-akait
*/
"use strict";
const Hash = require("../Hash");
const { digest, update } = require("./hash-digest");
/** @typedef {import("../../../declarations/WebpackOptions").HashDigest} Encoding */
/** @ty... | fim | webpack/webpack | javascript |
<|fim_suffix|>fer.from(data.slice(prefix.length), "hex").toString();
}
this.string += `[${data}](${
/** @type {string} */
(
// eslint-disable-next-line unicorn/error-message
new Error().stack
).split("\n", 3)[2]
})\n`;
return this;
}
/**
* Calculates the digest {@link https://nodejs.org/ap... | fim | webpack/webpack | javascript |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Alexander Akait @alexander-akait
*/
"use strict";
/** @typedef {import("../Hash")} Hash */
/** @typedef {import("../../../declarations/WebpackOptions").HashDigest} Encoding */
/** @typedef {"26" | "32" | "36" | "49" | "52" | "58" | "62"} Base... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
<|fim_suffix|>mpBmfOJ1AVqQQl3IhMgEiAZcnEgEiAZcXJqIAxqQZnzidQFakENdyIYIBIgE3JxIBIgE3FyaiAGakGZ84nUBWpBA3ciGSAYIBMgEiAZIBMgGHJxIBMgGHFyaiAJakGZ84nUBWpBBXciEiAYIBlycSAYIBlxcmogC2pBmfOJ1AVqQQl3Ih... | fim | webpack/webpack | javascript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.