duplicheck
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

duplicheck

Retrieve duplicates from strings, numbers, arrays, or objects.

Installation

npm install duplicheck

Real World Use Case

String

import dc from 'duplicheck'

const userAPI = getUserAPI() // 'https://example.com/api/v1/users'
const projectAPI = getProjectAPI() // 'https://example.com/api/v1/projects'

const baseAPI = dc(userAPI, projectAPI) // 'https://example.com/api/v1/'

Array

import dc from 'duplicheck'

const userArray = [
  { name: 'John Doe', age: 20 },
  { name: 'Jane Doe', age: 21 },
  { name: 'Jiwon Choi', age: 5 },
]

const authorizedUserArray = [
  { name: 'John Doe', age: 20 },
  { name: 'John Cena', age: 21 },
]

// Output: [{ name: 'John Doe', age: 20 }]
const validatedUserArray = dc(userArray, authorizedUserArray)

Object

import dc from 'duplicheck'
import { PageProps, LayoutProps } from './types'

// PageProps
// {
//   path: string,
//   children: React.ReactNode
// }

// LayoutProps
// {
//   title: string,
//   description: string,
//   path: string,
//   children: React.ReactNode
// }

const commonProps = dc(ButtonProps, InputProps)

// Output: { path: string, children: React.ReactNode }

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.22latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.22
0.1.10
0.1.00
0.0.70
0.0.60
0.0.50
0.0.30
0.0.20
0.0.10
0.0.00

Package Sidebar

Install

npm i duplicheck

Weekly Downloads

1

Version

0.1.2

License

MIT

Unpacked Size

10.8 kB

Total Files

9

Last publish

Collaborators

  • devjiwonchoi