easyeda 0.0.298 → 0.0.300
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/browser/index.d.ts +28 -28
- package/dist/browser/index.js +20 -5
- package/dist/browser/index.js.map +1 -1
- package/dist/index.d.ts +28 -28
- package/dist/index.js +20 -5
- package/dist/index.js.map +1 -1
- package/dist/main.cjs +21 -6
- package/dist/main.cjs.map +1 -1
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -3528,7 +3528,7 @@ var import_promises = __toESM(require("fs/promises"), 1);
|
|
|
3528
3528
|
var package_default = {
|
|
3529
3529
|
name: "easyeda",
|
|
3530
3530
|
type: "module",
|
|
3531
|
-
version: "0.0.
|
|
3531
|
+
version: "0.0.299",
|
|
3532
3532
|
files: [
|
|
3533
3533
|
"dist"
|
|
3534
3534
|
],
|
|
@@ -9303,8 +9303,17 @@ var getPolarizedPinMetadata = (pinLabels) => {
|
|
|
9303
9303
|
};
|
|
9304
9304
|
|
|
9305
9305
|
// lib/utils/normalize-pin-labels.ts
|
|
9306
|
+
var normalizeActiveLowPinLabel = (label) => {
|
|
9307
|
+
if (!label.startsWith("#")) return label;
|
|
9308
|
+
const activeLowLabel = label.slice(1);
|
|
9309
|
+
if (activeLowLabel.length === 0) return label;
|
|
9310
|
+
return `N_${activeLowLabel}`;
|
|
9311
|
+
};
|
|
9306
9312
|
var normalizePinLabels = (inputPinLabels) => {
|
|
9307
|
-
const
|
|
9313
|
+
const normalizedInputPinLabels = inputPinLabels.map(
|
|
9314
|
+
(labels) => labels.map(normalizeActiveLowPinLabel)
|
|
9315
|
+
);
|
|
9316
|
+
const uniqueInputPinLabels = normalizedInputPinLabels.map((labels) => [
|
|
9308
9317
|
...new Set(labels)
|
|
9309
9318
|
]);
|
|
9310
9319
|
const result = uniqueInputPinLabels.map(() => []);
|
|
@@ -10746,7 +10755,8 @@ var parseText = (str) => {
|
|
|
10746
10755
|
] = str.split("~");
|
|
10747
10756
|
return {
|
|
10748
10757
|
type: "TEXT",
|
|
10749
|
-
|
|
10758
|
+
// Some EasyEDA component payloads use "P" for start-aligned text.
|
|
10759
|
+
alignment: alignment === "P" ? "L" : alignment,
|
|
10750
10760
|
x: Number(x),
|
|
10751
10761
|
y: Number(y),
|
|
10752
10762
|
rotation: Number(rotation2),
|
|
@@ -10790,7 +10800,12 @@ var SingleLetterShapeSchema = import_zod180.z.string().transform((x) => {
|
|
|
10790
10800
|
// lib/schemas/easy-eda-json-schema.ts
|
|
10791
10801
|
var maybeNumber = import_zod181.z.any().transform((k) => k === "nan" || Number.isNaN(k) ? null : k).pipe(import_zod181.z.number().nullable().optional());
|
|
10792
10802
|
var SzlcscSchema = import_zod181.z.object({
|
|
10793
|
-
id: import_zod181.z.
|
|
10803
|
+
id: import_zod181.z.preprocess((value) => {
|
|
10804
|
+
if (typeof value === "string" && /^\d+$/.test(value)) {
|
|
10805
|
+
return Number(value);
|
|
10806
|
+
}
|
|
10807
|
+
return value;
|
|
10808
|
+
}, import_zod181.z.number()),
|
|
10794
10809
|
number: import_zod181.z.string(),
|
|
10795
10810
|
step: import_zod181.z.number().optional(),
|
|
10796
10811
|
min: import_zod181.z.number().optional(),
|
|
@@ -10823,10 +10838,10 @@ var HeadSchema = import_zod181.z.object({
|
|
|
10823
10838
|
puuid: import_zod181.z.string().optional(),
|
|
10824
10839
|
uuid: import_zod181.z.string(),
|
|
10825
10840
|
utime: import_zod181.z.preprocess((val) => {
|
|
10826
|
-
if (val === "") return 0;
|
|
10841
|
+
if (val == null || val === "") return void 0;
|
|
10827
10842
|
if (typeof val === "string") return Number(val);
|
|
10828
10843
|
return val;
|
|
10829
|
-
}, import_zod181.z.number()),
|
|
10844
|
+
}, import_zod181.z.number().optional()),
|
|
10830
10845
|
importFlag: import_zod181.z.number().optional(),
|
|
10831
10846
|
c_spiceCmd: import_zod181.z.any().optional(),
|
|
10832
10847
|
hasIdFlag: import_zod181.z.boolean().default(false)
|