New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

typecast

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typecast

Simple typecasting

0.0.1
latest
Source
npm
Version published
Maintainers
1
Created
Source

#typecast Simple typecasting in javascript.

##Example

var typecast = require('typecast');

typecast(123, 'string') // => '123'
typecast('123', 'number') // => 123
typecast('a, b, c', 'array') // => ['a', 'b', 'c']
typecast('false', 'boolean') // => false

##API

###typecast(val, type) Cast given val to type

###.string(val) Cast val to String

###.number(val) Cast val to Number

###.array(val) Cast val to Array

###.boolean(val) Cast val to Boolean

##Licence MIT

FAQs

Package last updated on 14 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts