node_modules/es-abstract/2015/ToPropertyDescriptor.js in immosquare-cleaner-0.1.32 vs node_modules/es-abstract/2015/ToPropertyDescriptor.js in immosquare-cleaner-0.1.38
- old
+ new
@@ -1,13 +1,11 @@
'use strict';
-var has = require('has');
+var hasOwn = require('hasown');
-var GetIntrinsic = require('get-intrinsic');
+var $TypeError = require('es-errors/type');
-var $TypeError = GetIntrinsic('%TypeError%');
-
var Type = require('./Type');
var ToBoolean = require('./ToBoolean');
var IsCallable = require('./IsCallable');
// https://262.ecma-international.org/5.1/#sec-8.10.5
@@ -16,37 +14,37 @@
if (Type(Obj) !== 'Object') {
throw new $TypeError('ToPropertyDescriptor requires an object');
}
var desc = {};
- if (has(Obj, 'enumerable')) {
+ if (hasOwn(Obj, 'enumerable')) {
desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);
}
- if (has(Obj, 'configurable')) {
+ if (hasOwn(Obj, 'configurable')) {
desc['[[Configurable]]'] = ToBoolean(Obj.configurable);
}
- if (has(Obj, 'value')) {
+ if (hasOwn(Obj, 'value')) {
desc['[[Value]]'] = Obj.value;
}
- if (has(Obj, 'writable')) {
+ if (hasOwn(Obj, 'writable')) {
desc['[[Writable]]'] = ToBoolean(Obj.writable);
}
- if (has(Obj, 'get')) {
+ if (hasOwn(Obj, 'get')) {
var getter = Obj.get;
if (typeof getter !== 'undefined' && !IsCallable(getter)) {
throw new $TypeError('getter must be a function');
}
desc['[[Get]]'] = getter;
}
- if (has(Obj, 'set')) {
+ if (hasOwn(Obj, 'set')) {
var setter = Obj.set;
if (typeof setter !== 'undefined' && !IsCallable(setter)) {
throw new $TypeError('setter must be a function');
}
desc['[[Set]]'] = setter;
}
- if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {
+ if ((hasOwn(desc, '[[Get]]') || hasOwn(desc, '[[Set]]')) && (hasOwn(desc, '[[Value]]') || hasOwn(desc, '[[Writable]]'))) {
throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
}
return desc;
};