Sha256: c0c7eb593936f6c27f142b79ed2a6057d8fd10d65603723e96649ed02e82524b
Contents?: true
Size: 694 Bytes
Versions: 243
Compression:
Stored size: 694 Bytes
Contents
'use strict'; var GetIntrinsic = require('get-intrinsic'); var $TypeError = GetIntrinsic('%TypeError%'); var IsPropertyKey = require('./IsPropertyKey'); var Type = require('./Type'); // https://262.ecma-international.org/6.0/#sec-deletepropertyorthrow module.exports = function DeletePropertyOrThrow(O, P) { if (Type(O) !== 'Object') { throw new $TypeError('Assertion failed: Type(O) is not Object'); } if (!IsPropertyKey(P)) { throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); } // eslint-disable-next-line no-param-reassign var success = delete O[P]; if (!success) { throw new $TypeError('Attempt to delete property failed.'); } return success; };
Version data entries
243 entries across 27 versions & 2 rubygems