@tanstack/vue-query 4.10.1 → 4.10.2
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/README.md +1 -1
- package/build/lib/devtools/devtools.esm.js +4 -6
- package/build/lib/devtools/devtools.esm.js.map +1 -1
- package/build/lib/devtools/devtools.js +4 -6
- package/build/lib/devtools/devtools.js.map +1 -1
- package/build/lib/devtools/devtools.mjs +4 -6
- package/build/lib/devtools/devtools.mjs.map +1 -1
- package/build/lib/devtools/utils.esm.js +1 -1
- package/build/lib/devtools/utils.esm.js.map +1 -1
- package/build/lib/devtools/utils.js +1 -1
- package/build/lib/devtools/utils.js.map +1 -1
- package/build/lib/devtools/utils.mjs +1 -1
- package/build/lib/devtools/utils.mjs.map +1 -1
- package/build/umd/index.development.js +511 -664
- package/build/umd/index.development.js.map +1 -1
- package/package.json +2 -2
|
@@ -3529,446 +3529,432 @@
|
|
|
3529
3529
|
}
|
|
3530
3530
|
}
|
|
3531
3531
|
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3532
|
+
/**
|
|
3533
|
+
* match-sorter-utils
|
|
3534
|
+
*
|
|
3535
|
+
* Copyright (c) TanStack
|
|
3536
|
+
*
|
|
3537
|
+
* This source code is licensed under the MIT license found in the
|
|
3538
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
3539
|
+
*
|
|
3540
|
+
* @license MIT
|
|
3541
|
+
*/
|
|
3542
|
+
const characterMap = {
|
|
3543
|
+
À: 'A',
|
|
3544
|
+
Á: 'A',
|
|
3545
|
+
Â: 'A',
|
|
3546
|
+
Ã: 'A',
|
|
3547
|
+
Ä: 'A',
|
|
3548
|
+
Å: 'A',
|
|
3549
|
+
Ấ: 'A',
|
|
3550
|
+
Ắ: 'A',
|
|
3551
|
+
Ẳ: 'A',
|
|
3552
|
+
Ẵ: 'A',
|
|
3553
|
+
Ặ: 'A',
|
|
3554
|
+
Æ: 'AE',
|
|
3555
|
+
Ầ: 'A',
|
|
3556
|
+
Ằ: 'A',
|
|
3557
|
+
Ȃ: 'A',
|
|
3558
|
+
Ç: 'C',
|
|
3559
|
+
Ḉ: 'C',
|
|
3560
|
+
È: 'E',
|
|
3561
|
+
É: 'E',
|
|
3562
|
+
Ê: 'E',
|
|
3563
|
+
Ë: 'E',
|
|
3564
|
+
Ế: 'E',
|
|
3565
|
+
Ḗ: 'E',
|
|
3566
|
+
Ề: 'E',
|
|
3567
|
+
Ḕ: 'E',
|
|
3568
|
+
Ḝ: 'E',
|
|
3569
|
+
Ȇ: 'E',
|
|
3570
|
+
Ì: 'I',
|
|
3571
|
+
Í: 'I',
|
|
3572
|
+
Î: 'I',
|
|
3573
|
+
Ï: 'I',
|
|
3574
|
+
Ḯ: 'I',
|
|
3575
|
+
Ȋ: 'I',
|
|
3576
|
+
Ð: 'D',
|
|
3577
|
+
Ñ: 'N',
|
|
3578
|
+
Ò: 'O',
|
|
3579
|
+
Ó: 'O',
|
|
3580
|
+
Ô: 'O',
|
|
3581
|
+
Õ: 'O',
|
|
3582
|
+
Ö: 'O',
|
|
3583
|
+
Ø: 'O',
|
|
3584
|
+
Ố: 'O',
|
|
3585
|
+
Ṍ: 'O',
|
|
3586
|
+
Ṓ: 'O',
|
|
3587
|
+
Ȏ: 'O',
|
|
3588
|
+
Ù: 'U',
|
|
3589
|
+
Ú: 'U',
|
|
3590
|
+
Û: 'U',
|
|
3591
|
+
Ü: 'U',
|
|
3592
|
+
Ý: 'Y',
|
|
3593
|
+
à: 'a',
|
|
3594
|
+
á: 'a',
|
|
3595
|
+
â: 'a',
|
|
3596
|
+
ã: 'a',
|
|
3597
|
+
ä: 'a',
|
|
3598
|
+
å: 'a',
|
|
3599
|
+
ấ: 'a',
|
|
3600
|
+
ắ: 'a',
|
|
3601
|
+
ẳ: 'a',
|
|
3602
|
+
ẵ: 'a',
|
|
3603
|
+
ặ: 'a',
|
|
3604
|
+
æ: 'ae',
|
|
3605
|
+
ầ: 'a',
|
|
3606
|
+
ằ: 'a',
|
|
3607
|
+
ȃ: 'a',
|
|
3608
|
+
ç: 'c',
|
|
3609
|
+
ḉ: 'c',
|
|
3610
|
+
è: 'e',
|
|
3611
|
+
é: 'e',
|
|
3612
|
+
ê: 'e',
|
|
3613
|
+
ë: 'e',
|
|
3614
|
+
ế: 'e',
|
|
3615
|
+
ḗ: 'e',
|
|
3616
|
+
ề: 'e',
|
|
3617
|
+
ḕ: 'e',
|
|
3618
|
+
ḝ: 'e',
|
|
3619
|
+
ȇ: 'e',
|
|
3620
|
+
ì: 'i',
|
|
3621
|
+
í: 'i',
|
|
3622
|
+
î: 'i',
|
|
3623
|
+
ï: 'i',
|
|
3624
|
+
ḯ: 'i',
|
|
3625
|
+
ȋ: 'i',
|
|
3626
|
+
ð: 'd',
|
|
3627
|
+
ñ: 'n',
|
|
3628
|
+
ò: 'o',
|
|
3629
|
+
ó: 'o',
|
|
3630
|
+
ô: 'o',
|
|
3631
|
+
õ: 'o',
|
|
3632
|
+
ö: 'o',
|
|
3633
|
+
ø: 'o',
|
|
3634
|
+
ố: 'o',
|
|
3635
|
+
ṍ: 'o',
|
|
3636
|
+
ṓ: 'o',
|
|
3637
|
+
ȏ: 'o',
|
|
3638
|
+
ù: 'u',
|
|
3639
|
+
ú: 'u',
|
|
3640
|
+
û: 'u',
|
|
3641
|
+
ü: 'u',
|
|
3642
|
+
ý: 'y',
|
|
3643
|
+
ÿ: 'y',
|
|
3644
|
+
Ā: 'A',
|
|
3645
|
+
ā: 'a',
|
|
3646
|
+
Ă: 'A',
|
|
3647
|
+
ă: 'a',
|
|
3648
|
+
Ą: 'A',
|
|
3649
|
+
ą: 'a',
|
|
3650
|
+
Ć: 'C',
|
|
3651
|
+
ć: 'c',
|
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Q',
|
|
3901
|
+
q̌: 'q',
|
|
3902
|
+
Ř̩: 'R',
|
|
3903
|
+
ř̩: 'r',
|
|
3904
|
+
Ṧ: 'S',
|
|
3905
|
+
ṧ: 's',
|
|
3906
|
+
V̌: 'V',
|
|
3907
|
+
v̌: 'v',
|
|
3908
|
+
W̌: 'W',
|
|
3909
|
+
w̌: 'w',
|
|
3910
|
+
X̌: 'X',
|
|
3911
|
+
x̌: 'x',
|
|
3912
|
+
Y̌: 'Y',
|
|
3913
|
+
y̌: 'y',
|
|
3914
|
+
A̧: 'A',
|
|
3915
|
+
a̧: 'a',
|
|
3916
|
+
B̧: 'B',
|
|
3917
|
+
b̧: 'b',
|
|
3918
|
+
Ḑ: 'D',
|
|
3919
|
+
ḑ: 'd',
|
|
3920
|
+
Ȩ: 'E',
|
|
3921
|
+
ȩ: 'e',
|
|
3922
|
+
Ɛ̧: 'E',
|
|
3923
|
+
ɛ̧: 'e',
|
|
3924
|
+
Ḩ: 'H',
|
|
3925
|
+
ḩ: 'h',
|
|
3926
|
+
I̧: 'I',
|
|
3927
|
+
i̧: 'i',
|
|
3928
|
+
Ɨ̧: 'I',
|
|
3929
|
+
ɨ̧: 'i',
|
|
3930
|
+
M̧: 'M',
|
|
3931
|
+
m̧: 'm',
|
|
3932
|
+
O̧: 'O',
|
|
3933
|
+
o̧: 'o',
|
|
3934
|
+
Q̧: 'Q',
|
|
3935
|
+
q̧: 'q',
|
|
3936
|
+
U̧: 'U',
|
|
3937
|
+
u̧: 'u',
|
|
3938
|
+
X̧: 'X',
|
|
3939
|
+
x̧: 'x',
|
|
3940
|
+
Z̧: 'Z',
|
|
3941
|
+
z̧: 'z'
|
|
3942
|
+
};
|
|
3943
|
+
const chars = Object.keys(characterMap).join('|');
|
|
3944
|
+
const allAccents = new RegExp(chars, 'g');
|
|
3945
|
+
function removeAccents(str) {
|
|
3946
|
+
return str.replace(allAccents, match => {
|
|
3947
|
+
return characterMap[match];
|
|
3948
|
+
});
|
|
3547
3949
|
}
|
|
3548
3950
|
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
"Ä": "A",
|
|
3557
|
-
"Å": "A",
|
|
3558
|
-
"Ấ": "A",
|
|
3559
|
-
"Ắ": "A",
|
|
3560
|
-
"Ẳ": "A",
|
|
3561
|
-
"Ẵ": "A",
|
|
3562
|
-
"Ặ": "A",
|
|
3563
|
-
"Æ": "AE",
|
|
3564
|
-
"Ầ": "A",
|
|
3565
|
-
"Ằ": "A",
|
|
3566
|
-
"Ȃ": "A",
|
|
3567
|
-
"Ç": "C",
|
|
3568
|
-
"Ḉ": "C",
|
|
3569
|
-
"È": "E",
|
|
3570
|
-
"É": "E",
|
|
3571
|
-
"Ê": "E",
|
|
3572
|
-
"Ë": "E",
|
|
3573
|
-
"Ế": "E",
|
|
3574
|
-
"Ḗ": "E",
|
|
3575
|
-
"Ề": "E",
|
|
3576
|
-
"Ḕ": "E",
|
|
3577
|
-
"Ḝ": "E",
|
|
3578
|
-
"Ȇ": "E",
|
|
3579
|
-
"Ì": "I",
|
|
3580
|
-
"Í": "I",
|
|
3581
|
-
"Î": "I",
|
|
3582
|
-
"Ï": "I",
|
|
3583
|
-
"Ḯ": "I",
|
|
3584
|
-
"Ȋ": "I",
|
|
3585
|
-
"Ð": "D",
|
|
3586
|
-
"Ñ": "N",
|
|
3587
|
-
"Ò": "O",
|
|
3588
|
-
"Ó": "O",
|
|
3589
|
-
"Ô": "O",
|
|
3590
|
-
"Õ": "O",
|
|
3591
|
-
"Ö": "O",
|
|
3592
|
-
"Ø": "O",
|
|
3593
|
-
"Ố": "O",
|
|
3594
|
-
"Ṍ": "O",
|
|
3595
|
-
"Ṓ": "O",
|
|
3596
|
-
"Ȏ": "O",
|
|
3597
|
-
"Ù": "U",
|
|
3598
|
-
"Ú": "U",
|
|
3599
|
-
"Û": "U",
|
|
3600
|
-
"Ü": "U",
|
|
3601
|
-
"Ý": "Y",
|
|
3602
|
-
"à": "a",
|
|
3603
|
-
"á": "a",
|
|
3604
|
-
"â": "a",
|
|
3605
|
-
"ã": "a",
|
|
3606
|
-
"ä": "a",
|
|
3607
|
-
"å": "a",
|
|
3608
|
-
"ấ": "a",
|
|
3609
|
-
"ắ": "a",
|
|
3610
|
-
"ẳ": "a",
|
|
3611
|
-
"ẵ": "a",
|
|
3612
|
-
"ặ": "a",
|
|
3613
|
-
"æ": "ae",
|
|
3614
|
-
"ầ": "a",
|
|
3615
|
-
"ằ": "a",
|
|
3616
|
-
"ȃ": "a",
|
|
3617
|
-
"ç": "c",
|
|
3618
|
-
"ḉ": "c",
|
|
3619
|
-
"è": "e",
|
|
3620
|
-
"é": "e",
|
|
3621
|
-
"ê": "e",
|
|
3622
|
-
"ë": "e",
|
|
3623
|
-
"ế": "e",
|
|
3624
|
-
"ḗ": "e",
|
|
3625
|
-
"ề": "e",
|
|
3626
|
-
"ḕ": "e",
|
|
3627
|
-
"ḝ": "e",
|
|
3628
|
-
"ȇ": "e",
|
|
3629
|
-
"ì": "i",
|
|
3630
|
-
"í": "i",
|
|
3631
|
-
"î": "i",
|
|
3632
|
-
"ï": "i",
|
|
3633
|
-
"ḯ": "i",
|
|
3634
|
-
"ȋ": "i",
|
|
3635
|
-
"ð": "d",
|
|
3636
|
-
"ñ": "n",
|
|
3637
|
-
"ò": "o",
|
|
3638
|
-
"ó": "o",
|
|
3639
|
-
"ô": "o",
|
|
3640
|
-
"õ": "o",
|
|
3641
|
-
"ö": "o",
|
|
3642
|
-
"ø": "o",
|
|
3643
|
-
"ố": "o",
|
|
3644
|
-
"ṍ": "o",
|
|
3645
|
-
"ṓ": "o",
|
|
3646
|
-
"ȏ": "o",
|
|
3647
|
-
"ù": "u",
|
|
3648
|
-
"ú": "u",
|
|
3649
|
-
"û": "u",
|
|
3650
|
-
"ü": "u",
|
|
3651
|
-
"ý": "y",
|
|
3652
|
-
"ÿ": "y",
|
|
3653
|
-
"Ā": "A",
|
|
3654
|
-
"ā": "a",
|
|
3655
|
-
"Ă": "A",
|
|
3656
|
-
"ă": "a",
|
|
3657
|
-
"Ą": "A",
|
|
3658
|
-
"ą": "a",
|
|
3659
|
-
"Ć": "C",
|
|
3660
|
-
"ć": "c",
|
|
3661
|
-
"Ĉ": "C",
|
|
3662
|
-
"ĉ": "c",
|
|
3663
|
-
"Ċ": "C",
|
|
3664
|
-
"ċ": "c",
|
|
3665
|
-
"Č": "C",
|
|
3666
|
-
"č": "c",
|
|
3667
|
-
"C̆": "C",
|
|
3668
|
-
"c̆": "c",
|
|
3669
|
-
"Ď": "D",
|
|
3670
|
-
"ď": "d",
|
|
3671
|
-
"Đ": "D",
|
|
3672
|
-
"đ": "d",
|
|
3673
|
-
"Ē": "E",
|
|
3674
|
-
"ē": "e",
|
|
3675
|
-
"Ĕ": "E",
|
|
3676
|
-
"ĕ": "e",
|
|
3677
|
-
"Ė": "E",
|
|
3678
|
-
"ė": "e",
|
|
3679
|
-
"Ę": "E",
|
|
3680
|
-
"ę": "e",
|
|
3681
|
-
"Ě": "E",
|
|
3682
|
-
"ě": "e",
|
|
3683
|
-
"Ĝ": "G",
|
|
3684
|
-
"Ǵ": "G",
|
|
3685
|
-
"ĝ": "g",
|
|
3686
|
-
"ǵ": "g",
|
|
3687
|
-
"Ğ": "G",
|
|
3688
|
-
"ğ": "g",
|
|
3689
|
-
"Ġ": "G",
|
|
3690
|
-
"ġ": "g",
|
|
3691
|
-
"Ģ": "G",
|
|
3692
|
-
"ģ": "g",
|
|
3693
|
-
"Ĥ": "H",
|
|
3694
|
-
"ĥ": "h",
|
|
3695
|
-
"Ħ": "H",
|
|
3696
|
-
"ħ": "h",
|
|
3697
|
-
"Ḫ": "H",
|
|
3698
|
-
"ḫ": "h",
|
|
3699
|
-
"Ĩ": "I",
|
|
3700
|
-
"ĩ": "i",
|
|
3701
|
-
"Ī": "I",
|
|
3702
|
-
"ī": "i",
|
|
3703
|
-
"Ĭ": "I",
|
|
3704
|
-
"ĭ": "i",
|
|
3705
|
-
"Į": "I",
|
|
3706
|
-
"į": "i",
|
|
3707
|
-
"İ": "I",
|
|
3708
|
-
"ı": "i",
|
|
3709
|
-
"IJ": "IJ",
|
|
3710
|
-
"ij": "ij",
|
|
3711
|
-
"Ĵ": "J",
|
|
3712
|
-
"ĵ": "j",
|
|
3713
|
-
"Ķ": "K",
|
|
3714
|
-
"ķ": "k",
|
|
3715
|
-
"Ḱ": "K",
|
|
3716
|
-
"ḱ": "k",
|
|
3717
|
-
"K̆": "K",
|
|
3718
|
-
"k̆": "k",
|
|
3719
|
-
"Ĺ": "L",
|
|
3720
|
-
"ĺ": "l",
|
|
3721
|
-
"Ļ": "L",
|
|
3722
|
-
"ļ": "l",
|
|
3723
|
-
"Ľ": "L",
|
|
3724
|
-
"ľ": "l",
|
|
3725
|
-
"Ŀ": "L",
|
|
3726
|
-
"ŀ": "l",
|
|
3727
|
-
"Ł": "l",
|
|
3728
|
-
"ł": "l",
|
|
3729
|
-
"Ḿ": "M",
|
|
3730
|
-
"ḿ": "m",
|
|
3731
|
-
"M̆": "M",
|
|
3732
|
-
"m̆": "m",
|
|
3733
|
-
"Ń": "N",
|
|
3734
|
-
"ń": "n",
|
|
3735
|
-
"Ņ": "N",
|
|
3736
|
-
"ņ": "n",
|
|
3737
|
-
"Ň": "N",
|
|
3738
|
-
"ň": "n",
|
|
3739
|
-
"ʼn": "n",
|
|
3740
|
-
"N̆": "N",
|
|
3741
|
-
"n̆": "n",
|
|
3742
|
-
"Ō": "O",
|
|
3743
|
-
"ō": "o",
|
|
3744
|
-
"Ŏ": "O",
|
|
3745
|
-
"ŏ": "o",
|
|
3746
|
-
"Ő": "O",
|
|
3747
|
-
"ő": "o",
|
|
3748
|
-
"Œ": "OE",
|
|
3749
|
-
"œ": "oe",
|
|
3750
|
-
"P̆": "P",
|
|
3751
|
-
"p̆": "p",
|
|
3752
|
-
"Ŕ": "R",
|
|
3753
|
-
"ŕ": "r",
|
|
3754
|
-
"Ŗ": "R",
|
|
3755
|
-
"ŗ": "r",
|
|
3756
|
-
"Ř": "R",
|
|
3757
|
-
"ř": "r",
|
|
3758
|
-
"R̆": "R",
|
|
3759
|
-
"r̆": "r",
|
|
3760
|
-
"Ȓ": "R",
|
|
3761
|
-
"ȓ": "r",
|
|
3762
|
-
"Ś": "S",
|
|
3763
|
-
"ś": "s",
|
|
3764
|
-
"Ŝ": "S",
|
|
3765
|
-
"ŝ": "s",
|
|
3766
|
-
"Ş": "S",
|
|
3767
|
-
"Ș": "S",
|
|
3768
|
-
"ș": "s",
|
|
3769
|
-
"ş": "s",
|
|
3770
|
-
"Š": "S",
|
|
3771
|
-
"š": "s",
|
|
3772
|
-
"Ţ": "T",
|
|
3773
|
-
"ţ": "t",
|
|
3774
|
-
"ț": "t",
|
|
3775
|
-
"Ț": "T",
|
|
3776
|
-
"Ť": "T",
|
|
3777
|
-
"ť": "t",
|
|
3778
|
-
"Ŧ": "T",
|
|
3779
|
-
"ŧ": "t",
|
|
3780
|
-
"T̆": "T",
|
|
3781
|
-
"t̆": "t",
|
|
3782
|
-
"Ũ": "U",
|
|
3783
|
-
"ũ": "u",
|
|
3784
|
-
"Ū": "U",
|
|
3785
|
-
"ū": "u",
|
|
3786
|
-
"Ŭ": "U",
|
|
3787
|
-
"ŭ": "u",
|
|
3788
|
-
"Ů": "U",
|
|
3789
|
-
"ů": "u",
|
|
3790
|
-
"Ű": "U",
|
|
3791
|
-
"ű": "u",
|
|
3792
|
-
"Ų": "U",
|
|
3793
|
-
"ų": "u",
|
|
3794
|
-
"Ȗ": "U",
|
|
3795
|
-
"ȗ": "u",
|
|
3796
|
-
"V̆": "V",
|
|
3797
|
-
"v̆": "v",
|
|
3798
|
-
"Ŵ": "W",
|
|
3799
|
-
"ŵ": "w",
|
|
3800
|
-
"Ẃ": "W",
|
|
3801
|
-
"ẃ": "w",
|
|
3802
|
-
"X̆": "X",
|
|
3803
|
-
"x̆": "x",
|
|
3804
|
-
"Ŷ": "Y",
|
|
3805
|
-
"ŷ": "y",
|
|
3806
|
-
"Ÿ": "Y",
|
|
3807
|
-
"Y̆": "Y",
|
|
3808
|
-
"y̆": "y",
|
|
3809
|
-
"Ź": "Z",
|
|
3810
|
-
"ź": "z",
|
|
3811
|
-
"Ż": "Z",
|
|
3812
|
-
"ż": "z",
|
|
3813
|
-
"Ž": "Z",
|
|
3814
|
-
"ž": "z",
|
|
3815
|
-
"ſ": "s",
|
|
3816
|
-
"ƒ": "f",
|
|
3817
|
-
"Ơ": "O",
|
|
3818
|
-
"ơ": "o",
|
|
3819
|
-
"Ư": "U",
|
|
3820
|
-
"ư": "u",
|
|
3821
|
-
"Ǎ": "A",
|
|
3822
|
-
"ǎ": "a",
|
|
3823
|
-
"Ǐ": "I",
|
|
3824
|
-
"ǐ": "i",
|
|
3825
|
-
"Ǒ": "O",
|
|
3826
|
-
"ǒ": "o",
|
|
3827
|
-
"Ǔ": "U",
|
|
3828
|
-
"ǔ": "u",
|
|
3829
|
-
"Ǖ": "U",
|
|
3830
|
-
"ǖ": "u",
|
|
3831
|
-
"Ǘ": "U",
|
|
3832
|
-
"ǘ": "u",
|
|
3833
|
-
"Ǚ": "U",
|
|
3834
|
-
"ǚ": "u",
|
|
3835
|
-
"Ǜ": "U",
|
|
3836
|
-
"ǜ": "u",
|
|
3837
|
-
"Ứ": "U",
|
|
3838
|
-
"ứ": "u",
|
|
3839
|
-
"Ṹ": "U",
|
|
3840
|
-
"ṹ": "u",
|
|
3841
|
-
"Ǻ": "A",
|
|
3842
|
-
"ǻ": "a",
|
|
3843
|
-
"Ǽ": "AE",
|
|
3844
|
-
"ǽ": "ae",
|
|
3845
|
-
"Ǿ": "O",
|
|
3846
|
-
"ǿ": "o",
|
|
3847
|
-
"Þ": "TH",
|
|
3848
|
-
"þ": "th",
|
|
3849
|
-
"Ṕ": "P",
|
|
3850
|
-
"ṕ": "p",
|
|
3851
|
-
"Ṥ": "S",
|
|
3852
|
-
"ṥ": "s",
|
|
3853
|
-
"X́": "X",
|
|
3854
|
-
"x́": "x",
|
|
3855
|
-
"Ѓ": "Г",
|
|
3856
|
-
"ѓ": "г",
|
|
3857
|
-
"Ќ": "К",
|
|
3858
|
-
"ќ": "к",
|
|
3859
|
-
"A̋": "A",
|
|
3860
|
-
"a̋": "a",
|
|
3861
|
-
"E̋": "E",
|
|
3862
|
-
"e̋": "e",
|
|
3863
|
-
"I̋": "I",
|
|
3864
|
-
"i̋": "i",
|
|
3865
|
-
"Ǹ": "N",
|
|
3866
|
-
"ǹ": "n",
|
|
3867
|
-
"Ồ": "O",
|
|
3868
|
-
"ồ": "o",
|
|
3869
|
-
"Ṑ": "O",
|
|
3870
|
-
"ṑ": "o",
|
|
3871
|
-
"Ừ": "U",
|
|
3872
|
-
"ừ": "u",
|
|
3873
|
-
"Ẁ": "W",
|
|
3874
|
-
"ẁ": "w",
|
|
3875
|
-
"Ỳ": "Y",
|
|
3876
|
-
"ỳ": "y",
|
|
3877
|
-
"Ȁ": "A",
|
|
3878
|
-
"ȁ": "a",
|
|
3879
|
-
"Ȅ": "E",
|
|
3880
|
-
"ȅ": "e",
|
|
3881
|
-
"Ȉ": "I",
|
|
3882
|
-
"ȉ": "i",
|
|
3883
|
-
"Ȍ": "O",
|
|
3884
|
-
"ȍ": "o",
|
|
3885
|
-
"Ȑ": "R",
|
|
3886
|
-
"ȑ": "r",
|
|
3887
|
-
"Ȕ": "U",
|
|
3888
|
-
"ȕ": "u",
|
|
3889
|
-
"B̌": "B",
|
|
3890
|
-
"b̌": "b",
|
|
3891
|
-
"Č̣": "C",
|
|
3892
|
-
"č̣": "c",
|
|
3893
|
-
"Ê̌": "E",
|
|
3894
|
-
"ê̌": "e",
|
|
3895
|
-
"F̌": "F",
|
|
3896
|
-
"f̌": "f",
|
|
3897
|
-
"Ǧ": "G",
|
|
3898
|
-
"ǧ": "g",
|
|
3899
|
-
"Ȟ": "H",
|
|
3900
|
-
"ȟ": "h",
|
|
3901
|
-
"J̌": "J",
|
|
3902
|
-
"ǰ": "j",
|
|
3903
|
-
"Ǩ": "K",
|
|
3904
|
-
"ǩ": "k",
|
|
3905
|
-
"M̌": "M",
|
|
3906
|
-
"m̌": "m",
|
|
3907
|
-
"P̌": "P",
|
|
3908
|
-
"p̌": "p",
|
|
3909
|
-
"Q̌": "Q",
|
|
3910
|
-
"q̌": "q",
|
|
3911
|
-
"Ř̩": "R",
|
|
3912
|
-
"ř̩": "r",
|
|
3913
|
-
"Ṧ": "S",
|
|
3914
|
-
"ṧ": "s",
|
|
3915
|
-
"V̌": "V",
|
|
3916
|
-
"v̌": "v",
|
|
3917
|
-
"W̌": "W",
|
|
3918
|
-
"w̌": "w",
|
|
3919
|
-
"X̌": "X",
|
|
3920
|
-
"x̌": "x",
|
|
3921
|
-
"Y̌": "Y",
|
|
3922
|
-
"y̌": "y",
|
|
3923
|
-
"A̧": "A",
|
|
3924
|
-
"a̧": "a",
|
|
3925
|
-
"B̧": "B",
|
|
3926
|
-
"b̧": "b",
|
|
3927
|
-
"Ḑ": "D",
|
|
3928
|
-
"ḑ": "d",
|
|
3929
|
-
"Ȩ": "E",
|
|
3930
|
-
"ȩ": "e",
|
|
3931
|
-
"Ɛ̧": "E",
|
|
3932
|
-
"ɛ̧": "e",
|
|
3933
|
-
"Ḩ": "H",
|
|
3934
|
-
"ḩ": "h",
|
|
3935
|
-
"I̧": "I",
|
|
3936
|
-
"i̧": "i",
|
|
3937
|
-
"Ɨ̧": "I",
|
|
3938
|
-
"ɨ̧": "i",
|
|
3939
|
-
"M̧": "M",
|
|
3940
|
-
"m̧": "m",
|
|
3941
|
-
"O̧": "O",
|
|
3942
|
-
"o̧": "o",
|
|
3943
|
-
"Q̧": "Q",
|
|
3944
|
-
"q̧": "q",
|
|
3945
|
-
"U̧": "U",
|
|
3946
|
-
"u̧": "u",
|
|
3947
|
-
"X̧": "X",
|
|
3948
|
-
"x̧": "x",
|
|
3949
|
-
"Z̧": "Z",
|
|
3950
|
-
"z̧": "z",
|
|
3951
|
-
};
|
|
3952
|
-
|
|
3953
|
-
var chars = Object.keys(characterMap).join('|');
|
|
3954
|
-
var allAccents = new RegExp(chars, 'g');
|
|
3955
|
-
var firstAccent = new RegExp(chars, '');
|
|
3956
|
-
|
|
3957
|
-
var removeAccents = function(string) {
|
|
3958
|
-
return string.replace(allAccents, function(match) {
|
|
3959
|
-
return characterMap[match];
|
|
3960
|
-
});
|
|
3961
|
-
};
|
|
3962
|
-
|
|
3963
|
-
var hasAccents = function(string) {
|
|
3964
|
-
return !!string.match(firstAccent);
|
|
3965
|
-
};
|
|
3966
|
-
|
|
3967
|
-
removeAccents$1.exports = removeAccents;
|
|
3968
|
-
removeAccents$1.exports.has = hasAccents;
|
|
3969
|
-
removeAccents$1.exports.remove = removeAccents;
|
|
3970
|
-
|
|
3971
|
-
var rankings = {
|
|
3951
|
+
/**
|
|
3952
|
+
* @name match-sorter
|
|
3953
|
+
* @license MIT license.
|
|
3954
|
+
* @copyright (c) 2099 Kent C. Dodds
|
|
3955
|
+
* @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
|
|
3956
|
+
*/
|
|
3957
|
+
const rankings = {
|
|
3972
3958
|
CASE_SENSITIVE_EQUAL: 7,
|
|
3973
3959
|
EQUAL: 6,
|
|
3974
3960
|
STARTS_WITH: 5,
|
|
@@ -3978,95 +3964,51 @@
|
|
|
3978
3964
|
MATCHES: 1,
|
|
3979
3965
|
NO_MATCH: 0
|
|
3980
3966
|
};
|
|
3981
|
-
matchSorter.rankings = rankings;
|
|
3982
|
-
|
|
3983
|
-
var defaultBaseSortFn = function defaultBaseSortFn(a, b) {
|
|
3984
|
-
return String(a.rankedValue).localeCompare(String(b.rankedValue));
|
|
3985
|
-
};
|
|
3986
|
-
/**
|
|
3987
|
-
* Takes an array of items and a value and returns a new array with the items that match the given value
|
|
3988
|
-
* @param {Array} items - the items to sort
|
|
3989
|
-
* @param {String} value - the value to use for ranking
|
|
3990
|
-
* @param {Object} options - Some options to configure the sorter
|
|
3991
|
-
* @return {Array} - the new sorted array
|
|
3992
|
-
*/
|
|
3993
|
-
|
|
3994
3967
|
|
|
3995
|
-
function matchSorter(items, value, options) {
|
|
3996
|
-
if (options === void 0) {
|
|
3997
|
-
options = {};
|
|
3998
|
-
}
|
|
3999
|
-
|
|
4000
|
-
var _options = options,
|
|
4001
|
-
keys = _options.keys,
|
|
4002
|
-
_options$threshold = _options.threshold,
|
|
4003
|
-
threshold = _options$threshold === void 0 ? rankings.MATCHES : _options$threshold,
|
|
4004
|
-
_options$baseSort = _options.baseSort,
|
|
4005
|
-
baseSort = _options$baseSort === void 0 ? defaultBaseSortFn : _options$baseSort,
|
|
4006
|
-
_options$sorter = _options.sorter,
|
|
4007
|
-
sorter = _options$sorter === void 0 ? function (matchedItems) {
|
|
4008
|
-
return matchedItems.sort(function (a, b) {
|
|
4009
|
-
return sortRankedValues(a, b, baseSort);
|
|
4010
|
-
});
|
|
4011
|
-
} : _options$sorter;
|
|
4012
|
-
var matchedItems = items.reduce(reduceItemsToRanked, []);
|
|
4013
|
-
return sorter(matchedItems).map(function (_ref) {
|
|
4014
|
-
var item = _ref.item;
|
|
4015
|
-
return item;
|
|
4016
|
-
});
|
|
4017
|
-
|
|
4018
|
-
function reduceItemsToRanked(matches, item, index) {
|
|
4019
|
-
var rankingInfo = getHighestRanking(item, keys, value, options);
|
|
4020
|
-
var rank = rankingInfo.rank,
|
|
4021
|
-
_rankingInfo$keyThres = rankingInfo.keyThreshold,
|
|
4022
|
-
keyThreshold = _rankingInfo$keyThres === void 0 ? threshold : _rankingInfo$keyThres;
|
|
4023
|
-
|
|
4024
|
-
if (rank >= keyThreshold) {
|
|
4025
|
-
matches.push(_extends({}, rankingInfo, {
|
|
4026
|
-
item: item,
|
|
4027
|
-
index: index
|
|
4028
|
-
}));
|
|
4029
|
-
}
|
|
4030
|
-
|
|
4031
|
-
return matches;
|
|
4032
|
-
}
|
|
4033
|
-
}
|
|
4034
3968
|
/**
|
|
4035
3969
|
* Gets the highest ranking for value for the given item based on its values for the given keys
|
|
4036
3970
|
* @param {*} item - the item to rank
|
|
4037
3971
|
* @param {Array} keys - the keys to get values from the item for the ranking
|
|
4038
3972
|
* @param {String} value - the value to rank against
|
|
4039
3973
|
* @param {Object} options - options to control the ranking
|
|
4040
|
-
* @return {{rank: Number,
|
|
3974
|
+
* @return {{rank: Number, accessorIndex: Number, accessorThreshold: Number}} - the highest ranking
|
|
4041
3975
|
*/
|
|
3976
|
+
function rankItem(item, value, options) {
|
|
3977
|
+
var _options$threshold;
|
|
4042
3978
|
|
|
3979
|
+
options = options || {};
|
|
3980
|
+
options.threshold = (_options$threshold = options.threshold) != null ? _options$threshold : rankings.MATCHES;
|
|
4043
3981
|
|
|
4044
|
-
|
|
4045
|
-
if (!keys) {
|
|
3982
|
+
if (!options.accessors) {
|
|
4046
3983
|
// if keys is not specified, then we assume the item given is ready to be matched
|
|
4047
|
-
|
|
3984
|
+
const rank = getMatchRanking(item, value, options);
|
|
4048
3985
|
return {
|
|
4049
3986
|
// ends up being duplicate of 'item' in matches but consistent
|
|
4050
|
-
rankedValue:
|
|
4051
|
-
rank
|
|
4052
|
-
|
|
4053
|
-
|
|
3987
|
+
rankedValue: item,
|
|
3988
|
+
rank,
|
|
3989
|
+
accessorIndex: -1,
|
|
3990
|
+
accessorThreshold: options.threshold,
|
|
3991
|
+
passed: rank >= options.threshold
|
|
4054
3992
|
};
|
|
4055
3993
|
}
|
|
4056
3994
|
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
3995
|
+
const valuesToRank = getAllValuesToRank(item, options.accessors);
|
|
3996
|
+
const rankingInfo = {
|
|
3997
|
+
rankedValue: item,
|
|
3998
|
+
rank: rankings.NO_MATCH,
|
|
3999
|
+
accessorIndex: -1,
|
|
4000
|
+
accessorThreshold: options.threshold,
|
|
4001
|
+
passed: false
|
|
4002
|
+
};
|
|
4003
|
+
|
|
4004
|
+
for (let i = 0; i < valuesToRank.length; i++) {
|
|
4005
|
+
const rankValue = valuesToRank[i];
|
|
4006
|
+
let newRank = getMatchRanking(rankValue.itemValue, value, options);
|
|
4007
|
+
const {
|
|
4008
|
+
minRanking,
|
|
4009
|
+
maxRanking,
|
|
4010
|
+
threshold
|
|
4011
|
+
} = rankValue.attributes;
|
|
4070
4012
|
|
|
4071
4013
|
if (newRank < minRanking && newRank >= rankings.MATCHES) {
|
|
4072
4014
|
newRank = minRanking;
|
|
@@ -4074,25 +4016,17 @@
|
|
|
4074
4016
|
newRank = maxRanking;
|
|
4075
4017
|
}
|
|
4076
4018
|
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4019
|
+
newRank = Math.min(newRank, maxRanking);
|
|
4020
|
+
|
|
4021
|
+
if (newRank > rankingInfo.rank) {
|
|
4022
|
+
rankingInfo.rank = newRank;
|
|
4023
|
+
rankingInfo.accessorIndex = i;
|
|
4024
|
+
rankingInfo.accessorThreshold = threshold;
|
|
4025
|
+
rankingInfo.rankedValue = rankValue.itemValue;
|
|
4082
4026
|
}
|
|
4027
|
+
}
|
|
4083
4028
|
|
|
4084
|
-
|
|
4085
|
-
rankedValue: newRankedValue,
|
|
4086
|
-
rank: rank,
|
|
4087
|
-
keyIndex: keyIndex,
|
|
4088
|
-
keyThreshold: keyThreshold
|
|
4089
|
-
};
|
|
4090
|
-
}, {
|
|
4091
|
-
rankedValue: item,
|
|
4092
|
-
rank: rankings.NO_MATCH,
|
|
4093
|
-
keyIndex: -1,
|
|
4094
|
-
keyThreshold: options.threshold
|
|
4095
|
-
});
|
|
4029
|
+
return rankingInfo;
|
|
4096
4030
|
}
|
|
4097
4031
|
/**
|
|
4098
4032
|
* Gives a rankings score based on how well the two strings match.
|
|
@@ -4102,7 +4036,6 @@
|
|
|
4102
4036
|
* @returns {Number} the ranking for how well stringToRank matches testString
|
|
4103
4037
|
*/
|
|
4104
4038
|
|
|
4105
|
-
|
|
4106
4039
|
function getMatchRanking(testString, stringToRank, options) {
|
|
4107
4040
|
testString = prepareValueForComparison(testString, options);
|
|
4108
4041
|
stringToRank = prepareValueForComparison(stringToRank, options); // too long
|
|
@@ -4162,11 +4095,11 @@
|
|
|
4162
4095
|
|
|
4163
4096
|
|
|
4164
4097
|
function getAcronym(string) {
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
wordsInString.forEach(
|
|
4168
|
-
|
|
4169
|
-
splitByHyphenWords.forEach(
|
|
4098
|
+
let acronym = '';
|
|
4099
|
+
const wordsInString = string.split(' ');
|
|
4100
|
+
wordsInString.forEach(wordInString => {
|
|
4101
|
+
const splitByHyphenWords = wordInString.split('-');
|
|
4102
|
+
splitByHyphenWords.forEach(splitByHyphenWord => {
|
|
4170
4103
|
acronym += splitByHyphenWord.substr(0, 1);
|
|
4171
4104
|
});
|
|
4172
4105
|
});
|
|
@@ -4185,12 +4118,12 @@
|
|
|
4185
4118
|
|
|
4186
4119
|
|
|
4187
4120
|
function getClosenessRanking(testString, stringToRank) {
|
|
4188
|
-
|
|
4189
|
-
|
|
4121
|
+
let matchingInOrderCharCount = 0;
|
|
4122
|
+
let charNumber = 0;
|
|
4190
4123
|
|
|
4191
4124
|
function findMatchingCharacter(matchChar, string, index) {
|
|
4192
|
-
for (
|
|
4193
|
-
|
|
4125
|
+
for (let j = index, J = string.length; j < J; j++) {
|
|
4126
|
+
const stringChar = string[j];
|
|
4194
4127
|
|
|
4195
4128
|
if (stringChar === matchChar) {
|
|
4196
4129
|
matchingInOrderCharCount += 1;
|
|
@@ -4202,13 +4135,13 @@
|
|
|
4202
4135
|
}
|
|
4203
4136
|
|
|
4204
4137
|
function getRanking(spread) {
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4138
|
+
const spreadPercentage = 1 / spread;
|
|
4139
|
+
const inOrderPercentage = matchingInOrderCharCount / stringToRank.length;
|
|
4140
|
+
const ranking = rankings.MATCHES + inOrderPercentage * spreadPercentage;
|
|
4208
4141
|
return ranking;
|
|
4209
4142
|
}
|
|
4210
4143
|
|
|
4211
|
-
|
|
4144
|
+
const firstIndex = findMatchingCharacter(stringToRank[0], testString, 0);
|
|
4212
4145
|
|
|
4213
4146
|
if (firstIndex < 0) {
|
|
4214
4147
|
return rankings.NO_MATCH;
|
|
@@ -4216,47 +4149,19 @@
|
|
|
4216
4149
|
|
|
4217
4150
|
charNumber = firstIndex;
|
|
4218
4151
|
|
|
4219
|
-
for (
|
|
4220
|
-
|
|
4152
|
+
for (let i = 1, I = stringToRank.length; i < I; i++) {
|
|
4153
|
+
const matchChar = stringToRank[i];
|
|
4221
4154
|
charNumber = findMatchingCharacter(matchChar, testString, charNumber);
|
|
4222
|
-
|
|
4155
|
+
const found = charNumber > -1;
|
|
4223
4156
|
|
|
4224
4157
|
if (!found) {
|
|
4225
4158
|
return rankings.NO_MATCH;
|
|
4226
4159
|
}
|
|
4227
4160
|
}
|
|
4228
4161
|
|
|
4229
|
-
|
|
4162
|
+
const spread = charNumber - firstIndex;
|
|
4230
4163
|
return getRanking(spread);
|
|
4231
4164
|
}
|
|
4232
|
-
/**
|
|
4233
|
-
* Sorts items that have a rank, index, and keyIndex
|
|
4234
|
-
* @param {Object} a - the first item to sort
|
|
4235
|
-
* @param {Object} b - the second item to sort
|
|
4236
|
-
* @return {Number} -1 if a should come first, 1 if b should come first, 0 if equal
|
|
4237
|
-
*/
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
function sortRankedValues(a, b, baseSort) {
|
|
4241
|
-
var aFirst = -1;
|
|
4242
|
-
var bFirst = 1;
|
|
4243
|
-
var aRank = a.rank,
|
|
4244
|
-
aKeyIndex = a.keyIndex;
|
|
4245
|
-
var bRank = b.rank,
|
|
4246
|
-
bKeyIndex = b.keyIndex;
|
|
4247
|
-
var same = aRank === bRank;
|
|
4248
|
-
|
|
4249
|
-
if (same) {
|
|
4250
|
-
if (aKeyIndex === bKeyIndex) {
|
|
4251
|
-
// use the base sort function as a tie-breaker
|
|
4252
|
-
return baseSort(a, b);
|
|
4253
|
-
} else {
|
|
4254
|
-
return aKeyIndex < bKeyIndex ? aFirst : bFirst;
|
|
4255
|
-
}
|
|
4256
|
-
} else {
|
|
4257
|
-
return aRank > bRank ? aFirst : bFirst;
|
|
4258
|
-
}
|
|
4259
|
-
}
|
|
4260
4165
|
/**
|
|
4261
4166
|
* Prepares value for comparison by stringifying it, removing diacritics (if specified)
|
|
4262
4167
|
* @param {String} value - the value to clean
|
|
@@ -4264,15 +4169,16 @@
|
|
|
4264
4169
|
* @return {String} the prepared value
|
|
4265
4170
|
*/
|
|
4266
4171
|
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4172
|
+
function prepareValueForComparison(value, _ref) {
|
|
4173
|
+
let {
|
|
4174
|
+
keepDiacritics
|
|
4175
|
+
} = _ref;
|
|
4270
4176
|
// value might not actually be a string at this point (we don't get to choose)
|
|
4271
4177
|
// so part of preparing the value for comparison is ensure that it is a string
|
|
4272
4178
|
value = "" + value; // toString
|
|
4273
4179
|
|
|
4274
4180
|
if (!keepDiacritics) {
|
|
4275
|
-
value = removeAccents
|
|
4181
|
+
value = removeAccents(value);
|
|
4276
4182
|
}
|
|
4277
4183
|
|
|
4278
4184
|
return value;
|
|
@@ -4285,26 +4191,14 @@
|
|
|
4285
4191
|
*/
|
|
4286
4192
|
|
|
4287
4193
|
|
|
4288
|
-
function getItemValues(item,
|
|
4289
|
-
|
|
4290
|
-
key = key.key;
|
|
4291
|
-
}
|
|
4292
|
-
|
|
4293
|
-
var value;
|
|
4194
|
+
function getItemValues(item, accessor) {
|
|
4195
|
+
let accessorFn = accessor;
|
|
4294
4196
|
|
|
4295
|
-
if (typeof
|
|
4296
|
-
|
|
4297
|
-
}
|
|
4298
|
-
value = null;
|
|
4299
|
-
} else if (Object.hasOwnProperty.call(item, key)) {
|
|
4300
|
-
value = item[key];
|
|
4301
|
-
} else if (key.includes('.')) {
|
|
4302
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
4303
|
-
return getNestedValues(key, item);
|
|
4304
|
-
} else {
|
|
4305
|
-
value = null;
|
|
4306
|
-
} // because `value` can also be undefined
|
|
4197
|
+
if (typeof accessor === 'object') {
|
|
4198
|
+
accessorFn = accessor.accessor;
|
|
4199
|
+
}
|
|
4307
4200
|
|
|
4201
|
+
const value = accessorFn(item); // because `value` can also be undefined
|
|
4308
4202
|
|
|
4309
4203
|
if (value == null) {
|
|
4310
4204
|
return [];
|
|
@@ -4316,53 +4210,6 @@
|
|
|
4316
4210
|
|
|
4317
4211
|
return [String(value)];
|
|
4318
4212
|
}
|
|
4319
|
-
/**
|
|
4320
|
-
* Given path: "foo.bar.baz"
|
|
4321
|
-
* And item: {foo: {bar: {baz: 'buzz'}}}
|
|
4322
|
-
* -> 'buzz'
|
|
4323
|
-
* @param path a dot-separated set of keys
|
|
4324
|
-
* @param item the item to get the value from
|
|
4325
|
-
*/
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
function getNestedValues(path, item) {
|
|
4329
|
-
var keys = path.split('.');
|
|
4330
|
-
var values = [item];
|
|
4331
|
-
|
|
4332
|
-
for (var i = 0, I = keys.length; i < I; i++) {
|
|
4333
|
-
var nestedKey = keys[i];
|
|
4334
|
-
var nestedValues = [];
|
|
4335
|
-
|
|
4336
|
-
for (var j = 0, J = values.length; j < J; j++) {
|
|
4337
|
-
var nestedItem = values[j];
|
|
4338
|
-
if (nestedItem == null) continue;
|
|
4339
|
-
|
|
4340
|
-
if (Object.hasOwnProperty.call(nestedItem, nestedKey)) {
|
|
4341
|
-
var nestedValue = nestedItem[nestedKey];
|
|
4342
|
-
|
|
4343
|
-
if (nestedValue != null) {
|
|
4344
|
-
nestedValues.push(nestedValue);
|
|
4345
|
-
}
|
|
4346
|
-
} else if (nestedKey === '*') {
|
|
4347
|
-
// ensure that values is an array
|
|
4348
|
-
nestedValues = nestedValues.concat(nestedItem);
|
|
4349
|
-
}
|
|
4350
|
-
}
|
|
4351
|
-
|
|
4352
|
-
values = nestedValues;
|
|
4353
|
-
}
|
|
4354
|
-
|
|
4355
|
-
if (Array.isArray(values[0])) {
|
|
4356
|
-
// keep allowing the implicit wildcard for an array of strings at the end of
|
|
4357
|
-
// the path; don't use `.flat()` because that's not available in node.js v10
|
|
4358
|
-
var result = [];
|
|
4359
|
-
return result.concat.apply(result, values);
|
|
4360
|
-
} // Based on our logic it should be an array of strings by now...
|
|
4361
|
-
// assuming the user's path terminated in strings
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
return values;
|
|
4365
|
-
}
|
|
4366
4213
|
/**
|
|
4367
4214
|
* Gets all the values for the given keys in the given item and returns an array of those values
|
|
4368
4215
|
* @param item - the item from which the values will be retrieved
|
|
@@ -4371,18 +4218,18 @@
|
|
|
4371
4218
|
*/
|
|
4372
4219
|
|
|
4373
4220
|
|
|
4374
|
-
function getAllValuesToRank(item,
|
|
4375
|
-
|
|
4221
|
+
function getAllValuesToRank(item, accessors) {
|
|
4222
|
+
const allValues = [];
|
|
4376
4223
|
|
|
4377
|
-
for (
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4224
|
+
for (let j = 0, J = accessors.length; j < J; j++) {
|
|
4225
|
+
const accessor = accessors[j];
|
|
4226
|
+
const attributes = getAccessorAttributes(accessor);
|
|
4227
|
+
const itemValues = getItemValues(item, accessor);
|
|
4381
4228
|
|
|
4382
|
-
for (
|
|
4229
|
+
for (let i = 0, I = itemValues.length; i < I; i++) {
|
|
4383
4230
|
allValues.push({
|
|
4384
4231
|
itemValue: itemValues[i],
|
|
4385
|
-
attributes
|
|
4232
|
+
attributes
|
|
4386
4233
|
});
|
|
4387
4234
|
}
|
|
4388
4235
|
}
|
|
@@ -4390,22 +4237,24 @@
|
|
|
4390
4237
|
return allValues;
|
|
4391
4238
|
}
|
|
4392
4239
|
|
|
4393
|
-
|
|
4240
|
+
const defaultKeyAttributes = {
|
|
4394
4241
|
maxRanking: Infinity,
|
|
4395
4242
|
minRanking: -Infinity
|
|
4396
4243
|
};
|
|
4397
4244
|
/**
|
|
4398
|
-
* Gets all the attributes for the given
|
|
4399
|
-
* @param
|
|
4400
|
-
* @return object containing the
|
|
4245
|
+
* Gets all the attributes for the given accessor
|
|
4246
|
+
* @param accessor - the accessor from which the attributes will be retrieved
|
|
4247
|
+
* @return object containing the accessor's attributes
|
|
4401
4248
|
*/
|
|
4402
4249
|
|
|
4403
|
-
function
|
|
4404
|
-
if (typeof
|
|
4250
|
+
function getAccessorAttributes(accessor) {
|
|
4251
|
+
if (typeof accessor === 'function') {
|
|
4405
4252
|
return defaultKeyAttributes;
|
|
4406
4253
|
}
|
|
4407
4254
|
|
|
4408
|
-
return
|
|
4255
|
+
return { ...defaultKeyAttributes,
|
|
4256
|
+
...accessor
|
|
4257
|
+
};
|
|
4409
4258
|
}
|
|
4410
4259
|
|
|
4411
4260
|
/* istanbul ignore file */
|
|
@@ -4491,7 +4340,7 @@
|
|
|
4491
4340
|
return 0x008327;
|
|
4492
4341
|
}
|
|
4493
4342
|
|
|
4494
|
-
const queryHashSort = (a, b) =>
|
|
4343
|
+
const queryHashSort = (a, b) => a.queryHash.localeCompare(b.queryHash);
|
|
4495
4344
|
|
|
4496
4345
|
const dateSort = (a, b) => a.state.dataUpdatedAt < b.state.dataUpdatedAt ? 1 : -1;
|
|
4497
4346
|
|
|
@@ -4611,11 +4460,9 @@
|
|
|
4611
4460
|
if (payload.inspectorId === pluginId) {
|
|
4612
4461
|
const queries = queryCache.getAll();
|
|
4613
4462
|
const settings = api.getSettings();
|
|
4614
|
-
const filtered =
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
});
|
|
4618
|
-
const nodes = filtered.map(query => {
|
|
4463
|
+
const filtered = payload.filter ? queries.filter(item => rankItem(item.queryHash, payload.filter).passed) : [...queries];
|
|
4464
|
+
const sorted = filtered.sort((a, b) => sortFns[settings.sortFn](a, b) * settings.baseSort);
|
|
4465
|
+
const nodes = sorted.map(query => {
|
|
4619
4466
|
const stateLabel = getQueryStateLabel(query);
|
|
4620
4467
|
return {
|
|
4621
4468
|
id: query.queryHash,
|