@intlayer/core 4.1.4 → 4.1.5

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.
@@ -21,9 +21,9 @@ __export(getEnumerationContent_exports, {
21
21
  getEnumerationContent: () => getEnumerationContent
22
22
  });
23
23
  module.exports = __toCommonJS(getEnumerationContent_exports);
24
- var import__ = require('../../index.cjs');
24
+ var import_findMatchingCondition = require('./findMatchingCondition.cjs');
25
25
  const getEnumerationContent = (enumerationContent, quantity) => {
26
- const key = (0, import__.findMatchingCondition)(enumerationContent, quantity);
26
+ const key = (0, import_findMatchingCondition.findMatchingCondition)(enumerationContent, quantity);
27
27
  return enumerationContent[key];
28
28
  };
29
29
  // Annotate the CommonJS export names for ESM import in node:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/transpiler/content_transformers/enumeration/getEnumerationContent.ts"],"sourcesContent":["import { findMatchingCondition } from '../..';\nimport type { QuantityContent } from './enumeration';\n\n/**\n * Allow to pick a content based on a quantity.\n *\n * Usage:\n *\n * ```ts\n * const content = getEnumerationContent({\n * '<=-2.3': 'You have less than -2.3',\n * '<1': 'You have less than one',\n * '2': 'You have two',\n * '>=3': 'You have three or more',\n * }, 2);\n * // 'You have two'\n * ```\n *\n * The order of the keys will define the priority of the content.\n *\n * ```ts\n * const content = getEnumerationContent({\n * '<4': 'You have less than four',\n * '2': 'You have two',\n * }, 2);\n * // 'You have less than four'\n * ```\n *\n */\nexport const getEnumerationContent = <Content>(\n enumerationContent: QuantityContent<Content>,\n quantity: number\n): Content => {\n const key = findMatchingCondition<Content>(enumerationContent, quantity);\n\n // Default or error handling if no keys match\n return enumerationContent[key];\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAAsC;AA6B/B,MAAM,wBAAwB,CACnC,oBACA,aACY;AACZ,QAAM,UAAM,gCAA+B,oBAAoB,QAAQ;AAGvE,SAAO,mBAAmB,GAAG;AAC/B;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/transpiler/content_transformers/enumeration/getEnumerationContent.ts"],"sourcesContent":["import type { QuantityContent } from './enumeration';\nimport { findMatchingCondition } from './findMatchingCondition';\n\n/**\n * Allow to pick a content based on a quantity.\n *\n * Usage:\n *\n * ```ts\n * const content = getEnumerationContent({\n * '<=-2.3': 'You have less than -2.3',\n * '<1': 'You have less than one',\n * '2': 'You have two',\n * '>=3': 'You have three or more',\n * }, 2);\n * // 'You have two'\n * ```\n *\n * The order of the keys will define the priority of the content.\n *\n * ```ts\n * const content = getEnumerationContent({\n * '<4': 'You have less than four',\n * '2': 'You have two',\n * }, 2);\n * // 'You have less than four'\n * ```\n *\n */\nexport const getEnumerationContent = <Content>(\n enumerationContent: QuantityContent<Content>,\n quantity: number\n): Content => {\n const key = findMatchingCondition<Content>(enumerationContent, quantity);\n\n // Default or error handling if no keys match\n return enumerationContent[key];\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mCAAsC;AA4B/B,MAAM,wBAAwB,CACnC,oBACA,aACY;AACZ,QAAM,UAAM,oDAA+B,oBAAoB,QAAQ;AAGvE,SAAO,mBAAmB,GAAG;AAC/B;","names":[]}
