easyeda 0.0.172 → 0.0.173

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.
@@ -162,7 +162,8 @@ var ShapeItemSchema = z.object({
162
162
  let points, rotation2;
163
163
  if (padShape === "RECT") {
164
164
  points = parsePoints(rest[0]);
165
- rotation2 = Number(rest[1]);
165
+ const r = Number(rest[1]);
166
+ rotation2 = Number.isNaN(r) ? void 0 : r;
166
167
  }
167
168
  const padInputParams = {
168
169
  type: "PAD",
@@ -258,6 +259,7 @@ var ShapeItemSchema = z.object({
258
259
  }
259
260
  case "RECT": {
260
261
  const [x, y, width, height, lineWidth, id, rotation2, layer, fillStyle] = shape.data.split("~");
262
+ const r = rotation2 ? Number(rotation2) : void 0;
261
263
  return RectSchema.parse({
262
264
  type: "RECT",
263
265
  x,
@@ -266,13 +268,14 @@ var ShapeItemSchema = z.object({
266
268
  height,
267
269
  lineWidth: Number(lineWidth),
268
270
  id,
269
- rotation: rotation2 ? Number(rotation2) : void 0,
271
+ rotation: Number.isNaN(r) ? void 0 : r,
270
272
  layer: layer ? Number(layer) : void 0,
271
273
  fillStyle: fillStyle || void 0
272
274
  });
273
275
  }
274
276
  case "TEXT": {
275
277
  const [textAnchor, x, y, size2, layer, id, rotation2, , font, text] = shape.data.split("~");
278
+ const r = rotation2 ? Number(rotation2) : void 0;
276
279
  return TextSchema.parse({
277
280
  type: "TEXT",
278
281
  text,
@@ -282,7 +285,7 @@ var ShapeItemSchema = z.object({
282
285
  // empirically this seems to match, C5248081 is a good test case
283
286
  layer: layer ? Number(layer) : void 0,
284
287
  id,
285
- rotation: rotation2 ? Number(rotation2) : void 0,
288
+ rotation: Number.isNaN(r) ? void 0 : r,
286
289
  textAnchor,
287
290
  font: font || void 0
288
291
  });
@@ -408,6 +411,7 @@ var parsePin = (pinString) => {
408
411
  const path = pathMatch ? pathMatch[1] : "";
409
412
  const arrowMatch = pinString.match(/\^\^0~(.+)$/);
410
413
  const arrow = arrowMatch ? arrowMatch[1] : "";
414
+ const r = parseFloat(rotation2);
411
415
  return {
412
416
  type: "PIN",
413
417
  visibility,
@@ -415,7 +419,7 @@ var parsePin = (pinString) => {
415
419
  pinNumber: isNaN(Number(pinNumber)) ? pinNumber : Number(pinNumber),
416
420
  x: parseFloat(x),
417
421
  y: parseFloat(y),
418
- rotation: parseFloat(rotation2),
422
+ rotation: Number.isNaN(r) ? 0 : r,
419
423
  label,
420
424
  labelColor,
421
425
  path,