@intlayer/chokidar 5.4.2 → 5.5.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/dist/cjs/checkDictionaryChanges.cjs +10 -8
- package/dist/cjs/checkDictionaryChanges.cjs.map +1 -1
- package/dist/cjs/chokidar/watcher.cjs +26 -27
- package/dist/cjs/chokidar/watcher.cjs.map +1 -1
- package/dist/cjs/cleanOutputDir.cjs +7 -9
- package/dist/cjs/cleanOutputDir.cjs.map +1 -1
- package/dist/cjs/fetchDistantDictionaries.cjs +8 -6
- package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -1
- package/dist/cjs/filterDictionaryLocales.cjs +58 -0
- package/dist/cjs/filterDictionaryLocales.cjs.map +1 -0
- package/dist/cjs/getBuiltUnmergedDictionariesPath.cjs +51 -0
- package/dist/cjs/getBuiltUnmergedDictionariesPath.cjs.map +1 -0
- package/dist/cjs/getContentDeclarationFileTemplate/cjsTemplate.md +9 -0
- package/dist/cjs/getContentDeclarationFileTemplate/esmTemplate.md +9 -0
- package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +62 -0
- package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +1 -0
- package/dist/cjs/getContentDeclarationFileTemplate/tsTemplate.md +8 -0
- package/dist/cjs/index.cjs +21 -6
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/listGitFiles.cjs +100 -0
- package/dist/cjs/listGitFiles.cjs.map +1 -0
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs +4 -25
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadDistantDictionaries.cjs +7 -1
- package/dist/cjs/loadDictionaries/loadDistantDictionaries.cjs.map +1 -1
- package/dist/cjs/mergeDictionaries.cjs +44 -23
- package/dist/cjs/mergeDictionaries.cjs.map +1 -1
- package/dist/cjs/prepareIntlayer.cjs +6 -5
- package/dist/cjs/prepareIntlayer.cjs.map +1 -1
- package/dist/cjs/processPerLocaleDictionary.cjs +49 -0
- package/dist/cjs/processPerLocaleDictionary.cjs.map +1 -0
- package/dist/cjs/reduceDictionaryContent/applyMask.cjs +50 -0
- package/dist/cjs/reduceDictionaryContent/applyMask.cjs.map +1 -0
- package/dist/cjs/reduceDictionaryContent/buildMask.cjs +49 -0
- package/dist/cjs/reduceDictionaryContent/buildMask.cjs.map +1 -0
- package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs +35 -0
- package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -0
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.cjs +4 -4
- package/dist/cjs/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.cjs.map +1 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.cjs +56 -8
- package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.cjs.map +1 -1
- package/dist/cjs/transpiler/declaration_file_to_dictionary/reactIntl_dictionary/writeDictionary.cjs +4 -4
- package/dist/cjs/transpiler/declaration_file_to_dictionary/reactIntl_dictionary/writeDictionary.cjs.map +1 -1
- package/dist/cjs/transpiler/dictionary_to_main/createDictionaryEntryPoint.cjs +21 -1
- package/dist/cjs/transpiler/dictionary_to_main/createDictionaryEntryPoint.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/formatCode.cjs +73 -0
- package/dist/cjs/writeContentDeclaration/formatCode.cjs.map +1 -0
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +36 -37
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +379 -0
- package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -0
- package/dist/esm/checkDictionaryChanges.mjs +10 -5
- package/dist/esm/checkDictionaryChanges.mjs.map +1 -1
- package/dist/esm/chokidar/watcher.mjs +18 -19
- package/dist/esm/chokidar/watcher.mjs.map +1 -1
- package/dist/esm/cleanOutputDir.mjs +7 -9
- package/dist/esm/cleanOutputDir.mjs.map +1 -1
- package/dist/esm/fetchDistantDictionaries.mjs +8 -6
- package/dist/esm/fetchDistantDictionaries.mjs.map +1 -1
- package/dist/esm/filterDictionaryLocales.mjs +37 -0
- package/dist/esm/filterDictionaryLocales.mjs.map +1 -0
- package/dist/esm/getBuiltUnmergedDictionariesPath.mjs +17 -0
- package/dist/esm/getBuiltUnmergedDictionariesPath.mjs.map +1 -0
- package/dist/esm/getContentDeclarationFileTemplate/cjsTemplate.md +9 -0
- package/dist/esm/getContentDeclarationFileTemplate/esmTemplate.md +9 -0
- package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +37 -0
- package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +1 -0
- package/dist/esm/getContentDeclarationFileTemplate/tsTemplate.md +8 -0
- package/dist/esm/index.mjs +21 -9
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/listGitFiles.mjs +66 -0
- package/dist/esm/listGitFiles.mjs.map +1 -0
- package/dist/esm/loadDictionaries/loadDictionaries.mjs +7 -14
- package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadDistantDictionaries.mjs +7 -1
- package/dist/esm/loadDictionaries/loadDistantDictionaries.mjs.map +1 -1
- package/dist/esm/mergeDictionaries.mjs +43 -22
- package/dist/esm/mergeDictionaries.mjs.map +1 -1
- package/dist/esm/prepareIntlayer.mjs +5 -4
- package/dist/esm/prepareIntlayer.mjs.map +1 -1
- package/dist/esm/processPerLocaleDictionary.mjs +25 -0
- package/dist/esm/processPerLocaleDictionary.mjs.map +1 -0
- package/dist/esm/reduceDictionaryContent/applyMask.mjs +26 -0
- package/dist/esm/reduceDictionaryContent/applyMask.mjs.map +1 -0
- package/dist/esm/reduceDictionaryContent/buildMask.mjs +24 -0
- package/dist/esm/reduceDictionaryContent/buildMask.mjs.map +1 -0
- package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs +11 -0
- package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs.map +1 -0
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.mjs +4 -4
- package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.mjs.map +1 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.mjs +54 -8
- package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.mjs.map +1 -1
- package/dist/esm/transpiler/declaration_file_to_dictionary/reactIntl_dictionary/writeDictionary.mjs +4 -4
- package/dist/esm/transpiler/declaration_file_to_dictionary/reactIntl_dictionary/writeDictionary.mjs.map +1 -1
- package/dist/esm/transpiler/dictionary_to_main/createDictionaryEntryPoint.mjs +21 -1
- package/dist/esm/transpiler/dictionary_to_main/createDictionaryEntryPoint.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/formatCode.mjs +39 -0
- package/dist/esm/writeContentDeclaration/formatCode.mjs.map +1 -0
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +35 -36
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/writeJSFile.mjs +347 -0
- package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -0
- package/dist/types/checkDictionaryChanges.d.ts.map +1 -1
- package/dist/types/chokidar/watcher.d.ts +2 -1
- package/dist/types/chokidar/watcher.d.ts.map +1 -1
- package/dist/types/cleanOutputDir.d.ts.map +1 -1
- package/dist/types/fetchDistantDictionaries.d.ts.map +1 -1
- package/dist/types/filterDictionaryLocales.d.ts +4 -0
- package/dist/types/filterDictionaryLocales.d.ts.map +1 -0
- package/dist/types/getBuiltUnmergedDictionariesPath.d.ts +5 -0
- package/dist/types/getBuiltUnmergedDictionariesPath.d.ts.map +1 -0
- package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts +2 -0
- package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts.map +1 -0
- package/dist/types/index.d.ts +12 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/listGitFiles.d.ts +9 -0
- package/dist/types/listGitFiles.d.ts.map +1 -0
- package/dist/types/loadDictionaries/loadDictionaries.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadDistantDictionaries.d.ts.map +1 -1
- package/dist/types/mergeDictionaries.d.ts +2 -4
- package/dist/types/mergeDictionaries.d.ts.map +1 -1
- package/dist/types/prepareIntlayer.d.ts.map +1 -1
- package/dist/types/processPerLocaleDictionary.d.ts +32 -0
- package/dist/types/processPerLocaleDictionary.d.ts.map +1 -0
- package/dist/types/reduceDictionaryContent/applyMask.d.ts +3 -0
- package/dist/types/reduceDictionaryContent/applyMask.d.ts.map +1 -0
- package/dist/types/reduceDictionaryContent/buildMask.d.ts +5 -0
- package/dist/types/reduceDictionaryContent/buildMask.d.ts.map +1 -0
- package/dist/types/reduceDictionaryContent/reduceDictionaryContent.d.ts +3 -0
- package/dist/types/reduceDictionaryContent/reduceDictionaryContent.d.ts.map +1 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.d.ts +38 -0
- package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.d.ts.map +1 -1
- package/dist/types/transpiler/dictionary_to_main/createDictionaryEntryPoint.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/formatCode.d.ts +2 -0
- package/dist/types/writeContentDeclaration/formatCode.d.ts.map +1 -0
- package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/writeJSFile.d.ts +9 -0
- package/dist/types/writeContentDeclaration/writeJSFile.d.ts.map +1 -0
- package/package.json +21 -13
package/dist/cjs/index.cjs
CHANGED
|
@@ -25,29 +25,39 @@ __export(index_exports, {
|
|
|
25
25
|
createModuleAugmentation: () => import_createModuleAugmentation.createModuleAugmentation,
|
|
26
26
|
fetchDistantDictionaries: () => import_fetchDistantDictionaries.fetchDistantDictionaries,
|
|
27
27
|
fetchDistantDictionaryKeys: () => import_fetchDistantDictionaryKeys.fetchDistantDictionaryKeys,
|
|
28
|
+
filterDictionaryLocales: () => import_filterDictionaryLocales.filterDictionaryLocales,
|
|
28
29
|
handleAdditionalContentDeclarationFile: () => import_watcher.handleAdditionalContentDeclarationFile,
|
|
29
30
|
handleContentDeclarationFileChange: () => import_watcher.handleContentDeclarationFileChange,
|
|
30
31
|
listDictionaries: () => import_listDictionariesPath.listDictionaries,
|
|
32
|
+
listGitFiles: () => import_listGitFiles.listGitFiles,
|
|
31
33
|
loadDictionaries: () => import_loadDictionaries.loadDictionaries,
|
|
32
34
|
loadDistantDictionaries: () => import_loadDictionaries.loadDistantDictionaries,
|
|
33
35
|
loadLocalDictionaries: () => import_loadDictionaries.loadLocalDictionaries,
|
|
36
|
+
mergeDictionaries: () => import_mergeDictionaries.mergeDictionaries,
|
|
34
37
|
prepareContentDeclaration: () => import_prepareContentDeclaration.prepareContentDeclaration,
|
|
35
38
|
prepareIntlayer: () => import_prepareIntlayer.prepareIntlayer,
|
|
39
|
+
processPerLocaleDictionary: () => import_processPerLocaleDictionary.processPerLocaleDictionary,
|
|
40
|
+
reduceDictionaryContent: () => import_reduceDictionaryContent.reduceDictionaryContent,
|
|
36
41
|
watch: () => import_watcher.watch,
|
|
37
42
|
writeContentDeclaration: () => import_writeContentDeclaration.writeContentDeclaration
|
|
38
43
|
});
|
|
39
44
|
module.exports = __toCommonJS(index_exports);
|
|
45
|
+
var import_checkDictionaryChanges = require('./checkDictionaryChanges.cjs');
|
|
40
46
|
var import_watcher = require('./chokidar/watcher.cjs');
|
|
41
|
-
var import_prepareIntlayer = require('./prepareIntlayer.cjs');
|
|
42
|
-
var import_declaration_file_to_dictionary = require('./transpiler/declaration_file_to_dictionary/index.cjs');
|
|
43
|
-
var import_createDictionaryEntryPoint = require('./transpiler/dictionary_to_main/createDictionaryEntryPoint.cjs');
|
|
44
|
-
var import_createModuleAugmentation = require('./transpiler/dictionary_to_type/createModuleAugmentation.cjs');
|
|
45
47
|
var import_fetchDistantDictionaries = require('./fetchDistantDictionaries.cjs');
|
|
46
48
|
var import_fetchDistantDictionaryKeys = require('./fetchDistantDictionaryKeys.cjs');
|
|
47
|
-
var
|
|
48
|
-
var import_checkDictionaryChanges = require('./checkDictionaryChanges.cjs');
|
|
49
|
+
var import_filterDictionaryLocales = require('./filterDictionaryLocales.cjs');
|
|
49
50
|
var import_listDictionariesPath = require('./listDictionariesPath.cjs');
|
|
51
|
+
var import_listGitFiles = require('./listGitFiles.cjs');
|
|
52
|
+
var import_loadDictionaries = require('./loadDictionaries/index.cjs');
|
|
53
|
+
var import_mergeDictionaries = require('./mergeDictionaries.cjs');
|
|
50
54
|
var import_prepareContentDeclaration = require('./prepareContentDeclaration.cjs');
|
|
55
|
+
var import_prepareIntlayer = require('./prepareIntlayer.cjs');
|
|
56
|
+
var import_processPerLocaleDictionary = require('./processPerLocaleDictionary.cjs');
|
|
57
|
+
var import_reduceDictionaryContent = require('./reduceDictionaryContent/reduceDictionaryContent.cjs');
|
|
58
|
+
var import_declaration_file_to_dictionary = require('./transpiler/declaration_file_to_dictionary/index.cjs');
|
|
59
|
+
var import_createDictionaryEntryPoint = require('./transpiler/dictionary_to_main/createDictionaryEntryPoint.cjs');
|
|
60
|
+
var import_createModuleAugmentation = require('./transpiler/dictionary_to_type/createModuleAugmentation.cjs');
|
|
51
61
|
var import_writeContentDeclaration = require('./writeContentDeclaration/index.cjs');
|
|
52
62
|
// Annotate the CommonJS export names for ESM import in node:
|
|
53
63
|
0 && (module.exports = {
|
|
@@ -58,14 +68,19 @@ var import_writeContentDeclaration = require('./writeContentDeclaration/index.cj
|
|
|
58
68
|
createModuleAugmentation,
|
|
59
69
|
fetchDistantDictionaries,
|
|
60
70
|
fetchDistantDictionaryKeys,
|
|
71
|
+
filterDictionaryLocales,
|
|
61
72
|
handleAdditionalContentDeclarationFile,
|
|
62
73
|
handleContentDeclarationFileChange,
|
|
63
74
|
listDictionaries,
|
|
75
|
+
listGitFiles,
|
|
64
76
|
loadDictionaries,
|
|
65
77
|
loadDistantDictionaries,
|
|
66
78
|
loadLocalDictionaries,
|
|
79
|
+
mergeDictionaries,
|
|
67
80
|
prepareContentDeclaration,
|
|
68
81
|
prepareIntlayer,
|
|
82
|
+
processPerLocaleDictionary,
|
|
83
|
+
reduceDictionaryContent,
|
|
69
84
|
watch,
|
|
70
85
|
writeContentDeclaration
|
|
71
86
|
});
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export {\n
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { checkDictionaryChanges } from './checkDictionaryChanges';\nexport {\n buildAndWatchIntlayer,\n handleAdditionalContentDeclarationFile,\n handleContentDeclarationFileChange,\n watch,\n} from './chokidar/watcher';\nexport { fetchDistantDictionaries } from './fetchDistantDictionaries';\nexport { fetchDistantDictionaryKeys } from './fetchDistantDictionaryKeys';\nexport { filterDictionaryLocales } from './filterDictionaryLocales';\nexport { listDictionaries } from './listDictionariesPath';\nexport {\n listGitFiles,\n type DiffMode,\n type ListGitFilesOptions,\n} from './listGitFiles';\nexport {\n loadDictionaries,\n loadDistantDictionaries,\n loadLocalDictionaries,\n} from './loadDictionaries/index';\nexport { mergeDictionaries } from './mergeDictionaries';\nexport { prepareContentDeclaration } from './prepareContentDeclaration';\nexport { prepareIntlayer } from './prepareIntlayer';\nexport { processPerLocaleDictionary } from './processPerLocaleDictionary';\nexport { reduceDictionaryContent } from './reduceDictionaryContent/reduceDictionaryContent';\nexport { buildDictionary } from './transpiler/declaration_file_to_dictionary/index';\nexport { createDictionaryEntryPoint } from './transpiler/dictionary_to_main/createDictionaryEntryPoint';\nexport { createModuleAugmentation } from './transpiler/dictionary_to_type/createModuleAugmentation';\nexport {\n writeContentDeclaration,\n type DictionaryStatus,\n} from './writeContentDeclaration';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oCAAuC;AACvC,qBAKO;AACP,sCAAyC;AACzC,wCAA2C;AAC3C,qCAAwC;AACxC,kCAAiC;AACjC,0BAIO;AACP,8BAIO;AACP,+BAAkC;AAClC,uCAA0C;AAC1C,6BAAgC;AAChC,wCAA2C;AAC3C,qCAAwC;AACxC,4CAAgC;AAChC,wCAA2C;AAC3C,sCAAyC;AACzC,qCAGO;","names":[]}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var listGitFiles_exports = {};
|
|
30
|
+
__export(listGitFiles_exports, {
|
|
31
|
+
listGitFiles: () => listGitFiles
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(listGitFiles_exports);
|
|
34
|
+
var import_config = require("@intlayer/config");
|
|
35
|
+
var import_built = __toESM(require("@intlayer/config/built"));
|
|
36
|
+
var import_path = require("path");
|
|
37
|
+
var import_simple_git = __toESM(require("simple-git"));
|
|
38
|
+
const getGitRootDir = async () => {
|
|
39
|
+
try {
|
|
40
|
+
const git = (0, import_simple_git.default)();
|
|
41
|
+
const rootDir = await git.revparse(["--show-toplevel"]);
|
|
42
|
+
return rootDir.trim();
|
|
43
|
+
} catch (error) {
|
|
44
|
+
const appLogger = (0, import_config.getAppLogger)(import_built.default);
|
|
45
|
+
appLogger("Error getting git root directory:" + error, {
|
|
46
|
+
level: "error"
|
|
47
|
+
});
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const listGitFiles = async ({
|
|
52
|
+
mode,
|
|
53
|
+
baseRef = "origin/main",
|
|
54
|
+
currentRef = "HEAD",
|
|
55
|
+
// HEAD points to the current branch's latest commit
|
|
56
|
+
absolute = true
|
|
57
|
+
}) => {
|
|
58
|
+
try {
|
|
59
|
+
const git = (0, import_simple_git.default)();
|
|
60
|
+
const diff = /* @__PURE__ */ new Set();
|
|
61
|
+
if (mode.includes("untracked")) {
|
|
62
|
+
const status = await git.status();
|
|
63
|
+
status.not_added.forEach((f) => diff.add(f));
|
|
64
|
+
}
|
|
65
|
+
if (mode.includes("uncommitted")) {
|
|
66
|
+
const uncommittedDiff = await git.diff(["--name-only", "HEAD"]);
|
|
67
|
+
const uncommittedFiles = uncommittedDiff.split("\n").filter(Boolean);
|
|
68
|
+
uncommittedFiles.forEach((file) => diff.add(file));
|
|
69
|
+
}
|
|
70
|
+
if (mode.includes("unpushed")) {
|
|
71
|
+
const unpushedDiff = await git.diff(["--name-only", "@{push}...HEAD"]);
|
|
72
|
+
const unpushedFiles = unpushedDiff.split("\n").filter(Boolean);
|
|
73
|
+
unpushedFiles.forEach((file) => diff.add(file));
|
|
74
|
+
}
|
|
75
|
+
if (mode.includes("gitDiff")) {
|
|
76
|
+
await git.fetch(baseRef);
|
|
77
|
+
const diffBranch = await git.diff([
|
|
78
|
+
"--name-only",
|
|
79
|
+
`${baseRef}...${currentRef}`
|
|
80
|
+
]);
|
|
81
|
+
const gitDiffFiles = diffBranch.split("\n").filter(Boolean);
|
|
82
|
+
gitDiffFiles.forEach((file) => diff.add(file));
|
|
83
|
+
}
|
|
84
|
+
if (absolute) {
|
|
85
|
+
const gitRootDir = await getGitRootDir();
|
|
86
|
+
if (!gitRootDir) {
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
89
|
+
return Array.from(diff).map((file) => (0, import_path.join)(gitRootDir, file));
|
|
90
|
+
}
|
|
91
|
+
return Array.from(diff);
|
|
92
|
+
} catch (error) {
|
|
93
|
+
console.warn("Failed to get changes list:", error);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
97
|
+
0 && (module.exports = {
|
|
98
|
+
listGitFiles
|
|
99
|
+
});
|
|
100
|
+
//# sourceMappingURL=listGitFiles.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/listGitFiles.ts"],"sourcesContent":["import { getAppLogger } from '@intlayer/config';\nimport configuration from '@intlayer/config/built';\nimport { join } from 'path';\nimport simpleGit from 'simple-git';\n\nexport type DiffMode = 'gitDiff' | 'uncommitted' | 'unpushed' | 'untracked';\n\nconst getGitRootDir = async (): Promise<string | null> => {\n try {\n const git = simpleGit();\n const rootDir = await git.revparse(['--show-toplevel']);\n return rootDir.trim();\n } catch (error) {\n const appLogger = getAppLogger(configuration);\n appLogger('Error getting git root directory:' + error, {\n level: 'error',\n });\n return null;\n }\n};\n\nexport type ListGitFilesOptions = {\n mode: DiffMode[];\n baseRef?: string;\n currentRef?: string;\n absolute?: boolean;\n};\n\nexport const listGitFiles = async ({\n mode,\n baseRef = 'origin/main',\n currentRef = 'HEAD', // HEAD points to the current branch's latest commit\n absolute = true,\n}: ListGitFilesOptions) => {\n try {\n const git = simpleGit();\n const diff: Set<string> = new Set();\n\n if (mode.includes('untracked')) {\n const status = await git.status();\n status.not_added.forEach((f) => diff.add(f));\n }\n\n if (mode.includes('uncommitted')) {\n // Get uncommitted changes\n const uncommittedDiff = await git.diff(['--name-only', 'HEAD']);\n\n const uncommittedFiles = uncommittedDiff.split('\\n').filter(Boolean);\n\n uncommittedFiles.forEach((file) => diff.add(file));\n }\n\n if (mode.includes('unpushed')) {\n // Get unpushed commits\n const unpushedDiff = await git.diff(['--name-only', '@{push}...HEAD']);\n\n const unpushedFiles = unpushedDiff.split('\\n').filter(Boolean);\n\n unpushedFiles.forEach((file) => diff.add(file));\n }\n\n if (mode.includes('gitDiff')) {\n // Get the base branch (usually main/master) from CI environment\n\n await git.fetch(baseRef);\n\n const diffBranch = await git.diff([\n '--name-only',\n `${baseRef}...${currentRef}`,\n ]);\n\n const gitDiffFiles = diffBranch.split('\\n').filter(Boolean);\n\n gitDiffFiles.forEach((file) => diff.add(file));\n }\n\n if (absolute) {\n const gitRootDir = await getGitRootDir();\n if (!gitRootDir) {\n return [];\n }\n return Array.from(diff).map((file) => join(gitRootDir, file));\n }\n\n return Array.from(diff);\n } catch (error) {\n console.warn('Failed to get changes list:', error);\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAC7B,mBAA0B;AAC1B,kBAAqB;AACrB,wBAAsB;AAItB,MAAM,gBAAgB,YAAoC;AACxD,MAAI;AACF,UAAM,UAAM,kBAAAA,SAAU;AACtB,UAAM,UAAU,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC;AACtD,WAAO,QAAQ,KAAK;AAAA,EACtB,SAAS,OAAO;AACd,UAAM,gBAAY,4BAAa,aAAAC,OAAa;AAC5C,cAAU,sCAAsC,OAAO;AAAA,MACrD,OAAO;AAAA,IACT,CAAC;AACD,WAAO;AAAA,EACT;AACF;AASO,MAAM,eAAe,OAAO;AAAA,EACjC;AAAA,EACA,UAAU;AAAA,EACV,aAAa;AAAA;AAAA,EACb,WAAW;AACb,MAA2B;AACzB,MAAI;AACF,UAAM,UAAM,kBAAAD,SAAU;AACtB,UAAM,OAAoB,oBAAI,IAAI;AAElC,QAAI,KAAK,SAAS,WAAW,GAAG;AAC9B,YAAM,SAAS,MAAM,IAAI,OAAO;AAChC,aAAO,UAAU,QAAQ,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC;AAAA,IAC7C;AAEA,QAAI,KAAK,SAAS,aAAa,GAAG;AAEhC,YAAM,kBAAkB,MAAM,IAAI,KAAK,CAAC,eAAe,MAAM,CAAC;AAE9D,YAAM,mBAAmB,gBAAgB,MAAM,IAAI,EAAE,OAAO,OAAO;AAEnE,uBAAiB,QAAQ,CAAC,SAAS,KAAK,IAAI,IAAI,CAAC;AAAA,IACnD;AAEA,QAAI,KAAK,SAAS,UAAU,GAAG;AAE7B,YAAM,eAAe,MAAM,IAAI,KAAK,CAAC,eAAe,gBAAgB,CAAC;AAErE,YAAM,gBAAgB,aAAa,MAAM,IAAI,EAAE,OAAO,OAAO;AAE7D,oBAAc,QAAQ,CAAC,SAAS,KAAK,IAAI,IAAI,CAAC;AAAA,IAChD;AAEA,QAAI,KAAK,SAAS,SAAS,GAAG;AAG5B,YAAM,IAAI,MAAM,OAAO;AAEvB,YAAM,aAAa,MAAM,IAAI,KAAK;AAAA,QAChC;AAAA,QACA,GAAG,OAAO,MAAM,UAAU;AAAA,MAC5B,CAAC;AAED,YAAM,eAAe,WAAW,MAAM,IAAI,EAAE,OAAO,OAAO;AAE1D,mBAAa,QAAQ,CAAC,SAAS,KAAK,IAAI,IAAI,CAAC;AAAA,IAC/C;AAEA,QAAI,UAAU;AACZ,YAAM,aAAa,MAAM,cAAc;AACvC,UAAI,CAAC,YAAY;AACf,eAAO,CAAC;AAAA,MACV;AACA,aAAO,MAAM,KAAK,IAAI,EAAE,IAAI,CAAC,aAAS,kBAAK,YAAY,IAAI,CAAC;AAAA,IAC9D;AAEA,WAAO,MAAM,KAAK,IAAI;AAAA,EACxB,SAAS,OAAO;AACd,YAAQ,KAAK,+BAA+B,KAAK;AAAA,EACnD;AACF;","names":["simpleGit","configuration"]}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var loadDictionaries_exports = {};
|
|
30
20
|
__export(loadDictionaries_exports, {
|
|
@@ -32,17 +22,16 @@ __export(loadDictionaries_exports, {
|
|
|
32
22
|
});
|
|
33
23
|
module.exports = __toCommonJS(loadDictionaries_exports);
|
|
34
24
|
var import_config = require("@intlayer/config");
|
|
35
|
-
var import_deepmerge = __toESM(require("deepmerge"));
|
|
36
25
|
var import_fetchDistantDictionaryKeys = require('../fetchDistantDictionaryKeys.cjs');
|
|
37
26
|
var import_log = require('../log.cjs');
|
|
38
|
-
var import_mergeDictionaries = require('../mergeDictionaries.cjs');
|
|
39
27
|
var import_utils = require('../utils.cjs');
|
|
40
28
|
var import_loadContentDeclaration = require('./loadContentDeclaration.cjs');
|
|
41
29
|
var import_loadDistantDictionaries = require('./loadDistantDictionaries.cjs');
|
|
42
30
|
const loadDictionaries = async (contentDeclarationsPaths, configuration = (0, import_config.getConfiguration)(), projectRequire = import_config.ESMxCJSRequire) => {
|
|
43
31
|
try {
|
|
32
|
+
const appLogger = (0, import_config.getAppLogger)(configuration);
|
|
44
33
|
const { editor } = configuration;
|
|
45
|
-
|
|
34
|
+
appLogger("Dictionaries:", { isVerbose: true });
|
|
46
35
|
const files = Array.isArray(contentDeclarationsPaths) ? contentDeclarationsPaths : [contentDeclarationsPaths];
|
|
47
36
|
const localDictionaries = await (0, import_loadContentDeclaration.loadContentDeclarations)(
|
|
48
37
|
files,
|
|
@@ -59,7 +48,6 @@ const loadDictionaries = async (contentDeclarationsPaths, configuration = (0, im
|
|
|
59
48
|
);
|
|
60
49
|
let distantDictionaries = [];
|
|
61
50
|
let distantDictionaryKeys = [];
|
|
62
|
-
let mergedDictionaries = localDictionaries;
|
|
63
51
|
if (editor.clientId && editor.clientSecret) {
|
|
64
52
|
try {
|
|
65
53
|
distantDictionaryKeys = await (0, import_fetchDistantDictionaryKeys.fetchDistantDictionaryKeys)();
|
|
@@ -68,23 +56,14 @@ const loadDictionaries = async (contentDeclarationsPaths, configuration = (0, im
|
|
|
68
56
|
distantDictionaries = await (0, import_loadDistantDictionaries.loadDistantDictionaries)({
|
|
69
57
|
dictionaryKeys: orderedDistantDictionaryKeys
|
|
70
58
|
});
|
|
71
|
-
if (editor.dictionaryPriorityStrategy === "distant_first") {
|
|
72
|
-
mergedDictionaries = (0, import_deepmerge.default)(localDictionaries, distantDictionaries, {
|
|
73
|
-
arrayMerge: (0, import_mergeDictionaries.mergeByKey)("key")
|
|
74
|
-
});
|
|
75
|
-
} else {
|
|
76
|
-
mergedDictionaries = (0, import_deepmerge.default)(distantDictionaries, localDictionaries, {
|
|
77
|
-
arrayMerge: (0, import_mergeDictionaries.mergeByKey)("key")
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
59
|
} catch (_error) {
|
|
81
|
-
|
|
60
|
+
appLogger("Error during fetching distant dictionaries", {
|
|
82
61
|
level: "error"
|
|
83
62
|
});
|
|
84
63
|
}
|
|
85
64
|
}
|
|
86
65
|
import_log.logger.stop();
|
|
87
|
-
return
|
|
66
|
+
return [...localDictionaries, ...distantDictionaries];
|
|
88
67
|
} catch (error) {
|
|
89
68
|
import_log.logger.stop();
|
|
90
69
|
throw error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/loadDictionaries/loadDictionaries.ts"],"sourcesContent":["// @ts-ignore @intlayer/backend is not build yet\nimport type { DictionaryAPI } from '@intlayer/backend';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/loadDictionaries/loadDictionaries.ts"],"sourcesContent":["// @ts-ignore @intlayer/backend is not build yet\nimport type { DictionaryAPI } from '@intlayer/backend';\nimport {\n ESMxCJSRequire,\n getAppLogger,\n getConfiguration,\n} from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/core';\nimport { fetchDistantDictionaryKeys } from '../fetchDistantDictionaryKeys';\nimport { logger } from '../log';\nimport { sortAlphabetically } from '../utils';\nimport { loadContentDeclarations } from './loadContentDeclaration';\nimport { loadDistantDictionaries } from './loadDistantDictionaries';\n\nexport const loadDictionaries = async (\n contentDeclarationsPaths: string[] | string,\n configuration = getConfiguration(),\n projectRequire = ESMxCJSRequire\n): Promise<Dictionary[]> => {\n try {\n const appLogger = getAppLogger(configuration);\n const { editor } = configuration;\n\n appLogger('Dictionaries:', { isVerbose: true });\n\n const files = Array.isArray(contentDeclarationsPaths)\n ? contentDeclarationsPaths\n : [contentDeclarationsPaths];\n\n const localDictionaries: Dictionary[] = await loadContentDeclarations(\n files,\n projectRequire\n );\n const localDictionaryKeys = localDictionaries\n .map((dict) => dict.key)\n .filter(Boolean); // Remove empty or undefined keys\n\n // Initialize the logger with both local and distant dictionaries\n logger.init(localDictionaryKeys, []);\n\n // Update logger statuses for local dictionaries\n logger.updateStatus(\n localDictionaries.map((dict) => ({\n dictionaryKey: dict.key,\n type: 'local',\n status: { status: 'built' },\n }))\n );\n\n let distantDictionaries: DictionaryAPI[] = [];\n let distantDictionaryKeys: string[] = [];\n\n if (editor.clientId && editor.clientSecret) {\n try {\n // Fetch distant dictionary keys\n distantDictionaryKeys = await fetchDistantDictionaryKeys();\n\n const orderedDistantDictionaryKeys =\n distantDictionaryKeys.sort(sortAlphabetically);\n\n // Add distant dictionaries to the logger\n logger.addDictionaryKeys('distant', orderedDistantDictionaryKeys);\n\n // Fetch distant dictionaries\n distantDictionaries = await loadDistantDictionaries({\n dictionaryKeys: orderedDistantDictionaryKeys,\n });\n } catch (_error) {\n appLogger('Error during fetching distant dictionaries', {\n level: 'error',\n });\n }\n }\n\n // Ensure the logger is stopped\n logger.stop();\n\n return [...localDictionaries, ...distantDictionaries];\n } catch (error) {\n // Ensure the logger is stopped\n logger.stop();\n\n throw error; // Re-throw the error after logging\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAIO;AAEP,wCAA2C;AAC3C,iBAAuB;AACvB,mBAAmC;AACnC,oCAAwC;AACxC,qCAAwC;AAEjC,MAAM,mBAAmB,OAC9B,0BACA,oBAAgB,gCAAiB,GACjC,iBAAiB,iCACS;AAC1B,MAAI;AACF,UAAM,gBAAY,4BAAa,aAAa;AAC5C,UAAM,EAAE,OAAO,IAAI;AAEnB,cAAU,iBAAiB,EAAE,WAAW,KAAK,CAAC;AAE9C,UAAM,QAAQ,MAAM,QAAQ,wBAAwB,IAChD,2BACA,CAAC,wBAAwB;AAE7B,UAAM,oBAAkC,UAAM;AAAA,MAC5C;AAAA,MACA;AAAA,IACF;AACA,UAAM,sBAAsB,kBACzB,IAAI,CAAC,SAAS,KAAK,GAAG,EACtB,OAAO,OAAO;AAGjB,sBAAO,KAAK,qBAAqB,CAAC,CAAC;AAGnC,sBAAO;AAAA,MACL,kBAAkB,IAAI,CAAC,UAAU;AAAA,QAC/B,eAAe,KAAK;AAAA,QACpB,MAAM;AAAA,QACN,QAAQ,EAAE,QAAQ,QAAQ;AAAA,MAC5B,EAAE;AAAA,IACJ;AAEA,QAAI,sBAAuC,CAAC;AAC5C,QAAI,wBAAkC,CAAC;AAEvC,QAAI,OAAO,YAAY,OAAO,cAAc;AAC1C,UAAI;AAEF,gCAAwB,UAAM,8DAA2B;AAEzD,cAAM,+BACJ,sBAAsB,KAAK,+BAAkB;AAG/C,0BAAO,kBAAkB,WAAW,4BAA4B;AAGhE,8BAAsB,UAAM,wDAAwB;AAAA,UAClD,gBAAgB;AAAA,QAClB,CAAC;AAAA,MACH,SAAS,QAAQ;AACf,kBAAU,8CAA8C;AAAA,UACtD,OAAO;AAAA,QACT,CAAC;AAAA,MACH;AAAA,IACF;AAGA,sBAAO,KAAK;AAEZ,WAAO,CAAC,GAAG,mBAAmB,GAAG,mBAAmB;AAAA,EACtD,SAAS,OAAO;AAEd,sBAAO,KAAK;AAEZ,UAAM;AAAA,EACR;AACF;","names":[]}
|
|
@@ -22,10 +22,16 @@ __export(loadDistantDictionaries_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(loadDistantDictionaries_exports);
|
|
24
24
|
var import_fetchDistantDictionaries = require('../fetchDistantDictionaries.cjs');
|
|
25
|
+
const formatDistantDictionaries = (dictionaries) => {
|
|
26
|
+
return dictionaries.map((dict) => ({
|
|
27
|
+
...dict,
|
|
28
|
+
location: "distant"
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
25
31
|
const loadDistantDictionaries = async (options) => {
|
|
26
32
|
try {
|
|
27
33
|
const distantDictionaries = await (0, import_fetchDistantDictionaries.fetchDistantDictionaries)(options);
|
|
28
|
-
return distantDictionaries;
|
|
34
|
+
return formatDistantDictionaries(distantDictionaries);
|
|
29
35
|
} catch (error) {
|
|
30
36
|
console.error(error);
|
|
31
37
|
return [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/loadDictionaries/loadDistantDictionaries.ts"],"sourcesContent":["// @ts-ignore @intlayer/backend is not build yet\nimport type { DictionaryAPI } from '@intlayer/backend';\nimport { fetchDistantDictionaries } from '../fetchDistantDictionaries';\n\ntype LoadDistantDictionariesOptions = {\n dictionaryKeys: string[];\n newDictionariesPath?: string;\n};\n\nexport const loadDistantDictionaries = async (\n options: LoadDistantDictionariesOptions\n): Promise<DictionaryAPI[]> => {\n try {\n const distantDictionaries = await fetchDistantDictionaries(options);\n\n return distantDictionaries;\n } catch (error) {\n console.error(error);\n return [];\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,sCAAyC;
|
|
1
|
+
{"version":3,"sources":["../../../src/loadDictionaries/loadDistantDictionaries.ts"],"sourcesContent":["// @ts-ignore @intlayer/backend is not build yet\nimport type { DictionaryAPI } from '@intlayer/backend';\nimport { fetchDistantDictionaries } from '../fetchDistantDictionaries';\n\ntype LoadDistantDictionariesOptions = {\n dictionaryKeys: string[];\n newDictionariesPath?: string;\n};\n\nconst formatDistantDictionaries = (dictionaries: DictionaryAPI[]) => {\n return dictionaries.map((dict) => ({\n ...dict,\n location: 'distant' as const,\n }));\n};\n\nexport const loadDistantDictionaries = async (\n options: LoadDistantDictionariesOptions\n): Promise<DictionaryAPI[]> => {\n try {\n const distantDictionaries = await fetchDistantDictionaries(options);\n\n return formatDistantDictionaries(distantDictionaries);\n } catch (error) {\n console.error(error);\n return [];\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,sCAAyC;AAOzC,MAAM,4BAA4B,CAAC,iBAAkC;AACnE,SAAO,aAAa,IAAI,CAAC,UAAU;AAAA,IACjC,GAAG;AAAA,IACH,UAAU;AAAA,EACZ,EAAE;AACJ;AAEO,MAAM,0BAA0B,OACrC,YAC6B;AAC7B,MAAI;AACF,UAAM,sBAAsB,UAAM,0DAAyB,OAAO;AAElE,WAAO,0BAA0B,mBAAmB;AAAA,EACtD,SAAS,OAAO;AACd,YAAQ,MAAM,KAAK;AACnB,WAAO,CAAC;AAAA,EACV;AACF;","names":[]}
|
|
@@ -28,35 +28,56 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var mergeDictionaries_exports = {};
|
|
30
30
|
__export(mergeDictionaries_exports, {
|
|
31
|
-
|
|
31
|
+
mergeDictionaries: () => mergeDictionaries
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(mergeDictionaries_exports);
|
|
34
|
+
var import_config = require("@intlayer/config");
|
|
35
|
+
var import_built = __toESM(require("@intlayer/config/built"));
|
|
36
|
+
var import_core = require("@intlayer/core");
|
|
34
37
|
var import_deepmerge = __toESM(require("deepmerge"));
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (sourceItem) {
|
|
45
|
-
const mergedItem = (0, import_deepmerge.default)(targetItem, sourceItem, options);
|
|
46
|
-
destination.push(mergedItem);
|
|
47
|
-
sourceMap.delete(targetItem[key]);
|
|
48
|
-
} else {
|
|
49
|
-
destination.push(targetItem);
|
|
38
|
+
const checkTypesMatch = (obj1, obj2, dictionaryKey, path = []) => {
|
|
39
|
+
const appLogger = (0, import_config.getAppLogger)(import_built.default);
|
|
40
|
+
const type1 = (0, import_core.getNodeType)(obj1);
|
|
41
|
+
const type2 = (0, import_core.getNodeType)(obj2);
|
|
42
|
+
if (type1 !== type2) {
|
|
43
|
+
appLogger(
|
|
44
|
+
`Error: Dictionary ${dictionaryKey} has a multiple content files with type mismatch at path "${path.join(".")}": Cannot merge ${type1} with ${type2}`,
|
|
45
|
+
{
|
|
46
|
+
level: "error"
|
|
50
47
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
if (type1 === "object" && obj1 && obj2) {
|
|
51
|
+
const allKeys = /* @__PURE__ */ new Set([...Object.keys(obj1), ...Object.keys(obj2)]);
|
|
52
|
+
for (const key of allKeys) {
|
|
53
|
+
if (key in obj1 && key in obj2) {
|
|
54
|
+
checkTypesMatch(obj1[key], obj2[key], dictionaryKey, [...path, key]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const mergeDictionaries = (dictionaries) => {
|
|
60
|
+
const { editor } = import_built.default;
|
|
61
|
+
let mergedDictionaries = dictionaries[0];
|
|
62
|
+
for (let i = 1; i < dictionaries.length; i++) {
|
|
63
|
+
const currentDictionary = dictionaries[i];
|
|
64
|
+
checkTypesMatch(
|
|
65
|
+
mergedDictionaries,
|
|
66
|
+
currentDictionary,
|
|
67
|
+
currentDictionary.key,
|
|
68
|
+
[]
|
|
69
|
+
);
|
|
70
|
+
const isDistant = currentDictionary.location === "distant";
|
|
71
|
+
if (editor.dictionaryPriorityStrategy === "distant_first" && isDistant) {
|
|
72
|
+
mergedDictionaries = (0, import_deepmerge.default)(mergedDictionaries, currentDictionary);
|
|
73
|
+
} else {
|
|
74
|
+
mergedDictionaries = (0, import_deepmerge.default)(currentDictionary, mergedDictionaries);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return { ...mergedDictionaries, filePath: void 0 };
|
|
57
78
|
};
|
|
58
79
|
// Annotate the CommonJS export names for ESM import in node:
|
|
59
80
|
0 && (module.exports = {
|
|
60
|
-
|
|
81
|
+
mergeDictionaries
|
|
61
82
|
});
|
|
62
83
|
//# sourceMappingURL=mergeDictionaries.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/mergeDictionaries.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../src/mergeDictionaries.ts"],"sourcesContent":["import { getAppLogger } from '@intlayer/config';\nimport configuration from '@intlayer/config/built';\nimport type { Dictionary } from '@intlayer/core';\nimport { getNodeType } from '@intlayer/core';\nimport merge from 'deepmerge';\n\nconst checkTypesMatch = (\n obj1: any,\n obj2: any,\n dictionaryKey: string,\n path: string[] = []\n): void => {\n const appLogger = getAppLogger(configuration);\n const type1 = getNodeType(obj1);\n const type2 = getNodeType(obj2);\n\n if (type1 !== type2) {\n appLogger(\n `Error: Dictionary ${dictionaryKey} has a multiple content files with type mismatch at path \"${path.join('.')}\": Cannot merge ${type1} with ${type2}`,\n {\n level: 'error',\n }\n );\n }\n\n if (type1 === 'object' && obj1 && obj2) {\n const allKeys = new Set([...Object.keys(obj1), ...Object.keys(obj2)]);\n for (const key of allKeys) {\n if (key in obj1 && key in obj2) {\n checkTypesMatch(obj1[key], obj2[key], dictionaryKey, [...path, key]);\n }\n }\n }\n};\n\nexport const mergeDictionaries = (dictionaries: Dictionary[]): Dictionary => {\n const { editor } = configuration;\n\n let mergedDictionaries: Dictionary = dictionaries[0];\n\n for (let i = 1; i < dictionaries.length; i++) {\n const currentDictionary = dictionaries[i];\n\n // Check types before merging\n checkTypesMatch(\n mergedDictionaries,\n currentDictionary,\n currentDictionary.key,\n []\n );\n\n const isDistant = currentDictionary.location === 'distant';\n\n if (editor.dictionaryPriorityStrategy === 'distant_first' && isDistant) {\n mergedDictionaries = merge(mergedDictionaries, currentDictionary);\n } else {\n mergedDictionaries = merge(currentDictionary, mergedDictionaries);\n }\n }\n\n return { ...mergedDictionaries, filePath: undefined };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAC7B,mBAA0B;AAE1B,kBAA4B;AAC5B,uBAAkB;AAElB,MAAM,kBAAkB,CACtB,MACA,MACA,eACA,OAAiB,CAAC,MACT;AACT,QAAM,gBAAY,4BAAa,aAAAA,OAAa;AAC5C,QAAM,YAAQ,yBAAY,IAAI;AAC9B,QAAM,YAAQ,yBAAY,IAAI;AAE9B,MAAI,UAAU,OAAO;AACnB;AAAA,MACE,qBAAqB,aAAa,6DAA6D,KAAK,KAAK,GAAG,CAAC,mBAAmB,KAAK,SAAS,KAAK;AAAA,MACnJ;AAAA,QACE,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAEA,MAAI,UAAU,YAAY,QAAQ,MAAM;AACtC,UAAM,UAAU,oBAAI,IAAI,CAAC,GAAG,OAAO,KAAK,IAAI,GAAG,GAAG,OAAO,KAAK,IAAI,CAAC,CAAC;AACpE,eAAW,OAAO,SAAS;AACzB,UAAI,OAAO,QAAQ,OAAO,MAAM;AAC9B,wBAAgB,KAAK,GAAG,GAAG,KAAK,GAAG,GAAG,eAAe,CAAC,GAAG,MAAM,GAAG,CAAC;AAAA,MACrE;AAAA,IACF;AAAA,EACF;AACF;AAEO,MAAM,oBAAoB,CAAC,iBAA2C;AAC3E,QAAM,EAAE,OAAO,IAAI,aAAAA;AAEnB,MAAI,qBAAiC,aAAa,CAAC;AAEnD,WAAS,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;AAC5C,UAAM,oBAAoB,aAAa,CAAC;AAGxC;AAAA,MACE;AAAA,MACA;AAAA,MACA,kBAAkB;AAAA,MAClB,CAAC;AAAA,IACH;AAEA,UAAM,YAAY,kBAAkB,aAAa;AAEjD,QAAI,OAAO,+BAA+B,mBAAmB,WAAW;AACtE,+BAAqB,iBAAAC,SAAM,oBAAoB,iBAAiB;AAAA,IAClE,OAAO;AACL,+BAAqB,iBAAAA,SAAM,mBAAmB,kBAAkB;AAAA,IAClE;AAAA,EACF;AAEA,SAAO,EAAE,GAAG,oBAAoB,UAAU,OAAU;AACtD;","names":["configuration","merge"]}
|
|
@@ -23,15 +23,16 @@ __export(prepareIntlayer_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(prepareIntlayer_exports);
|
|
24
24
|
var import_config = require("@intlayer/config");
|
|
25
25
|
var import_cleanOutputDir = require('./cleanOutputDir.cjs');
|
|
26
|
+
var import_listDictionariesPath = require('./listDictionariesPath.cjs');
|
|
26
27
|
var import_loadDictionaries = require('./loadDictionaries/loadDictionaries.cjs');
|
|
27
28
|
var import_declaration_file_to_dictionary = require('./transpiler/declaration_file_to_dictionary/index.cjs');
|
|
28
29
|
var import_createDictionaryEntryPoint = require('./transpiler/dictionary_to_main/createDictionaryEntryPoint.cjs');
|
|
29
30
|
var import_dictionary_to_type = require('./transpiler/dictionary_to_type/index.cjs');
|
|
30
31
|
var import_writeConfiguration = require('./writeConfiguration/index.cjs');
|
|
31
|
-
var import_listDictionariesPath = require('./listDictionariesPath.cjs');
|
|
32
32
|
const prepareIntlayer = async (configuration = (0, import_config.getConfiguration)(), projectRequire = import_config.ESMxCJSRequire) => {
|
|
33
|
+
const appLogger = (0, import_config.getAppLogger)(configuration);
|
|
33
34
|
(0, import_cleanOutputDir.cleanOutputDir)(configuration);
|
|
34
|
-
|
|
35
|
+
appLogger("Output directory cleaned", {
|
|
35
36
|
isVerbose: true
|
|
36
37
|
});
|
|
37
38
|
const files = (0, import_listDictionariesPath.listDictionaries)(configuration);
|
|
@@ -43,13 +44,13 @@ const prepareIntlayer = async (configuration = (0, import_config.getConfiguratio
|
|
|
43
44
|
const dictionariesPaths = await (0, import_declaration_file_to_dictionary.buildDictionary)(dictionaries, configuration);
|
|
44
45
|
(0, import_dictionary_to_type.createTypes)(dictionariesPaths, configuration);
|
|
45
46
|
(0, import_createDictionaryEntryPoint.createDictionaryEntryPoint)(configuration);
|
|
46
|
-
|
|
47
|
+
appLogger("Dictionaries built");
|
|
47
48
|
(0, import_dictionary_to_type.createModuleAugmentation)(configuration);
|
|
48
|
-
|
|
49
|
+
appLogger("Module augmentation built", {
|
|
49
50
|
isVerbose: true
|
|
50
51
|
});
|
|
51
52
|
(0, import_writeConfiguration.writeConfiguration)(configuration);
|
|
52
|
-
|
|
53
|
+
appLogger("Configuration written", {
|
|
53
54
|
isVerbose: true
|
|
54
55
|
});
|
|
55
56
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/prepareIntlayer.ts"],"sourcesContent":["import {\n ESMxCJSRequire,\n type IntlayerConfig,\n
|
|
1
|
+
{"version":3,"sources":["../../src/prepareIntlayer.ts"],"sourcesContent":["import {\n ESMxCJSRequire,\n type IntlayerConfig,\n getAppLogger,\n getConfiguration,\n} from '@intlayer/config';\nimport { cleanOutputDir } from './cleanOutputDir';\nimport { listDictionaries } from './listDictionariesPath';\nimport { loadDictionaries } from './loadDictionaries/loadDictionaries';\nimport { buildDictionary } from './transpiler/declaration_file_to_dictionary/index';\nimport { createDictionaryEntryPoint } from './transpiler/dictionary_to_main/createDictionaryEntryPoint';\nimport {\n createModuleAugmentation,\n createTypes,\n} from './transpiler/dictionary_to_type/index';\nimport { writeConfiguration } from './writeConfiguration';\n\nexport const prepareIntlayer = async (\n configuration: IntlayerConfig = getConfiguration(),\n projectRequire = ESMxCJSRequire\n) => {\n const appLogger = getAppLogger(configuration);\n\n cleanOutputDir(configuration);\n\n appLogger('Output directory cleaned', {\n isVerbose: true,\n });\n\n const files: string[] = listDictionaries(configuration);\n\n const dictionaries = await loadDictionaries(\n files,\n configuration,\n projectRequire\n );\n\n // Build locale dictionaries\n const dictionariesPaths = await buildDictionary(dictionaries, configuration);\n\n createTypes(dictionariesPaths, configuration);\n\n createDictionaryEntryPoint(configuration);\n\n appLogger('Dictionaries built');\n\n createModuleAugmentation(configuration);\n\n appLogger('Module augmentation built', {\n isVerbose: true,\n });\n\n writeConfiguration(configuration);\n\n appLogger('Configuration written', {\n isVerbose: true,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAKO;AACP,4BAA+B;AAC/B,kCAAiC;AACjC,8BAAiC;AACjC,4CAAgC;AAChC,wCAA2C;AAC3C,gCAGO;AACP,gCAAmC;AAE5B,MAAM,kBAAkB,OAC7B,oBAAgC,gCAAiB,GACjD,iBAAiB,iCACd;AACH,QAAM,gBAAY,4BAAa,aAAa;AAE5C,4CAAe,aAAa;AAE5B,YAAU,4BAA4B;AAAA,IACpC,WAAW;AAAA,EACb,CAAC;AAED,QAAM,YAAkB,8CAAiB,aAAa;AAEtD,QAAM,eAAe,UAAM;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAGA,QAAM,oBAAoB,UAAM,uDAAgB,cAAc,aAAa;AAE3E,6CAAY,mBAAmB,aAAa;AAE5C,oEAA2B,aAAa;AAExC,YAAU,oBAAoB;AAE9B,0DAAyB,aAAa;AAEtC,YAAU,6BAA6B;AAAA,IACrC,WAAW;AAAA,EACb,CAAC;AAED,oDAAmB,aAAa;AAEhC,YAAU,yBAAyB;AAAA,IACjC,WAAW;AAAA,EACb,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var processPerLocaleDictionary_exports = {};
|
|
20
|
+
__export(processPerLocaleDictionary_exports, {
|
|
21
|
+
processPerLocaleDictionary: () => processPerLocaleDictionary
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(processPerLocaleDictionary_exports);
|
|
24
|
+
var import_core = require("@intlayer/core");
|
|
25
|
+
const processPerLocaleDictionary = (dictionary) => {
|
|
26
|
+
const isPerLocaleDictionary = typeof dictionary.locale === "string";
|
|
27
|
+
if (!isPerLocaleDictionary) {
|
|
28
|
+
return dictionary;
|
|
29
|
+
}
|
|
30
|
+
const transformStringToTranslationPlugin = {
|
|
31
|
+
id: "transform-string-to-translation-plugin",
|
|
32
|
+
canHandle: (node) => typeof node === "string" || typeof node === "number",
|
|
33
|
+
transform: (node) => (0, import_core.t)({ [dictionary.locale]: node })
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
...dictionary,
|
|
37
|
+
locale: void 0,
|
|
38
|
+
content: (0, import_core.deepTransformNode)(dictionary.content, {
|
|
39
|
+
dictionaryKey: dictionary.key,
|
|
40
|
+
keyPath: [],
|
|
41
|
+
plugins: [transformStringToTranslationPlugin]
|
|
42
|
+
})
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
processPerLocaleDictionary
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=processPerLocaleDictionary.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/processPerLocaleDictionary.ts"],"sourcesContent":["import { deepTransformNode, Plugins, t, type Dictionary } from '@intlayer/core';\n\n/**\n *\n * Should transform per locale dictionaries to multi-locale dictionaries\n *\n * Example:\n *\n * ```json5\n * // .intlayer/dictionaries/home.fr.json\n * { 'key': 'home', 'locale': 'fr', 'content': { 'example': \"value\", ... } },\n * ```\n *\n * Result:\n *\n * ```json5\n * // .intlayer/dictionaries/home.json\n * {\n * 'key': 'home',\n * 'content': {\n * 'example': {\n * 'nodeType': 'translation',\n * 'translation': {\n * 'fr': 'valeur',\n * }\n * }, ... } },\n * ```\n *\n * @param dictionary\n * @returns\n */\nexport const processPerLocaleDictionary = (dictionary: Dictionary) => {\n const isPerLocaleDictionary = typeof dictionary.locale === 'string';\n\n if (!isPerLocaleDictionary) {\n return dictionary;\n }\n\n const transformStringToTranslationPlugin: Plugins = {\n id: 'transform-string-to-translation-plugin',\n canHandle: (node) => typeof node === 'string' || typeof node === 'number',\n transform: (node: string | number) =>\n t({ [dictionary.locale as string]: node }),\n };\n\n return {\n ...dictionary,\n locale: undefined,\n content: deepTransformNode(dictionary.content, {\n dictionaryKey: dictionary.key,\n keyPath: [],\n plugins: [transformStringToTranslationPlugin],\n }),\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA+D;AA+BxD,MAAM,6BAA6B,CAAC,eAA2B;AACpE,QAAM,wBAAwB,OAAO,WAAW,WAAW;AAE3D,MAAI,CAAC,uBAAuB;AAC1B,WAAO;AAAA,EACT;AAEA,QAAM,qCAA8C;AAAA,IAClD,IAAI;AAAA,IACJ,WAAW,CAAC,SAAS,OAAO,SAAS,YAAY,OAAO,SAAS;AAAA,IACjE,WAAW,CAAC,aACV,eAAE,EAAE,CAAC,WAAW,MAAgB,GAAG,KAAK,CAAC;AAAA,EAC7C;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,QAAQ;AAAA,IACR,aAAS,+BAAkB,WAAW,SAAS;AAAA,MAC7C,eAAe,WAAW;AAAA,MAC1B,SAAS,CAAC;AAAA,MACV,SAAS,CAAC,kCAAkC;AAAA,IAC9C,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var applyMask_exports = {};
|
|
20
|
+
__export(applyMask_exports, {
|
|
21
|
+
applyMask: () => applyMask
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(applyMask_exports);
|
|
24
|
+
const applyMask = (full, mask) => {
|
|
25
|
+
if (mask === true) {
|
|
26
|
+
return full;
|
|
27
|
+
}
|
|
28
|
+
if (Array.isArray(mask) && Array.isArray(full)) {
|
|
29
|
+
return mask.map((m, i) => applyMask(full[i], m));
|
|
30
|
+
}
|
|
31
|
+
if (full && typeof full === "object" && "nodeType" in full) {
|
|
32
|
+
if (mask && typeof mask === "object") {
|
|
33
|
+
return full;
|
|
34
|
+
}
|
|
35
|
+
return full;
|
|
36
|
+
}
|
|
37
|
+
if (mask && typeof mask === "object" && full && typeof full === "object") {
|
|
38
|
+
const out = {};
|
|
39
|
+
for (const [k, m] of Object.entries(mask)) {
|
|
40
|
+
out[k] = applyMask(full[k], m);
|
|
41
|
+
}
|
|
42
|
+
return out;
|
|
43
|
+
}
|
|
44
|
+
return full;
|
|
45
|
+
};
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
applyMask
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=applyMask.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/reduceDictionaryContent/applyMask.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/core';\n\nexport const applyMask = (full: Dictionary, mask: any): Dictionary => {\n // the mask \"true\" → we don't filter\n if (mask === true) {\n return full;\n }\n\n // arrays\n if (Array.isArray(mask) && Array.isArray(full)) {\n return mask.map((m, i) => applyMask(full[i], m)) as any;\n }\n\n // handle node with nodeType property\n if (full && typeof full === 'object' && 'nodeType' in full) {\n if (mask && typeof mask === 'object') {\n return full; // Keep the full object with nodeType intact\n }\n return full;\n }\n\n // generic object\n if (mask && typeof mask === 'object' && full && typeof full === 'object') {\n const out: any = {};\n for (const [k, m] of Object.entries(mask)) {\n out[k] = applyMask((full as any)[k], m);\n }\n return out;\n }\n\n // unexpected case: we return the original value\n return full;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,YAAY,CAAC,MAAkB,SAA0B;AAEpE,MAAI,SAAS,MAAM;AACjB,WAAO;AAAA,EACT;AAGA,MAAI,MAAM,QAAQ,IAAI,KAAK,MAAM,QAAQ,IAAI,GAAG;AAC9C,WAAO,KAAK,IAAI,CAAC,GAAG,MAAM,UAAU,KAAK,CAAC,GAAG,CAAC,CAAC;AAAA,EACjD;AAGA,MAAI,QAAQ,OAAO,SAAS,YAAY,cAAc,MAAM;AAC1D,QAAI,QAAQ,OAAO,SAAS,UAAU;AACpC,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT;AAGA,MAAI,QAAQ,OAAO,SAAS,YAAY,QAAQ,OAAO,SAAS,UAAU;AACxE,UAAM,MAAW,CAAC;AAClB,eAAW,CAAC,GAAG,CAAC,KAAK,OAAO,QAAQ,IAAI,GAAG;AACzC,UAAI,CAAC,IAAI,UAAW,KAAa,CAAC,GAAG,CAAC;AAAA,IACxC;AACA,WAAO;AAAA,EACT;AAGA,SAAO;AACT;","names":[]}
|