Skip to content

Commit

Permalink
fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanBulmer committed Apr 9, 2023
1 parent 7dde09e commit 1e5d428
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@codrjs/config",
"version": "1.0.3-patch1",
"version": "1.0.3-patch2",
"description": "Codr configuration, unified",
"main": "./cjs/index.js",
"module": "./esm/index.js",
Expand Down
39 changes: 22 additions & 17 deletions src/config/NodeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,27 @@ export const NodeConfig: {
modules: Object.keys(process.env)
.filter(m => /npm_package_dependencies_/g.test(m))
.map(m => [m, process.env[m]] as [string, string])
.map(m => m[0].replace(/npm_package_dependencies_/g, ""))
.map(m => [
m[0]
.split("_")
.map((p, idx) =>
p === ""
? "@"
: idx === m[0].split("_").length - 1 && m[0].split("_").length !== 1
? `/${p}`
: p,
)
.join(""),
m[1],
])
.reduce((acc, curr) => {
return (acc[curr[0]] = curr[1]);
}, {}),
.map(m => [m[0].replace(/npm_package_dependencies_/g, ""), m[1]])
.map(
m =>
[
m[0]
.split("_")
.map((p, idx) =>
p === ""
? "@"
: idx === m[0].split("_").length - 1 &&
m[0].split("_").length !== 1
? `/${p}`
: p,
)
.join(""),
m[1],
] as string[],
)
.reduce((acc, [key, value]) => {
acc[key] = value;
return acc;
}, {} as Record<string, string>),
yarnVersion: process.env.YARN_VERSION as string,
};

0 comments on commit 1e5d428

Please sign in to comment.