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

cz

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cz - npm Package Compare versions

Comparing version 1.7.2 to 1.7.3

coverage/lcov-report/base.css

5

lib/index.js

@@ -116,4 +116,7 @@ 'use strict';

value: function joinGets(gets, joins) {
var _this2 = this;
// @TODO: Add support for a single join param instead of just array
var results = gets.map(function (get) {
return this.get(get);
return _this2.get(get);
});

@@ -120,0 +123,0 @@ var finalResult = '';

37

lib/utils.js

@@ -1,2 +0,2 @@

'use strict';
"use strict";

@@ -6,36 +6,2 @@ Object.defineProperty(exports, "__esModule", {

});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var flattenObject = function flattenObject(ob) {
var toReturn = {};
var flatObject = void 0;
for (var i in ob) {
if (!{}.hasOwnProperty.call(ob, i)) {
continue;
}
// Exclude arrays from the final result
// Check this http://stackoverflow.com/questions/4775722/check-if-object-is-array
if (ob[i] && Array === ob[i].constructor) {
continue;
}
if (_typeof(ob[i]) === 'object') {
flatObject = flattenObject(ob[i]);
for (var x in flatObject) {
if (!{}.hasOwnProperty.call(flatObject, x)) {
continue;
}
// Exclude arrays from the final result
if (flatObject[x] && Array === flatObject.constructor) {
continue;
}
toReturn[i + (isNaN(x) ? ':' + x : '')] = flatObject[x];
}
} else {
toReturn[i] = ob[i];
}
}
return toReturn;
};
var weakToJSON = function weakToJSON(obj) {

@@ -45,3 +11,2 @@ return JSON.parse(JSON.stringify(obj));

exports.flattenObject = flattenObject;
exports.weakToJSON = weakToJSON;
{
"name": "cz",
"version": "1.7.2",
"version": "1.7.3",
"description": "A simple config utility for nodejs",
"main": "lib/index.js",
"scripts": {
"test": "xo && npm run compile && mocha --compilers js:babel-core/register ./test/**/* --arg:test=arg_test_value",
"compile": "babel -d lib/ src/",
"prepublish": "npm run compile"
"test": "xo && npm run build && mocha --compilers js:babel-core/register ./test/**/* --arg:test=arg_test_value",
"coverage": "cross-env NODE_ENV=test nyc mocha ./test/**/* --arg:test=arg_test_value",
"build": "babel -d lib/ src/",
"prepublish": "npm run build"
},

@@ -34,6 +35,11 @@ "repository": {

"babel-core": "^6.24.1",
"babel-plugin-istanbul": "^4.1.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"babel-register": "^6.24.1",
"chai": "^3.5.0",
"cross-env": "^4.0.0",
"istanbul": "^0.4.5",
"mocha": "^3.2.0",
"nyc": "^10.2.0",
"xo": "^0.18.1"

@@ -57,3 +63,14 @@ },

]
},
"nyc": {
"require": [
"babel-register"
],
"reporter": [
"lcov",
"text"
],
"sourceMap": false,
"instrument": false
}
}

@@ -9,3 +9,3 @@ 'use strict';

import Cz from '../lib/index';
import Cz from '../src/index';

@@ -111,1 +111,18 @@ const config = new Cz();

});
describe('joinGets should join multiple get params', () => {
before(() => {
config.reset();
config.defaults({});
config.set({
db: {
host: 'localhost',
port: 3000
}
});
});
it(`config.joinGets(['db:host', 'db:port'], [':']) should return localhost:3000`, () => {
expect(config.joinGets(['db:host', 'db:port'], [':'])).to.equal('localhost:3000');
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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