File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " @codrjs/config" ,
3- "version" : " 1.0.3" ,
3+ "version" : " 1.0.3-patch1 " ,
44 "description" : " Codr configuration, unified" ,
55 "main" : " ./cjs/index.js" ,
66 "module" : " ./esm/index.js" ,
Original file line number Diff line number Diff line change 11export const NodeConfig : {
22 env : "production" | "developement" | "testing" ;
33 version : string ;
4- modules : string [ ] ;
4+ modules : Record < string , string > ;
55 yarnVersion : string ;
66} = {
77 env : process . env . NODE_ENV as "production" | "developement" | "testing" ,
88 version : process . env . NODE_VERSION as string ,
99 modules : Object . keys ( process . env )
1010 . filter ( m => / n p m _ p a c k a g e _ d e p e n d e n c i e s _ / g. test ( m ) )
11- . map ( m => m . replace ( / n p m _ p a c k a g e _ d e p e n d e n c i e s _ / g, "" ) )
12- . map ( m =>
13- m
11+ . map ( m => [ m , process . env [ m ] ] as [ string , string ] )
12+ . map ( m => m [ 0 ] . replace ( / n p m _ p a c k a g e _ d e p e n d e n c i e s _ / g, "" ) )
13+ . map ( m => [
14+ m [ 0 ]
1415 . split ( "_" )
1516 . map ( ( p , idx ) =>
1617 p === ""
1718 ? "@"
18- : idx === m . split ( "_" ) . length - 1 && m . split ( "_" ) . length !== 1
19+ : idx === m [ 0 ] . split ( "_" ) . length - 1 && m [ 0 ] . split ( "_" ) . length !== 1
1920 ? `/${ p } `
2021 : p ,
2122 )
2223 . join ( "" ) ,
23- ) ,
24+ m [ 1 ] ,
25+ ] )
26+ . reduce ( ( acc , curr ) => {
27+ return ( acc [ curr [ 0 ] ] = curr [ 1 ] ) ;
28+ } , { } ) ,
2429 yarnVersion : process . env . YARN_VERSION as string ,
2530} ;
You can’t perform that action at this time.
0 commit comments