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

array-key-object-uniq

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-key-object-uniq

> do you have needs check duplicate value inside complex item array ?

  • 0.5.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

array-key-object-uniq

do you have needs check duplicate value inside complex item array ?

installation

  • npm install array-key-object-uniq --save

  • yarn add array-key-object-uniq

usage

index.js


const arrayKeyObjectUniq = require('array-key-object-uniq') ;

const myArray = [
    {
        username: "Foo",
        isLicorn: false
    } , {
        username: "Bar",
        isLicorn: false
    } , {
        username: "FooBar",
        isLicorn: true
    }, {
        username: "Foo",
        isLicorn: false
    }
] ;

const resolveMyArray = arrayKeyObjectUniq( myArray ) ;

console.log( resolveMyArray ) ;

output

[
    "Foo",false,
    "Bar",
    "FooBar",true
]

inline array

you can just transform your complex array in inline array with: require('array-key-object-uniq/lib/inline-transform')

inline array usage

index.js

const inlineArray = require('array-key-object-uniq/lib/inline-transform') ;

const myArray = [
    {
        username: "Foo",
        isLicorn: false
    } , {
        username: "Bar",
        isLicorn: false
    } , {
        username: "FooBar",
        isLicorn: true
    }, {
        username: "Foo",
        isLicorn: false
    }
] ;

const myInlineArray = inlineArray( myArray ) ;

console.log( myInlineArray ) ;

output

[
    "Foo", false,
    "Bar", false,
    "FooBar", true,
    "Foo", false
]

The inline-array module not applicate filter this the module call by array-key-object-uniq before filter final values, if you have needs applicate custom filter, you should use: inline-array module.

currently inline-array is not installable in standalone this is possible for next minor version: 0.6.0.

Keywords

FAQs

Package last updated on 14 Apr 2020

Did you know?

Socket

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.

Install

Related posts

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