@webiny/i18n 6.3.0 → 6.4.0-beta.1

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,41 +1,29 @@
1
1
  import { hash } from "ohash";
2
-
3
- /**
4
- * Searches for all declared namespaces.
5
- * Result contains an object with identifiers as keys, and namespaces they represent as values, for example:
6
- * {ns1: 'Webiny.Ns1', ns2: 'Webiny.Ns2', i18n: 'NewNamespace', t: 'Some.Other.Namespace'}
7
- * @param source
8
- */
9
- const getNamespaces = source => {
10
- const regex = /([a-zA-Z0-9]+)[ ]+=[ ]+i18n.namespace\(['"`]([a-zA-Z0-9.]+)['"`]\)/g;
11
- let m;
12
- const results = {};
13
- while ((m = regex.exec(source)) !== null) {
14
- if (m.index === regex.lastIndex) {
15
- regex.lastIndex++;
2
+ const getNamespaces = (source)=>{
3
+ const regex = /([a-zA-Z0-9]+)[ ]+=[ ]+i18n.namespace\(['"`]([a-zA-Z0-9.]+)['"`]\)/g;
4
+ let m;
5
+ const results = {};
6
+ while(null !== (m = regex.exec(source))){
7
+ if (m.index === regex.lastIndex) regex.lastIndex++;
8
+ results[m[1]] = m[2];
16
9
  }
17
- results[m[1]] = m[2];
18
- }
19
- return results;
10
+ return results;
20
11
  };
21
- export default source => {
22
- const results = {};
23
- const allDeclaredNamespaces = getNamespaces(source);
24
- for (const variable in allDeclaredNamespaces) {
25
- const regex = new RegExp(variable + "`(.*?)`", "g");
26
- let m;
27
- while ((m = regex.exec(source)) !== null) {
28
- if (m.index === regex.lastIndex) {
29
- regex.lastIndex++;
30
- }
31
-
32
- // This is the key - namespace + hash of matched label.
33
- const matchedText = m[1];
34
- const key = allDeclaredNamespaces[variable] + "." + hash(matchedText);
35
- results[key] = matchedText;
12
+ const extract = (source)=>{
13
+ const results = {};
14
+ const allDeclaredNamespaces = getNamespaces(source);
15
+ for(const variable in allDeclaredNamespaces){
16
+ const regex = new RegExp(variable + "`(.*?)`", "g");
17
+ let m;
18
+ while(null !== (m = regex.exec(source))){
19
+ if (m.index === regex.lastIndex) regex.lastIndex++;
20
+ const matchedText = m[1];
21
+ const key = allDeclaredNamespaces[variable] + "." + hash(matchedText);
22
+ results[key] = matchedText;
23
+ }
36
24
  }
37
- }
38
- return results;
25
+ return results;
39
26
  };
27
+ export default extract;
40
28
 
41
29
  //# sourceMappingURL=extract.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["hash","getNamespaces","source","regex","m","results","exec","index","lastIndex","allDeclaredNamespaces","variable","RegExp","matchedText","key"],"sources":["extract.ts"],"sourcesContent":["import { hash } from \"ohash\";\n\n/**\n * Searches for all declared namespaces.\n * Result contains an object with identifiers as keys, and namespaces they represent as values, for example:\n * {ns1: 'Webiny.Ns1', ns2: 'Webiny.Ns2', i18n: 'NewNamespace', t: 'Some.Other.Namespace'}\n * @param source\n */\nconst getNamespaces = (source: string) => {\n const regex = /([a-zA-Z0-9]+)[ ]+=[ ]+i18n.namespace\\(['\"`]([a-zA-Z0-9.]+)['\"`]\\)/g;\n let m;\n\n const results: Record<string, string> = {};\n\n while ((m = regex.exec(source)) !== null) {\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n results[m[1]] = m[2];\n }\n\n return results;\n};\n\nexport default (source: string) => {\n const results: Record<string, string> = {};\n const allDeclaredNamespaces = getNamespaces(source);\n\n for (const variable in allDeclaredNamespaces) {\n const regex = new RegExp(variable + \"`(.*?)`\", \"g\");\n\n let m;\n while ((m = regex.exec(source)) !== null) {\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n // This is the key - namespace + hash of matched label.\n const matchedText = m[1];\n const key = allDeclaredNamespaces[variable] + \".\" + hash(matchedText);\n results[key] = matchedText;\n }\n }\n\n return results;\n};\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAIC,MAAc,IAAK;EACtC,MAAMC,KAAK,GAAG,qEAAqE;EACnF,IAAIC,CAAC;EAEL,MAAMC,OAA+B,GAAG,CAAC,CAAC;EAE1C,OAAO,CAACD,CAAC,GAAGD,KAAK,CAACG,IAAI,CAACJ,MAAM,CAAC,MAAM,IAAI,EAAE;IACtC,IAAIE,CAAC,CAACG,KAAK,KAAKJ,KAAK,CAACK,SAAS,EAAE;MAC7BL,KAAK,CAACK,SAAS,EAAE;IACrB;IAEAH,OAAO,CAACD,CAAC,CAAC,CAAC,CAAC,CAAC,GAAGA,CAAC,CAAC,CAAC,CAAC;EACxB;EAEA,OAAOC,OAAO;AAClB,CAAC;AAED,eAAgBH,MAAc,IAAK;EAC/B,MAAMG,OAA+B,GAAG,CAAC,CAAC;EAC1C,MAAMI,qBAAqB,GAAGR,aAAa,CAACC,MAAM,CAAC;EAEnD,KAAK,MAAMQ,QAAQ,IAAID,qBAAqB,EAAE;IAC1C,MAAMN,KAAK,GAAG,IAAIQ,MAAM,CAACD,QAAQ,GAAG,SAAS,EAAE,GAAG,CAAC;IAEnD,IAAIN,CAAC;IACL,OAAO,CAACA,CAAC,GAAGD,KAAK,CAACG,IAAI,CAACJ,MAAM,CAAC,MAAM,IAAI,EAAE;MACtC,IAAIE,CAAC,CAACG,KAAK,KAAKJ,KAAK,CAACK,SAAS,EAAE;QAC7BL,KAAK,CAACK,SAAS,EAAE;MACrB;;MAEA;MACA,MAAMI,WAAW,GAAGR,CAAC,CAAC,CAAC,CAAC;MACxB,MAAMS,GAAG,GAAGJ,qBAAqB,CAACC,QAAQ,CAAC,GAAG,GAAG,GAAGV,IAAI,CAACY,WAAW,CAAC;MACrEP,OAAO,CAACQ,GAAG,CAAC,GAAGD,WAAW;IAC9B;EACJ;EAEA,OAAOP,OAAO;AAClB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"extractor/extract.js","sources":["../../src/extractor/extract.ts"],"sourcesContent":["import { hash } from \"ohash\";\n\n/**\n * Searches for all declared namespaces.\n * Result contains an object with identifiers as keys, and namespaces they represent as values, for example:\n * {ns1: 'Webiny.Ns1', ns2: 'Webiny.Ns2', i18n: 'NewNamespace', t: 'Some.Other.Namespace'}\n * @param source\n */\nconst getNamespaces = (source: string) => {\n const regex = /([a-zA-Z0-9]+)[ ]+=[ ]+i18n.namespace\\(['\"`]([a-zA-Z0-9.]+)['\"`]\\)/g;\n let m;\n\n const results: Record<string, string> = {};\n\n while ((m = regex.exec(source)) !== null) {\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n results[m[1]] = m[2];\n }\n\n return results;\n};\n\nexport default (source: string) => {\n const results: Record<string, string> = {};\n const allDeclaredNamespaces = getNamespaces(source);\n\n for (const variable in allDeclaredNamespaces) {\n const regex = new RegExp(variable + \"`(.*?)`\", \"g\");\n\n let m;\n while ((m = regex.exec(source)) !== null) {\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n // This is the key - namespace + hash of matched label.\n const matchedText = m[1];\n const key = allDeclaredNamespaces[variable] + \".\" + hash(matchedText);\n results[key] = matchedText;\n }\n }\n\n return results;\n};\n"],"names":["getNamespaces","source","regex","m","results","allDeclaredNamespaces","variable","RegExp","matchedText","key","hash"],"mappings":";AAQA,MAAMA,gBAAgB,CAACC;IACnB,MAAMC,QAAQ;IACd,IAAIC;IAEJ,MAAMC,UAAkC,CAAC;IAEzC,MAAQD,AAA4B,SAA5BA,CAAAA,IAAID,MAAM,IAAI,CAACD,OAAM,EAAa;QACtC,IAAIE,EAAE,KAAK,KAAKD,MAAM,SAAS,EAC3BA,MAAM,SAAS;QAGnBE,OAAO,CAACD,CAAC,CAAC,EAAE,CAAC,GAAGA,CAAC,CAAC,EAAE;IACxB;IAEA,OAAOC;AACX;AAEA,gBAAgB,CAAAH;IACZ,MAAMG,UAAkC,CAAC;IACzC,MAAMC,wBAAwBL,cAAcC;IAE5C,IAAK,MAAMK,YAAYD,sBAAuB;QAC1C,MAAMH,QAAQ,IAAIK,OAAOD,WAAW,WAAW;QAE/C,IAAIH;QACJ,MAAQA,AAA4B,SAA5BA,CAAAA,IAAID,MAAM,IAAI,CAACD,OAAM,EAAa;YACtC,IAAIE,EAAE,KAAK,KAAKD,MAAM,SAAS,EAC3BA,MAAM,SAAS;YAInB,MAAMM,cAAcL,CAAC,CAAC,EAAE;YACxB,MAAMM,MAAMJ,qBAAqB,CAACC,SAAS,GAAG,MAAMI,KAAKF;YACzDJ,OAAO,CAACK,IAAI,GAAGD;QACnB;IACJ;IAEA,OAAOJ;AACX"}
@@ -1,37 +1,36 @@
1
1
  import extract from "./extract.js";
2
- import fastGlob from "fast-glob";
3
- import fs from "node:fs";
2
+ import fast_glob from "fast-glob";
3
+ import node_fs from "node:fs";
4
4
  class Extractor {
5
- content = "";
6
- listOnly = false;
7
- setGlob(value) {
8
- this.glob = value;
9
- return this;
10
- }
11
- setContent(content) {
12
- this.content = content;
13
- return this;
14
- }
15
- execute() {
16
- const results = {};
17
- if (!this.glob) {
18
- return results;
5
+ setGlob(value) {
6
+ this.glob = value;
7
+ return this;
8
+ }
9
+ setContent(content) {
10
+ this.content = content;
11
+ return this;
12
+ }
13
+ execute() {
14
+ const results = {};
15
+ if (!this.glob) return results;
16
+ const paths = fast_glob.sync(this.glob);
17
+ paths.forEach((path)=>{
18
+ const contents = node_fs.readFileSync(path, "utf8");
19
+ const parsed = extract(contents);
20
+ for(const key in parsed)results[key] = parsed[key];
21
+ });
22
+ return results;
23
+ }
24
+ setListOnly(flag = true) {
25
+ this.listOnly = flag;
26
+ return this;
27
+ }
28
+ constructor(){
29
+ this.content = "";
30
+ this.listOnly = false;
19
31
  }
20
- const paths = fastGlob.sync(this.glob);
21
- paths.forEach(path => {
22
- const contents = fs.readFileSync(path, "utf8");
23
- const parsed = extract(contents);
24
- for (const key in parsed) {
25
- results[key] = parsed[key];
26
- }
27
- });
28
- return results;
29
- }
30
- setListOnly(flag = true) {
31
- this.listOnly = flag;
32
- return this;
33
- }
34
32
  }
35
- export default Extractor;
33
+ const extractor = Extractor;
34
+ export default extractor;
36
35
 
37
36
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["extract","fastGlob","fs","Extractor","content","listOnly","setGlob","value","glob","setContent","execute","results","paths","sync","forEach","path","contents","readFileSync","parsed","key","setListOnly","flag"],"sources":["index.ts"],"sourcesContent":["import extract from \"./extract.js\";\nimport fastGlob from \"fast-glob\";\nimport fs from \"node:fs\";\n\nexport interface ExtractorResults {\n [key: string]: string;\n}\nclass Extractor {\n private glob: string | undefined;\n public content = \"\";\n public listOnly = false;\n\n public setGlob(value: string): Extractor {\n this.glob = value;\n return this;\n }\n\n public setContent(content: string): Extractor {\n this.content = content;\n return this;\n }\n\n public execute(): ExtractorResults {\n const results: ExtractorResults = {};\n\n if (!this.glob) {\n return results;\n }\n const paths = fastGlob.sync(this.glob);\n paths.forEach(path => {\n const contents = fs.readFileSync(path, \"utf8\");\n const parsed = extract(contents);\n for (const key in parsed) {\n results[key] = parsed[key];\n }\n });\n\n return results;\n }\n\n public setListOnly(flag = true): Extractor {\n this.listOnly = flag;\n return this;\n }\n}\n\nexport default Extractor;\n"],"mappings":"AAAA,OAAOA,OAAO;AACd,OAAOC,QAAQ,MAAM,WAAW;AAChC,OAAOC,EAAE,MAAM,SAAS;AAKxB,MAAMC,SAAS,CAAC;EAELC,OAAO,GAAG,EAAE;EACZC,QAAQ,GAAG,KAAK;EAEhBC,OAAOA,CAACC,KAAa,EAAa;IACrC,IAAI,CAACC,IAAI,GAAGD,KAAK;IACjB,OAAO,IAAI;EACf;EAEOE,UAAUA,CAACL,OAAe,EAAa;IAC1C,IAAI,CAACA,OAAO,GAAGA,OAAO;IACtB,OAAO,IAAI;EACf;EAEOM,OAAOA,CAAA,EAAqB;IAC/B,MAAMC,OAAyB,GAAG,CAAC,CAAC;IAEpC,IAAI,CAAC,IAAI,CAACH,IAAI,EAAE;MACZ,OAAOG,OAAO;IAClB;IACA,MAAMC,KAAK,GAAGX,QAAQ,CAACY,IAAI,CAAC,IAAI,CAACL,IAAI,CAAC;IACtCI,KAAK,CAACE,OAAO,CAACC,IAAI,IAAI;MAClB,MAAMC,QAAQ,GAAGd,EAAE,CAACe,YAAY,CAACF,IAAI,EAAE,MAAM,CAAC;MAC9C,MAAMG,MAAM,GAAGlB,OAAO,CAACgB,QAAQ,CAAC;MAChC,KAAK,MAAMG,GAAG,IAAID,MAAM,EAAE;QACtBP,OAAO,CAACQ,GAAG,CAAC,GAAGD,MAAM,CAACC,GAAG,CAAC;MAC9B;IACJ,CAAC,CAAC;IAEF,OAAOR,OAAO;EAClB;EAEOS,WAAWA,CAACC,IAAI,GAAG,IAAI,EAAa;IACvC,IAAI,CAAChB,QAAQ,GAAGgB,IAAI;IACpB,OAAO,IAAI;EACf;AACJ;AAEA,eAAelB,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"extractor/index.js","sources":["../../src/extractor/index.ts"],"sourcesContent":["import extract from \"./extract.js\";\nimport fastGlob from \"fast-glob\";\nimport fs from \"node:fs\";\n\nexport interface ExtractorResults {\n [key: string]: string;\n}\nclass Extractor {\n private glob: string | undefined;\n public content = \"\";\n public listOnly = false;\n\n public setGlob(value: string): Extractor {\n this.glob = value;\n return this;\n }\n\n public setContent(content: string): Extractor {\n this.content = content;\n return this;\n }\n\n public execute(): ExtractorResults {\n const results: ExtractorResults = {};\n\n if (!this.glob) {\n return results;\n }\n const paths = fastGlob.sync(this.glob);\n paths.forEach(path => {\n const contents = fs.readFileSync(path, \"utf8\");\n const parsed = extract(contents);\n for (const key in parsed) {\n results[key] = parsed[key];\n }\n });\n\n return results;\n }\n\n public setListOnly(flag = true): Extractor {\n this.listOnly = flag;\n return this;\n }\n}\n\nexport default Extractor;\n"],"names":["Extractor","value","content","results","paths","fastGlob","path","contents","fs","parsed","extract","key","flag"],"mappings":";;;AAOA,MAAMA;IAKK,QAAQC,KAAa,EAAa;QACrC,IAAI,CAAC,IAAI,GAAGA;QACZ,OAAO,IAAI;IACf;IAEO,WAAWC,OAAe,EAAa;QAC1C,IAAI,CAAC,OAAO,GAAGA;QACf,OAAO,IAAI;IACf;IAEO,UAA4B;QAC/B,MAAMC,UAA4B,CAAC;QAEnC,IAAI,CAAC,IAAI,CAAC,IAAI,EACV,OAAOA;QAEX,MAAMC,QAAQC,UAAAA,IAAa,CAAC,IAAI,CAAC,IAAI;QACrCD,MAAM,OAAO,CAACE,CAAAA;YACV,MAAMC,WAAWC,QAAAA,YAAe,CAACF,MAAM;YACvC,MAAMG,SAASC,QAAQH;YACvB,IAAK,MAAMI,OAAOF,OACdN,OAAO,CAACQ,IAAI,GAAGF,MAAM,CAACE,IAAI;QAElC;QAEA,OAAOR;IACX;IAEO,YAAYS,OAAO,IAAI,EAAa;QACvC,IAAI,CAAC,QAAQ,GAAGA;QAChB,OAAO,IAAI;IACf;;aAlCO,OAAO,GAAG;aACV,QAAQ,GAAG;;AAkCtB;AAEA,kBAAeZ"}
package/index.js CHANGED
@@ -1,11 +1,12 @@
1
1
  import I18n from "./I18n.js";
2
- import defaultProcessor from "./processors/default.js";
3
- import modifiersFactory from "./modifiers/index.js";
2
+ import modifiers from "./modifiers/index.js";
4
3
  const i18n = new I18n();
5
- const defaultModifiers = modifiersFactory({
6
- i18n
4
+ const defaultModifiers = modifiers({
5
+ i18n: i18n
7
6
  });
8
- export default i18n;
9
- export { I18n, defaultModifiers, defaultProcessor };
7
+ const src = i18n;
8
+ export { default as defaultProcessor } from "./processors/default.js";
9
+ export default src;
10
+ export { I18n, defaultModifiers };
10
11
 
11
12
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["I18n","defaultProcessor","modifiersFactory","i18n","defaultModifiers"],"sources":["index.ts"],"sourcesContent":["import I18n from \"./I18n.js\";\nimport defaultProcessor from \"./processors/default.js\";\nimport modifiersFactory from \"./modifiers/index.js\";\n\nconst i18n = new I18n();\n\nconst defaultModifiers = modifiersFactory({ i18n });\n\nexport default i18n;\n\nexport { I18n, defaultModifiers, defaultProcessor };\n"],"mappings":"AAAA,OAAOA,IAAI;AACX,OAAOC,gBAAgB;AACvB,OAAOC,gBAAgB;AAEvB,MAAMC,IAAI,GAAG,IAAIH,IAAI,CAAC,CAAC;AAEvB,MAAMI,gBAAgB,GAAGF,gBAAgB,CAAC;EAAEC;AAAK,CAAC,CAAC;AAEnD,eAAeA,IAAI;AAEnB,SAASH,IAAI,EAAEI,gBAAgB,EAAEH,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import I18n from \"./I18n.js\";\nimport defaultProcessor from \"./processors/default.js\";\nimport modifiersFactory from \"./modifiers/index.js\";\n\nconst i18n = new I18n();\n\nconst defaultModifiers = modifiersFactory({ i18n });\n\nexport default i18n;\n\nexport { I18n, defaultModifiers, defaultProcessor };\n"],"names":["i18n","I18n","defaultModifiers","modifiersFactory"],"mappings":";;AAIA,MAAMA,OAAO,IAAIC;AAEjB,MAAMC,mBAAmBC,UAAiB;IAAEH,MAAAA;AAAK;AAEjD,YAAeA"}
@@ -1,31 +1,19 @@
1
- export default () => {
2
- return {
3
- name: "count",
4
- execute(value, parameters) {
5
- // Numbers can be single number or ranges.
6
- for (let i = 0; i < parameters.length; i = i + 2) {
7
- const current = parameters[i];
8
- if (current === "default") {
9
- return value + " " + parameters[i + 1];
1
+ const countModifier = ()=>({
2
+ name: "count",
3
+ execute (value, parameters) {
4
+ for(let i = 0; i < parameters.length; i += 2){
5
+ const current = parameters[i];
6
+ if ("default" === current) return value + " " + parameters[i + 1];
7
+ const numbers = current.split("-");
8
+ if (2 === numbers.length) {
9
+ if (value >= numbers[0] && value <= numbers[1]) return value + " " + parameters[i + 1];
10
+ continue;
11
+ }
12
+ if (String(value) === numbers[0]) return value + " " + parameters[i + 1];
13
+ }
14
+ return value;
10
15
  }
11
- const numbers = current.split("-");
12
-
13
- // If we are dealing with a numbers range, then let's check if we are in it.
14
- if (numbers.length === 2) {
15
- if (value >= numbers[0] && value <= numbers[1]) {
16
- return value + " " + parameters[i + 1];
17
- }
18
- continue;
19
- }
20
- if (String(value) === numbers[0]) {
21
- return value + " " + parameters[i + 1];
22
- }
23
- }
24
-
25
- // If we didn't match any condition, let's just remove the received value.
26
- return value;
27
- }
28
- };
29
- };
16
+ });
17
+ export default countModifier;
30
18
 
31
19
  //# sourceMappingURL=countModifier.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["name","execute","value","parameters","i","length","current","numbers","split","String"],"sources":["countModifier.ts"],"sourcesContent":["import type { Modifier } from \"~/types.js\";\n\nexport default (): Modifier => {\n return {\n name: \"count\",\n execute(value: string, parameters: Array<string>) {\n // Numbers can be single number or ranges.\n for (let i = 0; i < parameters.length; i = i + 2) {\n const current = parameters[i];\n if (current === \"default\") {\n return value + \" \" + parameters[i + 1];\n }\n\n const numbers = current.split(\"-\");\n\n // If we are dealing with a numbers range, then let's check if we are in it.\n if (numbers.length === 2) {\n if (value >= numbers[0] && value <= numbers[1]) {\n return value + \" \" + parameters[i + 1];\n }\n continue;\n }\n\n if (String(value) === numbers[0]) {\n return value + \" \" + parameters[i + 1];\n }\n }\n\n // If we didn't match any condition, let's just remove the received value.\n return value;\n }\n };\n};\n"],"mappings":"AAEA,eAAe,MAAgB;EAC3B,OAAO;IACHA,IAAI,EAAE,OAAO;IACbC,OAAOA,CAACC,KAAa,EAAEC,UAAyB,EAAE;MAC9C;MACA,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGD,UAAU,CAACE,MAAM,EAAED,CAAC,GAAGA,CAAC,GAAG,CAAC,EAAE;QAC9C,MAAME,OAAO,GAAGH,UAAU,CAACC,CAAC,CAAC;QAC7B,IAAIE,OAAO,KAAK,SAAS,EAAE;UACvB,OAAOJ,KAAK,GAAG,GAAG,GAAGC,UAAU,CAACC,CAAC,GAAG,CAAC,CAAC;QAC1C;QAEA,MAAMG,OAAO,GAAGD,OAAO,CAACE,KAAK,CAAC,GAAG,CAAC;;QAElC;QACA,IAAID,OAAO,CAACF,MAAM,KAAK,CAAC,EAAE;UACtB,IAAIH,KAAK,IAAIK,OAAO,CAAC,CAAC,CAAC,IAAIL,KAAK,IAAIK,OAAO,CAAC,CAAC,CAAC,EAAE;YAC5C,OAAOL,KAAK,GAAG,GAAG,GAAGC,UAAU,CAACC,CAAC,GAAG,CAAC,CAAC;UAC1C;UACA;QACJ;QAEA,IAAIK,MAAM,CAACP,KAAK,CAAC,KAAKK,OAAO,CAAC,CAAC,CAAC,EAAE;UAC9B,OAAOL,KAAK,GAAG,GAAG,GAAGC,UAAU,CAACC,CAAC,GAAG,CAAC,CAAC;QAC1C;MACJ;;MAEA;MACA,OAAOF,KAAK;IAChB;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"modifiers/countModifier.js","sources":["../../src/modifiers/countModifier.ts"],"sourcesContent":["import type { Modifier } from \"~/types.js\";\n\nexport default (): Modifier => {\n return {\n name: \"count\",\n execute(value: string, parameters: Array<string>) {\n // Numbers can be single number or ranges.\n for (let i = 0; i < parameters.length; i = i + 2) {\n const current = parameters[i];\n if (current === \"default\") {\n return value + \" \" + parameters[i + 1];\n }\n\n const numbers = current.split(\"-\");\n\n // If we are dealing with a numbers range, then let's check if we are in it.\n if (numbers.length === 2) {\n if (value >= numbers[0] && value <= numbers[1]) {\n return value + \" \" + parameters[i + 1];\n }\n continue;\n }\n\n if (String(value) === numbers[0]) {\n return value + \" \" + parameters[i + 1];\n }\n }\n\n // If we didn't match any condition, let's just remove the received value.\n return value;\n }\n };\n};\n"],"names":["value","parameters","i","current","numbers","String"],"mappings":"AAEA,sBAAgB,IACL;QACH,MAAM;QACN,SAAQA,KAAa,EAAEC,UAAyB;YAE5C,IAAK,IAAIC,IAAI,GAAGA,IAAID,WAAW,MAAM,EAAEC,KAAQ,EAAG;gBAC9C,MAAMC,UAAUF,UAAU,CAACC,EAAE;gBAC7B,IAAIC,AAAY,cAAZA,SACA,OAAOH,QAAQ,MAAMC,UAAU,CAACC,IAAI,EAAE;gBAG1C,MAAME,UAAUD,QAAQ,KAAK,CAAC;gBAG9B,IAAIC,AAAmB,MAAnBA,QAAQ,MAAM,EAAQ;oBACtB,IAAIJ,SAASI,OAAO,CAAC,EAAE,IAAIJ,SAASI,OAAO,CAAC,EAAE,EAC1C,OAAOJ,QAAQ,MAAMC,UAAU,CAACC,IAAI,EAAE;oBAE1C;gBACJ;gBAEA,IAAIG,OAAOL,WAAWI,OAAO,CAAC,EAAE,EAC5B,OAAOJ,QAAQ,MAAMC,UAAU,CAACC,IAAI,EAAE;YAE9C;YAGA,OAAOF;QACX;IACJ"}
@@ -1,10 +1,9 @@
1
- export default ({
2
- i18n
3
- }) => ({
4
- name: "date",
5
- execute(value) {
6
- return i18n.date(value);
7
- }
8
- });
1
+ const dateModifier = ({ i18n })=>({
2
+ name: "date",
3
+ execute (value) {
4
+ return i18n.date(value);
5
+ }
6
+ });
7
+ export default dateModifier;
9
8
 
10
9
  //# sourceMappingURL=dateModifier.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["i18n","name","execute","value","date"],"sources":["dateModifier.ts"],"sourcesContent":["import type { Modifier, ModifierOptions } from \"~/types.js\";\n\nexport default ({ i18n }: ModifierOptions): Modifier => ({\n name: \"date\",\n execute(value) {\n return i18n.date(value);\n }\n});\n"],"mappings":"AAEA,eAAe,CAAC;EAAEA;AAAsB,CAAC,MAAgB;EACrDC,IAAI,EAAE,MAAM;EACZC,OAAOA,CAACC,KAAK,EAAE;IACX,OAAOH,IAAI,CAACI,IAAI,CAACD,KAAK,CAAC;EAC3B;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"modifiers/dateModifier.js","sources":["../../src/modifiers/dateModifier.ts"],"sourcesContent":["import type { Modifier, ModifierOptions } from \"~/types.js\";\n\nexport default ({ i18n }: ModifierOptions): Modifier => ({\n name: \"date\",\n execute(value) {\n return i18n.date(value);\n }\n});\n"],"names":["i18n","value"],"mappings":"AAEA,qBAAgB,GAAEA,IAAI,EAAmB,GAAgB;QACrD,MAAM;QACN,SAAQC,KAAK;YACT,OAAOD,KAAK,IAAI,CAACC;QACrB;IACJ"}
@@ -1,10 +1,9 @@
1
- export default ({
2
- i18n
3
- }) => ({
4
- name: "dateTime",
5
- execute(value) {
6
- return i18n.dateTime(value);
7
- }
8
- });
1
+ const dateTimeModifier = ({ i18n })=>({
2
+ name: "dateTime",
3
+ execute (value) {
4
+ return i18n.dateTime(value);
5
+ }
6
+ });
7
+ export default dateTimeModifier;
9
8
 
10
9
  //# sourceMappingURL=dateTimeModifier.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["i18n","name","execute","value","dateTime"],"sources":["dateTimeModifier.ts"],"sourcesContent":["import type { Modifier, ModifierOptions } from \"~/types.js\";\n\nexport default ({ i18n }: ModifierOptions): Modifier => ({\n name: \"dateTime\",\n execute(value: string) {\n return i18n.dateTime(value);\n }\n});\n"],"mappings":"AAEA,eAAe,CAAC;EAAEA;AAAsB,CAAC,MAAgB;EACrDC,IAAI,EAAE,UAAU;EAChBC,OAAOA,CAACC,KAAa,EAAE;IACnB,OAAOH,IAAI,CAACI,QAAQ,CAACD,KAAK,CAAC;EAC/B;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"modifiers/dateTimeModifier.js","sources":["../../src/modifiers/dateTimeModifier.ts"],"sourcesContent":["import type { Modifier, ModifierOptions } from \"~/types.js\";\n\nexport default ({ i18n }: ModifierOptions): Modifier => ({\n name: \"dateTime\",\n execute(value: string) {\n return i18n.dateTime(value);\n }\n});\n"],"names":["i18n","value"],"mappings":"AAEA,yBAAgB,GAAEA,IAAI,EAAmB,GAAgB;QACrD,MAAM;QACN,SAAQC,KAAa;YACjB,OAAOD,KAAK,QAAQ,CAACC;QACzB;IACJ"}
@@ -1,10 +1,9 @@
1
- export default () => {
2
- return {
3
- name: "gender",
4
- execute(value, parameters) {
5
- return value === "male" ? parameters[0] : parameters[1];
6
- }
7
- };
8
- };
1
+ const genderModifier = ()=>({
2
+ name: "gender",
3
+ execute (value, parameters) {
4
+ return "male" === value ? parameters[0] : parameters[1];
5
+ }
6
+ });
7
+ export default genderModifier;
9
8
 
10
9
  //# sourceMappingURL=genderModifier.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["name","execute","value","parameters"],"sources":["genderModifier.ts"],"sourcesContent":["import type { Modifier } from \"~/types.js\";\n\nexport default (): Modifier => {\n return {\n name: \"gender\",\n execute(value: string, parameters: Array<string>) {\n return value === \"male\" ? parameters[0] : parameters[1];\n }\n };\n};\n"],"mappings":"AAEA,eAAe,MAAgB;EAC3B,OAAO;IACHA,IAAI,EAAE,QAAQ;IACdC,OAAOA,CAACC,KAAa,EAAEC,UAAyB,EAAE;MAC9C,OAAOD,KAAK,KAAK,MAAM,GAAGC,UAAU,CAAC,CAAC,CAAC,GAAGA,UAAU,CAAC,CAAC,CAAC;IAC3D;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"modifiers/genderModifier.js","sources":["../../src/modifiers/genderModifier.ts"],"sourcesContent":["import type { Modifier } from \"~/types.js\";\n\nexport default (): Modifier => {\n return {\n name: \"gender\",\n execute(value: string, parameters: Array<string>) {\n return value === \"male\" ? parameters[0] : parameters[1];\n }\n };\n};\n"],"names":["value","parameters"],"mappings":"AAEA,uBAAgB,IACL;QACH,MAAM;QACN,SAAQA,KAAa,EAAEC,UAAyB;YAC5C,OAAOD,AAAU,WAAVA,QAAmBC,UAAU,CAAC,EAAE,GAAGA,UAAU,CAAC,EAAE;QAC3D;IACJ"}
@@ -1,10 +1,9 @@
1
- export default () => {
2
- return {
3
- name: "if",
4
- execute(value, parameters) {
5
- return value === parameters[0] ? parameters[1] : parameters[2] || "";
6
- }
7
- };
8
- };
1
+ const ifModifier = ()=>({
2
+ name: "if",
3
+ execute (value, parameters) {
4
+ return value === parameters[0] ? parameters[1] : parameters[2] || "";
5
+ }
6
+ });
7
+ export default ifModifier;
9
8
 
10
9
  //# sourceMappingURL=ifModifier.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["name","execute","value","parameters"],"sources":["ifModifier.ts"],"sourcesContent":["import type { Modifier } from \"~/types.js\";\n\nexport default (): Modifier => {\n return {\n name: \"if\",\n execute(value: string, parameters: Array<string>) {\n return value === parameters[0] ? parameters[1] : parameters[2] || \"\";\n }\n };\n};\n"],"mappings":"AAEA,eAAe,MAAgB;EAC3B,OAAO;IACHA,IAAI,EAAE,IAAI;IACVC,OAAOA,CAACC,KAAa,EAAEC,UAAyB,EAAE;MAC9C,OAAOD,KAAK,KAAKC,UAAU,CAAC,CAAC,CAAC,GAAGA,UAAU,CAAC,CAAC,CAAC,GAAGA,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE;IACxE;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"modifiers/ifModifier.js","sources":["../../src/modifiers/ifModifier.ts"],"sourcesContent":["import type { Modifier } from \"~/types.js\";\n\nexport default (): Modifier => {\n return {\n name: \"if\",\n execute(value: string, parameters: Array<string>) {\n return value === parameters[0] ? parameters[1] : parameters[2] || \"\";\n }\n };\n};\n"],"names":["value","parameters"],"mappings":"AAEA,mBAAgB,IACL;QACH,MAAM;QACN,SAAQA,KAAa,EAAEC,UAAyB;YAC5C,OAAOD,UAAUC,UAAU,CAAC,EAAE,GAAGA,UAAU,CAAC,EAAE,GAAGA,UAAU,CAAC,EAAE,IAAI;QACtE;IACJ"}
@@ -1,5 +1,4 @@
1
- // Built-in modifiers
2
- import countModifiers from "./countModifier.js";
1
+ import countModifier from "./countModifier.js";
3
2
  import genderModifier from "./genderModifier.js";
4
3
  import ifModifier from "./ifModifier.js";
5
4
  import pluralModifier from "./pluralModifier.js";
@@ -8,6 +7,17 @@ import dateTimeModifier from "./dateTimeModifier.js";
8
7
  import timeModifier from "./timeModifier.js";
9
8
  import numberModifier from "./numberModifier.js";
10
9
  import priceModifier from "./priceModifier.js";
11
- export default options => [countModifiers(), genderModifier(), ifModifier(), pluralModifier(), dateModifier(options), dateTimeModifier(options), timeModifier(options), numberModifier(options), priceModifier(options)];
10
+ const modifiers = (options)=>[
11
+ countModifier(),
12
+ genderModifier(),
13
+ ifModifier(),
14
+ pluralModifier(),
15
+ dateModifier(options),
16
+ dateTimeModifier(options),
17
+ timeModifier(options),
18
+ numberModifier(options),
19
+ priceModifier(options)
20
+ ];
21
+ export default modifiers;
12
22
 
13
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["countModifiers","genderModifier","ifModifier","pluralModifier","dateModifier","dateTimeModifier","timeModifier","numberModifier","priceModifier","options"],"sources":["index.ts"],"sourcesContent":["// Built-in modifiers\nimport countModifiers from \"./countModifier.js\";\nimport genderModifier from \"./genderModifier.js\";\nimport ifModifier from \"./ifModifier.js\";\nimport pluralModifier from \"./pluralModifier.js\";\nimport dateModifier from \"./dateModifier.js\";\nimport dateTimeModifier from \"./dateTimeModifier.js\";\nimport timeModifier from \"./timeModifier.js\";\nimport numberModifier from \"./numberModifier.js\";\nimport priceModifier from \"./priceModifier.js\";\nimport type { Modifier, ModifierOptions } from \"~/types.js\";\n\nexport default (options: ModifierOptions): Modifier[] => [\n countModifiers(),\n genderModifier(),\n ifModifier(),\n pluralModifier(),\n dateModifier(options),\n dateTimeModifier(options),\n timeModifier(options),\n numberModifier(options),\n priceModifier(options)\n];\n"],"mappings":"AAAA;AACA,OAAOA,cAAc;AACrB,OAAOC,cAAc;AACrB,OAAOC,UAAU;AACjB,OAAOC,cAAc;AACrB,OAAOC,YAAY;AACnB,OAAOC,gBAAgB;AACvB,OAAOC,YAAY;AACnB,OAAOC,cAAc;AACrB,OAAOC,aAAa;AAGpB,eAAgBC,OAAwB,IAAiB,CACrDT,cAAc,CAAC,CAAC,EAChBC,cAAc,CAAC,CAAC,EAChBC,UAAU,CAAC,CAAC,EACZC,cAAc,CAAC,CAAC,EAChBC,YAAY,CAACK,OAAO,CAAC,EACrBJ,gBAAgB,CAACI,OAAO,CAAC,EACzBH,YAAY,CAACG,OAAO,CAAC,EACrBF,cAAc,CAACE,OAAO,CAAC,EACvBD,aAAa,CAACC,OAAO,CAAC,CACzB","ignoreList":[]}
1
+ {"version":3,"file":"modifiers/index.js","sources":["../../src/modifiers/index.ts"],"sourcesContent":["// Built-in modifiers\nimport countModifiers from \"./countModifier.js\";\nimport genderModifier from \"./genderModifier.js\";\nimport ifModifier from \"./ifModifier.js\";\nimport pluralModifier from \"./pluralModifier.js\";\nimport dateModifier from \"./dateModifier.js\";\nimport dateTimeModifier from \"./dateTimeModifier.js\";\nimport timeModifier from \"./timeModifier.js\";\nimport numberModifier from \"./numberModifier.js\";\nimport priceModifier from \"./priceModifier.js\";\nimport type { Modifier, ModifierOptions } from \"~/types.js\";\n\nexport default (options: ModifierOptions): Modifier[] => [\n countModifiers(),\n genderModifier(),\n ifModifier(),\n pluralModifier(),\n dateModifier(options),\n dateTimeModifier(options),\n timeModifier(options),\n numberModifier(options),\n priceModifier(options)\n];\n"],"names":["options","countModifiers","genderModifier","ifModifier","pluralModifier","dateModifier","dateTimeModifier","timeModifier","numberModifier","priceModifier"],"mappings":";;;;;;;;;AAYA,kBAAgB,CAAAA,UAAyC;QACrDC;QACAC;QACAC;QACAC;QACAC,aAAaL;QACbM,iBAAiBN;QACjBO,aAAaP;QACbQ,eAAeR;QACfS,cAAcT;KAClB"}
@@ -1,10 +1,9 @@
1
- export default ({
2
- i18n
3
- }) => ({
4
- name: "number",
5
- execute(value) {
6
- return i18n.number(value);
7
- }
8
- });
1
+ const numberModifier = ({ i18n })=>({
2
+ name: "number",
3
+ execute (value) {
4
+ return i18n.number(value);
5
+ }
6
+ });
7
+ export default numberModifier;
9
8
 
10
9
  //# sourceMappingURL=numberModifier.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["i18n","name","execute","value","number"],"sources":["numberModifier.ts"],"sourcesContent":["import type { Modifier, ModifierOptions } from \"~/types.js\";\n\nexport default ({ i18n }: ModifierOptions): Modifier => ({\n name: \"number\",\n execute(value: string) {\n return i18n.number(value);\n }\n});\n"],"mappings":"AAEA,eAAe,CAAC;EAAEA;AAAsB,CAAC,MAAgB;EACrDC,IAAI,EAAE,QAAQ;EACdC,OAAOA,CAACC,KAAa,EAAE;IACnB,OAAOH,IAAI,CAACI,MAAM,CAACD,KAAK,CAAC;EAC7B;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"modifiers/numberModifier.js","sources":["../../src/modifiers/numberModifier.ts"],"sourcesContent":["import type { Modifier, ModifierOptions } from \"~/types.js\";\n\nexport default ({ i18n }: ModifierOptions): Modifier => ({\n name: \"number\",\n execute(value: string) {\n return i18n.number(value);\n }\n});\n"],"names":["i18n","value"],"mappings":"AAEA,uBAAgB,GAAEA,IAAI,EAAmB,GAAgB;QACrD,MAAM;QACN,SAAQC,KAAa;YACjB,OAAOD,KAAK,MAAM,CAACC;QACvB;IACJ"}
@@ -1,29 +1,19 @@
1
- export default () => {
2
- return {
3
- name: "plural",
4
- execute(value, parameters) {
5
- // Numbers can be single number or ranges.
6
- for (let i = 0; i < parameters.length; i = i + 2) {
7
- const current = parameters[i];
8
- if (current === "default") {
9
- return parameters[i + 1];
1
+ const pluralModifier = ()=>({
2
+ name: "plural",
3
+ execute (value, parameters) {
4
+ for(let i = 0; i < parameters.length; i += 2){
5
+ const current = parameters[i];
6
+ if ("default" === current) return parameters[i + 1];
7
+ const numbers = current.split("-");
8
+ if (2 === numbers.length) {
9
+ if (value >= numbers[0] && value <= numbers[1]) return parameters[i + 1];
10
+ continue;
11
+ }
12
+ if (String(value) === numbers[0]) return parameters[i + 1];
13
+ }
14
+ return "";
10
15
  }
11
- const numbers = current.split("-");
12
-
13
- // If we are dealing with a numbers range, then let's check if we are in it.
14
- if (numbers.length === 2) {
15
- if (value >= numbers[0] && value <= numbers[1]) {
16
- return parameters[i + 1];
17
- }
18
- continue;
19
- }
20
- if (String(value) === numbers[0]) {
21
- return parameters[i + 1];
22
- }
23
- }
24
- return "";
25
- }
26
- };
27
- };
16
+ });
17
+ export default pluralModifier;
28
18
 
29
19
  //# sourceMappingURL=pluralModifier.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["name","execute","value","parameters","i","length","current","numbers","split","String"],"sources":["pluralModifier.ts"],"sourcesContent":["import type { Modifier } from \"~/types.js\";\n\nexport default (): Modifier => {\n return {\n name: \"plural\",\n execute(value: string, parameters: Array<string>) {\n // Numbers can be single number or ranges.\n for (let i = 0; i < parameters.length; i = i + 2) {\n const current = parameters[i];\n if (current === \"default\") {\n return parameters[i + 1];\n }\n\n const numbers = current.split(\"-\");\n\n // If we are dealing with a numbers range, then let's check if we are in it.\n if (numbers.length === 2) {\n if (value >= numbers[0] && value <= numbers[1]) {\n return parameters[i + 1];\n }\n continue;\n }\n\n if (String(value) === numbers[0]) {\n return parameters[i + 1];\n }\n }\n\n return \"\";\n }\n };\n};\n"],"mappings":"AAEA,eAAe,MAAgB;EAC3B,OAAO;IACHA,IAAI,EAAE,QAAQ;IACdC,OAAOA,CAACC,KAAa,EAAEC,UAAyB,EAAE;MAC9C;MACA,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGD,UAAU,CAACE,MAAM,EAAED,CAAC,GAAGA,CAAC,GAAG,CAAC,EAAE;QAC9C,MAAME,OAAO,GAAGH,UAAU,CAACC,CAAC,CAAC;QAC7B,IAAIE,OAAO,KAAK,SAAS,EAAE;UACvB,OAAOH,UAAU,CAACC,CAAC,GAAG,CAAC,CAAC;QAC5B;QAEA,MAAMG,OAAO,GAAGD,OAAO,CAACE,KAAK,CAAC,GAAG,CAAC;;QAElC;QACA,IAAID,OAAO,CAACF,MAAM,KAAK,CAAC,EAAE;UACtB,IAAIH,KAAK,IAAIK,OAAO,CAAC,CAAC,CAAC,IAAIL,KAAK,IAAIK,OAAO,CAAC,CAAC,CAAC,EAAE;YAC5C,OAAOJ,UAAU,CAACC,CAAC,GAAG,CAAC,CAAC;UAC5B;UACA;QACJ;QAEA,IAAIK,MAAM,CAACP,KAAK,CAAC,KAAKK,OAAO,CAAC,CAAC,CAAC,EAAE;UAC9B,OAAOJ,UAAU,CAACC,CAAC,GAAG,CAAC,CAAC;QAC5B;MACJ;MAEA,OAAO,EAAE;IACb;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"modifiers/pluralModifier.js","sources":["../../src/modifiers/pluralModifier.ts"],"sourcesContent":["import type { Modifier } from \"~/types.js\";\n\nexport default (): Modifier => {\n return {\n name: \"plural\",\n execute(value: string, parameters: Array<string>) {\n // Numbers can be single number or ranges.\n for (let i = 0; i < parameters.length; i = i + 2) {\n const current = parameters[i];\n if (current === \"default\") {\n return parameters[i + 1];\n }\n\n const numbers = current.split(\"-\");\n\n // If we are dealing with a numbers range, then let's check if we are in it.\n if (numbers.length === 2) {\n if (value >= numbers[0] && value <= numbers[1]) {\n return parameters[i + 1];\n }\n continue;\n }\n\n if (String(value) === numbers[0]) {\n return parameters[i + 1];\n }\n }\n\n return \"\";\n }\n };\n};\n"],"names":["value","parameters","i","current","numbers","String"],"mappings":"AAEA,uBAAgB,IACL;QACH,MAAM;QACN,SAAQA,KAAa,EAAEC,UAAyB;YAE5C,IAAK,IAAIC,IAAI,GAAGA,IAAID,WAAW,MAAM,EAAEC,KAAQ,EAAG;gBAC9C,MAAMC,UAAUF,UAAU,CAACC,EAAE;gBAC7B,IAAIC,AAAY,cAAZA,SACA,OAAOF,UAAU,CAACC,IAAI,EAAE;gBAG5B,MAAME,UAAUD,QAAQ,KAAK,CAAC;gBAG9B,IAAIC,AAAmB,MAAnBA,QAAQ,MAAM,EAAQ;oBACtB,IAAIJ,SAASI,OAAO,CAAC,EAAE,IAAIJ,SAASI,OAAO,CAAC,EAAE,EAC1C,OAAOH,UAAU,CAACC,IAAI,EAAE;oBAE5B;gBACJ;gBAEA,IAAIG,OAAOL,WAAWI,OAAO,CAAC,EAAE,EAC5B,OAAOH,UAAU,CAACC,IAAI,EAAE;YAEhC;YAEA,OAAO;QACX;IACJ"}
@@ -1,10 +1,9 @@
1
- export default ({
2
- i18n
3
- }) => ({
4
- name: "price",
5
- execute(value) {
6
- return i18n.price(value);
7
- }
8
- });
1
+ const priceModifier = ({ i18n })=>({
2
+ name: "price",
3
+ execute (value) {
4
+ return i18n.price(value);
5
+ }
6
+ });
7
+ export default priceModifier;
9
8
 
10
9
  //# sourceMappingURL=priceModifier.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["i18n","name","execute","value","price"],"sources":["priceModifier.ts"],"sourcesContent":["import type { Modifier, ModifierOptions } from \"~/types.js\";\n\nexport default ({ i18n }: ModifierOptions): Modifier => ({\n name: \"price\",\n execute(value: string) {\n return i18n.price(value);\n }\n});\n"],"mappings":"AAEA,eAAe,CAAC;EAAEA;AAAsB,CAAC,MAAgB;EACrDC,IAAI,EAAE,OAAO;EACbC,OAAOA,CAACC,KAAa,EAAE;IACnB,OAAOH,IAAI,CAACI,KAAK,CAACD,KAAK,CAAC;EAC5B;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"modifiers/priceModifier.js","sources":["../../src/modifiers/priceModifier.ts"],"sourcesContent":["import type { Modifier, ModifierOptions } from \"~/types.js\";\n\nexport default ({ i18n }: ModifierOptions): Modifier => ({\n name: \"price\",\n execute(value: string) {\n return i18n.price(value);\n }\n});\n"],"names":["i18n","value"],"mappings":"AAEA,sBAAgB,GAAEA,IAAI,EAAmB,GAAgB;QACrD,MAAM;QACN,SAAQC,KAAa;YACjB,OAAOD,KAAK,KAAK,CAACC;QACtB;IACJ"}
@@ -1,10 +1,9 @@
1
- export default ({
2
- i18n
3
- }) => ({
4
- name: "time",
5
- execute(value) {
6
- return i18n.time(value);
7
- }
8
- });
1
+ const timeModifier = ({ i18n })=>({
2
+ name: "time",
3
+ execute (value) {
4
+ return i18n.time(value);
5
+ }
6
+ });
7
+ export default timeModifier;
9
8
 
10
9
  //# sourceMappingURL=timeModifier.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["i18n","name","execute","value","time"],"sources":["timeModifier.ts"],"sourcesContent":["import type { Modifier, ModifierOptions } from \"~/types.js\";\n\nexport default ({ i18n }: ModifierOptions): Modifier => ({\n name: \"time\",\n execute(value: string) {\n return i18n.time(value);\n }\n});\n"],"mappings":"AAEA,eAAe,CAAC;EAAEA;AAAsB,CAAC,MAAgB;EACrDC,IAAI,EAAE,MAAM;EACZC,OAAOA,CAACC,KAAa,EAAE;IACnB,OAAOH,IAAI,CAACI,IAAI,CAACD,KAAK,CAAC;EAC3B;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"modifiers/timeModifier.js","sources":["../../src/modifiers/timeModifier.ts"],"sourcesContent":["import type { Modifier, ModifierOptions } from \"~/types.js\";\n\nexport default ({ i18n }: ModifierOptions): Modifier => ({\n name: \"time\",\n execute(value: string) {\n return i18n.time(value);\n }\n});\n"],"names":["i18n","value"],"mappings":"AAEA,qBAAgB,GAAEA,IAAI,EAAmB,GAAgB;QACrD,MAAM;QACN,SAAQC,KAAa;YACjB,OAAOD,KAAK,IAAI,CAACC;QACrB;IACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/i18n",
3
- "version": "6.3.0",
3
+ "version": "6.4.0-beta.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -28,17 +28,16 @@
28
28
  "react": "18.3.1"
29
29
  },
30
30
  "devDependencies": {
31
- "@babel/register": "7.29.3",
32
31
  "@types/accounting": "0.4.5",
33
32
  "@types/lodash": "4.17.24",
34
- "@webiny/build-tools": "6.3.0",
33
+ "@webiny/build-tools": "6.4.0-beta.1",
35
34
  "rimraf": "6.1.3",
36
35
  "typescript": "6.0.3",
37
- "vitest": "4.1.5"
36
+ "vitest": "4.1.6"
38
37
  },
39
38
  "publishConfig": {
40
39
  "access": "public",
41
40
  "directory": "dist"
42
41
  },
43
- "gitHead": "7cefe15431dbd65504e1f58147dc9e55bcbfa693"
42
+ "gitHead": "73237b8243693038c072bae1c0b783387448cbbe"
44
43
  }