Socket
Socket
Sign inDemoInstall

minobjs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minobjs - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

lib/index.js

@@ -11,3 +11,3 @@ "use strict";

}
return items.reduce(function (x, y) { return (Object.assign(x, y), {}); });
return items.reduce(function (x, y) { return Object.assign(x, y); });
};

@@ -14,0 +14,0 @@ Objs.prototype.isEmpty = function (obj) {

{
"name": "minobjs",
"version": "1.0.0",
"version": "1.0.1",
"description": "minimal object manipulation",

@@ -29,3 +29,3 @@ "main": "lib/index.js",

],
"author": "Andrie Lucaci",
"author": "Andrei Lucaci",
"license": "ISC",

@@ -32,0 +32,0 @@ "bugs": {

# minobjs
minimal object manipulation
## Contents
For now, the current implementation supports `isEmpty` and `merge` functions over objects
```typescript
export interface IObjs {
merge(...items: any[]): any;
isEmpty(obj: any): boolean;
}
```
## Example
### loading the module
```javascript
const { Objs } = require("minobjs");
// initialization
const obj = new Objs();
```
### `isEmpty`
```javascript
// previous initialization
// checks if an object is empty
console.log(obj.isEmpty({}));
// outputs: true
console.log(obj.isEmpty({ a: 1 }));
// outputs: false
```
### `merge`
```javascript
// previous initialization
const obj1 = {
a: 1,
b: 2,
c: {
a: 1,
b: 2,
c: {
d: 1,
e: 2
}
}
};
const obj2 = {
a: 1,
b: 3,
c: {
a: 1,
b: 2,
c: {
d: 1,
e: 3
}
}
};
const obj3 = {
e: 7
};
const obj4 = {
e: 8,
f: 1
};
const result = obj.merge(obj1, obj2, obj3, obj4);
console.log(result);
// outputs { a: 1, b: 3, c: { a: 1, b: 2, c: { d: 1, e: 3 } }, e: 8, f: 1 }
```
## Instalation
```bash
yarn add minobjs
# or
npm install minobjs
```
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