NM-012 · C60
js-subtype
npm library · 2024
“More precise than typeof.”
A Side A
A small, zero-dependency library that tells you the exact subtype of any JavaScript value —Array, Date, Map, RegExp…— where typeof only says “object”.
It exposes a single function, getType, which returns the subtype’s name, handy to validate input precisely or decide how to handle a value. It works in Node.js and in modern browsers, installs from npm or yarn and is MIT licensed.
B Side B
Facts
- Technologies
- JavaScript · Node.js
- Status
- Repository
- Date
- 2024
Links