node_modules/es-abstract/2023/AdvanceStringIndex.js in immosquare-cleaner-0.1.32 vs node_modules/es-abstract/2023/AdvanceStringIndex.js in immosquare-cleaner-0.1.38

- old
+ new

@@ -1,26 +1,23 @@ 'use strict'; -var GetIntrinsic = require('get-intrinsic'); - var CodePointAt = require('./CodePointAt'); -var Type = require('./Type'); var isInteger = require('../helpers/isInteger'); var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); -var $TypeError = GetIntrinsic('%TypeError%'); +var $TypeError = require('es-errors/type'); // https://262.ecma-international.org/12.0/#sec-advancestringindex module.exports = function AdvanceStringIndex(S, index, unicode) { - if (Type(S) !== 'String') { + if (typeof S !== 'string') { throw new $TypeError('Assertion failed: `S` must be a String'); } if (!isInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53'); } - if (Type(unicode) !== 'Boolean') { + if (typeof unicode !== 'boolean') { throw new $TypeError('Assertion failed: `unicode` must be a Boolean'); } if (!unicode) { return index + 1; }