1.1.0 • Published 7 years ago

has-uuid v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

has-uuid

Utility for finding or filtering in array on uuid.

Install

$ npm install --save has-uuid

Usage

import hasUuid from "has-uuid"

const collection = [
  { uuid: "03461560-fc25-11e6-bc64-92361f002671" },
  { uuid: "034618e4-fc25-11e6-bc64-92361f002671" },
  { uuid: "03461a74-fc25-11e6-bc64-92361f002671" }
]
const someUuid = "03461560-fc25-11e6-bc64-92361f002671"
const result = collection.find(hasUuid(someUuid))
// same as
const result2 = collection.find(item => item.uuid === someUuid)