easyeda 0.0.76 → 0.0.78
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.
|
@@ -1890,7 +1890,10 @@ async function fetchEasyEDAComponent(jlcpcbPartNumber) {
|
|
|
1890
1890
|
if (!searchResult.success || !searchResult.result.lists.lcsc.length) {
|
|
1891
1891
|
throw new Error("Component not found");
|
|
1892
1892
|
}
|
|
1893
|
-
const
|
|
1893
|
+
const bestMatchComponent = searchResult.result.lists.lcsc.find(
|
|
1894
|
+
(component) => component.dataStr.head.c_para["Supplier Part"] === jlcpcbPartNumber
|
|
1895
|
+
) ?? searchResult.result.lists.lcsc[0];
|
|
1896
|
+
const componentUUID = bestMatchComponent.uuid;
|
|
1894
1897
|
const componentResponse = await fetch(componentUrl(componentUUID), {
|
|
1895
1898
|
method: "GET",
|
|
1896
1899
|
headers: {
|
|
@@ -2793,4 +2796,4 @@ export {
|
|
|
2793
2796
|
convertRawEasyToTsx,
|
|
2794
2797
|
convertEasyEdaJsonToVariousFormats
|
|
2795
2798
|
};
|
|
2796
|
-
//# sourceMappingURL=chunk-
|
|
2799
|
+
//# sourceMappingURL=chunk-CNAN353Z.js.map
|