es-to-primitive

WebJar for es-to-primitive

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

es-to-primitive
Last Version

Last Version

1.2.1
Release Date

Release Date

Type

Type

jar
Description

Description

es-to-primitive
WebJar for es-to-primitive
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/ljharb/es-to-primitive

Download es-to-primitive

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/es-to-primitive/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>es-to-primitive</artifactId>
    <version>1.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/es-to-primitive/
implementation 'org.webjars.npm:es-to-primitive:1.2.1'
// https://jarcasting.com/artifacts/org.webjars.npm/es-to-primitive/
implementation ("org.webjars.npm:es-to-primitive:1.2.1")
'org.webjars.npm:es-to-primitive:jar:1.2.1'
<dependency org="org.webjars.npm" name="es-to-primitive" rev="1.2.1">
  <artifact name="es-to-primitive" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='es-to-primitive', version='1.2.1')
)
libraryDependencies += "org.webjars.npm" % "es-to-primitive" % "1.2.1"
[org.webjars.npm/es-to-primitive "1.2.1"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : is-callable jar [1.1.4,2)
org.webjars.npm : is-date-object jar [1.0.1,2)
org.webjars.npm : is-symbol jar [1.0.2,2)

Project Modules

There are no modules declared in this project.

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

Versions

Version
1.2.1
1.2.0
1.1.1
1.0.0