Sha256: d7dc15b9af3fbfd0d52cea2f81ea489b4caadf65f669af69ba576e2745d3bf11
Contents?: true
Size: 738 Bytes
Versions: 27
Compression:
Stored size: 738 Bytes
Contents
'use strict'; var GetIntrinsic = require('get-intrinsic'); var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); var hasToStringTag = require('has-tostringtag/shams')(); var has = require('has'); var toStringTag = hasToStringTag ? Symbol.toStringTag : null; module.exports = function setToStringTag(object, value) { var overrideIfSet = arguments.length > 2 && arguments[2] && arguments[2].force; if (toStringTag && (overrideIfSet || !has(object, toStringTag))) { if ($defineProperty) { $defineProperty(object, toStringTag, { configurable: true, enumerable: false, value: value, writable: false }); } else { object[toStringTag] = value; // eslint-disable-line no-param-reassign } } };
Version data entries
27 entries across 27 versions & 2 rubygems