@tscircuit/pcb-viewer 1.11.44 → 1.11.46

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/index.js CHANGED
@@ -3934,16 +3934,32 @@ ZodReadonly.create = (type, params) => {
3934
3934
  ...processCreateParams(params)
3935
3935
  });
3936
3936
  };
3937
- function custom(check, params = {}, fatal) {
3937
+ function cleanParams(params, data) {
3938
+ const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
3939
+ const p2 = typeof p === "string" ? { message: p } : p;
3940
+ return p2;
3941
+ }
3942
+ function custom(check, _params = {}, fatal) {
3938
3943
  if (check)
3939
3944
  return ZodAny.create().superRefine((data, ctx) => {
3940
3945
  var _a, _b;
3941
- if (!check(data)) {
3942
- const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
3943
- const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
3944
- const p2 = typeof p === "string" ? { message: p } : p;
3945
- ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
3946
+ const r = check(data);
3947
+ if (r instanceof Promise) {
3948
+ return r.then((r2) => {
3949
+ var _a2, _b2;
3950
+ if (!r2) {
3951
+ const params = cleanParams(_params, data);
3952
+ const _fatal = (_b2 = (_a2 = params.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
3953
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
3954
+ }
3955
+ });
3946
3956
  }
3957
+ if (!r) {
3958
+ const params = cleanParams(_params, data);
3959
+ const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
3960
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
3961
+ }
3962
+ return;
3947
3963
  });
3948
3964
  return ZodAny.create();
3949
3965
  }
@@ -8143,7 +8159,7 @@ import { css } from "@emotion/css";
8143
8159
  // package.json
8144
8160
  var package_default = {
8145
8161
  name: "@tscircuit/pcb-viewer",
8146
- version: "1.11.43",
8162
+ version: "1.11.45",
8147
8163
  main: "dist/index.js",
8148
8164
  type: "module",
8149
8165
  repository: "tscircuit/pcb-viewer",
@@ -8171,7 +8187,7 @@ var package_default = {
8171
8187
  "@swc/core": "^1.4.12",
8172
8188
  "@tscircuit/core": "0.0.274",
8173
8189
  "@tscircuit/eagle-xml-converter": "^1.0.0",
8174
- "@tscircuit/props": "^0.0.144",
8190
+ "@tscircuit/props": "^0.0.151",
8175
8191
  "@tscircuit/soup-util": "^0.0.41",
8176
8192
  "@types/color": "^3.0.6",
8177
8193
  "@types/node": "18.7.23",