text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_suffix|>.errors=[{params:{type:"string"}}],!1;if(a.includes("!")||!0!==r.test(a))return t.errors=[{params:{}}],!1}}return t.errors=null,!0}module.exports=t,module.exports.default=t;<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
const r=... | fim | webpack/webpack | javascript |
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
declare const check: (options: import("../../../declarations/plugins/dll/DllPlugin").DllPluginOptions) => boolean;
export = check;
<|endoftext|> | fim | webpack/webpack | typescript |
<|fim_suffix|>d 0!==e.type){let t=e.type;const o=0;if(0===o){if("string"!=typeof t)return r.errors=[{params:{type:"string"}}],!1;if(t.length<1)return r.errors=[{params:{}}],!1}s=0===o}else s=!0}}}}}}}return r.errors=null,!0}module.exports=r,module.exports.default=r;<|fim_prefix|>/*
* This file was automatically genera... | fim | webpack/webpack | javascript |
<|fim_suffix|>inOptions) => boolean;
export = check;
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
declare const check: (options: import("..<|fim_middle|>/../../declarations/plugins/dll/DllReferencePlugin").DllReferencePlug<|endoftext|> | fim | webpack/webpack | typescript |
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
const s=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;function t(s,{instancePath:e="",parentData:n,parentDataProperty:l,rootData:o=s}={}){let r=null,i=0;if(0===i){if(!s||"object"!=typeof s||Array.isArray(s))retu... | fim | webpack/webpack | javascript |
<|fim_suffix|>an;
export = check;
<|fim_prefix|>/*
* This file was<|fim_middle|> automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
declare const check: (options: import("../../../declarations/plugins/ids/HashedModuleIdsPlugin").HashedModuleIdsPluginOptions) => boole<|endoftext|... | fim | webpack/webpack | typescript |
<|fim_suffix|>rn null===o?o=[t]:o.push(t),l++,e.errors=o,!1}l=n,null!==o&&(n?o.length=n:o=null),u=r===l}else u=!0}}}}}return e.errors=o,0===l}module.exports=e,module.exports.default=e;<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
const t=/^(... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MO<|fim_suffix|>("../../../declarations/plugins/ids/OccurrenceChunkIdsPlugin").OccurrenceChunkIdsPluginOptions) => boolean;
export = check;
<|fim_middle|>DIFY BY HAND.
* Run `yarn fix:special` to update
*/
declare const check: (options: import<|endo... | fim | webpack/webpack | typescript |
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
"use strict";function r(t,{instancePath:e="",parentData:o,parentDataProperty:a,rootData:i=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;{const e... | fim | webpack/webpack | javascript |
<|fim_suffix|> => boolean;
export = check;
<|fim_prefix|>/*
* This file was au<|fim_middle|>tomatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
declare const check: (options: import("../../../declarations/plugins/ids/OccurrenceModuleIdsPlugin").OccurrenceModuleIdsPluginOptions)<|en... | fim | webpack/webpack | typescript |
<|fim_prefix|>/*
* This file was automatically g<|fim_suffix|>if("prioritiseInitial"!==e)return r.errors=[{params:{additionalProperty:e}}],!1;if(0===e&&void 0!==t.prioritiseInitial&&"boolean"!=typeof t.prioritiseInitial)return r.errors=[{params:{type:"boolean"}}],!1}return r.errors=null,!0}module.exports=r,module.expo... | fim | webpack/webpack | javascript |
<|fim_suffix|>: any) => boolean;
export = check;
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update<|fim_middle|>
*/
declare const check: (options<|endoftext|> | fim | webpack/webpack | typescript |
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
"use strict";function r(e,{instancePath:t="",pare<|fim_suffix|>SONParse&&"boolean"!=typeof e.JSONParse)return r.errors=[{params:{type:"boolean"}}],!1}return r.errors=null,!0}module.exports=r,modu... | fim | webpack/webpack | javascript |
<|fim_suffix|> any) => boolean;
export = check;
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODI<|fim_middle|>FY BY HAND.
* Run `yarn fix:special` to update
*/
declare const check: (options:<|endoftext|> | fim | webpack/webpack | typescript |
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
"use strict";function r(e,{instancePath:t="",parentData:o,parentDataProperty:a,rootData:s=e}={}){if(!e||"object"!=typeof e||Array.isArray(e))return r.errors=[{params:{type:"object"}}],!1;{const t... | fim | webpack/webpack | javascript |
<|fim_suffix|>essiveSplittingPluginOptions) => boolean;
export = check;
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to u<|fim_middle|>pdate
*/
declare const check: (options: import("../../../declarations/plugins/optimize/AggressiveSplittingPlugin").Agg... | fim | webpack/webpack | typescript |
<|fim_prefix|>/*
* This file was automati<|fim_suffix|>nstancePath:t="",parentData:n,parentDataProperty:i,rootData:o=e}={}){if(!e||"object"!=typeof e||Array.isArray(e))return r.errors=[{params:{type:"object"}}],!1;{const t=0;for(const t in e)if("chunkOverhead"!==t&&"entryChunkMultiplicator"!==t&&"maxSize"!==t&&"minSiz... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yar<|fim_suffix|>tChunkCountPlugin").LimitChunkCountPluginOptions) => boolean;
export = check;
<|fim_middle|>n fix:special` to update
*/
declare const check: (options: import("../../../declarations/plugins/optimize/Limi<|endof... | fim | webpack/webpack | typescript |
<|fim_suffix|>0;if("number"!=typeof e.entryChunkMultiplicator)return r.errors=[{params:{type:"number"}}],!1;s=0===t}else s=!0;if(s)if(void 0!==e.maxChunks){let t=e.maxChunks;const n=0;if(0===n){if("number"!=typeof t)return r.errors=[{params:{type:"number"}}],!1;if(t<1||isNaN(t))return r.errors=[{params:{comparison:">="... | fim | webpack/webpack | javascript |
<|fim_suffix|>cateChunksPluginOptions) => boolean;
export = check;
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
declare const check: (option<|fim_middle|>s: import("../../../declarations/plugins/optimize/MergeDuplicateChunksPlugin").MergeDu... | fim | webpack/webpack | typescript |
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
"use strict";function r(t,{instancePath:e="",parentData:a,parentDataProperty:o,rootData:s=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;{const e... | fim | webpack/webpack | javascript |
<|fim_suffix|>e const check: (options: import("../../../declarations/plugins/optimize/MinChunkSizePlugin").MinChunkSizePluginOptions) => boolean;
export = check;
<|fim_prefix|>/*
<|fim_middle|>* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
declar<|endoftext|> | fim | webpack/webpack | typescript |
<|fim_suffix|>!1;if(0===t){if(void 0!==e.chunkOverhead){const t=0;if("number"!=typeof e.chunkOverhead)return r.errors=[{params:{type:"number"}}],!1;var a=0===t}else a=!0;if(a){if(void 0!==e.entryChunkMultiplicator){const t=0;if("number"!=typeof e.entryChunkMultiplicator)return r.errors=[{params:{type:"number"}}],!1;a=0... | fim | webpack/webpack | javascript |
<|fim_suffix|>t check: (options: import("../../../declarations/plugins/schemes/HttpUriPlugin").HttpUriPluginOptions) => boolean;
export = check;
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* R<|fim_middle|>un `yarn fix:special` to update
*/
declare cons<|endoftext|> | fim | webpack/webpack | typescript |
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
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... | fim | webpack/webpack | javascript |
<|fim_suffix|>to update
*/
declare const check: (options: import("../../../declarations/plugins/schemes/VirtualUrlPlugin").VirtualUrlPluginOptions) => boolean;
export = check;
<|fim_prefix|>/*
* This f<|fim_middle|>ile was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` <|endoftext|> | fim | webpack/webpack | typescript |
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
"use strict";function t(r,{instancePath:e="",parentData:n,parentDataProperty:s,rootData:o=r}={}){let a=null,i=0;const l=i;let p=!1;const c=i;if("string"!=typeof r){const t={params:{type:"string"}};null===a?a=[... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
declare const check: (options: import("../../../declarations/plugins/sharing/ConsumeSharedPlugin").Co<|fim_suffix|>ns) => boolean;
export = check;
<|fim_middle|>nsumeSharedPluginOptio<|endoftext|... | fim | webpack/webpack | typescript |
<|fim_suffix|>i,0===l}module.exports=n,module.exports.default=n;<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
"use strict";function r(e,{instancePath:t="",parentData:n,parentDataProperty:s,rootData:a=e}={}){let o=null,i=0;if(0===i){if(!e||"o... | fim | webpack/webpack | javascript |
<|fim_suffix|>= check;
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
declare const check: (options: import("../../../declarations/plugins/sharing/ProvideSharedPlugin").ProvideSharedPluginOptions) => boolean;
e<|fim_middle|>xport <|endoftext|... | fim | webpack/webpack | typescript |
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
"use strict";function r(t,{instancePath:e="",parentData:s,parentDataProperty:n,rootData:a=t}={}){let o=null,l=0;if(0===l){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{typ... | fim | webpack/webpack | javascript |
<|fim_prefix|>/*
* This file was automatically generated.
* DO NOT MODIFY BY HA<|fim_suffix|>arations/plugins/sharing/SharePlugin").SharePluginOptions) => boolean;
export = check;
<|fim_middle|>ND.
* Run `yarn fix:special` to update
*/
declare const check: (options: import("../../../decl<|endoftext|> | fim | webpack/webpack | typescript |
<|fim_suffix|>.errors:i.concat(n.errors),l=i.length),y=s===l,f=f||y}if(!f){const r={params:{}};return null===i?i=[r]:i.push(r),l++,s.errors=i,!1}return l=p,null!==i&&(p?i.length=p:i=null),s.errors=i,0===l}function a(r,{instancePath:e="",parentData:t,parentDataProperty:n,rootData:o=r}={}){let i=null,l=0;if(0===l){if(!r|... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const fs = require("fs");
const path = require("path");
const root = process.cwd();
const nodeModulesFolder = path.resolve(root, "node_modules");
const webpackDependencyFolder = path.resolve(root, "node_modules/webpack");
/**
* @returns {Promise<void>} result
*/
function setup() {
retu... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const AbstractMethodError = require("../lib/errors/AbstractMethodError");
describe("WebpackError", () => {
class Foo {
abstractMethod() {
return new AbstractMethodError();
}
}
class Child extends Foo {}
const expectedMessage = "Abstract <|fim_suffix|>.replace("$1", "Child.abst... | fim | webpack/webpack | javascript |
<|fim_suffix|>oupBy works with empty array", () => {
expect(ArrayHelpers.groupBy([], (x) => x % 2 === 0)).toStrictEqual([
[],
[]
]);
});
});
<|fim_prefix|>"use strict";
const ArrayHelpers = require("../lib/util/ArrayHelpers");
describe("ArrayHelpers", () => {
it("groupBy should partition into two arrays",... | fim | webpack/webpack | javascript |
<|fim_suffix|>e = path.join(outputDir, "entry3.js");
try {
fs.mkdirSync(path.join(pluginDir), {
recursive: true
});
} catch (_err) {
// empty
}
const compiler = webpack({
mode: "production",
entry: {
entry3: entryFile
},
output: {
path: outputDir
},
plugins: [
new webp... | fim | webpack/webpack | javascript |
<|fim_prefix|>import { constants, writeFile } from "fs";
import fs from "fs/promises";
import { Session } from "inspector";
import path from "path";
import { fileURLToPath, pathToFileURL } from "url";
import {
InstrumentHooks,
getCodspeedRunnerMode,
getGitDir,
getV8Flags,
mongoMeasurement,
setupCore,
teardownCor... | fim | webpack/webpack | javascript |
<|fim_suffix|>alse, true, false, true], 134),
cont([false, true, false, true], 135),
cont([false, true, false, true], 10000),
cont([true], 135),
[null],
[null, null],
[null, null, null],
cont([null], 4),
cont([null], 100),
cont([null], 300),
cont([-20], 20),
cont([400], 20),
cont([5.5], 20)
];
... | fim | webpack/webpack | javascript |
<|fim_suffix|> 0;
let now5 = 0;
if (supportsEsm) {
fs.writeFileSync(
path.resolve(inputDirectory, "esm-dependency.js"),
"module.exports = Date.now();"
);
now4 = Date.now();
await exec("8", {
definedValue: "other",
warnings: [
/Managed item .+dep-without-package\.json isn't a directo... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
require("./helpers/warmup-webpack");
const path = require("path");
const fs = require("graceful-fs");
const { Volume, createFsFromVolume } = require("memfs");
/** @type {(path: string, callback: (err?: unknown) => void) => void} */
const rimraf = require("rimraf");
/**
* @param {import("... | fim | webpack/webpack | javascript |
<|fim_suffix|><|fim_prefix|>"use strict";
const Chunk = require("../lib/<|fim_middle|>Chunk");
describe("Chunk", () => {
/** @type {InstanceType<typeof Chunk>} */
let ChunkInstance;
beforeEach(() => {
const ChunkAny =
/** @type {new (...args: unknown[]) => InstanceType<typeof Chunk>} */ (
/** @type {unkn... | fim | webpack/webpack | javascript |
<|fim_suffix|>
const assets = new Map([
["./main.js", 0],
["./js/main.js", 0],
["./static/js/main.js", 0]
]);
const result = _getDirectories(assets);
expect([...result]).toEqual([".", "./js", "./static/js", "./static"]);
});
});
});
<|fim_prefix|>"use strict";
const { _getDirectories } = req... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const { createColors, getArguments, isColorSupported, processArguments } =
require("../").cli;
describe("Cli", () => {
describe("getArguments", () => {
it("should generate the correct cli flags", () => {
expect(getArguments()).toMatchSnapshot();
});
it("should generate the corr... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const { RawSource } = require("webpack-sources");
const webpack = require("../lib/index");
const createCompilation = () => {
const compiler = webpack({ mode: "none", entry: "./nope.js" });
const params = compiler.newCompilationParams();
return compiler.createCompilation(params);
};
des... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
require("./helpers/warmup-webpack");
const path = require("path");
const fs = require("graceful-fs");
/** @type {{ sync: (pattern: string) => void }} */
const rimraf = require("rimraf");
let fixtureCount = 0;
/**
* @typedef {{ mkdir: string[], writeFile: unknown[] }} CachingLogs
* @typ... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
require("./helpers/warmup-webpack");
const path = require("path");
const fs = require("graceful-fs");
const rimraf = /** @type {{ sync: (path: string) => void }} */ (
require("rimraf")
);
let fixtureCount = 0;
describe("Compiler (filesystem caching)", () => {
const tempFixturePath = pa... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
require("./helpers/warmup-webpack");
const path = require("path");
const { Volume, createFsFromVolume } = require("memfs");
const Stats = require("../lib/Stats");
const captureStdio = require("./helpers/captureStdio");
const deprecationTracking = require("./helpers/deprecationTracking");
... | fim | webpack/webpack | javascript |
<|fim_suffix|>eTestCases",
cache: {
type: "filesystem",
buildDependencies: {
defaultWebpack: []
}
}
});
<|fim_prefix|>"use strict";
const { describeCases } = requir<|fim_middle|>e("./ConfigTestCases.template");
describeCases({
name: "ConfigCach<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>cribeCases({
name: "ConfigTestCases"
});
<|fim_prefix|>"use strict";
const { describeCases } = require("./ConfigTestCases.te<|fim_middle|>mplate");
des<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>ions = deprecationTracker();
if (err) return handleFatalError(err, done);
const statOptions = {
preset: "verbose",
colors: false
};
fs.mkdirSync(outputDirectory, { recursive: true });
fs.writeFileSync(
path.join(outputDirectory, "stats.txt... | fim | webpack/webpack | javascript |
<|fim_suffix|>tModuleOptions} */ (
/** @type {unknown} */ ({
type: "javascript/auto",
request,
resource: "a",
mode: "lazy",
regExp: /a|b/
})
)
);
expect(contextModule.identifier()).toEqual(
expect.stringContaining("/a%7Cb/")
);
});
});
});
<|fim_prefix|>"use s... | fim | webpack/webpack | javascript |
"use strict";
const { Volume, createFsFromVolume } = require("memfs");
const ContextModuleFactory = require("../lib/ContextModuleFactory");
/** @typedef {import("memfs").IFs} IFs */
/** @typedef {import("../lib/util/fs").InputFileSystem} InputFileSystem */
/** @typedef {import("../lib/ContextModule").ContextModuleOpt... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const Dependency = require("../lib/Dependency");
const CssIcssExportDependency = require("../lib/dependencies/CssIcssExportDependency");
const { EXPORT_MODE, EXPORT_TYPE } = CssIcssExportDependency;
const makeModule = (convention = "as-is", localIdentName = "[local]") => ({
generator: { ... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
require("./helpers/warmup-webpack");
const path = require("path");
const fs = require("graceful-fs");
const prettyFormat = require("pretty-format").default;
const webpack = require("..");
const CWD_PATTERN = new RegExp(process.cwd().replace(/\\/g, "/"), "gm");
const ERROR_STACK_PATTERN = ... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
require("./helpers/warmup-webpack");
const path = require("path");
const fs = require("graceful-fs");
jest.setTimeout(60000);
const nodeVersion = Number.parseInt(process.version.slice(1).split(".")[0], 10);
// eslint-disable-next-line no-new-func
const dynamicImport = new Function("speci... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
/** @typedef {import("../lib/FileSystemInfo").Snapshot} Snapshot */
/** @typedef {import("../lib/FileSystemInfo").SnapshotOptions} SnapshotOptions */
/** @typedef {import("../lib/errors/WebpackError")} WebpackError */
/** @typedef {import("memfs").IFs} IFs */
const util = require("util");
... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const path = require("path");
const fs = require("graceful-fs");
const webpack = require("..");
describe("HotModuleReplacementPlugin", () => {
it("should not have circular hashes but equal if unmodified", (done) => {
const entryFile = path.join(
__dirname,
"js",
"HotModuleRepl... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
require("./helpers/warmup-webpack");
/** @typedef {{ name: string, tests: string[] }} Category */
/**
* @typedef {object} SuiteConfig
* @property {string} name suite name
* @property {string=} target target
*/
/**
* @typedef {object} HotTestConfig
* @property {((scope: EXPECTED_ANY, ... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict<|fim_suffix|>cribeCases } = require("./HotTestCases.template");
describe("HotTestCases", () => {
describeCases({
name: "async-node",
target: "async-node"
});
});
<|fim_middle|>";
const { des<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const { describeCases } = require("./HotTestCases.<|fim_suffix|> target: "node"
});
});
<|fim_middle|>template");
describe("HotTestCases", () => {
describeCases({
name: "node",
<|endoftext|> | fim | webpack/webpack | javascript |
"use strict";
const { describeCases } = require("./HotTestCases.template");
describe("HotTestCases", () => {
describeCases({
name: "web",
target: "web"
});
});
<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const { describeCases } = require("./HotTestCases.template");
descr<|fim_suffix|>: "webworker",
target: "webworker"
});
});
<|fim_middle|>ibe("HotTestCases", () => {
describeCases({
name<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_suffix|>nameEnd: "<script".length
}
]
};
};
it.each([
["<script type='module' src='a.js'></script>"],
["<script type=module src=b.js></script>"]
])(
"drops a single-quoted/unquoted type=module for classic output (%s)",
(source) => {
const { module, presentationalDependencies } = makeModule... | fim | webpack/webpack | javascript |
"use strict";
/* eslint-disable no-unused-expressions, no-unassigned-vars, func-names */
// cspell:ignore fghsub notry fghsub notry notry this's ijksub this's ijksub fghsub fghsub notry ijksub ijksub strrring strrring strr strrring strrring strr Sstrrringy strone stronetwo stronetwothree stronetwo stronetwothree stro... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const LazySet = require("../lib/util/LazySet");
describe("LazySet", () => {
it("addAll", () => {
const a = new Set(["a"]);
const sut = new LazySet(a);
const empty = new LazySet([]);
expect(sut.size).toBe(1);
sut.addAll(empty);
expect(sut._toDeepMerge).toStrictEqual([]);
<|fim... | fim | webpack/webpack | javascript |
<|fim_suffix|>
name: "local_module_sample",
idx: 2,
used: false
});
expect(state.localModules).toHaveLength(3);
});
});
describe("getLocalModule", () => {
it("returns `null` if names information doesn't match", () => {
const state =
/** @type {import("../lib/javascript/JavascriptParser")... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
require("./helpers/warmup-webpack");
const path = require("path");
const fs = require("graceful-fs");
const rimraf = require("rimraf");
const webpack = require("..");
const captureStdio = require("./helpers/captureStdio");
const toMiB = (/** @type {number} */ bytes) =>
`${Math.round(byte... | fim | webpack/webpack | javascript |
"use strict";
const path = require("path");
const ModuleDependencyError = require("../lib/errors/ModuleDependencyError");
describe("ModuleDependencyError", () => {
/** @type {{ error?: Error, moduleDependencyError?: InstanceType<typeof ModuleDependencyError> }} */
let env;
beforeEach(() => {
env = {};
});
de... | fim | webpack/webpack | javascript |
<|fim_suffix|> @type {((...args: EXPECTED_ANY[]) => void)[]} */
const watchCallbacksUndelayed = [];
compiler.watchFileSystem =
/** @type {import("../lib/util/fs").WatchFileSystem} */ ({
watch(
files,
directories,
missing,
startTime,
options,
callback,
callbackUndelayed
... | fim | webpack/webpack | javascript |
<|fim_suffix|>;
const callback = (
/** @type {Error | null | undefined} */ err,
/** @type {unknown} */ res
) => {
expect(err).toBeNull();
expect(res).toBeUndefined();
++callbacks;
};
multiItemCache.get(callback);
expect(callbacks).toBe(1);
});
/**
* @param {number} howMany how many generat... | fim | webpack/webpack | javascript |
<|fim_suffix|>pect.any(Array) })
);
expect(statsObject.children).toHaveLength(2);
});
it("should work with a boolean value", async () => {
const stats = await compile([
{
context: __dirname,
entry: "./fixtures/a"
},
{
context: __dirname,
entry: "./fixtures/b"
}
]);
expect(stats... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const SyncHook = require("tapable").SyncHook;
const MultiWatching = require("../lib/MultiWatching");
/** @typedef {import("../lib/Watching")} Watching */
/** @typedef {import("../lib/MultiCompiler")} MultiCompiler */
/**
* @returns {Watching} watching
*/
const createWatching = () =>
/*... | fim | webpack/webpack | javascript |
<|fim_suffix|> false
);
// @ts-expect-error generated file does not exist at type-check time
const result = require("./js/NodeTemplatePluginSingle/result2");
expect(result.nextTick).toBe(process.nextTick);
expect(result.fs).toBe(require("fs"));
const sameTick = true;
result.loadChunk(
... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const SourceMapSource = require("webpack-sources").SourceMapSource;
const OriginalSource = require("webpack-sources").OriginalSource;
const RawSource = require("webpack-sources").RawSource;
const NormalModule = require("../lib/NormalModule");
const HarmonyImportSideEffectDependency = requir... | fim | webpack/webpack | javascript |
<|fim_suffix|>e: { compression: false } });
expect(execute()).toBe(30);
for (let i = 0; i < 30; i++) {
updateSrc({
[files[i]]: "export default 2;",
"style.modules.css": `.class-${i} { color: red; background: url('image1.png'); }`
});
await compile({ cache: { compression: false } });
expect(execu... | fim | webpack/webpack | javascript |
<|fim_suffix|>tDuration[1] / 1000
);
const cpuProfile = data.find(
(/** @type {EXPECTED_ANY} */ entry) => entry.name === "CpuProfile"
);
expect(cpuProfile).toBeTypeOf("object");
const profile = cpuProfile.args.data.cpuProfile;
expect(profile.startTime).toBeGreaterThanOrEqual(minTs);
exp... | fim | webpack/webpack | javascript |
"use strict";
const path = require("path");
const ProfilingPlugin = require("../lib/debug/ProfilingPlugin");
describe("Profiling Plugin", () => {
it("should persist the passed output path", () => {
const outputPath = path.join(__dirname, "invest_in_doge_coin");
const plugin = new ProfilingPlugin({
outputPath
... | fim | webpack/webpack | javascript |
<|fim_suffix|>s = 70;
return runCompilerAsync(compiler).then(() => {
const logs = stderr.toString();
expect(logs).toEqual(
expect.stringMatching(/\d+\/\d+ [custom test logger]/)
);
expect(logs).toEqual(expect.stringMatching(/\d+ active/));
expect(logs).toEqual(expect.stringMatching(/\d+\/\d+ module... | fim | webpack/webpack | javascript |
<|fim_suffix|> q.enqueue("item2");
q.enqueue("item3");
expect(q.dequeue()).toBe("item2");
expect(q.dequeue()).toBe("item3");
expect(q.dequeue()).toBeUndefined();
});
it("length", () => {
const q = new Queue();
q.enqueue("item1");
q.enqueue("item2");
expect(q).toHaveLength(2);
q.dequeue();
ex... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const path = require("path");
const RawModule = require("../lib/RawModule");
const RequestShortener = require("../lib/RequestShortener");
describe("RawModule", () => {
const source = "sourceStr attribute";
const identifier = "identifierStr attribute";
const readableIdentifier = "readabl... | fim | webpack/webpack | javascript |
<|fim_suffix|>e.js");
});
it("should create RequestShortener and shorten with ../ file in parent directory", () => {
const shortener = new RequestShortener("/foo/bar");
expect(shortener.shorten("/foo/baz/some.js")).toBe("../baz/some.js");
});
it("should create RequestShortener and not shorten parent directory... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const RequestShortener = require("../lib/Reques<|fim_suffix|> "a",
{ expr: /** @type {string} */ (/** @type {unknown} */ (2)) }
)
).toBe('1 + "a" + 2');
});
it("should prefer shorten variant #2", () => {
expect(
runtimeTemplate.concatenation(
{ expr: /** @ty... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const {
parseRange,
parseVersion,
parseVersionRuntimeCode,
rangeToString,
rangeToStringRuntimeCode,
satisfy,
satisfyRuntimeCode,
versionLt,
versionLtRuntimeCode
} = require("../lib/util/semver");
describe("SemVer", () => {
const createRuntimeFunction = (
/** @type {(helpers: un... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const ProvideSharedModule = require("../lib/sharing/ProvideSharedModule");
const { normalizeVersion } = require("../lib/sharing/utils");
const { makePathsRelative } = require("../lib/util/identifier");
describe("ProvideSharedModule identifier", () => {
it("normalizes the request path acro... | fim | webpack/webpack | javascript |
"use strict";
const SideEffectsFlagPlugin = require("../lib/optimize/SideEffectsFlagPlugin");
describe("SideEffectsFlagPlugin", () => {
it("should assume true", () => {
expect(
SideEffectsFlagPlugin.moduleHasSideEffects(
"./foo/bar.js",
undefined,
new Map()
)
).toBe(true);
});
it("should und... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const SortableSet = require("../lib/util/SortableSet");
describe("util/SortableSet", () => {
it("can be constructed like a normal Set", () => {
const sortableSet = new SortableSet(
[1, 1, 1, 1, 1, 4, 5, 2],
(a, b) => a - b
);
expect([...sortableSet]).toEqual([1, 4, 5, 2]);
})... | fim | webpack/webpack | javascript |
<|fim_suffix|>: false,
env: true,
_env: {
prod: ["foo", "bar"],
baz: true
}
})
)
)
).toBe(
"Environment (--env): {\n" +
' "prod": [\n' +
' "foo",\n' +
' "bar"\n' +
" ],\n" +
' "baz": true\n' +
"}"
);
});
it("should omit all propertie... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
require("./helpers/warmup-webpack");
const path = require("path");
const fs = require("graceful-fs");
const rimraf = require("rimraf");
const webpack = require("..");
const { registerPerCaseSnapshotHooks } = require("./harness/snapshot");
const captureStdio = require("./helpers/captureStdi... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const Template = require("../lib/Template<|fim_suffix|>h("path/to-sdfas/sadfome$$.js")).toBe(
"path-to-sdfas-sadfome$$-js"
);
});
it("should strip JSDoc types from runtime function content but keep other comments", () => {
const content = Template.getFunctionContent({
toString:... | fim | webpack/webpack | javascript |
<|fim_suffix|>("");
});
it("interpolates [fullhash] and legacy [hash]", () => {
const data = { hash: "0123456789abcdef" };
expect(interpolate("[fullhash]", data)).toBe("0123456789abcdef");
expect(interpolate("[fullhash:4]", data)).toBe("0123");
expect(interpolate("[hash]", data)).toBe("0123456789abcdef");
}... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
require("./helpers/warmup-webpack");
/** @typedef {{ name: string, tests: string[] }} Category */
/**
* @typedef {object} SuiteConfig
* @property {string} name suite name
* @property {string=} target target
* @property {string=} mode mode
* @property {boolean=} module module
* @prope... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const { describeCases } = require("./TestCases.template");
describe("TestCases", () => {
describeCases(
/** @type {EXP<|fim_suffix|>gin().apply(c);
}
]
})
);
});
<|fim_middle|>ECTED_ANY} */ ({
name: "all-combined",
mode: "production",
devtool: "source-map",
minimiz... | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const path = require("path");
const { describeCases } = require("./TestCases.template");
describe("TestCases", () => {
describeCases({
name: "cache pack",
cache: {
type: "filesystem",
buildDependencies: {
<|fim_suffix|>enateModules: true
}
});
});
<|fim_middle|> defaultWeb... | fim | webpack/webpack | javascript |
<|fim_suffix|>emplate");
describe("TestCases", () => {
describeCases({
name: "development",
mode: "development",
devtool: false
});
});
<|fim_prefix|>"use strict";
const { describeCases } = require("./TestCases<|fim_middle|>.t<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const { describeCases } = require(<|fim_suffix|>ce-map",
devtool: "cheap-source-map"
});
});
<|fim_middle|>"./TestCases.template");
describe("TestCases", () => {
describeCases({
name: "devtool-cheap-sour<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const { describeCases } = require("./TestCases.template");
desc<|fim_suffix|>
name: "devtool-eval",
devtool: "eval"
});
});
<|fim_middle|>ribe("TestCases", () => {
describeCases({<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
const { describeCases } = require("./TestCases.template");
describe("TestCases", () => {
describeCases({
name: "devt<|fim_suffix|>val-cheap-module-source-map",
devtool: "eval-cheap-module-source-map"
});
});
<|fim_middle|>ool-e<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";
cons<|fim_suffix|>: "eval-cheap-source-map"
});
});
<|fim_middle|>t { describeCases } = require("./TestCases.template");
describe("TestCases", () => {
describeCases({
name: "devtool-eval-cheap-source-map",
devtool<|endoftext|> | fim | webpack/webpack | javascript |
<|fim_prefix|>"use strict";<|fim_suffix|>eterministic-module-ids",
devtool: "eval",
optimization: {
moduleIds: "deterministic"
}
});
});
<|fim_middle|>
const { describeCases } = require("./TestCases.template");
describe("TestCases", () => {
describeCases({
name: "devtool-eval-d<|endoftext|> | fim | webpack/webpack | javascript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.