@tramvai/module-environment 7.27.7 → 7.27.9

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.
@@ -7,8 +7,10 @@ function interpolate({ envKey, envValue, templates, }) {
7
7
  }
8
8
  return envValue.replace(templateRegex, (templateRaw, templateStr) => {
9
9
  // expect string in `key:param1,param2` format
10
- const [key, ...rest] = templateStr.split(':');
11
- const paramsRaw = rest.join('');
10
+ const separatorIndex = templateStr.indexOf(':');
11
+ const paramsExists = separatorIndex >= 0;
12
+ const key = paramsExists ? templateStr.substring(0, separatorIndex) : templateStr;
13
+ const paramsRaw = paramsExists ? templateStr.substring(separatorIndex + 1) : '';
12
14
  const params = paramsRaw.split(',').filter(Boolean);
13
15
  const template = templates[key];
14
16
  if (template) {
@@ -11,8 +11,10 @@ function interpolate({ envKey, envValue, templates, }) {
11
11
  }
12
12
  return envValue.replace(templateRegex, (templateRaw, templateStr) => {
13
13
  // expect string in `key:param1,param2` format
14
- const [key, ...rest] = templateStr.split(':');
15
- const paramsRaw = rest.join('');
14
+ const separatorIndex = templateStr.indexOf(':');
15
+ const paramsExists = separatorIndex >= 0;
16
+ const key = paramsExists ? templateStr.substring(0, separatorIndex) : templateStr;
17
+ const paramsRaw = paramsExists ? templateStr.substring(separatorIndex + 1) : '';
16
18
  const params = paramsRaw.split(',').filter(Boolean);
17
19
  const template = templates[key];
18
20
  if (template) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-environment",
3
- "version": "7.27.7",
3
+ "version": "7.27.9",
4
4
  "description": "",
5
5
  "browser": "lib/browser.js",
6
6
  "main": "lib/server.js",
@@ -20,11 +20,11 @@
20
20
  "peerDependencies": {
21
21
  "@tinkoff/dippy": "^1.0.0",
22
22
  "@tinkoff/utils": "^2.1.2",
23
- "@tramvai/core": "7.27.7",
24
- "@tramvai/papi": "7.27.7",
25
- "@tramvai/state": "7.27.7",
26
- "@tramvai/tokens-common": "7.27.7",
27
- "@tramvai/tokens-server": "7.27.7",
23
+ "@tramvai/core": "7.27.9",
24
+ "@tramvai/papi": "7.27.9",
25
+ "@tramvai/state": "7.27.9",
26
+ "@tramvai/tokens-common": "7.27.9",
27
+ "@tramvai/tokens-server": "7.27.9",
28
28
  "react": ">=16.14.0",
29
29
  "react-dom": ">=16.14.0",
30
30
  "tslib": "^2.4.0"