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

safe-to-string-x

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

safe-to-string-x

Like ES6 ToString but handles Symbols too.

  • 1.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
161
decreased by-71.95%
Maintainers
1
Weekly downloads
 
Created
Source

Travis status Dependency status devDependency status npm version

safe-to-string-x

Like ES6 ToString but handles Symbols too.

See: to-string-x
Version: 1.5.0
Author: Xotic750 Xotic750@gmail.com
License: MIT
Copyright: Xotic750

module.exports(value)string

The abstract operation safeToString converts a Symbol literal or object to Symbol() instead of throwing a TypeError.

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

ParamTypeDescription
value*The value to convert to a string.

Example

var safeToString = require('safe-to-string-x');

safeToString(); // 'undefined'
safeToString(null); // 'null'
safeToString('abc'); // 'abc'
safeToString(true); // 'true'
safeToString(Symbol('foo')); // 'Symbol(foo)'
safeToString(Symbol.iterator); // 'Symbol(Symbol.iterator)'
safeToString(Object(Symbol.iterator)); // 'Symbol(Symbol.iterator)'

Keywords

FAQs

Package last updated on 10 Jul 2017

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