0.1.2 • Published 10 months ago

duplicheck v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

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 }
0.1.0

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.0.5

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago

0.0.0

12 months ago