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

objob

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

objob - npm Package Compare versions

Comparing version 2.7.4 to 2.7.5

28

lib/functions.js

@@ -6,2 +6,10 @@ 'use strict';

});
exports.isEmptyObjectOrArray = exports.makeFlattenedShallow = undefined;
var _typeOf = require('type-of');
var _typeOf2 = _interopRequireDefault(_typeOf);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/*

@@ -31,2 +39,6 @@ * Returns a shallow version of the shallow object to remove redundancy

if (isEmptyObjectOrArray(subject[keyChain])) {
shallow = false;
}
if (!shallow) {

@@ -37,2 +49,18 @@ resp[keyChain] = subject[keyChain];

return resp;
};
/*
* Returns true if we're dealing with an empty array or object
*
* @param {object} subject the array or object to check
* @returns {boolean}
*/
var isEmptyObjectOrArray = exports.isEmptyObjectOrArray = function isEmptyObjectOrArray(subject) {
if ((0, _typeOf2.default)(subject) === 'object' || (0, _typeOf2.default)(subject) === 'array') {
if (Object.keys(subject).length === 0) {
return true;
}
}
return false;
};

2

package.json
{
"name": "objob",
"version": "2.7.4",
"version": "2.7.5",
"description": "A tool for controlling and manipulating javascript object fields and output.",

@@ -5,0 +5,0 @@ "main": "lib/objob.js",

@@ -0,1 +1,3 @@

import type from 'type-of';
/*

@@ -25,2 +27,6 @@ * Returns a shallow version of the shallow object to remove redundancy

if(isEmptyObjectOrArray(subject[keyChain])) {
shallow = false;
}
if(!shallow) {

@@ -32,1 +38,18 @@ resp[keyChain] = subject[keyChain];

};
/*
* Returns true if we're dealing with an empty array or object
*
* @param {object} subject the array or object to check
* @returns {boolean}
*/
export let isEmptyObjectOrArray = function(subject) {
if(type(subject) === 'object' || type(subject) === 'array'){
if(Object.keys(subject).length === 0) {
return true;
}
}
return false;
};
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