🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

to-object-path

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

to-object-path - npm Package Compare versions

Comparing version

to
0.3.0

27

index.js

@@ -10,12 +10,25 @@ /*!

var isArguments = require('is-arguments');
var flatten = require('arr-flatten');
var typeOf = require('kind-of');
module.exports = function toPath(args) {
if (isArguments(args)) {
args = [].slice.call(args);
} else {
args = [].slice.call(arguments);
if (typeOf(args) !== 'arguments') {
args = arguments;
}
return flatten(args).join('.');
return filter(args).join('.');
};
function filter(arr) {
var len = arr.length;
var idx = -1;
var res = [];
while (++idx < len) {
var ele = arr[idx];
if (typeOf(ele) === 'arguments' || Array.isArray(ele)) {
res.push.apply(res, filter(ele));
} else if (typeof ele === 'string') {
res.push(ele);
}
}
return res;
}
{
"name": "to-object-path",
"description": "Create an object path from a list or array of strings.",
"version": "0.2.0",
"version": "0.3.0",
"homepage": "https://github.com/jonschlinkert/to-object-path",

@@ -23,7 +23,6 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

"dependencies": {
"arr-flatten": "^1.0.1",
"is-arguments": "^1.0.2"
"kind-of": "^3.0.2"
},
"devDependencies": {
"base-methods": "^0.3.1",
"base": "^0.6.7",
"mocha": "*"

@@ -30,0 +29,0 @@ },

Sorry, the diff of this file is not supported yet