@intlayer/chokidar 8.6.2 → 8.6.3

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.
@@ -25,6 +25,7 @@ exports.assembleJSON = require_utils_chunkJSON.assembleJSON;
25
25
  exports.autoDecorateContent = require_utils_autoDecorateContent.autoDecorateContent;
26
26
  exports.buildComponentFilesList = require_utils_buildComponentFilesList.buildComponentFilesList;
27
27
  exports.chunkJSON = require_utils_chunkJSON.chunkJSON;
28
+ exports.excludeObjectFormat = require_utils_reduceObjectFormat.excludeObjectFormat;
28
29
  exports.formatLocale = require_utils_formatter.formatLocale;
29
30
  exports.formatPath = require_utils_formatter.formatPath;
30
31
  exports.getChunk = require_utils_getChunk.getChunk;
@@ -26,7 +26,45 @@ const reduceObjectFormat = (source, format) => {
26
26
  }
27
27
  return source;
28
28
  };
29
+ /**
30
+ * Returns the subset of source whose keys are NOT present in the format object.
31
+ * Inverse of reduceObjectFormat.
32
+ *
33
+ * Null values in source are always included as explicit fallback markers
34
+ * (they signal "use default locale" at render time).
35
+ *
36
+ * Examples:
37
+ * excludeObjectFormat({ a: 1, b: 2 }, { b: 0 }) => { a: 1 }
38
+ * excludeObjectFormat({ a: { x: 1, y: 2 } }, { a: { x: 0 } }) => { a: { y: 2 } }
39
+ * excludeObjectFormat({ a: null, b: 2 }, { b: 0 }) => { a: null }
40
+ */
41
+ const excludeObjectFormat = (source, format) => {
42
+ if (source === null) return null;
43
+ if (format === void 0 || format === null) return source;
44
+ if (typeof source === "object" && !Array.isArray(source) && typeof format === "object" && !Array.isArray(format)) {
45
+ const result = {};
46
+ let hasContent = false;
47
+ for (const key of Object.keys(source)) {
48
+ const excluded = excludeObjectFormat(source[key], format[key]);
49
+ if (excluded !== void 0) {
50
+ result[key] = excluded;
51
+ hasContent = true;
52
+ }
53
+ }
54
+ return hasContent ? result : void 0;
55
+ }
56
+ if (Array.isArray(source)) {
57
+ const formatArr = Array.isArray(format) ? format : [];
58
+ const result = [];
59
+ for (let i = 0; i < source.length; i++) {
60
+ const excluded = excludeObjectFormat(source[i], formatArr[i]);
61
+ if (excluded !== void 0) result.push(excluded);
62
+ }
63
+ return result.length > 0 ? result : void 0;
64
+ }
65
+ };
29
66
 
30
67
  //#endregion
68
+ exports.excludeObjectFormat = excludeObjectFormat;
31
69
  exports.reduceObjectFormat = reduceObjectFormat;
