Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

to-string-x

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

to-string-x

ES6-compliant shim for ToString.

  • 2.0.30
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Travis status Dependency status devDependency status npm version jsDelivr hits

to-string-x

ES6-compliant shim for ToString.

See: 7.1.12 ToString ( argument )

module.exports(value)string

The abstract operation ToString converts argument to a value of type String.

Kind: Exported function
Returns: string - The converted value.
Throws:

  • TypeError If value is a Symbol.
ParamTypeDescription
value*The value to convert to a string.

Example

import $toString from 'to-string-x';

console.log($toString()); // 'undefined'
console.log($toString(null)); // 'null'
console.log($toString('abc')); // 'abc'
console.log($toString(true)); // 'true'
console.log($toString(Symbol('foo'))); // TypeError
console.log($toString(Symbol.iterator)); // TypeError
console.log($toString(Object(Symbol.iterator))); // TypeError
console.log($toString(Object.create(null))); // TypeError

Keywords

FAQs

Package last updated on 24 Jul 2019

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