@intlayer/core 3.5.2 → 3.5.4

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/types/declarationContent.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type {\n EnumerationContent,\n TranslationContent,\n} from '../transpiler/index';\n\nexport type TypedNode =\n | TranslationContent<unknown>\n | EnumerationContent<unknown>;\n\nexport type ContentValue =\n | string\n | string[]\n | number\n | number[]\n | {\n [key: string]: ContentValue;\n }\n | (() => ContentValue)\n | Promise<ContentValue>\n | TypedNode;\n\nexport type Content = Record<string, ContentValue | ContentValue[] | undefined>;\n\nexport type FlatContentValue =\n | string\n | {\n [key: string]: FlatContentValue;\n }\n | TypedNode;\n\nexport type FlatContent = Record<string, FlatContentValue | undefined>;\n\n// Utility type that performs recursive replacement\ntype ReplaceContentValue<T> = {\n [P in keyof T]: T[P] extends string | number | boolean | null | ReactNode\n ? ContentValue\n : T[P] extends object\n ? ReplaceContentValue<T[P]>\n : ReplaceContentValueArray<T[P]>;\n};\n\ntype ReplaceContentValueArray<T> = T extends (infer U)[]\n ? ReplaceContentValue<U>[]\n : ReplaceContentValue<T>;\n\nexport type DeclarationContent<T = undefined> = {\n key: string;\n title?: string;\n description?: string;\n version?: string;\n filePath?: string;\n content: T extends undefined // Applying the generic to replace ContentValue with Replacement\n ? Content\n : ReplaceContentValue<T>;\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../../src/types/declarationContent.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type {\n EnumerationContent,\n TranslationContent,\n} from '../transpiler/index';\n\nexport type TypedNode<T = unknown> =\n | TranslationContent<T>\n | EnumerationContent<T>;\n\nexport type ContentValue =\n | string\n | string[]\n | number\n | number[]\n | {\n [key: string]: ContentValue;\n }\n | (() => ContentValue)\n | Promise<ContentValue>\n | TypedNode;\n\nexport type Content = Record<string, ContentValue | ContentValue[] | undefined>;\n\nexport type FlatContentValue =\n | string\n | {\n [key: string]: FlatContentValue;\n }\n | TypedNode;\n\nexport type FlatContent = Record<string, FlatContentValue | undefined>;\n\ntype IsArray<T> = T extends any[] ? true : false;\n\n// Utility type that performs recursive replacement\ntype ReplaceContentValue<T> = {\n [P in keyof T]: IsArray<T[P]> extends true\n ? ReplaceContentValueArray<T[P]>\n : T[P] extends object\n ? ReplaceContentValue<T[P]>\n : T[P] | TypedNode<T[P]>;\n};\n\ntype ReplaceContentValueArray<T> = T extends (infer U)[]\n ? ReplaceContentValue<U>[]\n : ReplaceContentValue<T>;\n\nexport type DeclarationContent<T = undefined> = {\n key: string;\n title?: string;\n description?: string;\n version?: string;\n filePath?: string;\n content: T extends undefined // Applying the generic to replace ContentValue with Replacement\n ? Content\n : ReplaceContentValue<T>;\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,6 +1,5 @@
1
- import type { ReactNode } from 'react';
2
1
  import type { EnumerationContent, TranslationContent } from '../transpiler/index';
3
- export type TypedNode = TranslationContent<unknown> | EnumerationContent<unknown>;
2
+ export type TypedNode<T = unknown> = TranslationContent<T> | EnumerationContent<T>;
4
3
  export type ContentValue = string | string[] | number | number[] | {
5
4
  [key: string]: ContentValue;
6
5
  } | (() => ContentValue) | Promise<ContentValue> | TypedNode;
@@ -9,8 +8,9 @@ export type FlatContentValue = string | {
9
8
  [key: string]: FlatContentValue;
10
9
  } | TypedNode;
11
10
  export type FlatContent = Record<string, FlatContentValue | undefined>;
11
+ type IsArray<T> = T extends any[] ? true : false;
12
12
  type ReplaceContentValue<T> = {
13
- [P in keyof T]: T[P] extends string | number | boolean | null | ReactNode ? ContentValue : T[P] extends object ? ReplaceContentValue<T[P]> : ReplaceContentValueArray<T[P]>;
13
+ [P in keyof T]: IsArray<T[P]> extends true ? ReplaceContentValueArray<T[P]> : T[P] extends object ? ReplaceContentValue<T[P]> : T[P] | TypedNode<T[P]>;
14
14
  };
