Huge News!Announcing our $40M Series B led by Abstract Ventures.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
  • Socket score

Version published
Weekly downloads
33K
decreased by-13.04%
Maintainers
1
Weekly downloads
 
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc