@ship-ui/core 0.18.4 → 0.18.10

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/bin/mcp/index.js CHANGED
@@ -4586,6 +4586,7 @@ var require_limitLength = __commonJS((exports) => {
4586
4586
  var require_pattern = __commonJS((exports) => {
4587
4587
  Object.defineProperty(exports, "__esModule", { value: true });
4588
4588
  var code_1 = require_code2();
4589
+ var util_1 = require_util();
4589
4590
  var codegen_1 = require_codegen();
4590
4591
  var error2 = {
4591
4592
  message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
@@ -4598,10 +4599,18 @@ var require_pattern = __commonJS((exports) => {
4598
4599
  $data: true,
4599
4600
  error: error2,
4600
4601
  code(cxt) {
4601
- const { data, $data, schema, schemaCode, it } = cxt;
4602
+ const { gen, data, $data, schema, schemaCode, it } = cxt;
4602
4603
  const u = it.opts.unicodeRegExp ? "u" : "";
4603
- const regExp = $data ? (0, codegen_1._)`(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema);
4604
- cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
4604
+ if ($data) {
4605
+ const { regExp } = it.opts.code;
4606
+ const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);
4607
+ const valid = gen.let("valid");
4608
+ gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
4609
+ cxt.fail$data((0, codegen_1._)`!${valid}`);
4610
+ } else {
4611
+ const regExp = (0, code_1.usePattern)(cxt, schema);
4612
+ cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
4613
+ }
4605
4614
  }
4606
4615
  };
4607
4616
  exports.default = def;
@@ -7888,7 +7897,7 @@ class Doc {
7888
7897
  var version = {
7889
7898
  major: 4,
7890
7899
  minor: 3,
7891
- patch: 5
7900
+ patch: 6
7892
7901
  };
7893
7902
 
7894
7903
  // node_modules/zod/v4/core/schemas.js
@@ -8928,7 +8937,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
8928
8937
  if (keyResult instanceof Promise) {
8929
8938
  throw new Error("Async schemas not supported in object keys currently");
8930
8939
  }
8931
- const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length && keyResult.issues.some((iss) => iss.code === "invalid_type" && iss.expected === "number");
8940
+ const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length;
8932
8941
  if (checkNumericKey) {
8933
8942
  const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
8934
8943
  if (retryResult instanceof Promise) {
@@ -10094,7 +10103,7 @@ function finalize(ctx, schema) {
10094
10103
  }
10095
10104
  }
10096
10105
  }
10097
- if (refSchema.$ref) {
10106
+ if (refSchema.$ref && refSeen.def) {
10098
10107
  for (const key in schema2) {
10099
10108
  if (key === "$ref" || key === "allOf")
10100
10109
  continue;