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

Version Path
immosquare-cleaner-0.1.32 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.31 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.30 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.29 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.28 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.27 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.26 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.25 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.24 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.23 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.22 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.21 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.20 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.19 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.18 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.17 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.16 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.14 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.13 node_modules/es-set-tostringtag/index.js
immosquare-cleaner-0.1.12 node_modules/es-set-tostringtag/index.js