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

- old
+ new

@@ -1,29 +1,25 @@ 'use strict'; -var GetIntrinsic = require('get-intrinsic'); - -var Type = require('./Type'); - var isInteger = require('../helpers/isInteger'); var isLeadingSurrogate = require('../helpers/isLeadingSurrogate'); var isTrailingSurrogate = require('../helpers/isTrailingSurrogate'); var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger'); -var $TypeError = GetIntrinsic('%TypeError%'); +var $TypeError = require('es-errors/type'); var $charCodeAt = require('call-bind/callBound')('String.prototype.charCodeAt'); // https://262.ecma-international.org/6.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; }