react-intl-lint 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -21
- package/README.md +299 -229
- package/dist/bin.d.ts +2 -2
- package/dist/bin.js +4 -4
- package/dist/package.json +104 -121
- package/dist/src/cli/bin.d.ts +2 -2
- package/dist/src/cli/bin.js +17 -6
- package/dist/src/cli/bin.js.map +1 -1
- package/dist/src/cli/cli.d.ts +17 -16
- package/dist/src/cli/cli.js +217 -173
- package/dist/src/cli/cli.js.map +1 -1
- package/dist/src/cli/dictionaries/CliOptions.d.ts +3 -3
- package/dist/src/cli/dictionaries/CliOptions.js +171 -157
- package/dist/src/cli/dictionaries/CliOptions.js.map +1 -1
- package/dist/src/cli/dictionaries/index.d.ts +1 -1
- package/dist/src/cli/dictionaries/index.js +17 -17
- package/dist/src/cli/enums/OptionsNames.d.ts +31 -29
- package/dist/src/cli/enums/OptionsNames.js +35 -35
- package/dist/src/cli/enums/OptionsNames.js.map +1 -1
- package/dist/src/cli/enums/OptionsPath.d.ts +6 -5
- package/dist/src/cli/enums/OptionsPath.js +9 -9
- package/dist/src/cli/enums/OptionsPath.js.map +1 -1
- package/dist/src/cli/enums/index.d.ts +2 -2
- package/dist/src/cli/enums/index.js +18 -18
- package/dist/src/cli/models/Option.d.ts +7 -7
- package/dist/src/cli/models/Option.js +35 -35
- package/dist/src/cli/models/Option.js.map +1 -1
- package/dist/src/cli/models/index.d.ts +1 -1
- package/dist/src/cli/models/index.js +17 -17
- package/dist/src/cli/utils/file.d.ts +3 -3
- package/dist/src/cli/utils/file.js +59 -50
- package/dist/src/cli/utils/file.js.map +1 -1
- package/dist/src/cli/utils/index.d.ts +1 -1
- package/dist/src/cli/utils/index.js +17 -17
- package/dist/src/core/index.d.ts +1 -7
- package/dist/src/core/index.js +17 -23
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/react-intl/regex.d.ts +1 -0
- package/dist/src/react-intl/regex.js +8 -0
- package/dist/src/react-intl/regex.js.map +1 -0
- package/package.json +104 -121
- package/dist/src/core/client.d.ts +0 -16
- package/dist/src/core/client.js +0 -171
- package/dist/src/core/client.js.map +0 -1
- package/dist/src/core/config.d.ts +0 -3
- package/dist/src/core/config.js +0 -24
- package/dist/src/core/config.js.map +0 -1
- package/dist/src/core/enums/ErrorFlow.d.ts +0 -15
- package/dist/src/core/enums/ErrorFlow.js +0 -20
- package/dist/src/core/enums/ErrorFlow.js.map +0 -1
- package/dist/src/core/enums/ErrorTypes.d.ts +0 -6
- package/dist/src/core/enums/ErrorTypes.js +0 -11
- package/dist/src/core/enums/ErrorTypes.js.map +0 -1
- package/dist/src/core/enums/StatusCodes.d.ts +0 -6
- package/dist/src/core/enums/StatusCodes.js +0 -11
- package/dist/src/core/enums/StatusCodes.js.map +0 -1
- package/dist/src/core/enums/ToggleRule.d.ts +0 -5
- package/dist/src/core/enums/ToggleRule.js +0 -10
- package/dist/src/core/enums/ToggleRule.js.map +0 -1
- package/dist/src/core/enums/index.d.ts +0 -4
- package/dist/src/core/enums/index.js +0 -21
- package/dist/src/core/enums/index.js.map +0 -1
- package/dist/src/core/interface/IAppConfig.d.ts +0 -10
- package/dist/src/core/interface/IAppConfig.js +0 -3
- package/dist/src/core/interface/IAppConfig.js.map +0 -1
- package/dist/src/core/interface/ILogger.d.ts +0 -5
- package/dist/src/core/interface/ILogger.js +0 -3
- package/dist/src/core/interface/ILogger.js.map +0 -1
- package/dist/src/core/interface/IMisprint.d.ts +0 -6
- package/dist/src/core/interface/IMisprint.js +0 -3
- package/dist/src/core/interface/IMisprint.js.map +0 -1
- package/dist/src/core/interface/IRule.d.ts +0 -8
- package/dist/src/core/interface/IRule.js +0 -3
- package/dist/src/core/interface/IRule.js.map +0 -1
- package/dist/src/core/interface/IRulesConfig.d.ts +0 -14
- package/dist/src/core/interface/IRulesConfig.js +0 -3
- package/dist/src/core/interface/IRulesConfig.js.map +0 -1
- package/dist/src/core/interface/IValidationMessage.d.ts +0 -5
- package/dist/src/core/interface/IValidationMessage.js +0 -3
- package/dist/src/core/interface/IValidationMessage.js.map +0 -1
- package/dist/src/core/interface/index.d.ts +0 -6
- package/dist/src/core/interface/index.js +0 -23
- package/dist/src/core/interface/index.js.map +0 -1
- package/dist/src/core/models/KeyModel.d.ts +0 -8
- package/dist/src/core/models/KeyModel.js +0 -15
- package/dist/src/core/models/KeyModel.js.map +0 -1
- package/dist/src/core/models/KeyModelWithLanguages.d.ts +0 -18
- package/dist/src/core/models/KeyModelWithLanguages.js +0 -29
- package/dist/src/core/models/KeyModelWithLanguages.js.map +0 -1
- package/dist/src/core/models/LanguagesModel.d.ts +0 -7
- package/dist/src/core/models/LanguagesModel.js +0 -12
- package/dist/src/core/models/LanguagesModel.js.map +0 -1
- package/dist/src/core/models/MisprintModel.d.ts +0 -8
- package/dist/src/core/models/MisprintModel.js +0 -12
- package/dist/src/core/models/MisprintModel.js.map +0 -1
- package/dist/src/core/models/StylishLogger.d.ts +0 -11
- package/dist/src/core/models/StylishLogger.js +0 -37
- package/dist/src/core/models/StylishLogger.js.map +0 -1
- package/dist/src/core/models/error/ErrorModel.d.ts +0 -7
- package/dist/src/core/models/error/ErrorModel.js +0 -4
- package/dist/src/core/models/error/ErrorModel.js.map +0 -1
- package/dist/src/core/models/error/FatalErrorModel.d.ts +0 -7
- package/dist/src/core/models/error/FatalErrorModel.js +0 -16
- package/dist/src/core/models/error/FatalErrorModel.js.map +0 -1
- package/dist/src/core/models/error/index.d.ts +0 -2
- package/dist/src/core/models/error/index.js +0 -19
- package/dist/src/core/models/error/index.js.map +0 -1
- package/dist/src/core/models/files/FileLanguageModel.d.ts +0 -10
- package/dist/src/core/models/files/FileLanguageModel.js +0 -90
- package/dist/src/core/models/files/FileLanguageModel.js.map +0 -1
- package/dist/src/core/models/files/FileModel.d.ts +0 -12
- package/dist/src/core/models/files/FileModel.js +0 -44
- package/dist/src/core/models/files/FileModel.js.map +0 -1
- package/dist/src/core/models/files/FileViewModel.d.ts +0 -7
- package/dist/src/core/models/files/FileViewModel.js +0 -22
- package/dist/src/core/models/files/FileViewModel.js.map +0 -1
- package/dist/src/core/models/files/index.d.ts +0 -3
- package/dist/src/core/models/files/index.js +0 -20
- package/dist/src/core/models/files/index.js.map +0 -1
- package/dist/src/core/models/index.d.ts +0 -8
- package/dist/src/core/models/index.js +0 -25
- package/dist/src/core/models/index.js.map +0 -1
- package/dist/src/core/models/results/ResultCliModel.d.ts +0 -22
- package/dist/src/core/models/results/ResultCliModel.js +0 -84
- package/dist/src/core/models/results/ResultCliModel.js.map +0 -1
- package/dist/src/core/models/results/ResultErrorModel.d.ts +0 -13
- package/dist/src/core/models/results/ResultErrorModel.js +0 -43
- package/dist/src/core/models/results/ResultErrorModel.js.map +0 -1
- package/dist/src/core/models/results/ResultFileModel.d.ts +0 -11
- package/dist/src/core/models/results/ResultFileModel.js +0 -16
- package/dist/src/core/models/results/ResultFileModel.js.map +0 -1
- package/dist/src/core/models/results/ResultModel.d.ts +0 -15
- package/dist/src/core/models/results/ResultModel.js +0 -62
- package/dist/src/core/models/results/ResultModel.js.map +0 -1
- package/dist/src/core/models/results/index.d.ts +0 -4
- package/dist/src/core/models/results/index.js +0 -21
- package/dist/src/core/models/results/index.js.map +0 -1
- package/dist/src/core/rules/AbsentViewKeysRule.d.ts +0 -12
- package/dist/src/core/rules/AbsentViewKeysRule.js +0 -38
- package/dist/src/core/rules/AbsentViewKeysRule.js.map +0 -1
- package/dist/src/core/rules/EmptyKeysRule.d.ts +0 -10
- package/dist/src/core/rules/EmptyKeysRule.js +0 -25
- package/dist/src/core/rules/EmptyKeysRule.js.map +0 -1
- package/dist/src/core/rules/MisprintRule.d.ts +0 -12
- package/dist/src/core/rules/MisprintRule.js +0 -38
- package/dist/src/core/rules/MisprintRule.js.map +0 -1
- package/dist/src/core/rules/ZombiesRule.d.ts +0 -10
- package/dist/src/core/rules/ZombiesRule.js +0 -26
- package/dist/src/core/rules/ZombiesRule.js.map +0 -1
- package/dist/src/core/rules/index.d.ts +0 -4
- package/dist/src/core/rules/index.js +0 -21
- package/dist/src/core/rules/index.js.map +0 -1
- package/dist/src/core/utils/index.d.ts +0 -4
- package/dist/src/core/utils/index.js +0 -21
- package/dist/src/core/utils/index.js.map +0 -1
- package/dist/src/core/utils/keys.d.ts +0 -7
- package/dist/src/core/utils/keys.js +0 -40
- package/dist/src/core/utils/keys.js.map +0 -1
- package/dist/src/core/utils/logger.d.ts +0 -3
- package/dist/src/core/utils/logger.js +0 -13
- package/dist/src/core/utils/logger.js.map +0 -1
- package/dist/src/core/utils/path.d.ts +0 -5
- package/dist/src/core/utils/path.js +0 -56
- package/dist/src/core/utils/path.js.map +0 -1
- package/dist/src/core/utils/shared.d.ts +0 -2
- package/dist/src/core/utils/shared.js +0 -24
- package/dist/src/core/utils/shared.js.map +0 -1
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResultFileModel = void 0;
|
|
4
|
-
const enums_1 = require("../../enums");
|
|
5
|
-
class ResultFileModel {
|
|
6
|
-
constructor(value, errors = [], errorType = enums_1.ErrorTypes.error) {
|
|
7
|
-
this.value = value;
|
|
8
|
-
this.errors = errors;
|
|
9
|
-
this.errorType = errorType;
|
|
10
|
-
}
|
|
11
|
-
message() {
|
|
12
|
-
return this.value ? `Following file ${this.value} have errors:` : `Founded errors without file`;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.ResultFileModel = ResultFileModel;
|
|
16
|
-
//# sourceMappingURL=ResultFileModel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResultFileModel.js","sourceRoot":"","sources":["../../../../../src/core/models/results/ResultFileModel.ts"],"names":[],"mappings":";;;AAAA,uCAAyC;AAIzC,MAAM,eAAe;IAKjB,YACI,KAAc,EACd,SAA6B,EAAE,EAC/B,YAAwB,kBAAU,CAAC,KAAK;QAExC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,CAAC;IAEM,OAAO;QACV,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,kBAAkB,IAAI,CAAC,KAAK,eAAe,CAAC,CAAC,CAAC,6BAA6B,CAAC;IACpG,CAAC;CACJ;AAEQ,0CAAe"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ResultFileModel } from './ResultFileModel';
|
|
2
|
-
import { ILogger } from '../../interface';
|
|
3
|
-
import { StylishLogger } from '../StylishLogger';
|
|
4
|
-
import { ResultCliModel } from './ResultCliModel';
|
|
5
|
-
declare class ResultModel extends StylishLogger {
|
|
6
|
-
cli: ResultCliModel;
|
|
7
|
-
files: ResultFileModel[];
|
|
8
|
-
hasError: boolean;
|
|
9
|
-
hasWarning: boolean;
|
|
10
|
-
readonly message: string;
|
|
11
|
-
constructor(cliModel: ResultCliModel, files?: ResultFileModel[], hasError?: boolean, hasWarning?: boolean, logger?: ILogger);
|
|
12
|
-
printResult(): void;
|
|
13
|
-
printSummery(): void;
|
|
14
|
-
}
|
|
15
|
-
export { ResultModel };
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResultModel = void 0;
|
|
4
|
-
const lodash_1 = require("lodash");
|
|
5
|
-
const enums_1 = require("../../enums");
|
|
6
|
-
const StylishLogger_1 = require("../StylishLogger");
|
|
7
|
-
class ResultModel extends StylishLogger_1.StylishLogger {
|
|
8
|
-
constructor(cliModel, files = [], hasError = false, hasWarning = false, logger = console) {
|
|
9
|
-
super(logger, hasError ? enums_1.ErrorTypes.error : enums_1.ErrorTypes.warning);
|
|
10
|
-
this.message = `Find missing translation keys in project`;
|
|
11
|
-
this.cli = cliModel;
|
|
12
|
-
this.files = files;
|
|
13
|
-
this.hasError = hasError;
|
|
14
|
-
this.hasWarning = hasWarning;
|
|
15
|
-
}
|
|
16
|
-
printResult() {
|
|
17
|
-
if (this.files.length !== 0) {
|
|
18
|
-
this.printMessage(`${this.message}\n`);
|
|
19
|
-
this.files.forEach((file) => {
|
|
20
|
-
this.printMessage(`\n\t${file.message()}\n`, file.errorType);
|
|
21
|
-
file.errors.forEach((error) => {
|
|
22
|
-
(0, lodash_1.isArray)(error.message())
|
|
23
|
-
? error.message().map((message) => {
|
|
24
|
-
this.printMessage(`\t\t${message}\n`, error.errorType);
|
|
25
|
-
})
|
|
26
|
-
: this.printMessage(`\t\t${error.message()}\n`, error.errorType);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
printSummery() {
|
|
32
|
-
if (this.cli.hasWarnings() || this.cli.hasErrors()) {
|
|
33
|
-
const totalErrorType = this.cli.isFullOfWarning() || this.cli.hasErrors() ? enums_1.ErrorTypes.error : enums_1.ErrorTypes.warning;
|
|
34
|
-
const emptyKeys = this.cli.errors.filter((x) => x.errorFlow === enums_1.ErrorFlow.emptyKeys);
|
|
35
|
-
const zombieKeys = this.cli.errors.filter((x) => x.errorFlow === enums_1.ErrorFlow.zombieKeys);
|
|
36
|
-
const keysOnViews = this.cli.errors.filter((x) => x.errorFlow === enums_1.ErrorFlow.keysOnViews);
|
|
37
|
-
const misprintKeys = this.cli.errors.filter((x) => x.errorFlow === enums_1.ErrorFlow.misprintKeys);
|
|
38
|
-
this.printMessage(`\nFind following errors:`, totalErrorType);
|
|
39
|
-
if (emptyKeys.length !== 0) {
|
|
40
|
-
const errorType = this.cli.isFullOfWarning() ? enums_1.ErrorTypes.error : emptyKeys[0].errorType;
|
|
41
|
-
this.printMessage(`Empty Keys: \t ${emptyKeys.length}`, errorType);
|
|
42
|
-
}
|
|
43
|
-
if (zombieKeys.length !== 0) {
|
|
44
|
-
const errorType = this.cli.isFullOfWarning() ? enums_1.ErrorTypes.error : zombieKeys[0].errorType;
|
|
45
|
-
this.printMessage(`Zombie Keys: \t ${zombieKeys.length}`, errorType);
|
|
46
|
-
}
|
|
47
|
-
if (keysOnViews.length !== 0) {
|
|
48
|
-
const errorType = this.cli.isFullOfWarning() ? enums_1.ErrorTypes.error : keysOnViews[0].errorType;
|
|
49
|
-
this.printMessage(`Key On Views: \t ${keysOnViews.length}`, errorType);
|
|
50
|
-
}
|
|
51
|
-
if (misprintKeys.length !== 0) {
|
|
52
|
-
const errorType = this.cli.isFullOfWarning() ? enums_1.ErrorTypes.error : misprintKeys[0].errorType;
|
|
53
|
-
this.printMessage(`Misprint Keys: \t ${misprintKeys.length}`, errorType);
|
|
54
|
-
}
|
|
55
|
-
this.printMessage(`--------------------`, totalErrorType);
|
|
56
|
-
this.printMessage(`TOTAL: \t\t ${this.cli.countWarnings() + this.cli.countErrors()}`, totalErrorType);
|
|
57
|
-
this.printMessage(`\n`);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.ResultModel = ResultModel;
|
|
62
|
-
//# sourceMappingURL=ResultModel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResultModel.js","sourceRoot":"","sources":["../../../../../src/core/models/results/ResultModel.ts"],"names":[],"mappings":";;;AAAA,mCAAiC;AAIjC,uCAAoD;AAEpD,oDAAiD;AAGjD,MAAM,WAAY,SAAQ,6BAAa;IAOnC,YACI,QAAwB,EACxB,QAA2B,EAAE,EAC7B,WAAoB,KAAK,EACzB,aAAsB,KAAK,EAC3B,SAAkB,OAAO;QAEzB,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,kBAAU,CAAC,KAAK,CAAC,CAAC,CAAC,kBAAU,CAAC,OAAO,CAAC,CAAC;QATpD,YAAO,GAAW,0CAA0C,CAAC;QAUzE,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG,KAAK,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AAC,MAAM,EAAE,EAAE,SAAS,CAAC,CAAC;aACxE;YAED,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC1B,MAAM,SAAS,GAAc,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,kBAAU,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;gBACtG,IAAI,CAAC,YAAY,CAAC,oBAAoB,WAAW,CAAC,MAAM,EAAE,EAAE,SAAS,CAAC,CAAC;aAC1E;YAGD,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC3B,MAAM,SAAS,GAAc,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,kBAAU,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;gBACvG,IAAI,CAAC,YAAY,CAAC,qBAAqB,YAAY,CAAC,MAAM,EAAE,EAAE,SAAS,CAAC,CAAC;aAC5E;YAGD,IAAI,CAAC,YAAY,CAAC,sBAAsB,EAAE,cAAc,CAAC,CAAC;YAC1D,IAAI,CAAC,YAAY,CAAC,eAAe,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,EAAE,cAAc,CAAC,CAAC;YACtG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;SAC3B;IACL,CAAC;CACJ;AAEQ,kCAAW"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./ResultModel"), exports);
|
|
18
|
-
__exportStar(require("./ResultCliModel"), exports);
|
|
19
|
-
__exportStar(require("./ResultFileModel"), exports);
|
|
20
|
-
__exportStar(require("./ResultErrorModel"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/models/results/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,mDAAiC;AACjC,oDAAkC;AAClC,qDAAmC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IRule } from './../interface';
|
|
2
|
-
import { ErrorTypes, ErrorFlow } from './../enums';
|
|
3
|
-
import { ResultErrorModel, KeyModel } from './../models';
|
|
4
|
-
declare class AbsentViewKeysRule implements IRule {
|
|
5
|
-
flow: ErrorFlow;
|
|
6
|
-
handler: ErrorTypes;
|
|
7
|
-
languagesPathList: string[];
|
|
8
|
-
languagesCount(): number;
|
|
9
|
-
constructor(handler: ErrorTypes | undefined, languagesPathList: string[]);
|
|
10
|
-
check(viewsKeys: KeyModel[], languagesKeys: KeyModel[]): ResultErrorModel[];
|
|
11
|
-
}
|
|
12
|
-
export { AbsentViewKeysRule };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.AbsentViewKeysRule = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const lodash_1 = require("lodash");
|
|
9
|
-
const utils_1 = require("./../utils");
|
|
10
|
-
const enums_1 = require("./../enums");
|
|
11
|
-
const models_1 = require("./../models");
|
|
12
|
-
class AbsentViewKeysRule {
|
|
13
|
-
constructor(handler = enums_1.ErrorTypes.error, languagesPathList) {
|
|
14
|
-
this.flow = enums_1.ErrorFlow.keysOnViews;
|
|
15
|
-
this.handler = handler;
|
|
16
|
-
this.languagesPathList = languagesPathList;
|
|
17
|
-
}
|
|
18
|
-
languagesCount() {
|
|
19
|
-
return this.languagesPathList.length;
|
|
20
|
-
}
|
|
21
|
-
check(viewsKeys, languagesKeys) {
|
|
22
|
-
const keysList = utils_1.KeysUtils.groupKeysByName([...viewsKeys, ...languagesKeys]);
|
|
23
|
-
const keysListError = keysList.filter((key) => !(key.languages.length === this.languagesCount()));
|
|
24
|
-
const resultErrorList = keysListError.reduce((result, key) => {
|
|
25
|
-
const resultErrors = key.views.map((viewPath) => {
|
|
26
|
-
const absentLanguagePath = (0, lodash_1.differenceBy)(this.languagesPathList, key.languages)
|
|
27
|
-
.map((filePath) => path_1.default.basename(filePath));
|
|
28
|
-
const resultErrorModel = new models_1.ResultErrorModel(key.name, this.flow, this.handler, viewPath, absentLanguagePath);
|
|
29
|
-
return resultErrorModel;
|
|
30
|
-
});
|
|
31
|
-
result.push(...resultErrors);
|
|
32
|
-
return result;
|
|
33
|
-
}, []);
|
|
34
|
-
return resultErrorList;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.AbsentViewKeysRule = AbsentViewKeysRule;
|
|
38
|
-
//# sourceMappingURL=AbsentViewKeysRule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Abs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E,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAC;gBACjI,OAAO,gBAAgB,CAAC;YAC5B,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;YAC7B,OAAO,MAAM,CAAC;QAClB,CAAC,EAAE,EAAE,CAAC,CAAC;QACP,OAAO,eAAe,CAAC;IAC3B,CAAC;CACJ;AAEQ,gDAAkB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IRule } from './../interface';
|
|
2
|
-
import { ErrorTypes, ErrorFlow } from './../enums';
|
|
3
|
-
import { ResultErrorModel, KeyModel } from './../models';
|
|
4
|
-
declare class EmptyKeysRule implements IRule {
|
|
5
|
-
flow: ErrorFlow;
|
|
6
|
-
handler: ErrorTypes;
|
|
7
|
-
constructor(handler?: ErrorTypes);
|
|
8
|
-
check(languagesKeys: KeyModel[]): ResultErrorModel[];
|
|
9
|
-
}
|
|
10
|
-
export { EmptyKeysRule };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EmptyKeysRule = void 0;
|
|
4
|
-
const enums_1 = require("./../enums");
|
|
5
|
-
const models_1 = require("./../models");
|
|
6
|
-
class EmptyKeysRule {
|
|
7
|
-
constructor(handler = enums_1.ErrorTypes.warning) {
|
|
8
|
-
this.flow = enums_1.ErrorFlow.emptyKeys;
|
|
9
|
-
this.handler = handler;
|
|
10
|
-
}
|
|
11
|
-
check(languagesKeys) {
|
|
12
|
-
const emptyKeyList = languagesKeys.filter((x) => x.value === '' || x.value === undefined || x.value === null);
|
|
13
|
-
const resultErrorList = emptyKeyList.reduce((result, key) => {
|
|
14
|
-
const resultErrors = key.languages.map((languagePath) => {
|
|
15
|
-
const resultErrorModel = new models_1.ResultErrorModel(key.name, this.flow, this.handler, languagePath);
|
|
16
|
-
return resultErrorModel;
|
|
17
|
-
});
|
|
18
|
-
result.push(...resultErrors);
|
|
19
|
-
return result;
|
|
20
|
-
}, []);
|
|
21
|
-
return resultErrorList;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.EmptyKeysRule = EmptyKeysRule;
|
|
25
|
-
//# sourceMappingURL=EmptyKeysRule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyKeysRule.js","sourceRoot":"","sources":["../../../../src/core/rules/EmptyKeysRule.ts"],"names":[],"mappings":";;;AAGA,sCAAmD;AACnD,wCAAyD;AAEzD,MAAM,aAAa;IAIf,YACI,UAAsB,kBAAU,CAAC,OAAO;QAJrC,SAAI,GAAc,iBAAS,CAAC,SAAS,CAAC;QAMzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IAEM,KAAK,CAAC,aAAyB;QAClC,MAAM,YAAY,GAAe,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC;QAC1H,MAAM,eAAe,GAAuB,YAAY,CAAC,MAAM,CAAC,CAAC,MAA0B,EAAE,GAAa,EAAE,EAAE;YAC1G,MAAM,YAAY,GAAuB,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,YAAoB,EAAE,EAAE;gBAChF,MAAM,gBAAgB,GAAqB,IAAI,yBAAgB,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;gBACjH,OAAO,gBAAgB,CAAC;YAC5B,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;YAC7B,OAAO,MAAM,CAAC;QAClB,CAAC,EAAE,EAAE,CAAC,CAAC;QACP,OAAO,eAAe,CAAC;IAC3B,CAAC;CACJ;AAEQ,sCAAa"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IRule } from "../interface";
|
|
2
|
-
import { ErrorTypes, ErrorFlow } from './../enums';
|
|
3
|
-
import { ResultErrorModel, KeyModel } from './../models';
|
|
4
|
-
declare class MisprintRule implements IRule {
|
|
5
|
-
flow: ErrorFlow;
|
|
6
|
-
handler: ErrorTypes;
|
|
7
|
-
private readonly maxCoefficient;
|
|
8
|
-
private ignoredMisprintKeys;
|
|
9
|
-
constructor(handler?: ErrorTypes, coefficient?: number, ignoredMisprintKeys?: string[]);
|
|
10
|
-
check(viewErrorsKeys: ResultErrorModel[], languagesKeys: KeyModel[]): ResultErrorModel[];
|
|
11
|
-
}
|
|
12
|
-
export { MisprintRule };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.MisprintRule = void 0;
|
|
7
|
-
const string_similarity_1 = __importDefault(require("string-similarity"));
|
|
8
|
-
const enums_1 = require("./../enums");
|
|
9
|
-
const models_1 = require("./../models");
|
|
10
|
-
class MisprintRule {
|
|
11
|
-
constructor(handler = enums_1.ErrorTypes.warning, coefficient = 0.9, ignoredMisprintKeys = []) {
|
|
12
|
-
this.flow = enums_1.ErrorFlow.misprintKeys;
|
|
13
|
-
this.ignoredMisprintKeys = [];
|
|
14
|
-
this.handler = handler;
|
|
15
|
-
this.maxCoefficient = coefficient;
|
|
16
|
-
this.ignoredMisprintKeys = ignoredMisprintKeys;
|
|
17
|
-
}
|
|
18
|
-
check(viewErrorsKeys, languagesKeys) {
|
|
19
|
-
const languagesKeysList = languagesKeys.map((key) => key.name);
|
|
20
|
-
const resultErrorList = viewErrorsKeys.reduce((result, key) => {
|
|
21
|
-
if (this.ignoredMisprintKeys.includes(key.value)) {
|
|
22
|
-
return result;
|
|
23
|
-
}
|
|
24
|
-
const bestMatchModel = string_similarity_1.default.findBestMatch(key.value, languagesKeysList);
|
|
25
|
-
const bestMatchIndex = bestMatchModel.bestMatch.rating >= this.maxCoefficient ? bestMatchModel.bestMatchIndex : -1;
|
|
26
|
-
if (bestMatchIndex !== -1 && languagesKeys[bestMatchIndex].name !== key.value) {
|
|
27
|
-
const error = new models_1.ResultErrorModel(key.value, this.flow, this.handler, key.currentPath, key.absentedPath, [
|
|
28
|
-
`${languagesKeys[bestMatchIndex].name}`
|
|
29
|
-
]);
|
|
30
|
-
result.push(error);
|
|
31
|
-
}
|
|
32
|
-
return result;
|
|
33
|
-
}, []);
|
|
34
|
-
return resultErrorList;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.MisprintRule = MisprintRule;
|
|
38
|
-
//# sourceMappingURL=MisprintRule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MisprintRule.js","sourceRoot":"","sources":["../../../../src/core/rules/MisprintRule.ts"],"names":[],"mappings":";;;;;;AAAA,0EAAgE;AAGhE,sCAAmD;AACnD,wCAAyD;AAEzD,MAAM,YAAY;IAMd,YACI,UAAsB,kBAAU,CAAC,OAAO,EACxC,cAAsB,GAAG,EACzB,sBAAgC,EAAE;QAR/B,SAAI,GAAc,iBAAS,CAAC,YAAY,CAAC;QAGxC,wBAAmB,GAAa,EAAE,CAAC;QAOvC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,cAAc,GAAG,WAAW,CAAC;QAClC,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IACnD,CAAC;IAEM,KAAK,CAAC,cAAkC,EAAE,aAAyB;QACtE,MAAM,iBAAiB,GAAa,aAAa,CAAC,GAAG,CAAC,CAAC,GAAa,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACnF,MAAM,eAAe,GAAuB,cAAc,CAAC,MAAM,CAAC,CAAC,MAA0B,EAAE,GAAqB,EAAE,EAAE;YACpH,IAAI,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;gBAC9C,OAAO,MAAM,CAAC;aACjB;YACD,MAAM,cAAc,GAAc,2BAAgB,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;YAC/F,MAAM,cAAc,GAAW,cAAc,CAAC,SAAS,CAAC,MAAM,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3H,IAAI,cAAc,KAAK,CAAC,CAAC,IAAI,aAAa,CAAC,cAAc,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,KAAK,EAAE;gBAC3E,MAAM,KAAK,GAAqB,IAAI,yBAAgB,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,YAAY,EAAE;oBACxH,GAAG,aAAa,CAAC,cAAc,CAAC,CAAC,IAAI,EAAE;iBAC1C,CAAC,CAAC;gBACH,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACtB;YACD,OAAO,MAAM,CAAC;QAClB,CAAC,EAAE,EAAE,CAAC,CAAC;QACP,OAAO,eAAe,CAAC;IAC3B,CAAC;CAEJ;AAEQ,oCAAY"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IRule } from './../interface';
|
|
2
|
-
import { ErrorTypes, ErrorFlow } from './../enums';
|
|
3
|
-
import { ResultErrorModel, KeyModel } from './../models';
|
|
4
|
-
declare class ZombieRule implements IRule {
|
|
5
|
-
flow: ErrorFlow;
|
|
6
|
-
handler: ErrorTypes;
|
|
7
|
-
constructor(handler?: ErrorTypes);
|
|
8
|
-
check(viewKeys: KeyModel[], languagesKeys: KeyModel[]): ResultErrorModel[];
|
|
9
|
-
}
|
|
10
|
-
export { ZombieRule };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZombieRule = void 0;
|
|
4
|
-
const lodash_1 = require("lodash");
|
|
5
|
-
const enums_1 = require("./../enums");
|
|
6
|
-
const models_1 = require("./../models");
|
|
7
|
-
class ZombieRule {
|
|
8
|
-
constructor(handler = enums_1.ErrorTypes.error) {
|
|
9
|
-
this.flow = enums_1.ErrorFlow.zombieKeys;
|
|
10
|
-
this.handler = handler;
|
|
11
|
-
}
|
|
12
|
-
check(viewKeys, languagesKeys) {
|
|
13
|
-
const keysListError = (0, lodash_1.differenceBy)(languagesKeys, viewKeys, 'name');
|
|
14
|
-
const resultErrorList = keysListError.reduce((result, key) => {
|
|
15
|
-
const resultErrors = key.languages.map((languagePath) => {
|
|
16
|
-
const resultErrorModel = new models_1.ResultErrorModel(key.name, this.flow, this.handler, languagePath);
|
|
17
|
-
return resultErrorModel;
|
|
18
|
-
});
|
|
19
|
-
result.push(...resultErrors);
|
|
20
|
-
return result;
|
|
21
|
-
}, []);
|
|
22
|
-
return resultErrorList;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.ZombieRule = ZombieRule;
|
|
26
|
-
//# sourceMappingURL=ZombiesRule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ZombiesRule.js","sourceRoot":"","sources":["../../../../src/core/rules/ZombiesRule.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAGtC,sCAAmD;AACnD,wCAAyD;AAEzD,MAAM,UAAU;IAIZ,YACI,UAAsB,kBAAU,CAAC,KAAK;QAJnC,SAAI,GAAc,iBAAS,CAAC,UAAU,CAAC;QAM1C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IAEM,KAAK,CAAC,QAAoB,EAAE,aAAyB;QACxD,MAAM,aAAa,GAAe,IAAA,qBAAY,EAAqB,aAAa,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACpG,MAAM,eAAe,GAAuB,aAAa,CAAC,MAAM,CAAC,CAAC,MAA0B,EAAE,GAAa,EAAE,EAAE;YAC3G,MAAM,YAAY,GAAuB,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,YAAoB,EAAE,EAAE;gBAChF,MAAM,gBAAgB,GAAqB,IAAI,yBAAgB,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;gBACjH,OAAO,gBAAgB,CAAC;YAC5B,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;YAC7B,OAAO,MAAM,CAAC;QAClB,CAAC,EAAE,EAAE,CAAC,CAAC;QACP,OAAO,eAAe,CAAC;IAC3B,CAAC;CACJ;AAEQ,gCAAU"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./AbsentViewKeysRule"), exports);
|
|
18
|
-
__exportStar(require("./ZombiesRule"), exports);
|
|
19
|
-
__exportStar(require("./MisprintRule"), exports);
|
|
20
|
-
__exportStar(require("./EmptyKeysRule"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/rules/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,gDAA8B;AAC9B,iDAA+B;AAC/B,kDAAiC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./keys"), exports);
|
|
18
|
-
__exportStar(require("./path"), exports);
|
|
19
|
-
__exportStar(require("./logger"), exports);
|
|
20
|
-
__exportStar(require("./shared"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,yCAAuB;AACvB,2CAAyB;AACzB,2CAAyB"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { KeyModel } from "./../models";
|
|
2
|
-
import { ToggleRule } from './../enums';
|
|
3
|
-
declare class KeysUtils {
|
|
4
|
-
static groupKeysByName(keys: KeyModel[]): KeyModel[];
|
|
5
|
-
static findKeysList(keys: string[], customRegExp?: string[] | RegExp[], deepSearch?: ToggleRule): RegExp;
|
|
6
|
-
}
|
|
7
|
-
export { KeysUtils };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KeysUtils = void 0;
|
|
4
|
-
const lodash_1 = require("lodash");
|
|
5
|
-
const models_1 = require("./../models");
|
|
6
|
-
const enums_1 = require("./../enums");
|
|
7
|
-
class KeysUtils {
|
|
8
|
-
static groupKeysByName(keys) {
|
|
9
|
-
return (0, lodash_1.chain)(keys).groupBy("name").map((dictionary, key) => {
|
|
10
|
-
const views = (0, lodash_1.union)(...(0, lodash_1.map)(dictionary, 'views'));
|
|
11
|
-
const languages = (0, lodash_1.union)(...(0, lodash_1.map)(dictionary, 'languages'));
|
|
12
|
-
const item = new models_1.KeyModel(key, views, languages);
|
|
13
|
-
return item;
|
|
14
|
-
}).value();
|
|
15
|
-
}
|
|
16
|
-
static findKeysList(keys, customRegExp = [], deepSearch = enums_1.ToggleRule.disable) {
|
|
17
|
-
let keysListRegExp = '';
|
|
18
|
-
const mainRegExp = "<[\\s|\\w|\\n]*FormattedMessage[\\s|\\w|\\n|.|=|'|\"]{0,}[^\\w]id=[\"']{1,2}(.*)['\"]{1,2}[^>]*>";
|
|
19
|
-
if (deepSearch === enums_1.ToggleRule.enable) {
|
|
20
|
-
keysListRegExp = keys.map((key) => {
|
|
21
|
-
const regExpForSingleKey = `(?<=[^\\w.-])${key.replace('.', '\\.')}(?=[^\\w.-])`;
|
|
22
|
-
return regExpForSingleKey;
|
|
23
|
-
}).join('|');
|
|
24
|
-
}
|
|
25
|
-
// @ts-ignore
|
|
26
|
-
const customRegExpList = customRegExp.map((regexp) => {
|
|
27
|
-
return `${regexp}`;
|
|
28
|
-
});
|
|
29
|
-
const resultKeysRegExp = [
|
|
30
|
-
mainRegExp,
|
|
31
|
-
...customRegExpList
|
|
32
|
-
];
|
|
33
|
-
if (deepSearch === enums_1.ToggleRule.enable) {
|
|
34
|
-
resultKeysRegExp.unshift(keysListRegExp);
|
|
35
|
-
}
|
|
36
|
-
return new RegExp(resultKeysRegExp.join('|'), 'gm');
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.KeysUtils = KeysUtils;
|
|
40
|
-
//# sourceMappingURL=keys.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../../../src/core/utils/keys.ts"],"names":[],"mappings":";;;AAAA,mCAA2C;AAE3C,wCAAuC;AACvC,sCAAwC;AAExC,MAAM,SAAS;IACJ,MAAM,CAAC,eAAe,CAAC,IAAgB;QAC1C,OAAO,IAAA,cAAK,EAAW,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,GAAG,EAAE,EAAE;YACjE,MAAM,KAAK,GAA0B,IAAA,cAAK,EAAC,GAAG,IAAA,YAAG,EAA2B,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;YAClG,MAAM,SAAS,GAAyB,IAAA,cAAK,EAAC,GAAG,IAAA,YAAG,EAA2B,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC;YACzG,MAAM,IAAI,GAAa,IAAI,iBAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;YAC3D,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAEM,MAAM,CAAC,YAAY,CAAC,IAAc,EAAE,eAAoC,EAAE,EAAE,aAAyB,kBAAU,CAAC,OAAO;QAC1H,IAAI,cAAc,GAAW,EAAE,CAAC;QAChC,MAAM,UAAU,GAAW,kGAAkG,CAAC;QAC9H,IAAI,UAAU,KAAK,kBAAU,CAAC,MAAM,EAAE;YAClC,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAW,EAAE,EAAE;gBACtC,MAAM,kBAAkB,GAAW,gBAAgB,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,cAAc,CAAC;gBACzF,OAAO,kBAAkB,CAAC;YAC9B,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAChB;QAED,aAAa;QACb,MAAM,gBAAgB,GAAa,YAAY,CAAC,GAAG,CAAC,CAAC,MAAc,EAAG,EAAE;YACrE,OAAO,GAAG,MAAM,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;QACH,MAAM,gBAAgB,GAAa;YAC/B,UAAU;YACV,GAAG,gBAAgB;SACtB,CAAC;QACF,IAAI,UAAU,KAAK,kBAAU,CAAC,MAAM,EAAE;YAClC,gBAAgB,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;SAC5C;QACD,OAAO,IAAI,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC;CACJ;AAEQ,8BAAS"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logger = void 0;
|
|
4
|
-
const logger = {
|
|
5
|
-
log(m) {
|
|
6
|
-
process.stdout.write(m);
|
|
7
|
-
},
|
|
8
|
-
error(m) {
|
|
9
|
-
process.stderr.write(m);
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
exports.logger = logger;
|
|
13
|
-
//# sourceMappingURL=logger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../../src/core/utils/logger.ts"],"names":[],"mappings":";;;AAEA,MAAM,MAAM,GAAY;IACpB,GAAG,CAAC,CAAS;QACT,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IACD,KAAK,CAAC,CAAS;QACX,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;CACJ,CAAC;AAEO,wBAAM"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.PathUtils = void 0;
|
|
30
|
-
const path_1 = __importDefault(require("path"));
|
|
31
|
-
const glob_1 = __importDefault(require("glob"));
|
|
32
|
-
const dir_glob_1 = __importDefault(require("dir-glob"));
|
|
33
|
-
const _ = __importStar(require("lodash"));
|
|
34
|
-
class PathUtils {
|
|
35
|
-
static resolvePath(filePath) {
|
|
36
|
-
return path_1.default.isAbsolute(filePath) ? filePath : path_1.default.resolve(process.cwd(), filePath);
|
|
37
|
-
}
|
|
38
|
-
static getNormalizeFiles(folder, ignores = []) {
|
|
39
|
-
const correctFilesPathList = dir_glob_1.default.sync(PathUtils.resolvePath(folder), {
|
|
40
|
-
extensions: ['html', 'ts', 'json', 'js']
|
|
41
|
-
});
|
|
42
|
-
const correctIgnorePath = ignores.map((path) => PathUtils.resolvePath(path.trim()));
|
|
43
|
-
const result = correctFilesPathList.reduce((acum, path) => {
|
|
44
|
-
const filesPathList = glob_1.default.sync(path, {
|
|
45
|
-
ignore: correctIgnorePath,
|
|
46
|
-
});
|
|
47
|
-
acum = _.concat(acum, filesPathList);
|
|
48
|
-
return acum;
|
|
49
|
-
}, []);
|
|
50
|
-
return result.map((filePath) => {
|
|
51
|
-
return path_1.default.normalize(filePath);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.PathUtils = PathUtils;
|
|
56
|
-
//# sourceMappingURL=path.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../../../src/core/utils/path.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,gDAAwB;AACxB,wDAA+B;AAC/B,0CAA4B;AAE5B,MAAM,SAAS;IACJ,MAAM,CAAC,WAAW,CAAC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
// tslint:disable-next-line:no-any
|
|
6
|
-
const resourceResolver = {
|
|
7
|
-
get(url) {
|
|
8
|
-
return new Promise((resolve, reject) => {
|
|
9
|
-
(0, fs_1.readFile)(url, 'utf-8', (err, content) => {
|
|
10
|
-
if (err) {
|
|
11
|
-
reject(err);
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
resolve(content);
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
},
|
|
19
|
-
getSync(url) {
|
|
20
|
-
return (0, fs_1.readFileSync)(url).toString();
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
exports.resourceResolver = resourceResolver;
|
|
24
|
-
//# sourceMappingURL=shared.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../src/core/utils/shared.ts"],"names":[],"mappings":";;;AAAA,2BAA4C;AAE5C,kCAAkC;AAClC,MAAM,gBAAgB,GAAS;IAC3B,GAAG,CAAC,GAAW;QACX,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACnC,IAAA,aAAQ,EAAC,GAAG,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;gBACpC,IAAI,GAAG,EAAE;oBACL,MAAM,CAAC,GAAG,CAAC,CAAC;iBACf;qBAAM;oBACH,OAAO,CAAC,OAAO,CAAC,CAAC;iBACpB;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACD,OAAO,CAAC,GAAW;QACf,OAAO,IAAA,iBAAY,EAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;IACxC,CAAC;CACJ,CAAC;AAGE,4CAAgB"}
|