Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

Latest commit

 

History

History
26 lines (18 loc) · 882 Bytes

readme.md

File metadata and controls

26 lines (18 loc) · 882 Bytes

is-record Build status npm version codecov

Type-guard for Record

Install

npm install @strong-roots-capital/is-record

Use

import isRecord from '@strong-roots-capital/is-record'

const object = fetchMysteryObject()
if (isRecord(object)) {
    console.log(object.Volume) // ok
} else {
    console.log(object.Volume) // potential error!
}

Related