easyeda 0.0.297 → 0.0.299

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/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.296",
3531
+ version: "0.0.298",
3532
3532
  files: [
3533
3533
  "dist"
3534
3534
  ],
@@ -10746,7 +10746,8 @@ var parseText = (str) => {
10746
10746
  ] = str.split("~");
10747
10747
  return {
10748
10748
  type: "TEXT",
10749
- alignment,
10749
+ // Some EasyEDA component payloads use "P" for start-aligned text.
10750
+ alignment: alignment === "P" ? "L" : alignment,
10750
10751
  x: Number(x),
10751
10752
  y: Number(y),
10752
10753
  rotation: Number(rotation2),
@@ -10790,7 +10791,12 @@ var SingleLetterShapeSchema = import_zod180.z.string().transform((x) => {
10790
10791
  // lib/schemas/easy-eda-json-schema.ts
10791
10792
  var maybeNumber = import_zod181.z.any().transform((k) => k === "nan" || Number.isNaN(k) ? null : k).pipe(import_zod181.z.number().nullable().optional());
10792
10793
  var SzlcscSchema = import_zod181.z.object({
10793
- id: import_zod181.z.number(),
10794
+ id: import_zod181.z.preprocess((value) => {
10795
+ if (typeof value === "string" && /^\d+$/.test(value)) {
10796
+ return Number(value);
10797
+ }
10798
+ return value;
10799
+ }, import_zod181.z.number()),
10794
10800
  number: import_zod181.z.string(),
10795
10801
  step: import_zod181.z.number().optional(),
10796
10802
  min: import_zod181.z.number().optional(),
@@ -10823,10 +10829,10 @@ var HeadSchema = import_zod181.z.object({
10823
10829
  puuid: import_zod181.z.string().optional(),
10824
10830
  uuid: import_zod181.z.string(),
10825
10831
  utime: import_zod181.z.preprocess((val) => {
10826
- if (val === "") return 0;
10832
+ if (val == null || val === "") return void 0;
10827
10833
  if (typeof val === "string") return Number(val);
10828
10834
  return val;
10829
- }, import_zod181.z.number()),
10835
+ }, import_zod181.z.number().optional()),
10830
10836
  importFlag: import_zod181.z.number().optional(),
10831
10837
  c_spiceCmd: import_zod181.z.any().optional(),
10832
10838
  hasIdFlag: import_zod181.z.boolean().default(false)