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

@venncity/nested-config

Package Overview
Dependencies
Maintainers
1
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@venncity/nested-config - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

config/test.json

17

CHANGELOG.md

@@ -6,2 +6,19 @@ # Change Log

# [1.1.0](https://github.com/venn-city/npm-shelf/compare/@venncity/nested-config@1.0.2...@venncity/nested-config@1.1.0) (2019-05-02)
### Bug Fixes
* **config:** fixed linting ([313a04b](https://github.com/venn-city/npm-shelf/commit/313a04b))
* **config:** refactored config to recieve options object ([bab4876](https://github.com/venn-city/npm-shelf/commit/bab4876))
### Features
* **config:** added ability to get props from parent config ([6c0ddfd](https://github.com/venn-city/npm-shelf/commit/6c0ddfd))
## [1.0.2](https://github.com/venn-city/npm-shelf/compare/@venncity/nested-config@1.0.1...@venncity/nested-config@1.0.2) (2019-05-01)

@@ -8,0 +25,0 @@

4

package.json
{
"name": "@venncity/nested-config",
"version": "1.0.2",
"version": "1.1.0",
"author": "Venn Engineering",

@@ -45,3 +45,3 @@ "main": "src/nestedConfig.js",

},
"gitHead": "86172685d9c7b63ebe9dd9224d112b90703e3ad8"
"gitHead": "81a8cf5ee830b7619d0edc129d1fd1173a406756"
}

@@ -57,4 +57,10 @@ /* eslint-disable no-underscore-dangle,global-require */

test('should throw an error when failed to create config key', () => {
test('should load parent value when get called with parent flag true', async () => {
await createFileAtPath('/inner/config/test.json', '{ "prop": "inner" }');
await createFileAtPath('/inner/package.json', '{ "prop": "123" }');
const innerModulePath = await createFileAtPath('/inner/src/module.js', '{ "prop": "123" }');
const nestedConfig = require('./nestedConfig')(innerModulePath);
const testValue = nestedConfig.get('prop', { parentConf: true });
expect(testValue).toEqual('outer');
});

@@ -61,0 +67,0 @@

@@ -37,4 +37,9 @@ process.env.ALLOW_CONFIG_MUTATIONS = true;

return {
get: key => config.get(`${packagePathToConfigKeyPrefix.get(packagePath)}.${key}`)
get: (key, options = { getConfigFromParent: false }) => {
if (options.parentConf) {
return config.get(key);
}
return config.get(`${packagePathToConfigKeyPrefix.get(packagePath)}.${key}`);
}
};
};
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