@nil-/doc 0.2.40 → 0.2.41
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/CHANGELOG.md
CHANGED
|
@@ -16,14 +16,16 @@
|
|
|
16
16
|
grid-template-columns: 15px 1fr;
|
|
17
17
|
align-items: center;
|
|
18
18
|
cursor: pointer;
|
|
19
|
+
gap: 5px;
|
|
20
|
+
box-sizing: border-box;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
.header:hover {
|
|
22
|
-
background-color:
|
|
24
|
+
background-color: hsla(203, 98%, 50%, 0.07);
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
.header.selected {
|
|
26
|
-
background-color:
|
|
28
|
+
background-color: hsla(203, 98%, 50%, 0.822);
|
|
27
29
|
color: black;
|
|
28
30
|
}
|
|
29
31
|
|
|
@@ -31,6 +33,7 @@
|
|
|
31
33
|
justify-content: center;
|
|
32
34
|
height: 15px;
|
|
33
35
|
width: 15px;
|
|
36
|
+
transition: transform 350ms;
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
.icon.expanded {
|
|
@@ -107,13 +107,16 @@ const doScoreFuzzy = (query, queryLower, queryLength, target, targetLower, targe
|
|
|
107
107
|
targetIndex--;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
return [scores[queryLength * targetLength - 1], positions.reverse()];
|
|
110
|
+
return [scores[queryLength * targetLength - 1] ?? 0, positions.reverse()];
|
|
111
111
|
};
|
|
112
|
-
export const
|
|
112
|
+
export const score = (target, query) => {
|
|
113
113
|
const targetLength = target.length;
|
|
114
114
|
const queryLength = query.length;
|
|
115
115
|
if (targetLength < queryLength) {
|
|
116
|
-
return
|
|
116
|
+
return [0, []];
|
|
117
117
|
}
|
|
118
|
-
return
|
|
118
|
+
return doScoreFuzzy(query, query.toLowerCase(), queryLength, target, target.toLowerCase(), targetLength);
|
|
119
|
+
};
|
|
120
|
+
export const fuzz = (target, query) => {
|
|
121
|
+
return score(target, query)[0] > 0;
|
|
119
122
|
};
|