Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@automattic/calypso-config

Package Overview
Dependencies
Maintainers
29
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@automattic/calypso-config - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

4

__tests__/__mocks__/fs.js

@@ -40,2 +40,6 @@ /**

myenvlocal_override: 'myenv',
features: {
enabledFeature3: true,
enabledFeature1: false,
}
} ),

@@ -42,0 +46,0 @@ 'myenv.local.json': toJSON( {

3

__tests__/parser.js

@@ -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 ) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc