node_modules/es-abstract/2019/StringGetOwnProperty.js in immosquare-cleaner-0.1.32 vs node_modules/es-abstract/2019/StringGetOwnProperty.js in immosquare-cleaner-0.1.38
- old
+ new
@@ -1,11 +1,9 @@
'use strict';
-var GetIntrinsic = require('get-intrinsic');
+var $TypeError = require('es-errors/type');
-var $TypeError = GetIntrinsic('%TypeError%');
-
var callBound = require('call-bind/callBound');
var $charAt = callBound('String.prototype.charAt');
var $stringToString = callBound('String.prototype.toString');
var CanonicalNumericIndexString = require('./CanonicalNumericIndexString');
@@ -22,16 +20,16 @@
if (Type(S) === 'Object') {
try {
str = $stringToString(S);
} catch (e) { /**/ }
}
- if (Type(str) !== 'String') {
+ if (typeof str !== 'string') {
throw new $TypeError('Assertion failed: `S` must be a boxed string object');
}
if (!IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
- if (Type(P) !== 'String') {
+ if (typeof P !== 'string') {
return void undefined;
}
var index = CanonicalNumericIndexString(P);
var len = str.length;
if (typeof index === 'undefined' || !IsInteger(index) || isNegativeZero(index) || index < 0 || len <= index) {