Bakhtina Sofya b84cb877be 1st comm 2 months ago
..
test b84cb877be 1st comm 2 months ago
.eslintrc b84cb877be 1st comm 2 months ago
CHANGELOG.md b84cb877be 1st comm 2 months ago
LICENSE b84cb877be 1st comm 2 months ago
README.md b84cb877be 1st comm 2 months ago
index.d.ts b84cb877be 1st comm 2 months ago
index.js b84cb877be 1st comm 2 months ago
package.json b84cb877be 1st comm 2 months ago
tsconfig.json b84cb877be 1st comm 2 months ago

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