@lvce-editor/text-search-worker 7.5.3 → 7.6.0
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/dist/textSearchWorkerMain.js +45 -87
- package/package.json +1 -1
|
@@ -54,52 +54,64 @@ class VError extends Error {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
class AssertionError extends Error {
|
|
58
58
|
constructor(message) {
|
|
59
59
|
super(message);
|
|
60
60
|
this.name = 'AssertionError';
|
|
61
61
|
}
|
|
62
|
-
}
|
|
63
|
-
const Object$1
|
|
64
|
-
const Number$
|
|
65
|
-
const Array$1
|
|
66
|
-
const String$
|
|
67
|
-
const Boolean$
|
|
68
|
-
const Function
|
|
69
|
-
const Null
|
|
70
|
-
const Unknown
|
|
71
|
-
const getType
|
|
62
|
+
}
|
|
63
|
+
const Object$1 = 1;
|
|
64
|
+
const Number$1 = 2;
|
|
65
|
+
const Array$1 = 3;
|
|
66
|
+
const String$1 = 4;
|
|
67
|
+
const Boolean$1 = 5;
|
|
68
|
+
const Function = 6;
|
|
69
|
+
const Null = 7;
|
|
70
|
+
const Unknown = 8;
|
|
71
|
+
const getType = value => {
|
|
72
72
|
switch (typeof value) {
|
|
73
73
|
case 'number':
|
|
74
|
-
return Number$
|
|
74
|
+
return Number$1;
|
|
75
75
|
case 'function':
|
|
76
|
-
return Function
|
|
76
|
+
return Function;
|
|
77
77
|
case 'string':
|
|
78
|
-
return String$
|
|
78
|
+
return String$1;
|
|
79
79
|
case 'object':
|
|
80
80
|
if (value === null) {
|
|
81
|
-
return Null
|
|
81
|
+
return Null;
|
|
82
82
|
}
|
|
83
83
|
if (Array.isArray(value)) {
|
|
84
|
-
return Array$1
|
|
84
|
+
return Array$1;
|
|
85
85
|
}
|
|
86
|
-
return Object$1
|
|
86
|
+
return Object$1;
|
|
87
87
|
case 'boolean':
|
|
88
|
-
return Boolean$
|
|
88
|
+
return Boolean$1;
|
|
89
89
|
default:
|
|
90
|
-
return Unknown
|
|
90
|
+
return Unknown;
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
93
|
const object = value => {
|
|
94
|
-
const type = getType
|
|
95
|
-
if (type !== Object$1
|
|
96
|
-
throw new AssertionError
|
|
94
|
+
const type = getType(value);
|
|
95
|
+
if (type !== Object$1) {
|
|
96
|
+
throw new AssertionError('expected value to be of type object');
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
-
const number
|
|
100
|
-
const type = getType
|
|
101
|
-
if (type !== Number$
|
|
102
|
-
throw new AssertionError
|
|
99
|
+
const number = value => {
|
|
100
|
+
const type = getType(value);
|
|
101
|
+
if (type !== Number$1) {
|
|
102
|
+
throw new AssertionError('expected value to be of type number');
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const array = value => {
|
|
106
|
+
const type = getType(value);
|
|
107
|
+
if (type !== Array$1) {
|
|
108
|
+
throw new AssertionError('expected value to be of type array');
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
const string = value => {
|
|
112
|
+
const type = getType(value);
|
|
113
|
+
if (type !== String$1) {
|
|
114
|
+
throw new AssertionError('expected value to be of type string');
|
|
103
115
|
}
|
|
104
116
|
};
|
|
105
117
|
|
|
@@ -1602,61 +1614,6 @@ const getIcons = async iconRequests => {
|
|
|
1602
1614
|
return invoke$2('IconTheme.getIcons', iconRequests);
|
|
1603
1615
|
};
|
|
1604
1616
|
|
|
1605
|
-
class AssertionError extends Error {
|
|
1606
|
-
constructor(message) {
|
|
1607
|
-
super(message);
|
|
1608
|
-
this.name = 'AssertionError';
|
|
1609
|
-
}
|
|
1610
|
-
}
|
|
1611
|
-
const Object$1 = 1;
|
|
1612
|
-
const Number$1 = 2;
|
|
1613
|
-
const Array$1 = 3;
|
|
1614
|
-
const String$1 = 4;
|
|
1615
|
-
const Boolean$1 = 5;
|
|
1616
|
-
const Function = 6;
|
|
1617
|
-
const Null = 7;
|
|
1618
|
-
const Unknown = 8;
|
|
1619
|
-
const getType = value => {
|
|
1620
|
-
switch (typeof value) {
|
|
1621
|
-
case 'number':
|
|
1622
|
-
return Number$1;
|
|
1623
|
-
case 'function':
|
|
1624
|
-
return Function;
|
|
1625
|
-
case 'string':
|
|
1626
|
-
return String$1;
|
|
1627
|
-
case 'object':
|
|
1628
|
-
if (value === null) {
|
|
1629
|
-
return Null;
|
|
1630
|
-
}
|
|
1631
|
-
if (Array.isArray(value)) {
|
|
1632
|
-
return Array$1;
|
|
1633
|
-
}
|
|
1634
|
-
return Object$1;
|
|
1635
|
-
case 'boolean':
|
|
1636
|
-
return Boolean$1;
|
|
1637
|
-
default:
|
|
1638
|
-
return Unknown;
|
|
1639
|
-
}
|
|
1640
|
-
};
|
|
1641
|
-
const number = value => {
|
|
1642
|
-
const type = getType(value);
|
|
1643
|
-
if (type !== Number$1) {
|
|
1644
|
-
throw new AssertionError('expected value to be of type number');
|
|
1645
|
-
}
|
|
1646
|
-
};
|
|
1647
|
-
const array = value => {
|
|
1648
|
-
const type = getType(value);
|
|
1649
|
-
if (type !== Array$1) {
|
|
1650
|
-
throw new AssertionError('expected value to be of type array');
|
|
1651
|
-
}
|
|
1652
|
-
};
|
|
1653
|
-
const string = value => {
|
|
1654
|
-
const type = getType(value);
|
|
1655
|
-
if (type !== String$1) {
|
|
1656
|
-
throw new AssertionError('expected value to be of type string');
|
|
1657
|
-
}
|
|
1658
|
-
};
|
|
1659
|
-
|
|
1660
1617
|
const {
|
|
1661
1618
|
invoke: invoke$1,
|
|
1662
1619
|
invokeAndTransfer,
|
|
@@ -5123,7 +5080,7 @@ const focusIndex = (state, index) => {
|
|
|
5123
5080
|
if (itemsLength === 0) {
|
|
5124
5081
|
return state;
|
|
5125
5082
|
}
|
|
5126
|
-
number
|
|
5083
|
+
number(itemHeight);
|
|
5127
5084
|
if (index === -1) {
|
|
5128
5085
|
return {
|
|
5129
5086
|
...state,
|
|
@@ -5239,7 +5196,7 @@ const getScrollBarSize = (size, contentSize, minimumSliderSize) => {
|
|
|
5239
5196
|
};
|
|
5240
5197
|
const setDeltaY = (state, value) => {
|
|
5241
5198
|
object(state);
|
|
5242
|
-
number
|
|
5199
|
+
number(value);
|
|
5243
5200
|
const {
|
|
5244
5201
|
deltaY,
|
|
5245
5202
|
finalDeltaY,
|
|
@@ -5326,8 +5283,8 @@ const handleScrollBarMove = (state, eventY) => {
|
|
|
5326
5283
|
return setDeltaY(state, newDeltaY);
|
|
5327
5284
|
};
|
|
5328
5285
|
const handleWheel = (state, deltaMode, deltaY) => {
|
|
5329
|
-
number
|
|
5330
|
-
number
|
|
5286
|
+
number(deltaMode);
|
|
5287
|
+
number(deltaY);
|
|
5331
5288
|
return setDeltaY(state, state.deltaY + deltaY);
|
|
5332
5289
|
};
|
|
5333
5290
|
|
|
@@ -5971,16 +5928,17 @@ const getSearchDetailsToggleVirtualDom = () => {
|
|
|
5971
5928
|
}];
|
|
5972
5929
|
};
|
|
5973
5930
|
|
|
5974
|
-
const
|
|
5931
|
+
const getSearchMessageClassName = indented => {
|
|
5975
5932
|
if (indented) {
|
|
5976
5933
|
return mergeClassNames(ViewletSearchMessage, ViewletSearchMessageIndented);
|
|
5977
5934
|
}
|
|
5978
5935
|
return ViewletSearchMessage;
|
|
5979
5936
|
};
|
|
5937
|
+
|
|
5980
5938
|
const getSearchMessageVirtualDom = (message, indented) => {
|
|
5981
5939
|
return [{
|
|
5982
5940
|
childCount: 1,
|
|
5983
|
-
className:
|
|
5941
|
+
className: getSearchMessageClassName(indented),
|
|
5984
5942
|
role: Status,
|
|
5985
5943
|
type: Div
|
|
5986
5944
|
}, text(message)];
|