2.0.1 • Published 11 years ago

type-of v2.0.1

Weekly downloads
520,088
License
-
Repository
github
Last release
11 years ago

type-of

Type assertions aka less-broken typeof.

Build Status Dependency Status NPM version

Example

var type = require('type-of')

var obj = new Date
if (type(obj) == 'date') ...

API

type(new Date) == 'date'
type({}) == 'object'
type(null) == 'null'
type(undefined) == 'undefined'
type("hey") == 'string'
type(true) == 'boolean'
type(false) == 'boolean'
type(12) == 'number'
type(type) == 'function'
type(/asdf/) == 'regexp'
type((function(){ return arguments })()) == 'arguments'
type([]) == 'array'
type(document.createElement('div')) == 'element'

License

MIT

ian-validatortypes-assertbigquery-modelbloody-simple-sqs@everything-registry/sub-chunk-2993talk-msg-dslwonder-slateteamspeak-queryswagdoc@coauthor/coauthor-transform-func@concord-consortium/slate@convertkit/slate@convertkit/slate-html-serializer@boyuai/slate@boyuai/slate-html-serializerj22-slatejson-nativejson-literaljsatomixjscs-angularsoyie-http-routerterryoy-slateto-bool-functiontonic-exercise-kit@ascorbic/gatsby@advanced-learning/slate@advanced-learning/slate-html-serializer@akeating-redhat/fh-js-sdk@akeating-redhat/fh-sync-js@aykamko/slate@bjoerge/slate@bighappiness/ts3package@accordproject/markdown-html@accordproject/markdown-pdf@7hci/gatsby-pge@bonobolabs/gatsbyuniversal-firebasets-module-templatets-functionalvalid-object@dwidge/function-simplify@heat/awsless@happyiterating/slate@hugo-team/slate@hugo-team/slate-html-serializer@eliumhq/slate@gigmade/slate-html-serializer@gigmade/slate@gitbook/slate-html-serializer@gitbook/slate@gitbook/slate-auto-replace@infinitebrahmanuniverse/nolb-type-@ksimons/slate@ksimons/slate-html-serializer@macko911/gatsby@mathieudutour/gatsby@netlify/content-engine@nodox/gatsby@dylanvann/gatsby@menubar/markup-it@kancloud/slate@kgdev/slate@jianghe/slate@jianghe/slate-html-serializer@productboard/slate@pathable/slate@nxtedition/slate@opuscapita/slate@opuscapita/slate-html-serializer@slate-fork/slate@slate-fork/slate-html-serializer@slate-legacy/slate@slate-legacy/slate-html-serializer@seafile/sdoc-editor@seafile/seafile-editor@segment/analytics.js-integration-adobe-analytics@segment/analytics.js-integration-omniturenaominaomi-mysqlpacking-ajaxobjobscirpussatirereact-jsoneditorpromising-helpnomad-slateplistparserremote-git-storageredux-segment-noderedis-micro-transportrankyjsskorzh-slate-html-serializerslate-mark-hotkeysslate-packagesslate-pzcslate-auto-replaceslate-auto-replace-blockslate-auto-replace-legacyslate-fixslate-html-serializer
2.0.1

11 years ago

2.0.0

12 years ago