easyeda 0.0.126 → 0.0.127
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.
|
@@ -1878,7 +1878,7 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, { useModelCdn, shouldRecente
|
|
|
1878
1878
|
var convertEasyEdaJsonToTscircuitSoupJson = convertEasyEdaJsonToCircuitJson;
|
|
1879
1879
|
|
|
1880
1880
|
// lib/fetch-easyeda-json.ts
|
|
1881
|
-
async function fetchEasyEDAComponent(jlcpcbPartNumber) {
|
|
1881
|
+
async function fetchEasyEDAComponent(jlcpcbPartNumber, { fetch: fetch2 = globalThis.fetch } = {}) {
|
|
1882
1882
|
const searchUrl = "https://easyeda.com/api/components/search";
|
|
1883
1883
|
const componentUrl = (uuid) => `https://easyeda.com/api/components/${uuid}?version=6.4.7&uuid=${uuid}&datastrid=`;
|
|
1884
1884
|
const searchHeaders = {
|
|
@@ -1898,7 +1898,7 @@ async function fetchEasyEDAComponent(jlcpcbPartNumber) {
|
|
|
1898
1898
|
cookie: "<PUT your cookies here>"
|
|
1899
1899
|
};
|
|
1900
1900
|
const searchData = `type=3&doctype%5B%5D=2&uid=0819f05c4eef4c71ace90d822a990e87&returnListStyle=classifyarr&wd=${jlcpcbPartNumber}&version=6.4.7`;
|
|
1901
|
-
const searchResponse = await
|
|
1901
|
+
const searchResponse = await fetch2(searchUrl, {
|
|
1902
1902
|
method: "POST",
|
|
1903
1903
|
headers: searchHeaders,
|
|
1904
1904
|
body: searchData
|
|
@@ -1914,7 +1914,7 @@ async function fetchEasyEDAComponent(jlcpcbPartNumber) {
|
|
|
1914
1914
|
(component) => component.dataStr.head.c_para["Supplier Part"] === jlcpcbPartNumber
|
|
1915
1915
|
) ?? searchResult.result.lists.lcsc[0];
|
|
1916
1916
|
const componentUUID = bestMatchComponent.uuid;
|
|
1917
|
-
const componentResponse = await
|
|
1917
|
+
const componentResponse = await fetch2(componentUrl(componentUUID), {
|
|
1918
1918
|
method: "GET",
|
|
1919
1919
|
headers: {
|
|
1920
1920
|
...searchHeaders,
|
|
@@ -2854,4 +2854,4 @@ export {
|
|
|
2854
2854
|
convertRawEasyToTsx,
|
|
2855
2855
|
convertEasyEdaJsonToVariousFormats
|
|
2856
2856
|
};
|
|
2857
|
-
//# sourceMappingURL=chunk-
|
|
2857
|
+
//# sourceMappingURL=chunk-CROLWOEW.js.map
|