node_modules/es-abstract/2022/CodePointAt.js in immosquare-cleaner-0.1.32 vs node_modules/es-abstract/2022/CodePointAt.js in immosquare-cleaner-0.1.38
- old
+ new
@@ -1,23 +1,20 @@
'use strict';
-var GetIntrinsic = require('get-intrinsic');
-
-var $TypeError = GetIntrinsic('%TypeError%');
+var $TypeError = require('es-errors/type');
var callBound = require('call-bind/callBound');
var isLeadingSurrogate = require('../helpers/isLeadingSurrogate');
var isTrailingSurrogate = require('../helpers/isTrailingSurrogate');
-var Type = require('./Type');
var UTF16SurrogatePairToCodePoint = require('./UTF16SurrogatePairToCodePoint');
var $charAt = callBound('String.prototype.charAt');
var $charCodeAt = callBound('String.prototype.charCodeAt');
// https://262.ecma-international.org/12.0/#sec-codepointat
module.exports = function CodePointAt(string, position) {
- if (Type(string) !== 'String') {
+ if (typeof string !== 'string') {
throw new $TypeError('Assertion failed: `string` must be a String');
}
var size = string.length;
if (position < 0 || position >= size) {
throw new $TypeError('Assertion failed: `position` must be >= 0, and < the length of `string`');