demo___customer_pitch-c4152739-a50b-4b5b-9d4d-0561461666d9.zip-extract/_dependencies/npm/dunder-proto-1.0.1/set.js

Path
demo___customer_pitch-c4152739-a50b-4b5b-9d4d-0561461666d9.zip-extract/_dependencies/npm/dunder-proto-1.0.1/set.js
Status
scanned
Type
file
Name
set.js
Extension
.js
Programming language
JavaScript
Mime type
text/plain
File type
ASCII text
Tag

      
    
Rootfs path

      
    
Size
1276 (1.2 KB)
MD5
1c871e238fcfac6c9ba954c5fae597da
SHA1
6b8841bcb6718267073724f2f59e0703c28c7397
SHA256
627dfab99b492879fca53b5d648a7263fc16181bfee148e7d29f7fa0f47bd24d
SHA512

      
    
SHA1_git
6085b6e84dbc760b9aa2fee924ef3bcb87989e93
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
set.js | 1.2 KB |

'use strict'; var callBind = require('call-bind-apply-helpers'); var gOPD = require('gopd'); var $TypeError = require('es-errors/type'); /** @type {{ __proto__?: object | null }} */ var obj = {}; try { obj.__proto__ = null; // eslint-disable-line no-proto } catch (e) { if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { throw e; } } var hasProtoMutator = !('toString' in obj); // eslint-disable-next-line no-extra-parens var desc = gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); /** @type {import('./set')} */ module.exports = hasProtoMutator && ( // eslint-disable-next-line no-extra-parens (!!desc && typeof desc.set === 'function' && /** @type {import('./set')} */ (callBind([desc.set]))) || /** @type {import('./set')} */ function setDunder(object, proto) { // this is node v0.10 or older, which doesn't have Object.setPrototypeOf and has undeniable __proto__ if (object == null) { // eslint-disable-line eqeqeq throw new $TypeError('set Object.prototype.__proto__ called on null or undefined'); } // eslint-disable-next-line no-proto, no-param-reassign, no-extra-parens /** @type {{ __proto__?: object | null }} */ (object).__proto__ = proto; return proto; } );
Package URL License Primary language
pkg:npm/acme-demo-app@1.0.0 JavaScript
pkg:npm/dunder-proto@1.0.1 mit JavaScript