Update checked-in dependencies
This commit is contained in:
parent
1afca056e3
commit
6989ba7bd2
3942 changed files with 55190 additions and 132206 deletions
11
node_modules/es-abstract/2019/QuoteJSONString.js
generated
vendored
11
node_modules/es-abstract/2019/QuoteJSONString.js
generated
vendored
|
|
@ -1,8 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
var $TypeError = require('es-errors/type');
|
||||
|
||||
var callBound = require('call-bind/callBound');
|
||||
var forEach = require('../helpers/forEach');
|
||||
|
|
@ -12,11 +10,10 @@ var isTrailingSurrogate = require('../helpers/isTrailingSurrogate');
|
|||
var $charCodeAt = callBound('String.prototype.charCodeAt');
|
||||
var $strSplit = callBound('String.prototype.split');
|
||||
|
||||
var Type = require('./Type');
|
||||
var UnicodeEscape = require('./UnicodeEscape');
|
||||
var UTF16Encoding = require('./UTF16Encoding');
|
||||
|
||||
var has = require('has');
|
||||
var hasOwn = require('hasown');
|
||||
|
||||
// https://262.ecma-international.org/10.0/#sec-quotejsonstring
|
||||
|
||||
|
|
@ -31,13 +28,13 @@ var escapes = {
|
|||
};
|
||||
|
||||
module.exports = function QuoteJSONString(value) {
|
||||
if (Type(value) !== 'String') {
|
||||
if (typeof value !== 'string') {
|
||||
throw new $TypeError('Assertion failed: `value` must be a String');
|
||||
}
|
||||
var product = '"';
|
||||
if (value) {
|
||||
forEach($strSplit(value), function (C) {
|
||||
if (has(escapes, C)) {
|
||||
if (hasOwn(escapes, C)) {
|
||||
product += escapes[C];
|
||||
} else {
|
||||
var cCharCode = $charCodeAt(C, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue