Update checked-in dependencies
This commit is contained in:
parent
1afca056e3
commit
6989ba7bd2
3942 changed files with 55190 additions and 132206 deletions
18
node_modules/es-abstract/2015/Canonicalize.js
generated
vendored
18
node_modules/es-abstract/2015/Canonicalize.js
generated
vendored
|
|
@ -1,27 +1,23 @@
|
|||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
var $TypeError = require('es-errors/type');
|
||||
|
||||
var callBound = require('call-bind/callBound');
|
||||
var has = require('has');
|
||||
var hasOwn = require('hasown');
|
||||
|
||||
var $charCodeAt = callBound('String.prototype.charCodeAt');
|
||||
var $toUpperCase = callBound('String.prototype.toUpperCase');
|
||||
|
||||
var Type = require('./Type');
|
||||
|
||||
var caseFolding = require('../helpers/caseFolding');
|
||||
var caseFolding = require('../helpers/caseFolding.json');
|
||||
|
||||
// https://262.ecma-international.org/6.0/#sec-runtime-semantics-canonicalize-ch
|
||||
|
||||
module.exports = function Canonicalize(ch, IgnoreCase, Unicode) {
|
||||
if (Type(ch) !== 'String') {
|
||||
if (typeof ch !== 'string') {
|
||||
throw new $TypeError('Assertion failed: `ch` must be a character');
|
||||
}
|
||||
|
||||
if (Type(IgnoreCase) !== 'Boolean' || Type(Unicode) !== 'Boolean') {
|
||||
if (typeof IgnoreCase !== 'boolean' || typeof Unicode !== 'boolean') {
|
||||
throw new $TypeError('Assertion failed: `IgnoreCase` and `Unicode` must be Booleans');
|
||||
}
|
||||
|
||||
|
|
@ -30,10 +26,10 @@ module.exports = function Canonicalize(ch, IgnoreCase, Unicode) {
|
|||
}
|
||||
|
||||
if (Unicode) { // step 2
|
||||
if (has(caseFolding.C, ch)) {
|
||||
if (hasOwn(caseFolding.C, ch)) {
|
||||
return caseFolding.C[ch];
|
||||
}
|
||||
if (has(caseFolding.S, ch)) {
|
||||
if (hasOwn(caseFolding.S, ch)) {
|
||||
return caseFolding.S[ch];
|
||||
}
|
||||
return ch; // step 2.b
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue