@lvce-editor/extension-search-view 1.0.0 → 1.1.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.
|
@@ -129,17 +129,6 @@ const getId = extension => {
|
|
|
129
129
|
return extension.id;
|
|
130
130
|
};
|
|
131
131
|
|
|
132
|
-
const toSorted = (array, compare) => {
|
|
133
|
-
return [...array].sort(compare);
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const compareExtension = (extensionA, extensionB) => {
|
|
137
|
-
return extensionA.name.localeCompare(extensionB.name) || extensionA.id.localeCompare(extensionB.id);
|
|
138
|
-
};
|
|
139
|
-
const sortExtensions = extensions => {
|
|
140
|
-
return toSorted(extensions, compareExtension);
|
|
141
|
-
};
|
|
142
|
-
|
|
143
132
|
const matchesParsedValue = (extension, parsedValue) => {
|
|
144
133
|
if (extension && typeof extension.name === 'string') {
|
|
145
134
|
const extensionNameLower = extension.name.toLowerCase();
|
|
@@ -151,6 +140,19 @@ const matchesParsedValue = (extension, parsedValue) => {
|
|
|
151
140
|
}
|
|
152
141
|
return false;
|
|
153
142
|
};
|
|
143
|
+
|
|
144
|
+
const toSorted = (array, compare) => {
|
|
145
|
+
return [...array].sort(compare);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const compareExtension = (extensionA, extensionB) => {
|
|
149
|
+
return extensionA.name.localeCompare(extensionB.name) || extensionA.id.localeCompare(extensionB.id);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const sortExtensions = extensions => {
|
|
153
|
+
return toSorted(extensions, compareExtension);
|
|
154
|
+
};
|
|
155
|
+
|
|
154
156
|
const getExtensions = async (extensions, parsedValue) => {
|
|
155
157
|
const filteredExtensions = [];
|
|
156
158
|
for (const extension of extensions) {
|