Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
de_duplicated
Advanced tools
This is package for deleting the duplicated elements in array, there are contain two methods, first method called simpleArray, this method de_duplicated the simple elements just numbers or strings or both, and second method is complexArray the de_duplicated object elements in array
download the package in your project and require it, and use it
you should have node.js in your local machine
open terminal and go to your project directory and write
npm install de_duplicated
// or
yarn add de_duplicated
After install package
//example 1
import DeDuplicated from 'de_duplicated';
// OR
const DeDuplicated = require('../de_duplicate/build').default;
let simpleArray = [2, 5, 8, 2, 2, 8, 5, 2, 3];
let uniqueSimpleArray = DeDuplicated.simpleArray(simpleArray);
console.log(uniqueSimpleArray);
//result
//[ 2, 5, 8, 3 ]
//example 2
import DeDuplicated from 'de_duplicated';
// OR
const DeDuplicated = require('../de_duplicate/build').default;
let simpleArray = ['john', 'milad', 'Milad', 'john', 'John'];
let uniqueSimpleArray = DeDuplicated.simpleArray(simpleArray);
console.log(uniqueSimpleArray);
// result
//[ 'john', 'milad' ]
// Note that: The simpleArray method case insensitive for string
//example 3
import DeDuplicated from 'de_duplicated';
// OR
const DeDuplicated = require('../de_duplicate/build').default;
let simpleArray = [1, 2, 1, 2, 5, 8, 8, 5, 'john', 'milad', 'Milad', 'john', 'John'];
let uniqueSimpleArray = DeDuplicated.simpleArray(simpleArray);
console.log(uniqueSimpleArray);
//result
//[ 1, 2, 5, 8, 'john', 'milad' ]
//Note That: The simpleArray method case insensitive for string
//example 1
import DeDuplicated from 'de_duplicated';
// OR
const DeDuplicated = require('../de_duplicate/build').default;
let complexArray = [
{ id: 1, name: "Milad", age: 24 },
{ id: 2, name: "Milad", age: 24 },
{ id: 1, name: "Milad", age: 24 },
{ id: 3, name: "Milad", age: 24 },
{ id: 1, name: "Milad", age: 24 },
{ id: 2, name: "Milad", age: 24 },
]
let uniqueComplexArray = DeDuplicated.complexArray(complexArray, 'id');
console.log(uniqueComplexArray);
// result
/* [
{ id: 1, name: 'Milad', age: 24 },
{ id: 2, name: 'Milad', age: 24 },
{ id: 3, name: 'Milad', age: 24 }
]*/
//example 2
import DeDuplicated from 'de_duplicated';
// OR
const DeDuplicated = require('../de_duplicate/build').default;
let complexArray = [
{ id: 1, name: "Milad", age: 24 },
{ id: 2, name: "John", age: 24 },
{ id: 1, name: "Milad", age: 24 },
{ id: 3, name: "John", age: 24 },
{ id: 1, name: "Milad", age: 24 },
{ id: 2, name: "Milad", age: 24 },
]
let uniqueComplexArray = DeDuplicated.complexArray(complexArray, 'name');
console.log(uniqueComplexArray);
//result
//[ { id: 1, name: 'Milad', age: 24 }, { id: 2, name: 'John', age: 24 } ]
//example 3
import DeDuplicated from 'de_duplicated';
// OR
const DeDuplicated = require('../de_duplicate/build').default;
let complexArray = [
{ id: 1, name: "Milad", age: 24 },
{ id: 2, name: "milad", age: 24 },
{ id: 1, name: "Milad", age: 24 },
{ id: 3, name: "milad", age: 24 },
{ id: 1, name: "Milad", age: 24 },
{ id: 2, name: "Milad", age: 24 },
]
let uniqueComplexArray = DeDuplicated.complexArray(complexArray, 'name');
console.log(uniqueComplexArray);
//result
/*[
{ id: 1, name: 'Milad', age: 24 },
{ id: 2, name: 'milad', age: 24 }
]*/
//Note that : The complexArray method case sensitive for string
This project is licensed under the MIT License - see the LICENSE.md file for details
FAQs
This is a package to delete the duplicated elements in array
The npm package de_duplicated receives a total of 3 weekly downloads. As such, de_duplicated popularity was classified as not popular.
We found that de_duplicated demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.