@automattic/calypso-config
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -40,2 +40,6 @@ /** | ||
myenvlocal_override: 'myenv', | ||
features: { | ||
enabledFeature3: true, | ||
enabledFeature1: false, | ||
} | ||
} ), | ||
@@ -42,0 +46,0 @@ 'myenv.local.json': toJSON( { |
@@ -38,6 +38,7 @@ jest.mock( 'fs' ); | ||
expect( data ).toHaveProperty( 'features', { | ||
enabledFeature1: true, | ||
enabledFeature1: false, | ||
enabledFeature2: true, | ||
disabledFeature1: false, | ||
disabledFeature2: false, | ||
enabledFeature3: true, | ||
} ); | ||
@@ -44,0 +45,0 @@ } ); |
module.exports = { | ||
testURL: 'http://localhost/', | ||
modulePaths: [ | ||
@@ -3,0 +4,0 @@ '<rootDir>/src/', |
{ | ||
"name": "@automattic/calypso-config", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Simple server and client config module. Originally written for wp-calypso.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -21,3 +21,2 @@ /** | ||
}, defaultOpts ), | ||
data = {}, | ||
configFiles = [ | ||
@@ -34,6 +33,14 @@ path.resolve( configPath, '_shared.json' ), | ||
configFiles.forEach( function( file ) { | ||
Object.assign( data, getDataFromFile( file ) ); | ||
} ); | ||
const data = configFiles.reduce( ( combinedData, file ) => { | ||
const fileData = getDataFromFile( file ); | ||
const features = Object.assign( {}, combinedData.features ); | ||
const mergedData = Object.assign( combinedData, fileData ); | ||
if ( fileData.hasOwnProperty( 'features' ) ) { | ||
mergedData.features = Object.assign( features, fileData.features ); | ||
} | ||
return mergedData; | ||
}, {} ); | ||
if ( data.hasOwnProperty( 'features' ) ) { | ||
@@ -40,0 +47,0 @@ enabledFeatures.forEach( function( feature ) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
395
17381
20
1