Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

es-to-primitive

Package Overview
Dependencies
3
Maintainers
1
Versions
6
Issues
File Explorer

Advanced tools

es-to-primitive

ECMAScript “ToPrimitive” algorithm. Provides ES5 and ES2015 versions.

    1.2.1latest

Version published
Maintainers
1
Weekly downloads
20,686,581
decreased by-10.27%

Weekly downloads

Readme

Source

es-to-primitive Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

ECMAScript “ToPrimitive” algorithm. Provides ES5 and ES2015 versions. When different versions of the spec conflict, the default export will be the latest version of the abstract operation. Alternative versions will also be available under an es5/es2015 exported property if you require a specific version.

Example

var toPrimitive = require('es-to-primitive'); var assert = require('assert'); assert(toPrimitive(function () {}) === String(function () {})); var date = new Date(); assert(toPrimitive(date) === String(date)); assert(toPrimitive({ valueOf: function () { return 3; } }) === 3); assert(toPrimitive(['a', 'b', 3]) === String(['a', 'b', 3])); var sym = Symbol(); assert(toPrimitive(Object(sym)) === sym);

Tests

Simply clone the repo, npm install, and run npm test

Keywords

FAQs

What is es-to-primitive?

ECMAScript “ToPrimitive” algorithm. Provides ES5 and ES2015 versions.

Is es-to-primitive popular?

The npm package es-to-primitive receives a total of 15,990,949 weekly downloads. As such, es-to-primitive popularity was classified as popular.

Is es-to-primitive well maintained?

We found that es-to-primitive demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 09 Nov 2019

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc