Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wankdanker/node-dank-cast
Cast values to more specific types with default values if they can't be casted
https://github.com/wankdanker/node-dank-cast
Last synced: 14 days ago
JSON representation
Cast values to more specific types with default values if they can't be casted
- Host: GitHub
- URL: https://github.com/wankdanker/node-dank-cast
- Owner: wankdanker
- License: mit
- Created: 2013-08-27T17:18:00.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-08-27T19:45:42.000Z (over 11 years ago)
- Last Synced: 2024-12-13T06:42:34.206Z (25 days ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
node-dank-cast
==============Cast values to more specific types with default values if they can't be casted
install
-------```bash
npm install dank-cast
```examples
--------```js
var cast = require('dank-cast');cast.int('asdf', 0); // 0
cast.int('12345', 0); // 12345
cast.string(null, 'default value); //default value
cast.bool('yes'); //true
cast.float('1234.34); //1234.34
```license
-------MIT