UNPKG

crocks

Version:

A collection of well known Algebraic Datatypes for your utter enjoyment.

16 lines (12 loc) 316 B
/** @license ISC License (c) copyright 2017 original and current authors */ /** @author Ian Hofmann-Hicks (evil) */ var isFunction = require('./isFunction') function type(x) { if(x) { if(isFunction(x.type)) { return x.type() } } return {}.toString.call(x).slice(8, -1) } module.exports = type