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

confort

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

confort - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

6

CHANGELOG.md

@@ -8,2 +8,7 @@ # Confort Changelog

## [v0.1.2] - 2019-09-25
### Changed
- layering to not merge objects unless they are direct instances of `Object` and `Array` (mostly created with literals)
## [v0.1.1] - 2019-09-23

@@ -22,1 +27,2 @@

[v0.1.1]: https://gitlab.com/GCSBOSS/confort/-/tags/v0.1.1
[v0.1.2]: https://gitlab.com/GCSBOSS/confort/-/tags/v0.1.2

6

lib/main.js

@@ -22,2 +22,5 @@ const fs = require('fs');

const isMergeableObject = val =>
typeof val === 'object' && ['Object', 'Array'].includes(val.constructor.name);
module.exports = class Confort extends EventEmitter {

@@ -49,3 +52,4 @@

this.object = deepmerge(this.object, pathOrObject, {
arrayMerge: (a, b) => b
arrayMerge: (a, b) => b,
isMergeableObject
});

@@ -52,0 +56,0 @@

4

package.json
{
"name": "confort",
"version": "0.1.1",
"version": "0.1.2",
"description": "A library for incrementally build config objects through layering config files in many formats.",

@@ -36,4 +36,4 @@ "main": "lib/main.js",

"toml": "^3.0.0",
"yaml": "^1.6.0"
"yaml": "^1.7.0"
}
}

@@ -80,2 +80,10 @@ const fs = require('fs');

it('Should replace objects with a class other than Object', () => {
class Foo{ constructor(){ this.a = 'foo'; } }
let conf = new Confort({ key: { a: 'a', b: 'bar' } });
conf.addLayer({ key: new Foo() });
assert.strictEqual(conf.object.key.a, 'foo');
assert.strictEqual(typeof conf.object.key.b, 'undefined');
});
it('Should load conf file when path is specified', () => {

@@ -82,0 +90,0 @@ let conf = new Confort('./test/res/conf.toml');

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