easyeda 0.0.19 → 0.0.21
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 +15 -10
- package/dist/cli/main.cjs.map +1 -1
- package/dist/lib/index.cjs +18 -11
- package/dist/lib/index.cjs.map +1 -1
- package/dist/lib/index.d.cts +3 -1
- package/package.json +1 -1
package/dist/lib/index.cjs
CHANGED
|
@@ -28650,7 +28650,8 @@ var lib_exports = {};
|
|
|
28650
28650
|
__export(lib_exports, {
|
|
28651
28651
|
convertEasyEdaJsonToTscircuitSoupJson: () => convertEasyEdaJsonToTscircuitSoupJson,
|
|
28652
28652
|
convertRawEasyEdaToTs: () => convertRawEasyEdaToTs,
|
|
28653
|
-
fetchEasyEDAComponent: () => fetchEasyEDAComponent
|
|
28653
|
+
fetchEasyEDAComponent: () => fetchEasyEDAComponent,
|
|
28654
|
+
normalizeManufacturerPartNumber: () => normalizeManufacturerPartNumber
|
|
28654
28655
|
});
|
|
28655
28656
|
module.exports = __toCommonJS(lib_exports);
|
|
28656
28657
|
|
|
@@ -28870,7 +28871,10 @@ var ShapeItemSchema = import_zod.z.object({
|
|
|
28870
28871
|
}
|
|
28871
28872
|
case "SOLIDREGION": {
|
|
28872
28873
|
const [layermask, , pathData, fillStyle, id] = shape.data.split("~");
|
|
28873
|
-
const points = pathData.match(/[ML] ?([\d.]+[ ,][\d.]+)/g)
|
|
28874
|
+
const points = pathData.match(/[ML] ?(-?[\d.]+)[ ,](-?[\d.]+)/g)?.map((point) => {
|
|
28875
|
+
const [, x, y] = point.match(/[ML]? ?(-?[\d.]+)[ ,](-?[\d.]+)/) || [];
|
|
28876
|
+
return [Number(x), Number(y)];
|
|
28877
|
+
}) || [];
|
|
28874
28878
|
return SolidRegionSchema.parse({
|
|
28875
28879
|
type: "SOLIDREGION",
|
|
28876
28880
|
layermask: Number(layermask),
|
|
@@ -29552,6 +29556,16 @@ export const use${componentName} = createUseComponent(${componentName}, pinNames
|
|
|
29552
29556
|
`.trim();
|
|
29553
29557
|
};
|
|
29554
29558
|
|
|
29559
|
+
// lib/utils/normalize-manufacturer-part-number.ts
|
|
29560
|
+
function normalizeManufacturerPartNumber(partNumber) {
|
|
29561
|
+
let normalized = partNumber.replace(/-/g, "_");
|
|
29562
|
+
normalized = normalized.replace(/[^a-zA-Z0-9_$]/g, "");
|
|
29563
|
+
if (/^\d/.test(normalized)) {
|
|
29564
|
+
normalized = "A" + normalized;
|
|
29565
|
+
}
|
|
29566
|
+
return normalized;
|
|
29567
|
+
}
|
|
29568
|
+
|
|
29555
29569
|
// lib/convert-to-typescript-component/index.tsx
|
|
29556
29570
|
var convertRawEasyEdaToTs = (rawEasy) => {
|
|
29557
29571
|
const easyeda = EasyEdaJsonSchema.parse(rawEasy);
|
|
@@ -29599,19 +29613,12 @@ var convertToTypescriptComponent = ({
|
|
|
29599
29613
|
easyEdaJson
|
|
29600
29614
|
});
|
|
29601
29615
|
};
|
|
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
|
-
}
|
|
29610
29616
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29611
29617
|
0 && (module.exports = {
|
|
29612
29618
|
convertEasyEdaJsonToTscircuitSoupJson,
|
|
29613
29619
|
convertRawEasyEdaToTs,
|
|
29614
|
-
fetchEasyEDAComponent
|
|
29620
|
+
fetchEasyEDAComponent,
|
|
29621
|
+
normalizeManufacturerPartNumber
|
|
29615
29622
|
});
|
|
29616
29623
|
/*! Bundled license information:
|
|
29617
29624
|
|