Skip to content

Commit 1e5d428

Browse files
author
DylanBulmer
committed
fix build error
1 parent 7dde09e commit 1e5d428

2 files changed

Lines changed: 23 additions & 18 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codrjs/config",
3-
"version": "1.0.3-patch1",
3+
"version": "1.0.3-patch2",
44
"description": "Codr configuration, unified",
55
"main": "./cjs/index.js",
66
"module": "./esm/index.js",

src/config/NodeConfig.ts

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,27 @@ export const NodeConfig: {
99
modules: Object.keys(process.env)
1010
.filter(m => /npm_package_dependencies_/g.test(m))
1111
.map(m => [m, process.env[m]] as [string, string])
12-
.map(m => m[0].replace(/npm_package_dependencies_/g, ""))
13-
.map(m => [
14-
m[0]
15-
.split("_")
16-
.map((p, idx) =>
17-
p === ""
18-
? "@"
19-
: idx === m[0].split("_").length - 1 && m[0].split("_").length !== 1
20-
? `/${p}`
21-
: p,
22-
)
23-
.join(""),
24-
m[1],
25-
])
26-
.reduce((acc, curr) => {
27-
return (acc[curr[0]] = curr[1]);
28-
}, {}),
12+
.map(m => [m[0].replace(/npm_package_dependencies_/g, ""), m[1]])
13+
.map(
14+
m =>
15+
[
16+
m[0]
17+
.split("_")
18+
.map((p, idx) =>
19+
p === ""
20+
? "@"
21+
: idx === m[0].split("_").length - 1 &&
22+
m[0].split("_").length !== 1
23+
? `/${p}`
24+
: p,
25+
)
26+
.join(""),
27+
m[1],
28+
] as string[],
29+
)
30+
.reduce((acc, [key, value]) => {
31+
acc[key] = value;
32+
return acc;
33+
}, {} as Record<string, string>),
2934
yarnVersion: process.env.YARN_VERSION as string,
3035
};

0 commit comments

Comments
 (0)