es-set-tostringtag
TypeScript icon, indicating that this package has built-in type declarations

2.0.3 • Public • Published

es-set-tostringtag Version Badge

github actions coverage License Downloads

npm badge

A helper to optimistically set Symbol.toStringTag, when possible.

Most common usage:

var assert = require('assert');
var setToStringTag = require('es-set-tostringtag');

var obj = {};

assert.equal(Object.prototype.toString.call(obj), '[object Object]');

setToStringTag(obj, 'tagged!');

assert.equal(Object.prototype.toString.call(obj), '[object tagged!]');

Tests

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.3
    12,676,988
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.3
    12,676,988
  • 2.0.2
    4,955,411
  • 2.0.1
    7,292,826
  • 2.0.0
    17,391
  • 1.0.0
    56

Package Sidebar

Install

npm i es-set-tostringtag

Weekly Downloads

20,896,799

Version

2.0.3

License

MIT

Unpacked Size

13.9 kB

Total Files

9

Last publish

Collaborators

  • ljharb