32
70
  //# sourceMappingURL=reduceObjectFormat.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"reduceObjectFormat.cjs","names":[],"sources":["../../../src/utils/reduceObjectFormat.ts"],"sourcesContent":["type Primitive = string | number | boolean | null | undefined;\n\ntype Recursive = Primitive | { [key: string]: Recursive } | Array<Recursive>;\n\n/**\n * Reduce an object to only the shape provided by a format object.\n * Values are always taken from the source object; the format is used only for structure.\n *\n * Examples:\n * reduceObjectFormat({ a: 1, b: 2 }, { a: 0 }) => { a: 1 }\n * reduceObjectFormat({ a: { x: 1, y: 2 } }, { a: { x: 0 } }) => { a: { x: 1 } }\n */\nexport const reduceObjectFormat = (\n source: Recursive,\n format: Recursive\n): Recursive => {\n // If the format is an array, reduce each element by its counterpart in source\n if (Array.isArray(format)) {\n const sourceArray = Array.isArray(source) ? source : [];\n return format.map((formatItem, index) =>\n reduceObjectFormat(sourceArray[index], formatItem)\n );\n }\n\n // If the format is an object (and not null), pick matching keys and recurse\n if (typeof format === 'object' && format !== null) {\n const result: Record<string, Recursive> = {};\n const sourceObject =\n typeof source === 'object' && source !== null && !Array.isArray(source)\n ? (source as Record<string, Recursive>)\n : ({} as Record<string, Recursive>);\n\n for (const key of Object.keys(format)) {\n const nextSource = sourceObject[key];\n const nextFormat = (format as Record<string, Recursive>)[key];\n result[key] = reduceObjectFormat(nextSource, nextFormat);\n }\n return result;\n }\n\n // For primitives in the format, simply return the source value (can be undefined)\n return source as Primitive;\n};\n"],"mappings":";;;;;;;;;;;AAYA,MAAa,sBACX,QACA,WACc;AAEd,KAAI,MAAM,QAAQ,OAAO,EAAE;EACzB,MAAM,cAAc,MAAM,QAAQ,OAAO,GAAG,SAAS,EAAE;AACvD,SAAO,OAAO,KAAK,YAAY,UAC7B,mBAAmB,YAAY,QAAQ,WAAW,CACnD;;AAIH,KAAI,OAAO,WAAW,YAAY,WAAW,MAAM;EACjD,MAAM,SAAoC,EAAE;EAC5C,MAAM,eACJ,OAAO,WAAW,YAAY,WAAW,QAAQ,CAAC,MAAM,QAAQ,OAAO,GAClE,SACA,EAAE;AAET,OAAK,MAAM,OAAO,OAAO,KAAK,OAAO,EAAE;GACrC,MAAM,aAAa,aAAa;GAChC,MAAM,aAAc,OAAqC;AACzD,UAAO,OAAO,mBAAmB,YAAY,WAAW;;AAE1D,SAAO;;AAIT,QAAO"}
1
+ {"version":3,"file":"reduceObjectFormat.cjs","names":[],"sources":["../../../src/utils/reduceObjectFormat.ts"],"sourcesContent":["export type Primitive = string | number | boolean | null | undefined;\n\nexport type Recursive =\n | Primitive\n | { [key: string]: Recursive }\n | Array<Recursive>;\n\n/**\n * Reduce an object to only the shape provided by a format object.\n * Values are always taken from the source object; the format is used only for structure.\n *\n * Examples:\n * reduceObjectFormat({ a: 1, b: 2 }, { a: 0 }) => { a: 1 }\n * reduceObjectFormat({ a: { x: 1, y: 2 } }, { a: { x: 0 } }) => { a: { x: 1 } }\n */\nexport const reduceObjectFormat = (\n source: Recursive,\n format: Recursive\n): Recursive => {\n // If the format is an array, reduce each element by its counterpart in source\n if (Array.isArray(format)) {\n const sourceArray = Array.isArray(source) ? source : [];\n return format.map((formatItem, index) =>\n reduceObjectFormat(sourceArray[index], formatItem)\n );\n }\n\n // If the format is an object (and not null), pick matching keys and recurse\n if (typeof format === 'object' && format !== null) {\n const result: Record<string, Recursive> = {};\n const sourceObject =\n typeof source === 'object' && source !== null && !Array.isArray(source)\n ? (source as Record<string, Recursive>)\n : ({} as Record<string, Recursive>);\n\n for (const key of Object.keys(format)) {\n const nextSource = sourceObject[key];\n const nextFormat = (format as Record<string, Recursive>)[key];\n result[key] = reduceObjectFormat(nextSource, nextFormat);\n }\n return result;\n }\n\n // For primitives in the format, simply return the source value (can be undefined)\n return source as Primitive;\n};\n\n/**\n * Returns the subset of source whose keys are NOT present in the format object.\n * Inverse of reduceObjectFormat.\n *\n * Null values in source are always included as explicit fallback markers\n * (they signal \"use default locale\" at render time).\n *\n * Examples:\n * excludeObjectFormat({ a: 1, b: 2 }, { b: 0 }) => { a: 1 }\n * excludeObjectFormat({ a: { x: 1, y: 2 } }, { a: { x: 0 } }) => { a: { y: 2 } }\n * excludeObjectFormat({ a: null, b: 2 }, { b: 0 }) => { a: null }\n */\nexport const excludeObjectFormat = (\n source: Recursive,\n format: Recursive\n): Recursive | undefined => {\n // null in source = explicit fallback marker → always include\n if (source === null) return null;\n\n // No format means nothing is translated yet → include all source\n if (format === undefined || format === null) return source;\n\n // Both plain objects → recurse key-by-key\n if (\n typeof source === 'object' &&\n !Array.isArray(source) &&\n typeof format === 'object' &&\n !Array.isArray(format)\n ) {\n const result: Record<string, Recursive> = {};\n let hasContent = false;\n\n for (const key of Object.keys(source as Record<string, Recursive>)) {\n const excluded = excludeObjectFormat(\n (source as Record<string, Recursive>)[key],\n (format as Record<string, Recursive>)[key]\n );\n if (excluded !== undefined) {\n result[key] = excluded;\n hasContent = true;\n }\n }\n\n return hasContent ? result : undefined;\n }\n\n // Arrays → recurse by index\n if (Array.isArray(source)) {\n const formatArr = Array.isArray(format) ? format : [];\n const result: Recursive[] = [];\n\n for (let i = 0; i < source.length; i++) {\n const excluded = excludeObjectFormat(source[i], formatArr[i]);\n if (excluded !== undefined) {\n result.push(excluded);\n }\n }\n\n return result.length > 0 ? result : undefined;\n }\n\n // Primitive in source and format has a value → already translated → exclude\n return undefined;\n};\n"],"mappings":";;;;;;;;;;;AAeA,MAAa,sBACX,QACA,WACc;AAEd,KAAI,MAAM,QAAQ,OAAO,EAAE;EACzB,MAAM,cAAc,MAAM,QAAQ,OAAO,GAAG,SAAS,EAAE;AACvD,SAAO,OAAO,KAAK,YAAY,UAC7B,mBAAmB,YAAY,QAAQ,WAAW,CACnD;;AAIH,KAAI,OAAO,WAAW,YAAY,WAAW,MAAM;EACjD,MAAM,SAAoC,EAAE;EAC5C,MAAM,eACJ,OAAO,WAAW,YAAY,WAAW,QAAQ,CAAC,MAAM,QAAQ,OAAO,GAClE,SACA,EAAE;AAET,OAAK,MAAM,OAAO,OAAO,KAAK,OAAO,EAAE;GACrC,MAAM,aAAa,aAAa;GAChC,MAAM,aAAc,OAAqC;AACzD,UAAO,OAAO,mBAAmB,YAAY,WAAW;;AAE1D,SAAO;;AAIT,QAAO;;;;;;;;;;;;;;AAeT,MAAa,uBACX,QACA,WAC0B;AAE1B,KAAI,WAAW,KAAM,QAAO;AAG5B,KAAI,WAAW,UAAa,WAAW,KAAM,QAAO;AAGpD,KACE,OAAO,WAAW,YAClB,CAAC,MAAM,QAAQ,OAAO,IACtB,OAAO,WAAW,YAClB,CAAC,MAAM,QAAQ,OAAO,EACtB;EACA,MAAM,SAAoC,EAAE;EAC5C,IAAI,aAAa;AAEjB,OAAK,MAAM,OAAO,OAAO,KAAK,OAAoC,EAAE;GAClE,MAAM,WAAW,oBACd,OAAqC,MACrC,OAAqC,KACvC;AACD,OAAI,aAAa,QAAW;AAC1B,WAAO,OAAO;AACd,iBAAa;;;AAIjB,SAAO,aAAa,SAAS;;AAI/B,KAAI,MAAM,QAAQ,OAAO,EAAE;EACzB,MAAM,YAAY,MAAM,QAAQ,OAAO,GAAG,SAAS,EAAE;EACrD,MAAM,SAAsB,EAAE;AAE9B,OAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;GACtC,MAAM,WAAW,oBAAoB,OAAO,IAAI,UAAU,GAAG;AAC7D,OAAI,aAAa,OACf,QAAO,KAAK,SAAS;;AAIzB,SAAO,OAAO,SAAS,IAAI,SAAS"}
@@ -11,7 +11,7 @@ import { getContentExtension } from "./getContentExtension.mjs";
11
11
  import { getExtensionFromFormat, getFormatFromExtension } from "./getFormatFromExtension.mjs";
