@bigbinary/neeto-playwright-commons 1.26.6 → 1.26.8

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/index.d.ts CHANGED
@@ -2870,6 +2870,7 @@ declare class SlashCommandEditorPage {
2870
2870
  private verifyEmojiSelector;
2871
2871
  private verifyImageUploadOption;
2872
2872
  private verifyDividerModifier;
2873
+ private verifyTodoListSelector;
2873
2874
  private slashCommandsAndVerifications;
2874
2875
  private getRandomText;
2875
2876
  private fillRandomText;
package/index.js CHANGED
@@ -3572,10 +3572,32 @@ function requireUtils$4 () {
3572
3572
  hasRequiredUtils$4 = 1;
3573
3573
 
3574
3574
  var formats = /*@__PURE__*/ requireFormats();
3575
+ var getSideChannel = requireSideChannel();
3575
3576
 
3576
3577
  var has = Object.prototype.hasOwnProperty;
3577
3578
  var isArray = Array.isArray;
3578
3579
 
3580
+ // Track objects created from arrayLimit overflow using side-channel
3581
+ // Stores the current max numeric index for O(1) lookup
3582
+ var overflowChannel = getSideChannel();
3583
+
3584
+ var markOverflow = function markOverflow(obj, maxIndex) {
3585
+ overflowChannel.set(obj, maxIndex);
3586
+ return obj;
3587
+ };
3588
+
3589
+ var isOverflow = function isOverflow(obj) {
3590
+ return overflowChannel.has(obj);
3591
+ };
3592
+
3593
+ var getMaxIndex = function getMaxIndex(obj) {
3594
+ return overflowChannel.get(obj);
3595
+ };
3596
+
3597
+ var setMaxIndex = function setMaxIndex(obj, maxIndex) {
3598
+ overflowChannel.set(obj, maxIndex);
3599
+ };
3600
+
3579
3601
  var hexTable = (function () {
3580
3602
  var array = [];
3581
3603
  for (var i = 0; i < 256; ++i) {
@@ -3625,7 +3647,12 @@ function requireUtils$4 () {
3625
3647
  if (isArray(target)) {
3626
3648
  target.push(source);
3627
3649
  } else if (target && typeof target === 'object') {
3628
- if (
3650
+ if (isOverflow(target)) {
3651
+ // Add at next numeric index for overflow objects
3652
+ var newIndex = getMaxIndex(target) + 1;
3653
+ target[newIndex] = source;
3654
+ setMaxIndex(target, newIndex);
3655
+ } else if (
3629
3656
  (options && (options.plainObjects || options.allowPrototypes))
3630
3657
  || !has.call(Object.prototype, source)
3631
3658
  ) {
@@ -3639,6 +3666,18 @@ function requireUtils$4 () {
3639
3666
  }
3640
3667
 
3641
3668
  if (!target || typeof target !== 'object') {
3669
+ if (isOverflow(source)) {
3670
+ // Create new object with target at 0, source values shifted by 1
3671
+ var sourceKeys = Object.keys(source);
3672
+ var result = options && options.plainObjects
3673
+ ? { __proto__: null, 0: target }
3674
+ : { 0: target };
3675
+ for (var m = 0; m < sourceKeys.length; m++) {
3676
+ var oldKey = parseInt(sourceKeys[m], 10);
3677
+ result[oldKey + 1] = source[sourceKeys[m]];
3678
+ }
3679
+ return markOverflow(result, getMaxIndex(source) + 1);
3680
+ }
3642
3681
  return [target].concat(source);
3643
3682
  }
3644
3683
 
@@ -3810,8 +3849,20 @@ function requireUtils$4 () {
3810
3849
  return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
3811
3850
  };
3812
3851
 
3813
- var combine = function combine(a, b) {
3814
- return [].concat(a, b);
3852
+ var combine = function combine(a, b, arrayLimit, plainObjects) {
3853
+ // If 'a' is already an overflow object, add to it
3854
+ if (isOverflow(a)) {
3855
+ var newIndex = getMaxIndex(a) + 1;
3856
+ a[newIndex] = b;
3857
+ setMaxIndex(a, newIndex);
3858
+ return a;
3859
+ }
3860
+
3861
+ var result = [].concat(a, b);
3862
+ if (result.length > arrayLimit) {
3863
+ return markOverflow(arrayToObject(result, { plainObjects: plainObjects }), result.length - 1);
3864
+ }
3865
+ return result;
3815
3866
  };
3816
3867
 
3817
3868
  var maybeMap = function maybeMap(val, fn) {
@@ -3833,6 +3884,7 @@ function requireUtils$4 () {
3833
3884
  decode: decode,
3834
3885
  encode: encode,
3835
3886
  isBuffer: isBuffer,
3887
+ isOverflow: isOverflow,
3836
3888
  isRegExp: isRegExp,
3837
3889
  maybeMap: maybeMap,
3838
3890
  merge: merge
@@ -4319,16 +4371,18 @@ function requireParse$4 () {
4319
4371
  } else {
4320
4372
  key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
4321
4373
 
4322
- val = utils.maybeMap(
4323
- parseArrayValue(
4324
- part.slice(pos + 1),
4325
- options,
4326
- isArray(obj[key]) ? obj[key].length : 0
4327
- ),
4328
- function (encodedVal) {
4329
- return options.decoder(encodedVal, defaults.decoder, charset, 'value');
4330
- }
4331
- );
4374
+ if (key !== null) {
4375
+ val = utils.maybeMap(
4376
+ parseArrayValue(
4377
+ part.slice(pos + 1),
4378
+ options,
4379
+ isArray(obj[key]) ? obj[key].length : 0
4380
+ ),
4381
+ function (encodedVal) {
4382
+ return options.decoder(encodedVal, defaults.decoder, charset, 'value');
4383
+ }
4384
+ );
4385
+ }
4332
4386
  }
4333
4387
 
4334
4388
  if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
@@ -4339,11 +4393,18 @@ function requireParse$4 () {
4339
4393
  val = isArray(val) ? [val] : val;
4340
4394
  }
4341
4395
 
4342
- var existing = has.call(obj, key);
4343
- if (existing && options.duplicates === 'combine') {
4344
- obj[key] = utils.combine(obj[key], val);
4345
- } else if (!existing || options.duplicates === 'last') {
4346
- obj[key] = val;
4396
+ if (key !== null) {
4397
+ var existing = has.call(obj, key);
4398
+ if (existing && options.duplicates === 'combine') {
4399
+ obj[key] = utils.combine(
4400
+ obj[key],
4401
+ val,
4402
+ options.arrayLimit,
4403
+ options.plainObjects
4404
+ );
4405
+ } else if (!existing || options.duplicates === 'last') {
4406
+ obj[key] = val;
4407
+ }
4347
4408
  }
4348
4409
  }
4349
4410
 
@@ -4364,9 +4425,19 @@ function requireParse$4 () {
4364
4425
  var root = chain[i];
4365
4426
 
4366
4427
  if (root === '[]' && options.parseArrays) {
4367
- obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
4368
- ? []
4369
- : utils.combine([], leaf);
4428
+ if (utils.isOverflow(leaf)) {
4429
+ // leaf is already an overflow object, preserve it
4430
+ obj = leaf;
4431
+ } else {
4432
+ obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
4433
+ ? []
4434
+ : utils.combine(
4435
+ [],
4436
+ leaf,
4437
+ options.arrayLimit,
4438
+ options.plainObjects
4439
+ );
4440
+ }
4370
4441
  } else {
4371
4442
  obj = options.plainObjects ? { __proto__: null } : {};
4372
4443
  var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
@@ -4394,29 +4465,28 @@ function requireParse$4 () {
4394
4465
  return leaf;
4395
4466
  };
4396
4467
 
4397
- var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
4398
- if (!givenKey) {
4399
- return;
4400
- }
4401
-
4402
- // Transform dot notation to bracket notation
4468
+ var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) {
4403
4469
  var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
4404
4470
 
4405
- // The regex chunks
4471
+ if (options.depth <= 0) {
4472
+ if (!options.plainObjects && has.call(Object.prototype, key)) {
4473
+ if (!options.allowPrototypes) {
4474
+ return;
4475
+ }
4476
+ }
4477
+
4478
+ return [key];
4479
+ }
4406
4480
 
4407
4481
  var brackets = /(\[[^[\]]*])/;
4408
4482
  var child = /(\[[^[\]]*])/g;
4409
4483
 
4410
- // Get the parent
4411
-
4412
- var segment = options.depth > 0 && brackets.exec(key);
4484
+ var segment = brackets.exec(key);
4413
4485
  var parent = segment ? key.slice(0, segment.index) : key;
4414
4486
 
4415
- // Stash the parent if it exists
4416
-
4417
4487
  var keys = [];
4488
+
4418
4489
  if (parent) {
4419
- // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
4420
4490
  if (!options.plainObjects && has.call(Object.prototype, parent)) {
4421
4491
  if (!options.allowPrototypes) {
4422
4492
  return;
@@ -4426,28 +4496,42 @@ function requireParse$4 () {
4426
4496
  keys.push(parent);
4427
4497
  }
4428
4498
 
4429
- // Loop through children appending to the array until we hit depth
4430
-
4431
4499
  var i = 0;
4432
- while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
4500
+ while ((segment = child.exec(key)) !== null && i < options.depth) {
4433
4501
  i += 1;
4434
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
4502
+
4503
+ var segmentContent = segment[1].slice(1, -1);
4504
+ if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
4435
4505
  if (!options.allowPrototypes) {
4436
4506
  return;
4437
4507
  }
4438
4508
  }
4509
+
4439
4510
  keys.push(segment[1]);
4440
4511
  }
4441
4512
 
4442
- // If there's a remainder, check strictDepth option for throw, else just add whatever is left
4443
-
4444
4513
  if (segment) {
4445
4514
  if (options.strictDepth === true) {
4446
4515
  throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
4447
4516
  }
4517
+
4448
4518
  keys.push('[' + key.slice(segment.index) + ']');
4449
4519
  }
4450
4520
 
4521
+ return keys;
4522
+ };
4523
+
4524
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
4525
+ if (!givenKey) {
4526
+ return;
4527
+ }
4528
+
4529
+ var keys = splitKeyIntoSegments(givenKey, options);
4530
+
4531
+ if (!keys) {
4532
+ return;
4533
+ }
4534
+
4451
4535
  return parseObject(keys, val, options, valuesParsed);
4452
4536
  };
4453
4537
 
@@ -117298,6 +117382,13 @@ class SlashCommandEditorPage {
117298
117382
  return [{ key: "image-upload", value: imagePath }];
117299
117383
  };
117300
117384
  this.verifyDividerModifier = () => expect(this.contentField.locator("hr")).toBeVisible();
117385
+ this.verifyTodoListSelector = async () => {
117386
+ const randomText = await this.fillRandomText();
117387
+ await expect(this.contentField.locator(NEETO_EDITOR_SELECTORS.todoList, {
117388
+ hasText: randomText,
117389
+ })).toBeVisible();
117390
+ return [{ key: "todoList", value: randomText }];
117391
+ };
117301
117392
  this.slashCommandsAndVerifications = {
117302
117393
  normalText: () => this.verifyFontSize("normal"),
117303
117394
  heading1: () => this.verifyFontSize(1),
@@ -117316,6 +117407,7 @@ class SlashCommandEditorPage {
117316
117407
  image: () => this.verifyImageUploadOption(this.filePath),
117317
117408
  emoji: () => this.verifyEmojiSelector(),
117318
117409
  divider: () => this.verifyDividerModifier(),
117410
+ "to-doList": () => this.verifyTodoListSelector(),
117319
117411
  };
117320
117412
  this.getRandomText = () => {
117321
117413
  let randomText;