{"_id":"typely","_rev":"437342","name":"typely","description":"Lightweight (meaning relatively fast) type-checking in CoffeeScript. ","dist-tags":{"latest":"0.0.0"},"maintainers":[{"name":"dyoder","email":"danielyoder@gmail.com"}],"time":{"modified":"2021-08-05T06:20:28.000Z","created":"2013-06-01T02:00:43.224Z","0.0.0":"2013-06-01T02:00:43.224Z"},"users":{},"author":{"name":"Dan Yoder","email":"danielyoder@gmail.com"},"repository":{"type":"git","url":"git://github.com/dyoder/typely.git"},"versions":{"0.0.0":{"name":"typely","version":"0.0.0","description":"Lightweight (meaning relatively fast) type-checking in CoffeeScript. ","main":"index.coffee","scripts":{"test":"coffee test.coffee"},"repository":{"type":"git","url":"git://github.com/dyoder/typely.git"},"keywords":["type-checking","coffeescript",""],"author":{"name":"Dan Yoder","email":"danielyoder@gmail.com"},"license":"MIT","readmeFilename":"README.md","dependencies":{"fairmont":"~0.4.1"},"_id":"typely@0.0.0","dist":{"shasum":"cbb7cccd549febfff24f217d2186643c037d38e1","size":1316,"noattachment":false,"key":"/typely/-/typely-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/typely/download/typely-0.0.0.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"dyoder","email":"danielyoder@gmail.com"},"maintainers":[{"name":"dyoder","email":"danielyoder@gmail.com"}],"directories":{},"publish_time":1370052043224,"_cnpm_publish_time":1370052043224,"_hasShrinkwrap":false}},"readme":"# typely\n\nA lightweight (read: relatively fast) type-checking library in CoffeeScript.\n\n    {overload} = require \"typely\"\n\n    class Multiplier \n  \n      total: 1\n  \n      multiply: overload (match) ->\n        match \"array\", (array) -> @multiply element for element in array\n        match \"number\", (number) -> @total *= number\n    \n    multiplier = new Multiplier\n\n    multiplier.multiply 2\n    multiplier.multiply [ 3, 4, 5 ]\n\n    console.log multiplier.total\n    \nTypely is limited to checking for types, [as per Douglas Crockford's `typeOf` function][0]. That is: null, undefined, boolean, number, string, date, regexp, array, object, and function. This limitation allows it to run relatively fast, by simply using as an index a string based on the types of the given arguments and seeing whether it returns a function.\n\n## Installation\n\n    npm install typely","_attachments":{},"readmeFilename":"README.md","license":"MIT"}