react-native-intlayer 5.2.1 → 5.2.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.
@@ -39,7 +39,7 @@ var import_chokidar = require("@intlayer/chokidar");
39
39
  const configMetroIntlayer = async (baseConfig) => {
40
40
  const intlayerConfig = (0, import_config.getConfiguration)();
41
41
  await (0, import_chokidar.prepareIntlayer)(intlayerConfig);
42
- const { mainDir, configDir, watchedFilesPattern } = intlayerConfig.content;
42
+ const { mainDir, configDir } = intlayerConfig.content;
43
43
  const dictionariesPath = (0, import_path.join)(mainDir, "dictionaries.cjs");
44
44
  const configurationPath = (0, import_path.join)(configDir, "configuration.json");
45
45
  const config = {
@@ -65,7 +65,12 @@ const configMetroIntlayer = async (baseConfig) => {
65
65
  }
66
66
  return (0, import_metro_resolver.resolve)(context, moduleName, platform);
67
67
  },
68
- blockList: (0, import_exclusionList.exclusionList)(watchedFilesPattern)
68
+ blockList: (0, import_exclusionList.exclusionList)([
69
+ ...[baseConfig.resolver?.blockList ?? []].flat(),
70
+ // the following instruction should be replaced intlayerConfig.content.watchedFilesPattern
71
+ // but using watchedFilesPattern does not exclude the files properly for now
72
+ /.*\.content\.(?:ts|tsx|js|jsx|cjs|cjx|mjs|mjx|json)$/
73
+ ])
69
74
  }
70
75
  };
71
76
  return config;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/configMetroIntlayer.ts"],"sourcesContent":["import { getDefaultConfig } from 'expo/metro-config';\nimport { getConfiguration } from '@intlayer/config';\nimport { join } from 'path';\nimport { resolve } from 'metro-resolver';\nimport { exclusionList } from './exclusionList';\nimport { prepareIntlayer } from '@intlayer/chokidar';\n\ntype MetroConfig = ReturnType<typeof getDefaultConfig>;\n\nexport const configMetroIntlayer = async (\n baseConfig: MetroConfig\n): Promise<MetroConfig> => {\n const intlayerConfig = getConfiguration();\n\n await prepareIntlayer(intlayerConfig);\n\n const { mainDir, configDir, watchedFilesPattern } = intlayerConfig.content;\n\n const dictionariesPath = join(mainDir, 'dictionaries.cjs');\n const configurationPath = join(configDir, 'configuration.json');\n\n const config = {\n ...baseConfig,\n\n resolver: {\n ...baseConfig.resolver,\n resolveRequest: (context, moduleName, platform) => {\n if (moduleName === '@intlayer/dictionaries-entry') {\n return {\n filePath: require.resolve(dictionariesPath),\n type: 'sourceFile',\n };\n } else if (moduleName === '@intlayer/config/built') {\n return {\n filePath: require.resolve(configurationPath),\n type: 'sourceFile',\n };\n } else if (moduleName === '@intlayer/config/client') {\n return {\n filePath: require.resolve('@intlayer/config/client'),\n type: 'sourceFile',\n };\n }\n\n // Prevent infinite recursion\n return resolve(context, moduleName, platform);\n },\n blockList: exclusionList(watchedFilesPattern),\n },\n } satisfies MetroConfig;\n\n return config;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAiC;AACjC,kBAAqB;AACrB,4BAAwB;AACxB,2BAA8B;AAC9B,sBAAgC;AAIzB,MAAM,sBAAsB,OACjC,eACyB;AACzB,QAAM,qBAAiB,gCAAiB;AAExC,YAAM,iCAAgB,cAAc;AAEpC,QAAM,EAAE,SAAS,WAAW,oBAAoB,IAAI,eAAe;AAEnE,QAAM,uBAAmB,kBAAK,SAAS,kBAAkB;AACzD,QAAM,wBAAoB,kBAAK,WAAW,oBAAoB;AAE9D,QAAM,SAAS;AAAA,IACb,GAAG;AAAA,IAEH,UAAU;AAAA,MACR,GAAG,WAAW;AAAA,MACd,gBAAgB,CAAC,SAAS,YAAY,aAAa;AACjD,YAAI,eAAe,gCAAgC;AACjD,iBAAO;AAAA,YACL,UAAU,QAAQ,QAAQ,gBAAgB;AAAA,YAC1C,MAAM;AAAA,UACR;AAAA,QACF,WAAW,eAAe,0BAA0B;AAClD,iBAAO;AAAA,YACL,UAAU,QAAQ,QAAQ,iBAAiB;AAAA,YAC3C,MAAM;AAAA,UACR;AAAA,QACF,WAAW,eAAe,2BAA2B;AACnD,iBAAO;AAAA,YACL,UAAU,gBAAgB,yBAAyB;AAAA,YACnD,MAAM;AAAA,UACR;AAAA,QACF;AAGA,mBAAO,+BAAQ,SAAS,YAAY,QAAQ;AAAA,MAC9C;AAAA,MACA,eAAW,oCAAc,mBAAmB;AAAA,IAC9C;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/configMetroIntlayer.ts"],"sourcesContent":["import { getDefaultConfig } from 'expo/metro-config';\nimport { getConfiguration } from '@intlayer/config';\nimport { join } from 'path';\nimport { resolve } from 'metro-resolver';\nimport { exclusionList } from './exclusionList';\nimport { prepareIntlayer } from '@intlayer/chokidar';\n\ntype MetroConfig = ReturnType<typeof getDefaultConfig>;\n\nexport const configMetroIntlayer = async (\n baseConfig: MetroConfig\n): Promise<MetroConfig> => {\n const intlayerConfig = getConfiguration();\n\n await prepareIntlayer(intlayerConfig);\n\n const { mainDir, configDir } = intlayerConfig.content;\n\n const dictionariesPath = join(mainDir, 'dictionaries.cjs');\n const configurationPath = join(configDir, 'configuration.json');\n\n const config = {\n ...baseConfig,\n\n resolver: {\n ...baseConfig.resolver,\n resolveRequest: (context, moduleName, platform) => {\n if (moduleName === '@intlayer/dictionaries-entry') {\n return {\n filePath: require.resolve(dictionariesPath),\n type: 'sourceFile',\n };\n } else if (moduleName === '@intlayer/config/built') {\n return {\n filePath: require.resolve(configurationPath),\n type: 'sourceFile',\n };\n } else if (moduleName === '@intlayer/config/client') {\n return {\n filePath: require.resolve('@intlayer/config/client'),\n type: 'sourceFile',\n };\n }\n\n // Prevent infinite recursion\n return resolve(context, moduleName, platform);\n },\n blockList: exclusionList([\n ...[baseConfig.resolver?.blockList ?? []].flat(),\n // the following instruction should be replaced intlayerConfig.content.watchedFilesPattern\n // but using watchedFilesPattern does not exclude the files properly for now\n /.*\\.content\\.(?:ts|tsx|js|jsx|cjs|cjx|mjs|mjx|json)$/,\n ]),\n },\n } satisfies MetroConfig;\n\n return config;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAiC;AACjC,kBAAqB;AACrB,4BAAwB;AACxB,2BAA8B;AAC9B,sBAAgC;AAIzB,MAAM,sBAAsB,OACjC,eACyB;AACzB,QAAM,qBAAiB,gCAAiB;AAExC,YAAM,iCAAgB,cAAc;AAEpC,QAAM,EAAE,SAAS,UAAU,IAAI,eAAe;AAE9C,QAAM,uBAAmB,kBAAK,SAAS,kBAAkB;AACzD,QAAM,wBAAoB,kBAAK,WAAW,oBAAoB;AAE9D,QAAM,SAAS;AAAA,IACb,GAAG;AAAA,IAEH,UAAU;AAAA,MACR,GAAG,WAAW;AAAA,MACd,gBAAgB,CAAC,SAAS,YAAY,aAAa;AACjD,YAAI,eAAe,gCAAgC;AACjD,iBAAO;AAAA,YACL,UAAU,QAAQ,QAAQ,gBAAgB;AAAA,YAC1C,MAAM;AAAA,UACR;AAAA,QACF,WAAW,eAAe,0BAA0B;AAClD,iBAAO;AAAA,YACL,UAAU,QAAQ,QAAQ,iBAAiB;AAAA,YAC3C,MAAM;AAAA,UACR;AAAA,QACF,WAAW,eAAe,2BAA2B;AACnD,iBAAO;AAAA,YACL,UAAU,gBAAgB,yBAAyB;AAAA,YACnD,MAAM;AAAA,UACR;AAAA,QACF;AAGA,mBAAO,+BAAQ,SAAS,YAAY,QAAQ;AAAA,MAC9C;AAAA,MACA,eAAW,oCAAc;AAAA,QACvB,GAAG,CAAC,WAAW,UAAU,aAAa,CAAC,CAAC,EAAE,KAAK;AAAA;AAAA;AAAA,QAG/C;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/exclusionList.ts"],"sourcesContent":["import path from 'path';\n\nconst escapeRegExp = (pattern: RegExp | string) => {\n if (Object.prototype.toString.call(pattern) === '[object RegExp]') {\n return (pattern as RegExp).source.replace(/\\/|\\\\\\//g, '\\\\' + path.sep);\n } else if (typeof pattern === 'string') {\n var escaped = pattern.replace(/[\\-\\[\\]\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n return escaped.replaceAll('/', '\\\\' + path.sep);\n } else {\n throw new Error('Unexpected exclusion pattern: ' + pattern);\n }\n};\n\nexport const exclusionList = (additionalExclusions?: RegExp[] | string[]) =>\n new RegExp(\n '(' + (additionalExclusions || []).map(escapeRegExp).join('|') + ')$'\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,MAAM,eAAe,CAAC,YAA6B;AACjD,MAAI,OAAO,UAAU,SAAS,KAAK,OAAO,MAAM,mBAAmB;AACjE,WAAQ,QAAmB,OAAO,QAAQ,YAAY,OAAO,YAAAA,QAAK,GAAG;AAAA,EACvE,WAAW,OAAO,YAAY,UAAU;AACtC,QAAI,UAAU,QAAQ,QAAQ,qCAAqC,MAAM;AACzE,WAAO,QAAQ,WAAW,KAAK,OAAO,YAAAA,QAAK,GAAG;AAAA,EAChD,OAAO;AACL,UAAM,IAAI,MAAM,mCAAmC,OAAO;AAAA,EAC5D;AACF;AAEO,MAAM,gBAAgB,CAAC,yBAC5B,IAAI;AAAA,EACF,OAAO,wBAAwB,CAAC,GAAG,IAAI,YAAY,EAAE,KAAK,GAAG,IAAI;AACnE;","names":["path"]}
1
+ {"version":3,"sources":["../../src/exclusionList.ts"],"sourcesContent":["import path from 'path';\n\nconst escapeRegExp = (pattern: RegExp | string) => {\n if (Object.prototype.toString.call(pattern) === '[object RegExp]') {\n return (pattern as RegExp).source.replace(/\\/|\\\\\\//g, '\\\\' + path.sep);\n } else if (typeof pattern === 'string') {\n var escaped = pattern.replace(/[\\-\\[\\]\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n return escaped.replaceAll('/', '\\\\' + path.sep);\n } else {\n throw new Error('Unexpected exclusion pattern: ' + pattern);\n }\n};\n\nexport const exclusionList = (additionalExclusions?: (RegExp | string)[]) =>\n new RegExp(\n '(' + (additionalExclusions || []).map(escapeRegExp).join('|') + ')$'\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,MAAM,eAAe,CAAC,YAA6B;AACjD,MAAI,OAAO,UAAU,SAAS,KAAK,OAAO,MAAM,mBAAmB;AACjE,WAAQ,QAAmB,OAAO,QAAQ,YAAY,OAAO,YAAAA,QAAK,GAAG;AAAA,EACvE,WAAW,OAAO,YAAY,UAAU;AACtC,QAAI,UAAU,QAAQ,QAAQ,qCAAqC,MAAM;AACzE,WAAO,QAAQ,WAAW,KAAK,OAAO,YAAAA,QAAK,GAAG;AAAA,EAChD,OAAO;AACL,UAAM,IAAI,MAAM,mCAAmC,OAAO;AAAA,EAC5D;AACF;AAEO,MAAM,gBAAgB,CAAC,yBAC5B,IAAI;AAAA,EACF,OAAO,wBAAwB,CAAC,GAAG,IAAI,YAAY,EAAE,KAAK,GAAG,IAAI;AACnE;","names":["path"]}
@@ -24,9 +24,17 @@ module.exports = __toCommonJS(intlayerPolyfill_exports);
24
24
  const intlayerPolyfill = () => {
25
25
  if (typeof global.structuredClone !== "function") {
26
26
  global.structuredClone = (obj) => JSON.parse(JSON.stringify(obj));
27
- window.addEventListener = () => null;
28
- window.removeEventListener = () => null;
29
- window.postMessage = () => null;
27
+ }
28
+ if (typeof window !== "undefined") {
29
+ if (typeof window.addEventListener !== "function") {
30
+ window.addEventListener = () => null;
31
+ }
32
+ if (typeof window.removeEventListener !== "function") {
33
+ window.removeEventListener = () => null;
34
+ }
35
+ if (typeof window.postMessage !== "function") {
36
+ window.postMessage = () => null;
37
+ }
30
38
  }
31
39
  };
32
40
  // Annotate the CommonJS export names for ESM import in node:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/intlayerPolyfill.ts"],"sourcesContent":["export const intlayerPolyfill = () => {\n if (typeof global.structuredClone !== 'function') {\n global.structuredClone = (obj) => JSON.parse(JSON.stringify(obj));\n window.addEventListener = () => null;\n window.removeEventListener = () => null;\n window.postMessage = () => null;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,mBAAmB,MAAM;AACpC,MAAI,OAAO,OAAO,oBAAoB,YAAY;AAChD,WAAO,kBAAkB,CAAC,QAAQ,KAAK,MAAM,KAAK,UAAU,GAAG,CAAC;AAChE,WAAO,mBAAmB,MAAM;AAChC,WAAO,sBAAsB,MAAM;AACnC,WAAO,cAAc,MAAM;AAAA,EAC7B;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/intlayerPolyfill.ts"],"sourcesContent":["export const intlayerPolyfill = () => {\n if (typeof global.structuredClone !== 'function') {\n global.structuredClone = (obj) => JSON.parse(JSON.stringify(obj));\n }\n\n if (typeof window !== 'undefined') {\n if (typeof window.addEventListener !== 'function') {\n window.addEventListener = () => null;\n }\n if (typeof window.removeEventListener !== 'function') {\n window.removeEventListener = () => null;\n }\n if (typeof window.postMessage !== 'function') {\n window.postMessage = () => null;\n }\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,mBAAmB,MAAM;AACpC,MAAI,OAAO,OAAO,oBAAoB,YAAY;AAChD,WAAO,kBAAkB,CAAC,QAAQ,KAAK,MAAM,KAAK,UAAU,GAAG,CAAC;AAAA,EAClE;AAEA,MAAI,OAAO,WAAW,aAAa;AACjC,QAAI,OAAO,OAAO,qBAAqB,YAAY;AACjD,aAAO,mBAAmB,MAAM;AAAA,IAClC;AACA,QAAI,OAAO,OAAO,wBAAwB,YAAY;AACpD,aAAO,sBAAsB,MAAM;AAAA,IACrC;AACA,QAAI,OAAO,OAAO,gBAAgB,YAAY;AAC5C,aAAO,cAAc,MAAM;AAAA,IAC7B;AAAA,EACF;AACF;","names":[]}
@@ -6,7 +6,7 @@ import { prepareIntlayer } from "@intlayer/chokidar";
6
6
  const configMetroIntlayer = async (baseConfig) => {
7
7
  const intlayerConfig = getConfiguration();
8
8
  await prepareIntlayer(intlayerConfig);
9
- const { mainDir, configDir, watchedFilesPattern } = intlayerConfig.content;
9
+ const { mainDir, configDir } = intlayerConfig.content;
10
10
  const dictionariesPath = join(mainDir, "dictionaries.cjs");
11
11
  const configurationPath = join(configDir, "configuration.json");
12
12
  const config = {
@@ -32,7 +32,12 @@ const configMetroIntlayer = async (baseConfig) => {
32
32
  }
33
33
  return resolve(context, moduleName, platform);
34
34
  },
35
- blockList: exclusionList(watchedFilesPattern)
35
+ blockList: exclusionList([
36
+ ...[baseConfig.resolver?.blockList ?? []].flat(),
37
+ // the following instruction should be replaced intlayerConfig.content.watchedFilesPattern
38
+ // but using watchedFilesPattern does not exclude the files properly for now
39
+ /.*\.content\.(?:ts|tsx|js|jsx|cjs|cjx|mjs|mjx|json)$/
40
+ ])
36
41
  }
37
42
  };
38
43
  return config;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/configMetroIntlayer.ts"],"sourcesContent":["import { getDefaultConfig } from 'expo/metro-config';\nimport { getConfiguration } from '@intlayer/config';\nimport { join } from 'path';\nimport { resolve } from 'metro-resolver';\nimport { exclusionList } from './exclusionList';\nimport { prepareIntlayer } from '@intlayer/chokidar';\n\ntype MetroConfig = ReturnType<typeof getDefaultConfig>;\n\nexport const configMetroIntlayer = async (\n baseConfig: MetroConfig\n): Promise<MetroConfig> => {\n const intlayerConfig = getConfiguration();\n\n await prepareIntlayer(intlayerConfig);\n\n const { mainDir, configDir, watchedFilesPattern } = intlayerConfig.content;\n\n const dictionariesPath = join(mainDir, 'dictionaries.cjs');\n const configurationPath = join(configDir, 'configuration.json');\n\n const config = {\n ...baseConfig,\n\n resolver: {\n ...baseConfig.resolver,\n resolveRequest: (context, moduleName, platform) => {\n if (moduleName === '@intlayer/dictionaries-entry') {\n return {\n filePath: require.resolve(dictionariesPath),\n type: 'sourceFile',\n };\n } else if (moduleName === '@intlayer/config/built') {\n return {\n filePath: require.resolve(configurationPath),\n type: 'sourceFile',\n };\n } else if (moduleName === '@intlayer/config/client') {\n return {\n filePath: require.resolve('@intlayer/config/client'),\n type: 'sourceFile',\n };\n }\n\n // Prevent infinite recursion\n return resolve(context, moduleName, platform);\n },\n blockList: exclusionList(watchedFilesPattern),\n },\n } satisfies MetroConfig;\n\n return config;\n};\n"],"mappings":"AACA,SAAS,wBAAwB;AACjC,SAAS,YAAY;AACrB,SAAS,eAAe;AACxB,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAIzB,MAAM,sBAAsB,OACjC,eACyB;AACzB,QAAM,iBAAiB,iBAAiB;AAExC,QAAM,gBAAgB,cAAc;AAEpC,QAAM,EAAE,SAAS,WAAW,oBAAoB,IAAI,eAAe;AAEnE,QAAM,mBAAmB,KAAK,SAAS,kBAAkB;AACzD,QAAM,oBAAoB,KAAK,WAAW,oBAAoB;AAE9D,QAAM,SAAS;AAAA,IACb,GAAG;AAAA,IAEH,UAAU;AAAA,MACR,GAAG,WAAW;AAAA,MACd,gBAAgB,CAAC,SAAS,YAAY,aAAa;AACjD,YAAI,eAAe,gCAAgC;AACjD,iBAAO;AAAA,YACL,UAAU,QAAQ,QAAQ,gBAAgB;AAAA,YAC1C,MAAM;AAAA,UACR;AAAA,QACF,WAAW,eAAe,0BAA0B;AAClD,iBAAO;AAAA,YACL,UAAU,QAAQ,QAAQ,iBAAiB;AAAA,YAC3C,MAAM;AAAA,UACR;AAAA,QACF,WAAW,eAAe,2BAA2B;AACnD,iBAAO;AAAA,YACL,UAAU,gBAAgB,yBAAyB;AAAA,YACnD,MAAM;AAAA,UACR;AAAA,QACF;AAGA,eAAO,QAAQ,SAAS,YAAY,QAAQ;AAAA,MAC9C;AAAA,MACA,WAAW,cAAc,mBAAmB;AAAA,IAC9C;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/configMetroIntlayer.ts"],"sourcesContent":["import { getDefaultConfig } from 'expo/metro-config';\nimport { getConfiguration } from '@intlayer/config';\nimport { join } from 'path';\nimport { resolve } from 'metro-resolver';\nimport { exclusionList } from './exclusionList';\nimport { prepareIntlayer } from '@intlayer/chokidar';\n\ntype MetroConfig = ReturnType<typeof getDefaultConfig>;\n\nexport const configMetroIntlayer = async (\n baseConfig: MetroConfig\n): Promise<MetroConfig> => {\n const intlayerConfig = getConfiguration();\n\n await prepareIntlayer(intlayerConfig);\n\n const { mainDir, configDir } = intlayerConfig.content;\n\n const dictionariesPath = join(mainDir, 'dictionaries.cjs');\n const configurationPath = join(configDir, 'configuration.json');\n\n const config = {\n ...baseConfig,\n\n resolver: {\n ...baseConfig.resolver,\n resolveRequest: (context, moduleName, platform) => {\n if (moduleName === '@intlayer/dictionaries-entry') {\n return {\n filePath: require.resolve(dictionariesPath),\n type: 'sourceFile',\n };\n } else if (moduleName === '@intlayer/config/built') {\n return {\n filePath: require.resolve(configurationPath),\n type: 'sourceFile',\n };\n } else if (moduleName === '@intlayer/config/client') {\n return {\n filePath: require.resolve('@intlayer/config/client'),\n type: 'sourceFile',\n };\n }\n\n // Prevent infinite recursion\n return resolve(context, moduleName, platform);\n },\n blockList: exclusionList([\n ...[baseConfig.resolver?.blockList ?? []].flat(),\n // the following instruction should be replaced intlayerConfig.content.watchedFilesPattern\n // but using watchedFilesPattern does not exclude the files properly for now\n /.*\\.content\\.(?:ts|tsx|js|jsx|cjs|cjx|mjs|mjx|json)$/,\n ]),\n },\n } satisfies MetroConfig;\n\n return config;\n};\n"],"mappings":"AACA,SAAS,wBAAwB;AACjC,SAAS,YAAY;AACrB,SAAS,eAAe;AACxB,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAIzB,MAAM,sBAAsB,OACjC,eACyB;AACzB,QAAM,iBAAiB,iBAAiB;AAExC,QAAM,gBAAgB,cAAc;AAEpC,QAAM,EAAE,SAAS,UAAU,IAAI,eAAe;AAE9C,QAAM,mBAAmB,KAAK,SAAS,kBAAkB;AACzD,QAAM,oBAAoB,KAAK,WAAW,oBAAoB;AAE9D,QAAM,SAAS;AAAA,IACb,GAAG;AAAA,IAEH,UAAU;AAAA,MACR,GAAG,WAAW;AAAA,MACd,gBAAgB,CAAC,SAAS,YAAY,aAAa;AACjD,YAAI,eAAe,gCAAgC;AACjD,iBAAO;AAAA,YACL,UAAU,QAAQ,QAAQ,gBAAgB;AAAA,YAC1C,MAAM;AAAA,UACR;AAAA,QACF,WAAW,eAAe,0BAA0B;AAClD,iBAAO;AAAA,YACL,UAAU,QAAQ,QAAQ,iBAAiB;AAAA,YAC3C,MAAM;AAAA,UACR;AAAA,QACF,WAAW,eAAe,2BAA2B;AACnD,iBAAO;AAAA,YACL,UAAU,gBAAgB,yBAAyB;AAAA,YACnD,MAAM;AAAA,UACR;AAAA,QACF;AAGA,eAAO,QAAQ,SAAS,YAAY,QAAQ;AAAA,MAC9C;AAAA,MACA,WAAW,cAAc;AAAA,QACvB,GAAG,CAAC,WAAW,UAAU,aAAa,CAAC,CAAC,EAAE,KAAK;AAAA;AAAA;AAAA,QAG/C;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/exclusionList.ts"],"sourcesContent":["import path from 'path';\n\nconst escapeRegExp = (pattern: RegExp | string) => {\n if (Object.prototype.toString.call(pattern) === '[object RegExp]') {\n return (pattern as RegExp).source.replace(/\\/|\\\\\\//g, '\\\\' + path.sep);\n } else if (typeof pattern === 'string') {\n var escaped = pattern.replace(/[\\-\\[\\]\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n return escaped.replaceAll('/', '\\\\' + path.sep);\n } else {\n throw new Error('Unexpected exclusion pattern: ' + pattern);\n }\n};\n\nexport const exclusionList = (additionalExclusions?: RegExp[] | string[]) =>\n new RegExp(\n '(' + (additionalExclusions || []).map(escapeRegExp).join('|') + ')$'\n );\n"],"mappings":"AAAA,OAAO,UAAU;AAEjB,MAAM,eAAe,CAAC,YAA6B;AACjD,MAAI,OAAO,UAAU,SAAS,KAAK,OAAO,MAAM,mBAAmB;AACjE,WAAQ,QAAmB,OAAO,QAAQ,YAAY,OAAO,KAAK,GAAG;AAAA,EACvE,WAAW,OAAO,YAAY,UAAU;AACtC,QAAI,UAAU,QAAQ,QAAQ,qCAAqC,MAAM;AACzE,WAAO,QAAQ,WAAW,KAAK,OAAO,KAAK,GAAG;AAAA,EAChD,OAAO;AACL,UAAM,IAAI,MAAM,mCAAmC,OAAO;AAAA,EAC5D;AACF;AAEO,MAAM,gBAAgB,CAAC,yBAC5B,IAAI;AAAA,EACF,OAAO,wBAAwB,CAAC,GAAG,IAAI,YAAY,EAAE,KAAK,GAAG,IAAI;AACnE;","names":[]}
1
+ {"version":3,"sources":["../../src/exclusionList.ts"],"sourcesContent":["import path from 'path';\n\nconst escapeRegExp = (pattern: RegExp | string) => {\n if (Object.prototype.toString.call(pattern) === '[object RegExp]') {\n return (pattern as RegExp).source.replace(/\\/|\\\\\\//g, '\\\\' + path.sep);\n } else if (typeof pattern === 'string') {\n var escaped = pattern.replace(/[\\-\\[\\]\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n return escaped.replaceAll('/', '\\\\' + path.sep);\n } else {\n throw new Error('Unexpected exclusion pattern: ' + pattern);\n }\n};\n\nexport const exclusionList = (additionalExclusions?: (RegExp | string)[]) =>\n new RegExp(\n '(' + (additionalExclusions || []).map(escapeRegExp).join('|') + ')$'\n );\n"],"mappings":"AAAA,OAAO,UAAU;AAEjB,MAAM,eAAe,CAAC,YAA6B;AACjD,MAAI,OAAO,UAAU,SAAS,KAAK,OAAO,MAAM,mBAAmB;AACjE,WAAQ,QAAmB,OAAO,QAAQ,YAAY,OAAO,KAAK,GAAG;AAAA,EACvE,WAAW,OAAO,YAAY,UAAU;AACtC,QAAI,UAAU,QAAQ,QAAQ,qCAAqC,MAAM;AACzE,WAAO,QAAQ,WAAW,KAAK,OAAO,KAAK,GAAG;AAAA,EAChD,OAAO;AACL,UAAM,IAAI,MAAM,mCAAmC,OAAO;AAAA,EAC5D;AACF;AAEO,MAAM,gBAAgB,CAAC,yBAC5B,IAAI;AAAA,EACF,OAAO,wBAAwB,CAAC,GAAG,IAAI,YAAY,EAAE,KAAK,GAAG,IAAI;AACnE;","names":[]}
@@ -1,9 +1,17 @@
1
1
  const intlayerPolyfill = () => {
2
2
  if (typeof global.structuredClone !== "function") {
3
3
  global.structuredClone = (obj) => JSON.parse(JSON.stringify(obj));
4
- window.addEventListener = () => null;
5
- window.removeEventListener = () => null;
6
- window.postMessage = () => null;
4
+ }
5
+ if (typeof window !== "undefined") {
6
+ if (typeof window.addEventListener !== "function") {
7
+ window.addEventListener = () => null;
8
+ }
9
+ if (typeof window.removeEventListener !== "function") {
10
+ window.removeEventListener = () => null;
11
+ }
12
+ if (typeof window.postMessage !== "function") {
13
+ window.postMessage = () => null;
14
+ }
7
15
  }
8
16
  };
9
17
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/intlayerPolyfill.ts"],"sourcesContent":["export const intlayerPolyfill = () => {\n if (typeof global.structuredClone !== 'function') {\n global.structuredClone = (obj) => JSON.parse(JSON.stringify(obj));\n window.addEventListener = () => null;\n window.removeEventListener = () => null;\n window.postMessage = () => null;\n }\n};\n"],"mappings":"AAAO,MAAM,mBAAmB,MAAM;AACpC,MAAI,OAAO,OAAO,oBAAoB,YAAY;AAChD,WAAO,kBAAkB,CAAC,QAAQ,KAAK,MAAM,KAAK,UAAU,GAAG,CAAC;AAChE,WAAO,mBAAmB,MAAM;AAChC,WAAO,sBAAsB,MAAM;AACnC,WAAO,cAAc,MAAM;AAAA,EAC7B;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/intlayerPolyfill.ts"],"sourcesContent":["export const intlayerPolyfill = () => {\n if (typeof global.structuredClone !== 'function') {\n global.structuredClone = (obj) => JSON.parse(JSON.stringify(obj));\n }\n\n if (typeof window !== 'undefined') {\n if (typeof window.addEventListener !== 'function') {\n window.addEventListener = () => null;\n }\n if (typeof window.removeEventListener !== 'function') {\n window.removeEventListener = () => null;\n }\n if (typeof window.postMessage !== 'function') {\n window.postMessage = () => null;\n }\n }\n};\n"],"mappings":"AAAO,MAAM,mBAAmB,MAAM;AACpC,MAAI,OAAO,OAAO,oBAAoB,YAAY;AAChD,WAAO,kBAAkB,CAAC,QAAQ,KAAK,MAAM,KAAK,UAAU,GAAG,CAAC;AAAA,EAClE;AAEA,MAAI,OAAO,WAAW,aAAa;AACjC,QAAI,OAAO,OAAO,qBAAqB,YAAY;AACjD,aAAO,mBAAmB,MAAM;AAAA,IAClC;AACA,QAAI,OAAO,OAAO,wBAAwB,YAAY;AACpD,aAAO,sBAAsB,MAAM;AAAA,IACrC;AACA,QAAI,OAAO,OAAO,gBAAgB,YAAY;AAC5C,aAAO,cAAc,MAAM;AAAA,IAC7B;AAAA,EACF;AACF;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"configMetroIntlayer.d.ts","sourceRoot":"","sources":["../../src/configMetroIntlayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAOrD,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEvD,eAAO,MAAM,mBAAmB,GAC9B,YAAY,WAAW,KACtB,OAAO,CAAC,WAAW,CAyCrB,CAAC"}
1
+ {"version":3,"file":"configMetroIntlayer.d.ts","sourceRoot":"","sources":["../../src/configMetroIntlayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAOrD,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEvD,eAAO,MAAM,mBAAmB,GAC9B,YAAY,WAAW,KACtB,OAAO,CAAC,WAAW,CA8CrB,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const exclusionList: (additionalExclusions?: RegExp[] | string[]) => RegExp;
1
+ export declare const exclusionList: (additionalExclusions?: (RegExp | string)[]) => RegExp;
2
2
  //# sourceMappingURL=exclusionList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exclusionList.d.ts","sourceRoot":"","sources":["../../src/exclusionList.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,aAAa,GAAI,uBAAuB,MAAM,EAAE,GAAG,MAAM,EAAE,WAGrE,CAAC"}
1
+ {"version":3,"file":"exclusionList.d.ts","sourceRoot":"","sources":["../../src/exclusionList.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,aAAa,GAAI,uBAAuB,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,WAGrE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"intlayerPolyfill.d.ts","sourceRoot":"","sources":["../../src/intlayerPolyfill.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,YAO5B,CAAC"}
1
+ {"version":3,"file":"intlayerPolyfill.d.ts","sourceRoot":"","sources":["../../src/intlayerPolyfill.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,YAgB5B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-intlayer",
3
- "version": "5.2.1",
3
+ "version": "5.2.4",
4
4
  "private": false,
5
5
  "description": "A React Native plugin for seamless internationalization (i18n), providing locale detection, redirection, and environment-based configuration",
6
6
  "keywords": [
@@ -62,9 +62,9 @@
62
62
  "./package.json"
63
63
  ],
64
64
  "dependencies": {
65
- "@intlayer/chokidar": "5.2.1",
66
- "@intlayer/config": "5.2.1",
67
- "@intlayer/core": "5.2.1"
65
+ "@intlayer/chokidar": "5.2.4",
66
+ "@intlayer/core": "5.2.4",
67
+ "@intlayer/config": "5.2.4"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@types/node": "^22.10.6",
@@ -78,18 +78,18 @@
78
78
  "tsc-alias": "^1.8.10",
79
79
  "tsup": "^8.3.5",
80
80
  "typescript": "^5.7.3",
81
- "@utils/ts-config": "1.0.4",
82
- "@utils/ts-config-types": "1.0.4",
83
81
  "@utils/eslint-config": "1.0.4",
84
- "@utils/tsup-config": "1.0.4"
82
+ "@utils/ts-config": "1.0.4",
83
+ "@utils/tsup-config": "1.0.4",
84
+ "@utils/ts-config-types": "1.0.4"
85
85
  },
86
86
  "peerDependencies": {
87
87
  "expo": "^52.0.37",
88
88
  "metro-resolver": "^0.82.0",
89
89
  "vite": ">=4.0.0",
90
- "@intlayer/chokidar": "5.2.1",
91
- "@intlayer/config": "5.2.1",
92
- "@intlayer/core": "5.2.1"
90
+ "@intlayer/chokidar": "5.2.4",
91
+ "@intlayer/config": "5.2.4",
92
+ "@intlayer/core": "5.2.4"
93
93
  },
94
94
  "engines": {
95
95
  "node": ">=14.18"