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

59

Version

2.0.0

License

MIT

Last publish

Collaborators

  • sitecorecorporation
  • sc-maximnakhod
  • appadmin-svc