12
12
  import { mergeChunks } from "./mergeChunks.mjs";
13
13
  import { getGlobalLimiter, getTaskLimiter, parallelizeGlobal } from "./parallelizeGlobal.mjs";
14
- import { reduceObjectFormat } from "./reduceObjectFormat.mjs";
14
+ import { excludeObjectFormat, reduceObjectFormat } from "./reduceObjectFormat.mjs";
15
15
  import { resolveObjectPromises } from "./resolveObjectPromises.mjs";
16
16
  import { resolveRelativePath } from "./resolveRelativePath.mjs";
17
17
  import { runOnce } from "./runOnce.mjs";
@@ -19,4 +19,4 @@ import { runParallel } from "./runParallel/index.mjs";
19
19
  import { sortAlphabetically } from "./sortAlphabetically.mjs";
20
20
  import { verifyIdenticObjectFormat } from "./verifyIdenticObjectFormat.mjs";
21
21
 
22
- export { Queue, assembleJSON, autoDecorateContent, buildComponentFilesList, chunkJSON, formatLocale, formatPath, getChunk, getContentExtension, getExtensionFromFormat, getFormatFromExtension, getGlobalLimiter, getPathHash, getTaskLimiter, mergeChunks, pLimit, parallelize, parallelizeGlobal, reconstructFromSingleChunk, reduceObjectFormat, resolveObjectPromises, resolveRelativePath, runOnce, runParallel, sortAlphabetically, splitTextByLines, verifyIdenticObjectFormat };
22
+ export { Queue, assembleJSON, autoDecorateContent, buildComponentFilesList, chunkJSON, excludeObjectFormat, formatLocale, formatPath, getChunk, getContentExtension, getExtensionFromFormat, getFormatFromExtension, getGlobalLimiter, getPathHash, getTaskLimiter, mergeChunks, pLimit, parallelize, parallelizeGlobal, reconstructFromSingleChunk, reduceObjectFormat, resolveObjectPromises, resolveRelativePath, runOnce, runParallel, sortAlphabetically, splitTextByLines, verifyIdenticObjectFormat };
@@ -24,7 +24,44 @@ const reduceObjectFormat = (source, format) => {
24
24
  }
25
25
  return source;
26
26
  };
27
+ /**
28
+ * Returns the subset of source whose keys are NOT present in the format object.
29
+ * Inverse of reduceObjectFormat.
30
+ *
31
+ * Null values in source are always included as explicit fallback markers
32
+ * (they signal "use default locale" at render time).
33
+ *
34
+ * Examples:
35
+ * excludeObjectFormat({ a: 1, b: 2 }, { b: 0 }) => { a: 1 }
36
+ * excludeObjectFormat({ a: { x: 1, y: 2 } }, { a: { x: 0 } }) => { a: { y: 2 } }
37
+ * excludeObjectFormat({ a: null, b: 2 }, { b: 0 }) => { a: null }
38
+ */
39
+ const excludeObjectFormat = (source, format) => {
40
+ if (source === null) return null;
41
+ if (format === void 0 || format === null) return source;
42
+ if (typeof source === "object" && !Array.isArray(source) && typeof format === "object" && !Array.isArray(format)) {
43
+ const result = {};
44
+ let hasContent = false;
45
+ for (const key of Object.keys(source)) {
46
+ const excluded = excludeObjectFormat(source[key], format[key]);
47
+ if (excluded !== void 0) {
48
+ result[key] = excluded;
49
+ hasContent = true;
50
+ }
51
+ }
52
+ return hasContent ? result : void 0;
53
+ }
54
+ if (Array.isArray(source)) {
55
+ const formatArr = Array.isArray(format) ? format : [];
56
+ const result = [];
57
+ for (let i = 0; i < source.length; i++) {
58
+ const excluded = excludeObjectFormat(source[i], formatArr[i]);
59
+ if (excluded !== void 0) result.push(excluded);
60
+ }
61
+ return result.length > 0 ? result : void 0;
62
+ }
63
+ };
27
64
 
28
65
  //#endregion
29
- export { reduceObjectFormat };
66
+ export { excludeObjectFormat, reduceObjectFormat };
30
67
  //# sourceMappingURL=reduceObjectFormat.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"reduceObjectFormat.mjs","names":[],"sources":["../../../src/utils/reduceObjectFormat.ts"],"sourcesContent":["type Primitive = string | number | boolean | null | undefined;\n\ntype Recursive = Primitive | { [key: string]: Recursive } | Array<Recursive>;\n\n/**\n * Reduce an object to only the shape provided by a format object.\n * Values are always taken from the source object; the format is used only for structure.\n *\n * Examples:\n * reduceObjectFormat({ a: 1, b: 2 }, { a: 0 }) => { a: 1 }\n * reduceObjectFormat({ a: { x: 1, y: 2 } }, { a: { x: 0 } }) => { a: { x: 1 } }\n */\nexport const reduceObjectFormat = (\n source: Recursive,\n format: Recursive\n): Recursive => {\n // If the format is an array, reduce each element by its counterpart in source\n if (Array.isArray(format)) {\n const sourceArray = Array.isArray(source) ? source : [];\n return format.map((formatItem, index) =>\n reduceObjectFormat(sourceArray[index], formatItem)\n );\n }\n\n // If the format is an object (and not null), pick matching keys and recurse\n if (typeof format === 'object' && format !== null) {\n const result: Record<string, Recursive> = {};\n const sourceObject =\n typeof source === 'object' && source !== null && !Array.isArray(source)\n ? (source as Record<string, Recursive>)\n : ({} as Record<string, Recursive>);\n\n for (const key of Object.keys(format)) {\n const nextSource = sourceObject[key];\n const nextFormat = (format as Record<string, Recursive>)[key];\n result[key] = reduceObjectFormat(nextSource, nextFormat);\n }\n return result;\n }\n\n // For primitives in the format, simply return the source value (can be undefined)\n return source as Primitive;\n};\n"],"mappings":";;;;;;;;;AAYA,MAAa,sBACX,QACA,WACc;AAEd,KAAI,MAAM,QAAQ,OAAO,EAAE;EACzB,MAAM,cAAc,MAAM,QAAQ,OAAO,GAAG,SAAS,EAAE;AACvD,SAAO,OAAO,KAAK,YAAY,UAC7B,mBAAmB,YAAY,QAAQ,WAAW,CACnD;;AAIH,KAAI,OAAO,WAAW,YAAY,WAAW,MAAM;EACjD,MAAM,SAAoC,EAAE;EAC5C,MAAM,eACJ,OAAO,WAAW,YAAY,WAAW,QAAQ,CAAC,MAAM,QAAQ,OAAO,GAClE,SACA,EAAE;AAET,OAAK,MAAM,OAAO,OAAO,KAAK,OAAO,EAAE;GACrC,MAAM,aAAa,aAAa;GAChC,MAAM,aAAc,OAAqC;AACzD,UAAO,OAAO,mBAAmB,YAAY,WAAW;;AAE1D,SAAO;;AAIT,QAAO"}
1
+ {"version":3,"file":"reduceObjectFormat.mjs","names":[],"sources":["../../../src/utils/reduceObjectFormat.ts"],"sourcesContent":["export type Primitive = string | number | boolean | null | undefined;\n\nexport type Recursive =\n | Primitive\n | { [key: string]: Recursive }\n | Array<Recursive>;\n\n/**\n * Reduce an object to only the shape provided by a format object.\n * Values are always taken from the source object; the format is used only for structure.\n *\n * Examples:\n * reduceObjectFormat({ a: 1, b: 2 }, { a: 0 }) => { a: 1 }\n * reduceObjectFormat({ a: { x: 1, y: 2 } }, { a: { x: 0 } }) => { a: { x: 1 } }\n */\nexport const reduceObjectFormat = (\n source: Recursive,\n format: Recursive\n): Recursive => {\n // If the format is an array, reduce each element by its counterpart in source\n if (Array.isArray(format)) {\n const sourceArray = Array.isArray(source) ? source : [];\n return format.map((formatItem, index) =>\n reduceObjectFormat(sourceArray[index], formatItem)\n );\n }\n\n // If the format is an object (and not null), pick matching keys and recurse\n if (typeof format === 'object' && format !== null) {\n const result: Record<string, Recursive> = {};\n const sourceObject =\n typeof source === 'object' && source !== null && !Array.isArray(source)\n ? (source as Record<string, Recursive>)\n : ({} as Record<string, Recursive>);\n\n for (const key of Object.keys(format)) {\n const nextSource = sourceObject[key];\n const nextFormat = (format as Record<string, Recursive>)[key];\n result[key] = reduceObjectFormat(nextSource, nextFormat);\n }\n return result;\n }\n\n // For primitives in the format, simply return the source value (can be undefined)\n return source as Primitive;\n};\n\n/**\n * Returns the subset of source whose keys are NOT present in the format object.\n * Inverse of reduceObjectFormat.\n *\n * Null values in source are always included as explicit fallback markers\n * (they signal \"use default locale\" at render time).\n *\n * Examples:\n * excludeObjectFormat({ a: 1, b: 2 }, { b: 0 }) => { a: 1 }\n * excludeObjectFormat({ a: { x: 1, y: 2 } }, { a: { x: 0 } }) => { a: { y: 2 } }\n * excludeObjectFormat({ a: null, b: 2 }, { b: 0 }) => { a: null }\n */\nexport const excludeObjectFormat = (\n source: Recursive,\n format: Recursive\n): Recursive | undefined => {\n // null in source = explicit fallback marker → always include\n if (source === null) return null;\n\n // No format means nothing is translated yet → include all source\n if (format === undefined || format === null) return source;\n\n // Both plain objects → recurse key-by-key\n if (\n typeof source === 'object' &&\n !Array.isArray(source) &&\n typeof format === 'object' &&\n !Array.isArray(format)\n ) {\n const result: Record<string, Recursive> = {};\n let hasContent = false;\n\n for (const key of Object.keys(source as Record<string, Recursive>)) {\n const excluded = excludeObjectFormat(\n (source as Record<string, Recursive>)[key],\n (format as Record<string, Recursive>)[key]\n );\n if (excluded !== undefined) {\n result[key] = excluded;\n hasContent = true;\n }\n }\n\n return hasContent ? result : undefined;\n }\n\n // Arrays → recurse by index\n if (Array.isArray(source)) {\n const formatArr = Array.isArray(format) ? format : [];\n const result: Recursive[] = [];\n\n for (let i = 0; i < source.length; i++) {\n const excluded = excludeObjectFormat(source[i], formatArr[i]);\n if (excluded !== undefined) {\n result.push(excluded);\n }\n }\n\n return result.length > 0 ? result : undefined;\n }\n\n // Primitive in source and format has a value → already translated → exclude\n return undefined;\n};\n"],"mappings":";;;;;;;;;AAeA,MAAa,sBACX,QACA,WACc;AAEd,KAAI,MAAM,QAAQ,OAAO,EAAE;EACzB,MAAM,cAAc,MAAM,QAAQ,OAAO,GAAG,SAAS,EAAE;AACvD,SAAO,OAAO,KAAK,YAAY,UAC7B,mBAAmB,YAAY,QAAQ,WAAW,CACnD;;AAIH,KAAI,OAAO,WAAW,YAAY,WAAW,MAAM;EACjD,MAAM,SAAoC,EAAE;EAC5C,MAAM,eACJ,OAAO,WAAW,YAAY,WAAW,QAAQ,CAAC,MAAM,QAAQ,OAAO,GAClE,SACA,EAAE;AAET,OAAK,MAAM,OAAO,OAAO,KAAK,OAAO,EAAE;GACrC,MAAM,aAAa,aAAa;GAChC,MAAM,aAAc,OAAqC;AACzD,UAAO,OAAO,mBAAmB,YAAY,WAAW;;AAE1D,SAAO;;AAIT,QAAO;;;;;;;;;;;;;;AAeT,MAAa,uBACX,QACA,WAC0B;AAE1B,KAAI,WAAW,KAAM,QAAO;AAG5B,KAAI,WAAW,UAAa,WAAW,KAAM,QAAO;AAGpD,KACE,OAAO,WAAW,YAClB,CAAC,MAAM,QAAQ,OAAO,IACtB,OAAO,WAAW,YAClB,CAAC,MAAM,QAAQ,OAAO,EACtB;EACA,MAAM,SAAoC,EAAE;EAC5C,IAAI,aAAa;AAEjB,OAAK,MAAM,OAAO,OAAO,KAAK,OAAoC,EAAE;GAClE,MAAM,WAAW,oBACd,OAAqC,MACrC,OAAqC,KACvC;AACD,OAAI,aAAa,QAAW;AAC1B,WAAO,OAAO;AACd,iBAAa;;;AAIjB,SAAO,aAAa,SAAS;;AAI/B,KAAI,MAAM,QAAQ,OAAO,EAAE;EACzB,MAAM,YAAY,MAAM,QAAQ,OAAO,GAAG,SAAS,EAAE;EACrD,MAAM,SAAsB,EAAE;AAE9B,OAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;GACtC,MAAM,WAAW,oBAAoB,OAAO,IAAI,UAAU,GAAG;AAC7D,OAAI,aAAa,OACf,QAAO,KAAK,SAAS;;AAIzB,SAAO,OAAO,SAAS,IAAI,SAAS"}
@@ -10,7 +10,7 @@ import { mergeChunks } from "./mergeChunks.js";
10
10
  import { parallelize } from "./parallelize.js";
