@tramvai/module-environment 7.27.7 → 7.27.8
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
|
|
11
|
-
const
|
|
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) {
|
package/lib/shared/template.js
CHANGED
|
@@ -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
|
|
15
|
-
const
|
|
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.
|
|
3
|
+
"version": "7.27.8",
|
|
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.
|
|
24
|
-
"@tramvai/papi": "7.27.
|
|
25
|
-
"@tramvai/state": "7.27.
|
|
26
|
-
"@tramvai/tokens-common": "7.27.
|
|
27
|
-
"@tramvai/tokens-server": "7.27.
|
|
23
|
+
"@tramvai/core": "7.27.8",
|
|
24
|
+
"@tramvai/papi": "7.27.8",
|
|
25
|
+
"@tramvai/state": "7.27.8",
|
|
26
|
+
"@tramvai/tokens-common": "7.27.8",
|
|
27
|
+
"@tramvai/tokens-server": "7.27.8",
|
|
28
28
|
"react": ">=16.14.0",
|
|
29
29
|
"react-dom": ">=16.14.0",
|
|
30
30
|
"tslib": "^2.4.0"
|