New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

JSUS

Package Overview
Dependencies
Maintainers
1
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

JSUS - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

32

lib/obj.js

@@ -75,3 +75,9 @@ (function (JSUS) {

OBJ._obj2Array = function(obj, keyed) {
OBJ._obj2Array = function(obj, keyed, level, cur_level) {
if (level) {
var cur_level = ('undefined' !== typeof cur_level) ? cur_level : 1;
if (cur_level > level) return [obj];
cur_level = cur_level + 1;
}
var result = [];

@@ -81,3 +87,3 @@ for (var key in obj) {

if ( 'object' === typeof obj[key] ) {
result = result.concat(OBJ._obj2Array(obj[key],keyed));
result = result.concat(OBJ._obj2Array(obj[key], keyed, level, cur_level));
}

@@ -90,16 +96,24 @@ else {

}
}
}
return result;
};
OBJ.obj2Array = function (obj) {
return OBJ._obj2Array(obj);
/**
* Recursively put the values of the properties of an object into
* an array and returns it. The level of recursion can be set with the
* parameter level, by default recursion has no limit. That means that
* the whole object gets totally unfolded into an array.
*/
OBJ.obj2Array = function (obj, level) {
return OBJ._obj2Array(obj, false, level);
};
/**
* Creates an array containing all keys and values of the obj.
* Creates an array containing all keys and values of an object and
* returns it.
*
* @see OBJ.obj2Array
*/
OBJ.obj2KeyedArray = function (obj) {
return OBJ._obj2Array(obj,true);
OBJ.obj2KeyedArray = function (obj, level) {
return OBJ._obj2Array(obj, true, level);
};

@@ -106,0 +120,0 @@

{
"name": "JSUS",
"description": "JavaScript UtilS. Collection of general purpose functions. JSUS helps!",
"version": "0.1.0",
"version": "0.1.1",
"keywords": [ "util", "general", "array", "eval", "time", "date", "object"],

@@ -6,0 +6,0 @@ "author": "Stefano Balietti <futur.dorko@gmail.com>",

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