diff --git a/lib/ChunkGraph.js b/lib/ChunkGraph.js index 8e9bd9fc8..a9ada154a 100644 --- a/lib/ChunkGraph.js +++ b/lib/ChunkGraph.js @@ -558,7 +558,7 @@ class ChunkGraph { /** * @param {Chunk} chunk the chunk - * @returns {Module[]} root modules of the chunks (ordered by identifer) + * @returns {Module[]} root modules of the chunks (ordered by identifier) */ getChunkRootModules(chunk) { const cgc = this._getChunkGraphChunk(chunk); diff --git a/lib/Template.js b/lib/Template.js index 939f18af2..e8acb244b 100644 --- a/lib/Template.js +++ b/lib/Template.js @@ -129,7 +129,7 @@ class Template { * @param {number} n number to convert to ident * @returns {string} returns single character ident */ - static numberToIdentifer(n) { + static numberToIdentifier(n) { // lower case if (n < DELTA_A_TO_Z) { return String.fromCharCode(START_LOWERCASE_ALPHABET_CODE + n); @@ -144,8 +144,8 @@ class Template { // use multiple letters return ( - Template.numberToIdentifer(n % (2 * DELTA_A_TO_Z)) + - Template.numberToIdentifer(Math.floor(n / (2 * DELTA_A_TO_Z))) + Template.numberToIdentifier(n % (2 * DELTA_A_TO_Z)) + + Template.numberToIdentifier(Math.floor(n / (2 * DELTA_A_TO_Z))) ); } diff --git a/lib/dependencies/HarmonyDetectionParserPlugin.js b/lib/dependencies/HarmonyDetectionParserPlugin.js index b6a6034ea..9ab9a9115 100644 --- a/lib/dependencies/HarmonyDetectionParserPlugin.js +++ b/lib/dependencies/HarmonyDetectionParserPlugin.js @@ -62,21 +62,21 @@ module.exports = class HarmonyDetectionParserPlugin { }; const nonHarmonyIdentifiers = ["define", "exports"]; - for (const identifer of nonHarmonyIdentifiers) { + for (const identifier of nonHarmonyIdentifiers) { parser.hooks.evaluateTypeof - .for(identifer) + .for(identifier) .tap("HarmonyDetectionParserPlugin", nullInHarmony); parser.hooks.typeof - .for(identifer) + .for(identifier) .tap("HarmonyDetectionParserPlugin", skipInHarmony); parser.hooks.evaluate - .for(identifer) + .for(identifier) .tap("HarmonyDetectionParserPlugin", nullInHarmony); parser.hooks.expression - .for(identifer) + .for(identifier) .tap("HarmonyDetectionParserPlugin", skipInHarmony); parser.hooks.call - .for(identifer) + .for(identifier) .tap("HarmonyDetectionParserPlugin", skipInHarmony); } } diff --git a/lib/optimize/MangleExportsPlugin.js b/lib/optimize/MangleExportsPlugin.js index 2b4b268ce..b731f3979 100644 --- a/lib/optimize/MangleExportsPlugin.js +++ b/lib/optimize/MangleExportsPlugin.js @@ -5,7 +5,7 @@ "use strict"; -const { numberToIdentifer } = require("../Template"); +const { numberToIdentifier } = require("../Template"); const { assignDeterministicIds } = require("../ids/IdHelpers"); const { concatComparators, @@ -65,7 +65,7 @@ class MangleExportsPlugin { e => e.name, comparator, (e, id) => { - const name = numberToIdentifer(id); + const name = numberToIdentifier(id); const size = usedNames.size; usedNames.add(name); if (size === usedNames.size) return false; diff --git a/lib/wasm/WebAssemblyUtils.js b/lib/wasm/WebAssemblyUtils.js index e1ea2dd21..712bc692f 100644 --- a/lib/wasm/WebAssemblyUtils.js +++ b/lib/wasm/WebAssemblyUtils.js @@ -46,7 +46,7 @@ const getUsedDependencies = (moduleGraph, module, mangle) => { if (mangle) { array.push({ dependency: dep, - name: Template.numberToIdentifer(importIndex++), + name: Template.numberToIdentifier(importIndex++), module: MANGLED_MODULE }); } else { diff --git a/open-bot.yaml b/open-bot.yaml index 838e87ebd..51819ca1e 100644 --- a/open-bot.yaml +++ b/open-bot.yaml @@ -541,7 +541,7 @@ rules: last_action_age: 13w # three months actions: comment: - identifer: inactive-warning + identifier: inactive-warning message: |- **This issue had no activity for at least three months.** @@ -565,7 +565,7 @@ rules: actions: close: true comment: - identifer: inactive-close + identifier: inactive-close message: |- Issue was closed because of inactivity. diff --git a/schemas/plugins/SourceMapDevToolPlugin.json b/schemas/plugins/SourceMapDevToolPlugin.json index 60cd87a69..d948d142d 100644 --- a/schemas/plugins/SourceMapDevToolPlugin.json +++ b/schemas/plugins/SourceMapDevToolPlugin.json @@ -64,7 +64,7 @@ "description": "Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap used only if 'moduleFilenameTemplate' would result in a conflict", "oneOf": [ { - "description": "Custom function generating the identifer", + "description": "Custom function generating the identifier", "instanceof": "Function", "tsType": "Function" }, @@ -108,7 +108,7 @@ "description": "Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap", "oneOf": [ { - "description": "Custom function generating the identifer", + "description": "Custom function generating the identifier", "instanceof": "Function", "tsType": "Function" }, diff --git a/test/Template.unittest.js b/test/Template.unittest.js index 8b744e9c5..e951fbf95 100644 --- a/test/Template.unittest.js +++ b/test/Template.unittest.js @@ -10,7 +10,7 @@ describe("Template", () => { const items = []; let item; for (let i = 0; i < 80; i += 1) { - item = Template.numberToIdentifer(i); + item = Template.numberToIdentifier(i); expect(item).not.toBe(""); expect(items).not.toContain(item); items.push(item); diff --git a/test/numberHash.unittest.js b/test/numberHash.unittest.js index 683d1a161..ea059297d 100644 --- a/test/numberHash.unittest.js +++ b/test/numberHash.unittest.js @@ -1,12 +1,12 @@ const numberHash = require("../lib/util/numberHash"); -const { numberToIdentifer } = require("../lib/Template"); +const { numberToIdentifier } = require("../lib/Template"); describe("numberHash", () => { for (const n of [10, 100, 1000, 10000]) { it("should eventually fill nearly the complete range up to n", () => { const set = new Set(); for (let i = 0; i < n * 200; i++) { - set.add(numberHash(numberToIdentifer(i), n)); + set.add(numberHash(numberToIdentifier(i), n)); if (set.size >= n - 1) break; } expect(set.size).toBeGreaterThanOrEqual(n - 1);