JSPM

to-str

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15511
  • Score
    100M100P100Q128973F
  • License MIT

Converts the given value to a string.

Package Exports

  • to-str

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (to-str) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

to-str

Converts the given value to a string.

MIT License

build:? coverage:?

Install

$ npm install --save to-str 

Usage

For more use-cases see the tests

var toString = require('to-str');

toString();          // => ''
toString(null);      // => ''
toString(0);         // => '0'
toString(-0);        // => '-0'
toString('abc');     // => 'abc'
toString('-1.100');  // => -1
toString([1, 2, 3]); // => '1,2,3'

toString({ foo: 'bar' });        
// => '[object Object]'

toString(function () { console.log(123); });
// => 'function () { console.log(123); }'
  • to-num - Converts the given value to a number.
  • to-integer - Converts the given value to an integer.
  • to-length - Converts value to an integer suitable for use as the length of an array-like object.
  • to-lower - Converts string, as a whole, to lower case.
  • to-upper - Converts string, as a whole, to upper case.
  • to-path - Converts value to a property path array.
  • to-source-code - Converts function to its source code.

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.