@parcel/utils 2.0.0-nightly.1174 → 2.0.0-nightly.1176

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -3084,12 +3084,10 @@ function $6e1ae4ed5b62d1d9$var$parseAsync(str, opts) {
3084
3084
  setImmediate(parseAsyncNext, index, blocksize, resolve, reject);
3085
3085
  });
3086
3086
  function parseAsyncNext(index, blocksize, resolve, reject) {
3087
- if (index >= str.length) {
3088
- try {
3089
- return resolve(parser.finish());
3090
- } catch (err) {
3091
- return reject($ciuZ9(err, str));
3092
- }
3087
+ if (index >= str.length) try {
3088
+ return resolve(parser.finish());
3089
+ } catch (err) {
3090
+ return reject($ciuZ9(err, str));
3093
3091
  }
3094
3092
  try {
3095
3093
  parser.parse(str.slice(index, index + blocksize));
@@ -7396,8 +7394,14 @@ var $ca9d5cba0afae339$var$imix; // inverse mix-columns table
7396
7394
  e2 = xtime[e];
7397
7395
  e4 = xtime[e2];
7398
7396
  e8 = xtime[e4];
7399
- me = sx2 << 24 ^ sx << 16 ^ sx << 8 ^ (sx ^ sx2); // 3
7400
- ime = (e2 ^ e4 ^ e8) << 24 ^ (e ^ e8) << 16 ^ (e ^ e4 ^ e8) << 8 ^ (e ^ e2 ^ e8); // B (11)
7397
+ me = sx2 << 24 ^ // 2
7398
+ sx << 16 ^ // 1
7399
+ sx << 8 ^ // 1
7400
+ (sx ^ sx2); // 3
7401
+ ime = (e2 ^ e4 ^ e8) << 24 ^ // E (14)
7402
+ (e ^ e8) << 16 ^ // 9
7403
+ (e ^ e4 ^ e8) << 8 ^ // D (13)
7404
+ (e ^ e2 ^ e8); // B (11)
7401
7405
  // produce each of the mix tables by rotating the 2,1,1,3 value
7402
7406
  for(var n = 0; n < 4; ++n){
7403
7407
  $ca9d5cba0afae339$var$mix[n][e] = me;
@@ -8663,7 +8667,9 @@ $10862ec0f65326f9$var$_IN("1.3.6.1.5.5.7.3.8", "timeStamping");
8663
8667
  // determine if a non-constructed value should be decoded as a composed
8664
8668
  // value that contains other ASN.1 objects. BIT STRINGs (and OCTET STRINGs)
8665
8669
  // can be used this way.
8666
- if (value === undefined && options.decodeBitStrings && tagClass === $579f29a8775d6845$var$asn1.Class.UNIVERSAL && type === $579f29a8775d6845$var$asn1.Type.BITSTRING /*|| type === asn1.Type.OCTETSTRING*/ && length > 1) {
8670
+ if (value === undefined && options.decodeBitStrings && tagClass === $579f29a8775d6845$var$asn1.Class.UNIVERSAL && // FIXME: OCTET STRINGs not yet supported here
8671
+ // .. other parts of forge expect to decode OCTET STRINGs manually
8672
+ type === $579f29a8775d6845$var$asn1.Type.BITSTRING /*|| type === asn1.Type.OCTETSTRING*/ && length > 1) {
8667
8673
  // save read position
8668
8674
  var savedRead = bytes.read;
8669
8675
  var savedRemaining = remaining;
@@ -8766,7 +8772,9 @@ $10862ec0f65326f9$var$_IN("1.3.6.1.5.5.7.3.8", "timeStamping");
8766
8772
  else // ensure integer is minimally-encoded
8767
8773
  // TODO: should all leading bytes be stripped vs just one?
8768
8774
  // .. ex '00 00 01' => '01'?
8769
- if (obj.type === $579f29a8775d6845$var$asn1.Type.INTEGER && obj.value.length > 1 && (obj.value.charCodeAt(0) === 0 && (obj.value.charCodeAt(1) & 0x80) === 0 || obj.value.charCodeAt(0) === 0xFF && (obj.value.charCodeAt(1) & 0x80) === 0x80)) value.putBytes(obj.value.substr(1));
8775
+ if (obj.type === $579f29a8775d6845$var$asn1.Type.INTEGER && obj.value.length > 1 && // leading 0x00 for positive integer
8776
+ (obj.value.charCodeAt(0) === 0 && (obj.value.charCodeAt(1) & 0x80) === 0 || // leading 0xFF for negative integer
8777
+ obj.value.charCodeAt(0) === 0xFF && (obj.value.charCodeAt(1) & 0x80) === 0x80)) value.putBytes(obj.value.substr(1));
8770
8778
  else value.putBytes(obj.value);
8771
8779
  }
8772
8780
  // add tag byte
@@ -16507,7 +16515,9 @@ var $8ab3548bea1beb81$var$digestInfoValidator = {
16507
16515
  if (hex[0] >= "8") hex = "00" + hex;
16508
16516
  var bytes = $iGlOy.util.hexToBytes(hex);
16509
16517
  // ensure integer is minimally-encoded
16510
- if (bytes.length > 1 && (bytes.charCodeAt(0) === 0 && (bytes.charCodeAt(1) & 0x80) === 0 || bytes.charCodeAt(0) === 0xFF && (bytes.charCodeAt(1) & 0x80) === 0x80)) return bytes.substr(1);
16518
+ if (bytes.length > 1 && // leading 0x00 for positive integer
16519
+ (bytes.charCodeAt(0) === 0 && (bytes.charCodeAt(1) & 0x80) === 0 || // leading 0xFF for negative integer
16520
+ bytes.charCodeAt(0) === 0xFF && (bytes.charCodeAt(1) & 0x80) === 0x80)) return bytes.substr(1);
16511
16521
  return bytes;
16512
16522
  }
16513
16523
  /**
@@ -24447,7 +24457,12 @@ $e55982d45da68b81$var$hsTable[$e55982d45da68b81$var$tls.ConnectionEnd.server] =
24447
24457
  // cipher suites and compression methods size will need to be
24448
24458
  // updated if more get added to the list
24449
24459
  var sessionId = c.session.id;
24450
- var length = sessionId.length + 1 + 2 + 4 + 28 + 2 + cSuites + 1 + cMethods + extLength; // extensions vector
24460
+ var length = sessionId.length + 1 + // session ID vector
24461
+ 2 + // version (major + minor)
24462
+ 4 + 28 + // random time and random bytes
24463
+ 2 + cSuites + // cipher suites vector
24464
+ 1 + cMethods + // compression methods vector
24465
+ extLength; // extensions vector
24451
24466
  // build record fragment
24452
24467
  var rval = $iGlOy.util.createBuffer();
24453
24468
  rval.putByte($e55982d45da68b81$var$tls.HandshakeType.client_hello);
@@ -24470,7 +24485,11 @@ $e55982d45da68b81$var$hsTable[$e55982d45da68b81$var$tls.ConnectionEnd.server] =
24470
24485
  */ $e55982d45da68b81$var$tls.createServerHello = function(c) {
24471
24486
  // determine length of the handshake message
24472
24487
  var sessionId = c.session.id;
24473
- var length = sessionId.length + 1 + 2 + 4 + 28 + 2 + 1; // chosen compression method
24488
+ var length = sessionId.length + 1 + // session ID vector
24489
+ 2 + // version (major + minor)
24490
+ 4 + 28 + // random time and random bytes
24491
+ 2 + // chosen cipher suite
24492
+ 1; // chosen compression method
24474
24493
  // build record fragment
24475
24494
  var rval = $iGlOy.util.createBuffer();
24476
24495
  rval.putByte($e55982d45da68b81$var$tls.HandshakeType.server_hello);
@@ -26626,17 +26645,25 @@ var $33c8fc1a702f0359$var$_states = null;
26626
26645
  hi = w2[0];
26627
26646
  lo = w2[1];
26628
26647
  // high bits
26629
- t1_hi = ((hi >>> 19 | lo << 13) ^ (lo >>> 29 | hi << 3) ^ hi >>> 6) >>> 0; // SHR 6
26648
+ t1_hi = ((hi >>> 19 | lo << 13) ^ // ROTR 19
26649
+ (lo >>> 29 | hi << 3) ^ // ROTR 61/(swap + ROTR 29)
26650
+ hi >>> 6) >>> 0; // SHR 6
26630
26651
  // low bits
26631
- t1_lo = ((hi << 13 | lo >>> 19) ^ (lo << 3 | hi >>> 29) ^ (hi << 26 | lo >>> 6)) >>> 0; // SHR 6
26652
+ t1_lo = ((hi << 13 | lo >>> 19) ^ (// ROTR 19
26653
+ lo << 3 | hi >>> 29) ^ // ROTR 61/(swap + ROTR 29)
26654
+ (hi << 26 | lo >>> 6)) >>> 0; // SHR 6
26632
26655
  // for word 15 words ago: ROTR 1(x) ^ ROTR 8(x) ^ SHR 7(x)
26633
26656
  w15 = w[i - 15];
26634
26657
  hi = w15[0];
26635
26658
  lo = w15[1];
26636
26659
  // high bits
26637
- t2_hi = ((hi >>> 1 | lo << 31) ^ (hi >>> 8 | lo << 24) ^ hi >>> 7) >>> 0; // SHR 7
26660
+ t2_hi = ((hi >>> 1 | lo << 31) ^ // ROTR 1
26661
+ (hi >>> 8 | lo << 24) ^ // ROTR 8
26662
+ hi >>> 7) >>> 0; // SHR 7
26638
26663
  // low bits
26639
- t2_lo = ((hi << 31 | lo >>> 1) ^ (hi << 24 | lo >>> 8) ^ (hi << 25 | lo >>> 7)) >>> 0; // SHR 7
26664
+ t2_lo = ((hi << 31 | lo >>> 1) ^ // ROTR 1
26665
+ (hi << 24 | lo >>> 8) ^ (// ROTR 8
26666
+ hi << 25 | lo >>> 7)) >>> 0; // SHR 7
26640
26667
  // sum(t1, word 7 ago, t2, word 16 ago) modulo 2^64 (carry lo overflow)
26641
26668
  w7 = w[i - 7];
26642
26669
  w16 = w[i - 16];
@@ -26664,14 +26691,22 @@ var $33c8fc1a702f0359$var$_states = null;
26664
26691
  // round function
26665
26692
  for(i = 0; i < 80; ++i){
26666
26693
  // Sum1(e) = ROTR 14(e) ^ ROTR 18(e) ^ ROTR 41(e)
26667
- s1_hi = ((e_hi >>> 14 | e_lo << 18) ^ (e_hi >>> 18 | e_lo << 14) ^ (e_lo >>> 9 | e_hi << 23)) >>> 0; // ROTR 41/(swap + ROTR 9)
26668
- s1_lo = ((e_hi << 18 | e_lo >>> 14) ^ (e_hi << 14 | e_lo >>> 18) ^ (e_lo << 23 | e_hi >>> 9)) >>> 0; // ROTR 41/(swap + ROTR 9)
26694
+ s1_hi = ((e_hi >>> 14 | e_lo << 18) ^ (// ROTR 14
26695
+ e_hi >>> 18 | e_lo << 14) ^ (// ROTR 18
26696
+ e_lo >>> 9 | e_hi << 23)) >>> 0; // ROTR 41/(swap + ROTR 9)
26697
+ s1_lo = ((e_hi << 18 | e_lo >>> 14) ^ // ROTR 14
26698
+ (e_hi << 14 | e_lo >>> 18) ^ (// ROTR 18
26699
+ e_lo << 23 | e_hi >>> 9)) >>> 0; // ROTR 41/(swap + ROTR 9)
26669
26700
  // Ch(e, f, g) (optimized the same way as SHA-1)
26670
26701
  ch_hi = (g_hi ^ e_hi & (f_hi ^ g_hi)) >>> 0;
26671
26702
  ch_lo = (g_lo ^ e_lo & (f_lo ^ g_lo)) >>> 0;
26672
26703
  // Sum0(a) = ROTR 28(a) ^ ROTR 34(a) ^ ROTR 39(a)
26673
- s0_hi = ((a_hi >>> 28 | a_lo << 4) ^ (a_lo >>> 2 | a_hi << 30) ^ (a_lo >>> 7 | a_hi << 25)) >>> 0; // ROTR 39/(swap + ROTR 7)
26674
- s0_lo = ((a_hi << 4 | a_lo >>> 28) ^ (a_lo << 30 | a_hi >>> 2) ^ (a_lo << 25 | a_hi >>> 7)) >>> 0; // ROTR 39/(swap + ROTR 7)
26704
+ s0_hi = ((a_hi >>> 28 | a_lo << 4) ^ (// ROTR 28
26705
+ a_lo >>> 2 | a_hi << 30) ^ // ROTR 34/(swap + ROTR 2)
26706
+ (a_lo >>> 7 | a_hi << 25)) >>> 0; // ROTR 39/(swap + ROTR 7)
26707
+ s0_lo = ((a_hi << 4 | a_lo >>> 28) ^ (// ROTR 28
26708
+ a_lo << 30 | a_hi >>> 2) ^ (// ROTR 34/(swap + ROTR 2)
26709
+ a_lo << 25 | a_hi >>> 7)) >>> 0; // ROTR 39/(swap + ROTR 7)
26675
26710
  // Maj(a, b, c) (optimized the same way as SHA-1)
26676
26711
  maj_hi = (a_hi & b_hi | c_hi & (a_hi ^ b_hi)) >>> 0;
26677
26712
  maj_lo = (a_lo & b_lo | c_lo & (a_lo ^ b_lo)) >>> 0;
@@ -28595,39 +28630,31 @@ $e128d865c5cf51a7$var$p7.createSignedData = function() {
28595
28630
  for(var i = 0; i < msg.signers.length; ++i){
28596
28631
  var signer = msg.signers[i];
28597
28632
  var oid = signer.digestAlgorithm;
28598
- if (!(oid in mds)) {
28599
- // content digest
28600
- mds[oid] = $iGlOy.md[$iGlOy.pki.oids[oid]].create();
28601
- }
28602
- if (signer.authenticatedAttributes.length === 0) {
28603
- // no custom attributes to digest; use content message digest
28604
- signer.md = mds[oid];
28605
- } else {
28606
- // custom attributes to be digested; use own message digest
28607
- // TODO: optimize to just copy message digest state if that
28608
- // feature is ever supported with message digests
28609
- signer.md = $iGlOy.md[$iGlOy.pki.oids[oid]].create();
28610
- }
28633
+ if (!(oid in mds)) // content digest
28634
+ mds[oid] = $iGlOy.md[$iGlOy.pki.oids[oid]].create();
28635
+ if (signer.authenticatedAttributes.length === 0) // no custom attributes to digest; use content message digest
28636
+ signer.md = mds[oid];
28637
+ else // custom attributes to be digested; use own message digest
28638
+ // TODO: optimize to just copy message digest state if that
28639
+ // feature is ever supported with message digests
28640
+ signer.md = $iGlOy.md[$iGlOy.pki.oids[oid]].create();
28611
28641
  }
28612
28642
  // add unique digest algorithm identifiers
28613
28643
  msg.digestAlgorithmIdentifiers = [];
28614
- for(var oid in mds){
28615
- msg.digestAlgorithmIdentifiers.push(// AlgorithmIdentifier
28616
- $e128d865c5cf51a7$var$asn1.create($e128d865c5cf51a7$var$asn1.Class.UNIVERSAL, $e128d865c5cf51a7$var$asn1.Type.SEQUENCE, true, [
28617
- // algorithm
28618
- $e128d865c5cf51a7$var$asn1.create($e128d865c5cf51a7$var$asn1.Class.UNIVERSAL, $e128d865c5cf51a7$var$asn1.Type.OID, false, $e128d865c5cf51a7$var$asn1.oidToDer(oid).getBytes()),
28619
- // parameters (null)
28620
- $e128d865c5cf51a7$var$asn1.create($e128d865c5cf51a7$var$asn1.Class.UNIVERSAL, $e128d865c5cf51a7$var$asn1.Type.NULL, false, "")
28621
- ]));
28622
- }
28644
+ for(var oid in mds)msg.digestAlgorithmIdentifiers.push(// AlgorithmIdentifier
28645
+ $e128d865c5cf51a7$var$asn1.create($e128d865c5cf51a7$var$asn1.Class.UNIVERSAL, $e128d865c5cf51a7$var$asn1.Type.SEQUENCE, true, [
28646
+ // algorithm
28647
+ $e128d865c5cf51a7$var$asn1.create($e128d865c5cf51a7$var$asn1.Class.UNIVERSAL, $e128d865c5cf51a7$var$asn1.Type.OID, false, $e128d865c5cf51a7$var$asn1.oidToDer(oid).getBytes()),
28648
+ // parameters (null)
28649
+ $e128d865c5cf51a7$var$asn1.create($e128d865c5cf51a7$var$asn1.Class.UNIVERSAL, $e128d865c5cf51a7$var$asn1.Type.NULL, false, "")
28650
+ ]));
28623
28651
  return mds;
28624
28652
  }
28625
28653
  function addSignerInfos(mds) {
28626
28654
  var content;
28627
- if (msg.detachedContent) {
28628
- // Signature has been made in detached mode.
28629
- content = msg.detachedContent;
28630
- } else {
28655
+ if (msg.detachedContent) // Signature has been made in detached mode.
28656
+ content = msg.detachedContent;
28657
+ else {
28631
28658
  // Note: ContentInfo is a SEQUENCE with 2 values, second value is
28632
28659
  // the content field and is optional for a ContentInfo but required here
28633
28660
  // since signers are present
@@ -28636,9 +28663,7 @@ $e128d865c5cf51a7$var$p7.createSignedData = function() {
28636
28663
  // skip [0] EXPLICIT content wrapper
28637
28664
  content = content.value[0];
28638
28665
  }
28639
- if (!content) {
28640
- throw new Error("Could not sign PKCS#7 message; there is no content to sign.");
28641
- }
28666
+ if (!content) throw new Error("Could not sign PKCS#7 message; there is no content to sign.");
28642
28667
  // get ContentInfo content type
28643
28668
  var contentType = $e128d865c5cf51a7$var$asn1.derToOid(msg.contentInfo.value[0].value);
28644
28669
  // serialize content
@@ -28650,9 +28675,7 @@ $e128d865c5cf51a7$var$p7.createSignedData = function() {
28650
28675
  $e128d865c5cf51a7$var$asn1.getBerValueLength(bytes);
28651
28676
  bytes = bytes.getBytes();
28652
28677
  // digest content DER value bytes
28653
- for(var oid in mds){
28654
- mds[oid].start().update(bytes);
28655
- }
28678
+ for(var oid in mds)mds[oid].start().update(bytes);
28656
28679
  // sign content
28657
28680
  var signingTime = new Date();
28658
28681
  for(var i = 0; i < msg.signers.length; ++i){
@@ -28660,9 +28683,7 @@ $e128d865c5cf51a7$var$p7.createSignedData = function() {
28660
28683
  if (signer.authenticatedAttributes.length === 0) {
28661
28684
  // if ContentInfo content type is not "Data", then
28662
28685
  // authenticatedAttributes must be present per RFC 2315
28663
- if (contentType !== $iGlOy.pki.oids.data) {
28664
- throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.");
28665
- }
28686
+ if (contentType !== $iGlOy.pki.oids.data) throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.");
28666
28687
  } else {
28667
28688
  // process authenticated attributes
28668
28689
  // [0] IMPLICIT
@@ -28672,14 +28693,11 @@ $e128d865c5cf51a7$var$p7.createSignedData = function() {
28672
28693
  var attrsAsn1 = $e128d865c5cf51a7$var$asn1.create($e128d865c5cf51a7$var$asn1.Class.UNIVERSAL, $e128d865c5cf51a7$var$asn1.Type.SET, true, []);
28673
28694
  for(var ai = 0; ai < signer.authenticatedAttributes.length; ++ai){
28674
28695
  var attr = signer.authenticatedAttributes[ai];
28675
- if (attr.type === $iGlOy.pki.oids.messageDigest) {
28676
- // use content message digest as value
28677
- attr.value = mds[signer.digestAlgorithm].digest();
28678
- } else if (attr.type === $iGlOy.pki.oids.signingTime) {
28679
- // auto-populate signing time if not already set
28680
- if (!attr.value) {
28681
- attr.value = signingTime;
28682
- }
28696
+ if (attr.type === $iGlOy.pki.oids.messageDigest) // use content message digest as value
28697
+ attr.value = mds[signer.digestAlgorithm].digest();
28698
+ else if (attr.type === $iGlOy.pki.oids.signingTime) // auto-populate signing time if not already set
28699
+ {
28700
+ if (!attr.value) attr.value = signingTime;
28683
28701
  }
28684
28702
  // convert to ASN.1 and push onto Attributes SET (for signing) and
28685
28703
  // onto authenticatedAttributesAsn1 to complete SignedData ASN.1
@@ -32157,27 +32175,17 @@ function $4609f2cae016f1ac$var$fastqueue(context, worker, concurrency) {
32157
32175
  }
32158
32176
  }
32159
32177
  function release(holder) {
32160
- if (holder) {
32161
- cache.release(holder);
32162
- }
32178
+ if (holder) cache.release(holder);
32163
32179
  var next = queueHead;
32164
32180
  if (next) {
32165
32181
  if (!self.paused) {
32166
- if (queueTail === queueHead) {
32167
- queueTail = null;
32168
- }
32182
+ if (queueTail === queueHead) queueTail = null;
32169
32183
  queueHead = next.next;
32170
32184
  next.next = null;
32171
32185
  worker.call(context, next.value, next.worked);
32172
- if (queueTail === null) {
32173
- self.empty();
32174
- }
32175
- } else {
32176
- _running--;
32177
- }
32178
- } else if (--_running === 0) {
32179
- self.drain();
32180
- }
32186
+ if (queueTail === null) self.empty();
32187
+ } else _running--;
32188
+ } else if (--_running === 0) self.drain();
32181
32189
  }
32182
32190
  function kill() {
32183
32191
  queueHead = null;
@@ -35332,22 +35340,13 @@ var $5dc3ee1f90b35876$var$stringify = function stringify(value, replacer, space)
35332
35340
  function serializeProperty(key, holder) {
35333
35341
  let value = holder[key];
35334
35342
  if (value != null) {
35335
- if (typeof value.toJSON5 === "function") {
35336
- value = value.toJSON5(key);
35337
- } else if (typeof value.toJSON === "function") {
35338
- value = value.toJSON(key);
35339
- }
35340
- }
35341
- if (replacerFunc) {
35342
- value = replacerFunc.call(holder, key, value);
35343
- }
35344
- if (value instanceof Number) {
35345
- value = Number(value);
35346
- } else if (value instanceof String) {
35347
- value = String(value);
35348
- } else if (value instanceof Boolean) {
35349
- value = value.valueOf();
35343
+ if (typeof value.toJSON5 === "function") value = value.toJSON5(key);
35344
+ else if (typeof value.toJSON === "function") value = value.toJSON(key);
35350
35345
  }
35346
+ if (replacerFunc) value = replacerFunc.call(holder, key, value);
35347
+ if (value instanceof Number) value = Number(value);
35348
+ else if (value instanceof String) value = String(value);
35349
+ else if (value instanceof Boolean) value = value.valueOf();
35351
35350
  switch(value){
35352
35351
  case null:
35353
35352
  return "null";
@@ -35356,15 +35355,9 @@ var $5dc3ee1f90b35876$var$stringify = function stringify(value, replacer, space)
35356
35355
  case false:
35357
35356
  return "false";
35358
35357
  }
35359
- if (typeof value === "string") {
35360
- return quoteString(value, false);
35361
- }
35362
- if (typeof value === "number") {
35363
- return String(value);
35364
- }
35365
- if (typeof value === "object") {
35366
- return Array.isArray(value) ? serializeArray(value) : serializeObject(value);
35367
- }
35358
+ if (typeof value === "string") return quoteString(value, false);
35359
+ if (typeof value === "number") return String(value);
35360
+ if (typeof value === "object") return Array.isArray(value) ? serializeArray(value) : serializeObject(value);
35368
35361
  return undefined;
35369
35362
  }
35370
35363
  function quoteString(value) {
@@ -35417,9 +35410,7 @@ var $5dc3ee1f90b35876$var$stringify = function stringify(value, replacer, space)
35417
35410
  return quoteChar + product + quoteChar;
35418
35411
  }
35419
35412
  function serializeObject(value) {
35420
- if (stack.indexOf(value) >= 0) {
35421
- throw TypeError("Converting circular structure to JSON5");
35422
- }
35413
+ if (stack.indexOf(value) >= 0) throw TypeError("Converting circular structure to JSON5");
35423
35414
  stack.push(value);
35424
35415
  let stepback = indent;
35425
35416
  indent = indent + gap;
@@ -35429,17 +35420,14 @@ var $5dc3ee1f90b35876$var$stringify = function stringify(value, replacer, space)
35429
35420
  const propertyString = serializeProperty(key, value);
35430
35421
  if (propertyString !== undefined) {
35431
35422
  let member = serializeKey(key) + ":";
35432
- if (gap !== "") {
35433
- member += " ";
35434
- }
35423
+ if (gap !== "") member += " ";
35435
35424
  member += propertyString;
35436
35425
  partial.push(member);
35437
35426
  }
35438
35427
  }
35439
35428
  let final;
35440
- if (partial.length === 0) {
35441
- final = "{}";
35442
- } else {
35429
+ if (partial.length === 0) final = "{}";
35430
+ else {
35443
35431
  let properties;
35444
35432
  if (gap === "") {
35445
35433
  properties = partial.join(",");
@@ -35455,24 +35443,16 @@ var $5dc3ee1f90b35876$var$stringify = function stringify(value, replacer, space)
35455
35443
  return final;
35456
35444
  }
35457
35445
  function serializeKey(key) {
35458
- if (key.length === 0) {
35459
- return quoteString(key, true);
35460
- }
35446
+ if (key.length === 0) return quoteString(key, true);
35461
35447
  const firstChar = String.fromCodePoint(key.codePointAt(0));
35462
- if (!$5dc3ee1f90b35876$var$util.isIdStartChar(firstChar)) {
35463
- return quoteString(key, true);
35464
- }
35448
+ if (!$5dc3ee1f90b35876$var$util.isIdStartChar(firstChar)) return quoteString(key, true);
35465
35449
  for(let i = firstChar.length; i < key.length; i++){
35466
- if (!$5dc3ee1f90b35876$var$util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
35467
- return quoteString(key, true);
35468
- }
35450
+ if (!$5dc3ee1f90b35876$var$util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) return quoteString(key, true);
35469
35451
  }
35470
35452
  return key;
35471
35453
  }
35472
35454
  function serializeArray(value) {
35473
- if (stack.indexOf(value) >= 0) {
35474
- throw TypeError("Converting circular structure to JSON5");
35475
- }
35455
+ if (stack.indexOf(value) >= 0) throw TypeError("Converting circular structure to JSON5");
35476
35456
  stack.push(value);
35477
35457
  let stepback = indent;
35478
35458
  indent = indent + gap;
@@ -35482,17 +35462,14 @@ var $5dc3ee1f90b35876$var$stringify = function stringify(value, replacer, space)
35482
35462
  partial.push(propertyString !== undefined ? propertyString : "null");
35483
35463
  }
35484
35464
  let final;
35485
- if (partial.length === 0) {
35486
- final = "[]";
35465
+ if (partial.length === 0) final = "[]";
35466
+ else if (gap === "") {
35467
+ let properties = partial.join(",");
35468
+ final = "[" + properties + "]";
35487
35469
  } else {
35488
- if (gap === "") {
35489
- let properties = partial.join(",");
35490
- final = "[" + properties + "]";
35491
- } else {
35492
- let separator = ",\n" + indent;
35493
- let properties1 = partial.join(separator);
35494
- final = "[\n" + indent + properties1 + ",\n" + stepback + "]";
35495
- }
35470
+ let separator = ",\n" + indent;
35471
+ let properties1 = partial.join(separator);
35472
+ final = "[\n" + indent + properties1 + ",\n" + stepback + "]";
35496
35473
  }
35497
35474
  stack.pop();
35498
35475
  indent = stepback;