@inappstory/game-center-api 1.3.32 → 1.3.35

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,10 @@ export type GameLaunchConfig = {
25
25
  verbose: boolean;
26
26
  authUrl: string;
27
27
  payload: string;
28
+ localization: {
29
+ lang: string;
30
+ resources: Record<string, string> | null;
31
+ };
28
32
  clientConfig: {
29
33
  apiBaseUrl: string;
30
34
  apiKey: string;
@@ -16,12 +16,10 @@ exports.gameLaunchHandlers = {
16
16
  filterPlaceholders: (placeholders) => placeholders,
17
17
  };
18
18
  function setGameLaunchConfig(config) {
19
- for (const key in config) {
20
- // @ts-ignore
21
- exports.gameLaunchConfig[key] = config[key];
22
- }
19
+ Object.assign(exports.gameLaunchConfig, config);
23
20
  checkUserId(exports.gameLaunchConfig.clientConfig.userId);
24
21
  processImagePlaceholders();
22
+ processLocalization();
25
23
  Object.freeze(exports.gameLaunchConfig);
26
24
  }
27
25
  exports.setGameLaunchConfig = setGameLaunchConfig;
@@ -89,3 +87,9 @@ function processImagePlaceholders() {
89
87
  exports.gameLaunchConfig.clientConfig.placeholders = placeholders;
90
88
  }
91
89
  }
90
+ function processLocalization() {
91
+ exports.gameLaunchConfig.localization = Object.assign({
92
+ lang: exports.gameLaunchConfig.clientConfig.lang ?? "en",
93
+ resources: null,
94
+ }, exports.gameLaunchConfig.localization ?? {});
95
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inappstory/game-center-api",
3
- "version": "1.3.32",
3
+ "version": "1.3.35",
4
4
  "description": "",
5
5
  "dependencies": {
6
6
  "@sentry/browser": "^9.5.0",