sc-cast

2.0.0 • Public • Published

TOC

sc-cast

Cast values to specific types.

cast( "[1,2,3]", "array" ).should.eql( [ 1, 2, 3 ] );
cast( "false", "boolean" ).should.eql( false );
cast( "29 aug 1997", "date" ).should.eql( new Date( 1997, 7, 29 ) );
cast( "-42", "number" ).should.eql( -42 );
cast( true, "string" ).should.eql( "true" );

Readme

Keywords

none

Package Sidebar

Install

npm i sc-cast

Weekly Downloads

127

Version

2.0.0

License

MIT

Last publish

Collaborators

  • sc-yarikfedin
  • sitecorecorporation
  • sc-maximnakhod
  • appadmin-svc