tree: b6b4c57439299f2247ddeb181b78f8fbcf71da9f [path history] [tgz]
  1. test/
  2. .eslintrc
  3. CHANGELOG.md
  4. index.d.ts
  5. index.js
  6. LICENSE
  7. package.json
  8. README.md
  9. tsconfig.json
node_modules/es-set-tostringtag/README.md

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