15
15
  type ReplaceContentValueArray<T> = T extends (infer U)[] ? ReplaceContentValue<U>[] : ReplaceContentValue<T>;
16
16
  export type DeclarationContent<T = undefined> = {
@@ -1 +1 @@
1
- {"version":3,"file":"declarationContent.d.ts","sourceRoot":"","sources":["../../../src/types/declarationContent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,SAAS,GACjB,kBAAkB,CAAC,OAAO,CAAC,GAC3B,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAEhC,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,EAAE,GACR,MAAM,GACN,MAAM,EAAE,GACR;IACE,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAC;CAC7B,GACD,CAAC,MAAM,YAAY,CAAC,GACpB,OAAO,CAAC,YAAY,CAAC,GACrB,SAAS,CAAC;AAEd,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,EAAE,GAAG,SAAS,CAAC,CAAC;AAEhF,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN;IACE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;CACjC,GACD,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAC,CAAC;AAGvE,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GACrE,YAAY,GACZ,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GACjB,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACzB,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACrC,CAAC;AAEF,KAAK,wBAAwB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GACpD,mBAAmB,CAAC,CAAC,CAAC,EAAE,GACxB,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAE3B,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,SAAS,IAAI;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,CAAC,SAAS,SAAS,GACxB,OAAO,GACP,mBAAmB,CAAC,CAAC,CAAC,CAAC;CAC5B,CAAC"}
1
+ {"version":3,"file":"declarationContent.d.ts","sourceRoot":"","sources":["../../../src/types/declarationContent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,SAAS,CAAC,CAAC,GAAG,OAAO,IAC7B,kBAAkB,CAAC,CAAC,CAAC,GACrB,kBAAkB,CAAC,CAAC,CAAC,CAAC;AAE1B,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,EAAE,GACR,MAAM,GACN,MAAM,EAAE,GACR;IACE,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAC;CAC7B,GACD,CAAC,MAAM,YAAY,CAAC,GACpB,OAAO,CAAC,YAAY,CAAC,GACrB,SAAS,CAAC;AAEd,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,EAAE,GAAG,SAAS,CAAC,CAAC;AAEhF,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN;IACE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;CACjC,GACD,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAC,CAAC;AAEvE,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE,GAAG,IAAI,GAAG,KAAK,CAAC;AAGjD,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GACtC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAC9B,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GACjB,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACzB,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC7B,CAAC;AAEF,KAAK,wBAAwB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GACpD,mBAAmB,CAAC,CAAC,CAAC,EAAE,GACxB,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAE3B,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,SAAS,IAAI;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,CAAC,SAAS,SAAS,GACxB,OAAO,GACP,mBAAmB,CAAC,CAAC,CAAC,CAAC;CAC5B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/core",
3
- "version": "3.5.2",
3
+ "version": "3.5.4",
4
4
  "private": false,
5
5
  "description": "IntLayer - Layer of abstraction between the business logic and the data access layer. Manage internationalization in a simple way, through TypeScript, JavaScript or JSON declaration file.",
6
6
  "keywords": [
@@ -61,7 +61,7 @@
61
61
  "@formatjs/intl-localematcher": "^0.5.4",
62
62
  "chokidar": "^3.6.0",
63
63
  "negotiator": "^0.6.3",
64
- "@intlayer/config": "^3.5.2"
64
+ "@intlayer/config": "^3.5.4"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@types/negotiator": "^0.6.3",
@@ -74,14 +74,14 @@
74
74
  "tsc-alias": "^1.8.10",
75
75
  "tsup": "^8.3.5",
76
76
  "typescript": "^5.7.2",
77
- "@utils/eslint-config": "^1.0.4",
78
77
  "@utils/ts-config": "^1.0.4",
79
- "@utils/ts-config-types": "^1.0.4",
80
- "@utils/tsup-config": "^1.0.4"
78
+ "@utils/tsup-config": "^1.0.4",
79
+ "@utils/eslint-config": "^1.0.4",
80
+ "@utils/ts-config-types": "^1.0.4"
81
81
  },
82
82
  "peerDependencies": {
83
83
  "react": ">=16.0.0 <19.0.0",
84
- "@intlayer/config": "^3.5.2"
84
+ "@intlayer/config": "^3.5.4"
85
85
  },
86
86
  "engines": {
87
87
  "node": ">=14.18"