mirror of https://github.com/webpack/webpack.git
correct spelling mistake, update identifer to identifier
This commit is contained in:
parent
efda972ffd
commit
ff8c37e887
|
@ -558,7 +558,7 @@ class ChunkGraph {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Chunk} chunk the chunk
|
* @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) {
|
getChunkRootModules(chunk) {
|
||||||
const cgc = this._getChunkGraphChunk(chunk);
|
const cgc = this._getChunkGraphChunk(chunk);
|
||||||
|
|
|
@ -129,7 +129,7 @@ class Template {
|
||||||
* @param {number} n number to convert to ident
|
* @param {number} n number to convert to ident
|
||||||
* @returns {string} returns single character ident
|
* @returns {string} returns single character ident
|
||||||
*/
|
*/
|
||||||
static numberToIdentifer(n) {
|
static numberToIdentifier(n) {
|
||||||
// lower case
|
// lower case
|
||||||
if (n < DELTA_A_TO_Z) {
|
if (n < DELTA_A_TO_Z) {
|
||||||
return String.fromCharCode(START_LOWERCASE_ALPHABET_CODE + n);
|
return String.fromCharCode(START_LOWERCASE_ALPHABET_CODE + n);
|
||||||
|
@ -144,8 +144,8 @@ class Template {
|
||||||
|
|
||||||
// use multiple letters
|
// use multiple letters
|
||||||
return (
|
return (
|
||||||
Template.numberToIdentifer(n % (2 * DELTA_A_TO_Z)) +
|
Template.numberToIdentifier(n % (2 * DELTA_A_TO_Z)) +
|
||||||
Template.numberToIdentifer(Math.floor(n / (2 * DELTA_A_TO_Z)))
|
Template.numberToIdentifier(Math.floor(n / (2 * DELTA_A_TO_Z)))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,21 +62,21 @@ module.exports = class HarmonyDetectionParserPlugin {
|
||||||
};
|
};
|
||||||
|
|
||||||
const nonHarmonyIdentifiers = ["define", "exports"];
|
const nonHarmonyIdentifiers = ["define", "exports"];
|
||||||
for (const identifer of nonHarmonyIdentifiers) {
|
for (const identifier of nonHarmonyIdentifiers) {
|
||||||
parser.hooks.evaluateTypeof
|
parser.hooks.evaluateTypeof
|
||||||
.for(identifer)
|
.for(identifier)
|
||||||
.tap("HarmonyDetectionParserPlugin", nullInHarmony);
|
.tap("HarmonyDetectionParserPlugin", nullInHarmony);
|
||||||
parser.hooks.typeof
|
parser.hooks.typeof
|
||||||
.for(identifer)
|
.for(identifier)
|
||||||
.tap("HarmonyDetectionParserPlugin", skipInHarmony);
|
.tap("HarmonyDetectionParserPlugin", skipInHarmony);
|
||||||
parser.hooks.evaluate
|
parser.hooks.evaluate
|
||||||
.for(identifer)
|
.for(identifier)
|
||||||
.tap("HarmonyDetectionParserPlugin", nullInHarmony);
|
.tap("HarmonyDetectionParserPlugin", nullInHarmony);
|
||||||
parser.hooks.expression
|
parser.hooks.expression
|
||||||
.for(identifer)
|
.for(identifier)
|
||||||
.tap("HarmonyDetectionParserPlugin", skipInHarmony);
|
.tap("HarmonyDetectionParserPlugin", skipInHarmony);
|
||||||
parser.hooks.call
|
parser.hooks.call
|
||||||
.for(identifer)
|
.for(identifier)
|
||||||
.tap("HarmonyDetectionParserPlugin", skipInHarmony);
|
.tap("HarmonyDetectionParserPlugin", skipInHarmony);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const { numberToIdentifer } = require("../Template");
|
const { numberToIdentifier } = require("../Template");
|
||||||
const { assignDeterministicIds } = require("../ids/IdHelpers");
|
const { assignDeterministicIds } = require("../ids/IdHelpers");
|
||||||
const {
|
const {
|
||||||
concatComparators,
|
concatComparators,
|
||||||
|
@ -65,7 +65,7 @@ class MangleExportsPlugin {
|
||||||
e => e.name,
|
e => e.name,
|
||||||
comparator,
|
comparator,
|
||||||
(e, id) => {
|
(e, id) => {
|
||||||
const name = numberToIdentifer(id);
|
const name = numberToIdentifier(id);
|
||||||
const size = usedNames.size;
|
const size = usedNames.size;
|
||||||
usedNames.add(name);
|
usedNames.add(name);
|
||||||
if (size === usedNames.size) return false;
|
if (size === usedNames.size) return false;
|
||||||
|
|
|
@ -46,7 +46,7 @@ const getUsedDependencies = (moduleGraph, module, mangle) => {
|
||||||
if (mangle) {
|
if (mangle) {
|
||||||
array.push({
|
array.push({
|
||||||
dependency: dep,
|
dependency: dep,
|
||||||
name: Template.numberToIdentifer(importIndex++),
|
name: Template.numberToIdentifier(importIndex++),
|
||||||
module: MANGLED_MODULE
|
module: MANGLED_MODULE
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -541,7 +541,7 @@ rules:
|
||||||
last_action_age: 13w # three months
|
last_action_age: 13w # three months
|
||||||
actions:
|
actions:
|
||||||
comment:
|
comment:
|
||||||
identifer: inactive-warning
|
identifier: inactive-warning
|
||||||
message: |-
|
message: |-
|
||||||
**This issue had no activity for at least three months.**
|
**This issue had no activity for at least three months.**
|
||||||
|
|
||||||
|
@ -565,7 +565,7 @@ rules:
|
||||||
actions:
|
actions:
|
||||||
close: true
|
close: true
|
||||||
comment:
|
comment:
|
||||||
identifer: inactive-close
|
identifier: inactive-close
|
||||||
message: |-
|
message: |-
|
||||||
Issue was closed because of inactivity.
|
Issue was closed because of inactivity.
|
||||||
|
|
||||||
|
|
|
@ -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",
|
"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": [
|
"oneOf": [
|
||||||
{
|
{
|
||||||
"description": "Custom function generating the identifer",
|
"description": "Custom function generating the identifier",
|
||||||
"instanceof": "Function",
|
"instanceof": "Function",
|
||||||
"tsType": "Function"
|
"tsType": "Function"
|
||||||
},
|
},
|
||||||
|
@ -108,7 +108,7 @@
|
||||||
"description": "Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap",
|
"description": "Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap",
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
{
|
{
|
||||||
"description": "Custom function generating the identifer",
|
"description": "Custom function generating the identifier",
|
||||||
"instanceof": "Function",
|
"instanceof": "Function",
|
||||||
"tsType": "Function"
|
"tsType": "Function"
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,7 +10,7 @@ describe("Template", () => {
|
||||||
const items = [];
|
const items = [];
|
||||||
let item;
|
let item;
|
||||||
for (let i = 0; i < 80; i += 1) {
|
for (let i = 0; i < 80; i += 1) {
|
||||||
item = Template.numberToIdentifer(i);
|
item = Template.numberToIdentifier(i);
|
||||||
expect(item).not.toBe("");
|
expect(item).not.toBe("");
|
||||||
expect(items).not.toContain(item);
|
expect(items).not.toContain(item);
|
||||||
items.push(item);
|
items.push(item);
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
const numberHash = require("../lib/util/numberHash");
|
const numberHash = require("../lib/util/numberHash");
|
||||||
const { numberToIdentifer } = require("../lib/Template");
|
const { numberToIdentifier } = require("../lib/Template");
|
||||||
|
|
||||||
describe("numberHash", () => {
|
describe("numberHash", () => {
|
||||||
for (const n of [10, 100, 1000, 10000]) {
|
for (const n of [10, 100, 1000, 10000]) {
|
||||||
it("should eventually fill nearly the complete range up to n", () => {
|
it("should eventually fill nearly the complete range up to n", () => {
|
||||||
const set = new Set();
|
const set = new Set();
|
||||||
for (let i = 0; i < n * 200; i++) {
|
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;
|
if (set.size >= n - 1) break;
|
||||||
}
|
}
|
||||||
expect(set.size).toBeGreaterThanOrEqual(n - 1);
|
expect(set.size).toBeGreaterThanOrEqual(n - 1);
|
||||||
|
|
Loading…
Reference in New Issue