0.1.0 • Published 10 years ago

map-types v0.1.0

Weekly downloads
1
License
-
Repository
github
Last release
10 years ago

map-types NPM version

Map single letter abbreviations to javascript native types. Useful as a shorthand for pseudo-argument destructuring when debugging.

Install

Install with npm:

npm i map-types --save-dev

Run tests

npm test

Usage

var abbrev = require('map-types');

abbrev('a') //=> ['array']
abbrev('b') //=> ['boolean']
abbrev('f') //=> ['function']
abbrev('n') //=> ['number']
abbrev('o') //=> ['object']
abbrev('r') //=> ['regexp']
abbrev('s') //=> ['string']
abbrev('y') //=> ['symbol']

Multiple letters are possible:

abbrev('s') //=> ['string']
abbrev('ss') //=> ['string', 'string']
abbrev('sso') //=> ['string', 'string', 'object']
abbrev('ssoo') //=> ['string', 'string', 'object', 'object']

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license


This file was generated by verb-cli on October 10, 2014.