11
11
  import { Queue, pLimit } from "./pLimit.js";
12
12
  import { getGlobalLimiter, getTaskLimiter, parallelizeGlobal } from "./parallelizeGlobal.js";
13
- import { reduceObjectFormat } from "./reduceObjectFormat.js";
13
+ import { Primitive, Recursive, excludeObjectFormat, reduceObjectFormat } from "./reduceObjectFormat.js";
14
14
  import { resolveObjectPromises } from "./resolveObjectPromises.js";
15
15
  import { resolveRelativePath } from "./resolveRelativePath.js";
16
16
  import { runOnce } from "./runOnce.js";
@@ -18,4 +18,4 @@ import { ParallelHandle, runParallel } from "./runParallel/index.js";
18
18
  import { sortAlphabetically } from "./sortAlphabetically.js";
19
19
  import { splitTextByLines } from "./splitTextByLine.js";
20
20
  import { verifyIdenticObjectFormat } from "./verifyIdenticObjectFormat.js";
21
- export { Extension, Format, JSONObject, JsonChunk, ParallelHandle, Queue, assembleJSON, autoDecorateContent, buildComponentFilesList, chunkJSON, formatLocale, formatPath, getChunk, getContentExtension, getExtensionFromFormat, getFormatFromExtension, getGlobalLimiter, getPathHash, getTaskLimiter, mergeChunks, pLimit, parallelize, parallelizeGlobal, reconstructFromSingleChunk, reduceObjectFormat, resolveObjectPromises, resolveRelativePath, runOnce, runParallel, sortAlphabetically, splitTextByLines, verifyIdenticObjectFormat };
21
+ export { Extension, Format, JSONObject, JsonChunk, ParallelHandle, Primitive, Queue, Recursive, assembleJSON, autoDecorateContent, buildComponentFilesList, chunkJSON, excludeObjectFormat, formatLocale, formatPath, getChunk, getContentExtension, getExtensionFromFormat, getFormatFromExtension, getGlobalLimiter, getPathHash, getTaskLimiter, mergeChunks, pLimit, parallelize, parallelizeGlobal, reconstructFromSingleChunk, reduceObjectFormat, resolveObjectPromises, resolveRelativePath, runOnce, runParallel, sortAlphabetically, splitTextByLines, verifyIdenticObjectFormat };
@@ -12,6 +12,19 @@ type Recursive = Primitive | {
12
12
  * reduceObjectFormat({ a: { x: 1, y: 2 } }, { a: { x: 0 } }) => { a: { x: 1 } }
13
13
  */
14
14
  declare const reduceObjectFormat: (source: Recursive, format: Recursive) => Recursive;
15
+ /**
16
+ * Returns the subset of source whose keys are NOT present in the format object.
17
+ * Inverse of reduceObjectFormat.
18
+ *
19
+ * Null values in source are always included as explicit fallback markers
20
+ * (they signal "use default locale" at render time).
21
+ *
22
+ * Examples:
23
+ * excludeObjectFormat({ a: 1, b: 2 }, { b: 0 }) => { a: 1 }
24
+ * excludeObjectFormat({ a: { x: 1, y: 2 } }, { a: { x: 0 } }) => { a: { y: 2 } }
25
+ * excludeObjectFormat({ a: null, b: 2 }, { b: 0 }) => { a: null }
26
+ */
27
+ declare const excludeObjectFormat: (source: Recursive, format: Recursive) => Recursive | undefined;
15
28
  //#endregion
16
- export { reduceObjectFormat };
29
+ export { Primitive, Recursive, excludeObjectFormat, reduceObjectFormat };
17
30
  //# sourceMappingURL=reduceObjectFormat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reduceObjectFormat.d.ts","names":[],"sources":["../../../src/utils/reduceObjectFormat.ts"],"mappings":";KAAK,SAAA;AAAA,KAEA,SAAA,GAAY,SAAA;EAAA,CAAe,GAAA,WAAc,SAAA;AAAA,IAAc,KAAA,CAAM,SAAA;;;AAFpD;;;;;;cAYD,kBAAA,GACX,MAAA,EAAQ,SAAA,EACR,MAAA,EAAQ,SAAA,KACP,SAAA"}
1
+ {"version":3,"file":"reduceObjectFormat.d.ts","names":[],"sources":["../../../src/utils/reduceObjectFormat.ts"],"mappings":";KAAY,SAAA;AAAA,KAEA,SAAA,GACR,SAAA;EAAA,CACG,GAAA,WAAc,SAAA;AAAA,IACjB,KAAA,CAAM,SAAA;;;AAHV;;;;;;cAaa,kBAAA,GACX,MAAA,EAAQ,SAAA,EACR,MAAA,EAAQ,SAAA,KACP,SAAA;;;;;;;;;;AAHH;;;cA4Ca,mBAAA,GACX,MAAA,EAAQ,SAAA,EACR,MAAA,EAAQ,SAAA,KACP,SAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/chokidar",
3
- "version": "8.6.2",
3
+ "version": "8.6.3",
4
4
  "private": false,
5
5
  "description": "Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.",
6
6
  "keywords": [
@@ -109,13 +109,13 @@
109
109
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
110
110
  },
111
111
  "dependencies": {
112
- "@intlayer/api": "8.6.2",
113
- "@intlayer/config": "8.6.2",
114
- "@intlayer/core": "8.6.2",
115
- "@intlayer/dictionaries-entry": "8.6.2",
116
- "@intlayer/remote-dictionaries-entry": "8.6.2",
117
- "@intlayer/types": "8.6.2",
118
- "@intlayer/unmerged-dictionaries-entry": "8.6.2",
112
+ "@intlayer/api": "8.6.3",
113
+ "@intlayer/config": "8.6.3",
114
+ "@intlayer/core": "8.6.3",
115
+ "@intlayer/dictionaries-entry": "8.6.3",
116
+ "@intlayer/remote-dictionaries-entry": "8.6.3",
117
+ "@intlayer/types": "8.6.3",
118
+ "@intlayer/unmerged-dictionaries-entry": "8.6.3",
119
119
  "chokidar": "3.6.0",
120
120
  "defu": "6.1.4",
121
121
  "fast-glob": "3.3.3",