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

addtoset

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

addtoset - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

2

package.json
{
"name": "addtoset",
"version": "0.0.3",
"version": "0.0.4",
"description": "Utility array function to add value to array if doesn't exist",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -17,6 +17,8 @@ © ,Kailash Yogeshwar, Licensed under MIT-License

const addToSet = require('addtoset');
const set = new addToSet();
let arr = [1,2,3,4,5];
addToSet.push(arr, 6); // [1,2,3,4,5,6]
addToSet.push(arr, 1); // [1,2,3,4,5]
arr = set.push(arr, 6); // [1,2,3,4,5,6]
arr = set.push(arr, 1); // [1,2,3,4,5]

@@ -26,5 +28,5 @@ // Error if parameter is not array

addToSet.push(str,1); // Error: Source must be array
set.push(str,1); // Error: Source must be array
```
Thank you. Happy Coding
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