Comparing version 5.0.0-canary.1 to 5.0.0
@@ -1,2 +0,3 @@ | ||
var merge = require('deeply') | ||
var deeply = require('deeply') | ||
, typeOf = require('precise-typeof') | ||
// sub-modules | ||
@@ -22,3 +23,4 @@ , compare = require('./compare.js') | ||
configly.compareExtensions = compare.ascendingIgnoreCase; | ||
configly.arrayMerge = merge.adapters.array; | ||
configly.arrayMerge = deeply.adapters.array; | ||
configly.mergeTypeOf = function(input) { return typeOf(input, {pojoOnly: true}); }; | ||
@@ -25,0 +27,0 @@ // defaults |
@@ -1,2 +0,2 @@ | ||
var merge = require('deeply') | ||
var clone = require('deeply') | ||
, getCacheKey = require('./get_cache_key.js') | ||
@@ -22,4 +22,3 @@ ; | ||
// fallback to default directories | ||
// context = this.new(merge({directories: this.defaults.directories}, options || {})); | ||
context = this.new(merge(options || {})); | ||
context = this.new(clone(options || {})); | ||
@@ -36,3 +35,6 @@ // prepare cache key | ||
// always return object here | ||
return merge(this._cache[cacheKey] || {}); | ||
return clone.call({ | ||
useCustomTypeOf: clone.behaviors.useCustomTypeOf, | ||
'typeof': context.mergeTypeOf | ||
}, this._cache[cacheKey] || {}); | ||
} |
@@ -1,2 +0,2 @@ | ||
var merge = require('deeply') | ||
var clone = require('deeply') | ||
, typeOf = require('precise-typeof') | ||
@@ -50,3 +50,6 @@ , getCacheKey = require('./get_cache_key.js') | ||
// return immutable copy | ||
return merge(this._cache[cacheKey]); | ||
return clone.call({ | ||
useCustomTypeOf: clone.behaviors.useCustomTypeOf, | ||
'typeof': context.mergeTypeOf | ||
}, this._cache[cacheKey]); | ||
} |
@@ -1,2 +0,2 @@ | ||
var merge = require('deeply'); | ||
var merge = require('deeply'); | ||
@@ -28,3 +28,5 @@ // Public API | ||
useCustomAdapters: merge.behaviors.useCustomAdapters, | ||
'array': _instance.arrayMerge | ||
'array': _instance.arrayMerge, | ||
useCustomTypeOf: merge.behaviors.useCustomTypeOf, | ||
'typeof': _instance.mergeTypeOf | ||
}, result || {}, cfg.config); | ||
@@ -31,0 +33,0 @@ }); |
{ | ||
"name": "configly", | ||
"version": "5.0.0-canary.1", | ||
"version": "5.0.0", | ||
"description": "A developer-friendly lightweight replacement for the 'config' module that works with custom config directories and pluggable parsers", | ||
@@ -8,3 +8,2 @@ "main": "default.js", | ||
"lint": "eslint *.js test/*.js", | ||
"ci-lint": "is-node-modern && npm run lint || is-node-not-modern", | ||
"test": "nyc --reporter=lcov --reporter=text --check-coverage --lines 99 --functions 99 --branches 99 tape test/*.js | tap-spec", | ||
@@ -59,22 +58,21 @@ "debug": "tape test/*.js | tap-spec" | ||
"compare-property": "^2.0.0", | ||
"deeply": "^2.0.3", | ||
"fulcon": "^1.0.2", | ||
"precise-typeof": "^1.0.2", | ||
"deeply": "3.0.0", | ||
"fulcon": "^2.0.0", | ||
"precise-typeof": "^2.0.0", | ||
"stripbom": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"coffeescript": "^2.3.1", | ||
"coffeescript": "^2.3.2", | ||
"coveralls": "^3.0.2", | ||
"cson-parser": "^3.0.0", | ||
"eslint": "^5.3.0", | ||
"hjson": "^3.1.1", | ||
"cson": "^5.1.0", | ||
"eslint": "^5.9.0", | ||
"hjson": "^3.1.2", | ||
"ini": "^1.3.4", | ||
"is-node-modern": "^1.0.0", | ||
"js-yaml": "^3.6.1", | ||
"json5": "^1.0.1", | ||
"json5": "^2.1.0", | ||
"moment": "^2.22.2", | ||
"nyc": "^12.0.2", | ||
"nyc": "^13.1.0", | ||
"pre-commit": "^1.1.3", | ||
"properties": "^1.2.1", | ||
"sinon": "^6.1.4", | ||
"sinon": "^7.1.1", | ||
"tap-spec": "^5.0.0", | ||
@@ -81,0 +79,0 @@ "tape": "^4.6.2", |
@@ -5,7 +5,7 @@ # configly [![NPM Module](https://img.shields.io/npm/v/configly.svg?style=flat)](https://www.npmjs.com/package/configly) | ||
[![Linux Build](https://img.shields.io/travis/alexindigo/configly/canary.svg?label=linux:6.x-10.x&style=flat)](https://travis-ci.org/alexindigo/configly) | ||
[![MacOS Build](https://img.shields.io/travis/alexindigo/configly/canary.svg?label=macos:6.x-10.x&style=flat)](https://travis-ci.org/alexindigo/configly) | ||
[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/configly/canary.svg?label=windows:6.x-10.x&style=flat)](https://ci.appveyor.com/project/alexindigo/configly) | ||
[![Linux Build](https://img.shields.io/travis/alexindigo/configly/master.svg?label=linux:6.x-11.x&style=flat)](https://travis-ci.org/alexindigo/configly) | ||
[![MacOS Build](https://img.shields.io/travis/alexindigo/configly/master.svg?label=macos:6.x-11.x&style=flat)](https://travis-ci.org/alexindigo/configly) | ||
[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/configly/master.svg?label=windows:6.x-11.x&style=flat)](https://ci.appveyor.com/project/alexindigo/configly) | ||
[![Coverage Status](https://img.shields.io/coveralls/alexindigo/configly/canary.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/configly?branch=canary) | ||
[![Coverage Status](https://img.shields.io/coveralls/alexindigo/configly/master.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/configly?branch=master) | ||
[![Dependency Status](https://img.shields.io/david/alexindigo/configly.svg?style=flat)](https://david-dm.org/alexindigo/configly) | ||
@@ -63,3 +63,6 @@ | ||
// due to https://github.com/groupon/cson-parser/issues/56 | ||
var cson = require('cson-parser'); | ||
// Update: | ||
// recommended to use `cson` over `cson-parser` | ||
// due to https://github.com/groupon/cson-parser/issues/74 | ||
var cson = require('cson'); | ||
var yaml = require('js-yaml'); | ||
@@ -78,3 +81,3 @@ var properties = require('properties'); | ||
cson : function(str) { return cson.parse(str); }, | ||
yml : function(str) { return yaml.safeLoad(str); }, | ||
yaml : function(str) { return yaml.safeLoad(str); }, | ||
// same options as used within `config` module | ||
@@ -99,3 +102,3 @@ properties: function(str) { return properties.parse(str, {namespaces: true, variables: true, sections: true}); }, | ||
cson : function(str) { return cson.parse(str); }, | ||
yml : function(str) { return yaml.safeLoad(str); }, | ||
yaml : function(str) { return yaml.safeLoad(str); }, | ||
// same options as used within `config` module | ||
@@ -399,4 +402,4 @@ properties: function(str) { return properties.parse(str, {namespaces: true, variables: true, sections: true}); }, | ||
// also will try to load config files matching current app name | ||
// e.g. `my-app.ini`, 'my-app.js', `my-app.json`, `my-app.yml`, | ||
// `my-app-production.ini`, `my-app-production.js`, `my-app-production.json`, `my-app-production.yml`, | ||
// e.g. `my-app.ini`, 'my-app.js', `my-app.json`, `my-app.yaml`, | ||
// `my-app-production.ini`, `my-app-production.js`, `my-app-production.json`, `my-app-production.yaml`, | ||
// from both local config folder and `/etc/consul` | ||
@@ -407,5 +410,5 @@ files: configly.files.concat('my-app'), | ||
parsers: { | ||
ini : ini.parse, | ||
ini : ini.parse, | ||
// have it as a wrapper to prevent extra arguments leaking | ||
yml : function(str) { return yaml.safeLoad(str); } | ||
yaml : function(str) { return yaml.safeLoad(str); } | ||
} | ||
@@ -510,3 +513,4 @@ }); | ||
- Configly provides ability to combine environment variables within one entry (e.g. `"endpoint": "${REMOTE_HOST}:${REMOTE_PORT}"`). | ||
- Configly provides ability to "mount" custom config files into specified entries (useful to pull webpack manifest files into app's config). | ||
- Configly supports built-in and custom modifiers for environment variables overrides (e.g. `"loggingEnabled": "boolean LOGGING_ENABLED_BOOLEAN_AS_STRING"`) | ||
- Configly provides ability to "mount" custom config files into specified entries (e.g. useful to pull webpack manifest files into app's config). | ||
- Configly provides access to the underlying functions and defaults, allowing to utilize parts of the functionality for greater flexibility. | ||
@@ -520,3 +524,3 @@ | ||
- Configly doesn't provide `get`, `has` methods, it always returns pure js (POJO) object. | ||
- Configly doesn't auto-strip comments from JSON files, use `configly.PARSERS['json'] = json5.parse;`. | ||
- Configly doesn't auto-strip comments from JSON files, instead use `parsers: {json: (str) => json5.parse(str)}`. | ||
@@ -523,0 +527,0 @@ ## License |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
151250
16
940
1
522
+ Addeddeeply@3.0.0(transitive)
+ Addedfulcon@2.0.0(transitive)
+ Addedprecise-typeof@2.0.1(transitive)
- Removeddeeply@2.0.3(transitive)
- Removedfulcon@1.0.2(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedprecise-typeof@1.0.2(transitive)
Updateddeeply@3.0.0
Updatedfulcon@^2.0.0
Updatedprecise-typeof@^2.0.0