@lvce-editor/extension-search-view 4.8.0 → 4.9.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.
|
@@ -2776,6 +2776,15 @@ const getId$1 = extension => {
|
|
|
2776
2776
|
}
|
|
2777
2777
|
return extension.id;
|
|
2778
2778
|
};
|
|
2779
|
+
const isString = item => {
|
|
2780
|
+
return typeof item === 'string';
|
|
2781
|
+
};
|
|
2782
|
+
const getCategories = extension => {
|
|
2783
|
+
if (!extension || !extension.categories || !Array.isArray(extension.categories)) {
|
|
2784
|
+
return [];
|
|
2785
|
+
}
|
|
2786
|
+
return extension.categories.filter(isString);
|
|
2787
|
+
};
|
|
2779
2788
|
|
|
2780
2789
|
const RE_PUBLISHER = /^[a-z\d-]+/;
|
|
2781
2790
|
|
|
@@ -2800,8 +2809,7 @@ const normalizeExtension$1 = (extension, platform, assetDir) => {
|
|
|
2800
2809
|
uri: '',
|
|
2801
2810
|
publisher: getPublisher(extension),
|
|
2802
2811
|
icon: getIcon(extension, platform, assetDir),
|
|
2803
|
-
|
|
2804
|
-
categories: extension.categories
|
|
2812
|
+
categories: getCategories(extension)
|
|
2805
2813
|
};
|
|
2806
2814
|
};
|
|
2807
2815
|
|