@@ -1,4 +1,4 @@
1
- import { findMatchingCondition } from "../../index.mjs";
1
+ import { findMatchingCondition } from "./findMatchingCondition.mjs";
2
2
  const getEnumerationContent = (enumerationContent, quantity) => {
3
3
  const key = findMatchingCondition(enumerationContent, quantity);
4
4
  return enumerationContent[key];
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/transpiler/content_transformers/enumeration/getEnumerationContent.ts"],"sourcesContent":["import { findMatchingCondition } from '../..';\nimport type { QuantityContent } from './enumeration';\n\n/**\n * Allow to pick a content based on a quantity.\n *\n * Usage:\n *\n * ```ts\n * const content = getEnumerationContent({\n * '<=-2.3': 'You have less than -2.3',\n * '<1': 'You have less than one',\n * '2': 'You have two',\n * '>=3': 'You have three or more',\n * }, 2);\n * // 'You have two'\n * ```\n *\n * The order of the keys will define the priority of the content.\n *\n * ```ts\n * const content = getEnumerationContent({\n * '<4': 'You have less than four',\n * '2': 'You have two',\n * }, 2);\n * // 'You have less than four'\n * ```\n *\n */\nexport const getEnumerationContent = <Content>(\n enumerationContent: QuantityContent<Content>,\n quantity: number\n): Content => {\n const key = findMatchingCondition<Content>(enumerationContent, quantity);\n\n // Default or error handling if no keys match\n return enumerationContent[key];\n};\n"],"mappings":"AAAA,SAAS,6BAA6B;AA6B/B,MAAM,wBAAwB,CACnC,oBACA,aACY;AACZ,QAAM,MAAM,sBAA+B,oBAAoB,QAAQ;AAGvE,SAAO,mBAAmB,GAAG;AAC/B;","names":[]}
1
+ {"version":3,"sources":["../../../../../src/transpiler/content_transformers/enumeration/getEnumerationContent.ts"],"sourcesContent":["import type { QuantityContent } from './enumeration';\nimport { findMatchingCondition } from './findMatchingCondition';\n\n/**\n * Allow to pick a content based on a quantity.\n *\n * Usage:\n *\n * ```ts\n * const content = getEnumerationContent({\n * '<=-2.3': 'You have less than -2.3',\n * '<1': 'You have less than one',\n * '2': 'You have two',\n * '>=3': 'You have three or more',\n * }, 2);\n * // 'You have two'\n * ```\n *\n * The order of the keys will define the priority of the content.\n *\n * ```ts\n * const content = getEnumerationContent({\n * '<4': 'You have less than four',\n * '2': 'You have two',\n * }, 2);\n * // 'You have less than four'\n * ```\n *\n */\nexport const getEnumerationContent = <Content>(\n enumerationContent: QuantityContent<Content>,\n quantity: number\n): Content => {\n const key = findMatchingCondition<Content>(enumerationContent, quantity);\n\n // Default or error handling if no keys match\n return enumerationContent[key];\n};\n"],"mappings":"AACA,SAAS,6BAA6B;AA4B/B,MAAM,wBAAwB,CACnC,oBACA,aACY;AACZ,QAAM,MAAM,sBAA+B,oBAAoB,QAAQ;AAGvE,SAAO,mBAAmB,GAAG;AAC/B;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"getEnumerationContent.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/content_transformers/enumeration/getEnumerationContent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,sBACvB,eAAe,CAAC,OAAO,CAAC,YAClC,MAAM,KACf,OAKF,CAAC"}
1
+ {"version":3,"file":"getEnumerationContent.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/content_transformers/enumeration/getEnumerationContent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,sBACvB,eAAe,CAAC,OAAO,CAAC,YAClC,MAAM,KACf,OAKF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/core",
3
- "version": "4.1.4",
3
+ "version": "4.1.5",
4
4
  "private": false,
5
5
  "description": "Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.",
6
6
  "keywords": [
@@ -60,7 +60,7 @@
60
60
  "dependencies": {
61
61
  "@formatjs/intl-localematcher": "^0.5.10",
62
62
  "negotiator": "^1.0.0",
63
- "@intlayer/config": "4.1.4"
63
+ "@intlayer/config": "4.1.5"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@types/negotiator": "^0.6.3",
@@ -75,13 +75,13 @@
75
75
  "tsup": "^8.3.5",
76
76
  "typescript": "^5.7.3",
77
77
  "@utils/eslint-config": "1.0.4",
78
- "@utils/ts-config-types": "1.0.4",
78
+ "@utils/ts-config": "1.0.4",
79
79
  "@utils/tsup-config": "1.0.4",
80
- "@utils/ts-config": "1.0.4"
80
+ "@utils/ts-config-types": "1.0.4"
81
81
  },
82
82
  "peerDependencies": {
83
83
  "react": ">=16.0.0",
84
- "@intlayer/config": "4.1.4"
84
+ "@intlayer/config": "4.1.5"
85
85
  },
86
86
  "engines": {
87
87
  "node": ">=14.18"