easyeda 0.0.18 → 0.0.19
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/dist/cli/main.cjs +11 -2
- package/dist/cli/main.cjs.map +1 -1
- package/dist/lib/index.cjs +10 -1
- package/dist/lib/index.cjs.map +1 -1
- package/package.json +1 -1
package/dist/lib/index.cjs
CHANGED
|
@@ -29568,7 +29568,8 @@ var convertToTypescriptComponent = ({
|
|
|
29568
29568
|
soup,
|
|
29569
29569
|
easyeda: easyEdaJson
|
|
29570
29570
|
}) => {
|
|
29571
|
-
const
|
|
29571
|
+
const rawPn = easyEdaJson.dataStr.head.c_para["Manufacturer Part"];
|
|
29572
|
+
const pn = normalizeManufacturerPartNumber(rawPn);
|
|
29572
29573
|
const [cad_component2] = (0, import_soup_util2.su)(soup).cad_component.list();
|
|
29573
29574
|
const smtpads = (0, import_soup_util2.su)(soup).pcb_smtpad.list();
|
|
29574
29575
|
const plated_holes = (0, import_soup_util2.su)(soup).pcb_plated_hole.list();
|
|
@@ -29598,6 +29599,14 @@ var convertToTypescriptComponent = ({
|
|
|
29598
29599
|
easyEdaJson
|
|
29599
29600
|
});
|
|
29600
29601
|
};
|
|
29602
|
+
function normalizeManufacturerPartNumber(partNumber) {
|
|
29603
|
+
let normalized = partNumber.replace(/-/g, "_");
|
|
29604
|
+
normalized = normalized.replace(/[^a-zA-Z0-9_$]/g, "");
|
|
29605
|
+
if (/^\d/.test(normalized)) {
|
|
29606
|
+
normalized = "A" + normalized;
|
|
29607
|
+
}
|
|
29608
|
+
return normalized;
|
|
29609
|
+
}
|
|
29601
29610
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29602
29611
|
0 && (module.exports = {
|
|
29603
29612
|
convertEasyEdaJsonToTscircuitSoupJson,
|