@ghentcdh/crouton-api 0.0.1-alpha.57 → 0.0.1-alpha.58

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.cjs CHANGED
@@ -1993,7 +1993,9 @@ var import_zod21 = require("zod");
1993
1993
  var isInstanceOf = /* @__PURE__ */ __name((zodSchema, className) => {
1994
1994
  if (!(zodSchema instanceof import_zod21.z.ZodCustom)) return false;
1995
1995
  const result = zodSchema.safeParse(null);
1996
- return !result.success && result.error.issues[0]?.expected === className;
1996
+ if (result.success) return false;
1997
+ const issue = result.error.issues[0];
1998
+ return issue?.expected === className || (issue?.message?.includes(className) ?? false);
1997
1999
  }, "isInstanceOf");
1998
2000
  var jsonSchemaOverride = /* @__PURE__ */ __name(({ zodSchema, jsonSchema }) => {
1999
2001
  if (zodSchema instanceof import_zod21.z.ZodDate) {
@@ -7916,6 +7918,7 @@ var buildResourceDiffs = /* @__PURE__ */ __name(async (models, deps) => {
7916
7918
  var import_node_child_process = require("child_process");
7917
7919
  var import_node_fs7 = require("fs");
7918
7920
  var import_promises7 = require("fs/promises");
7921
+ var import_node_module2 = require("module");
7919
7922
  var import_node_path15 = require("path");
7920
7923
  var run = /* @__PURE__ */ __name((cmd, args, cwd) => new Promise((resolve7) => {
7921
7924
  const child = (0, import_node_child_process.spawn)(cmd, args, {
@@ -7967,11 +7970,28 @@ ${stderr}`.trim()
7967
7970
  };
7968
7971
  }, "prismaDbPull");
7969
7972
  var prismaCaseFormat = /* @__PURE__ */ __name(async (cwd, schemaPath) => {
7970
- const { code, stdout, stderr } = await run("npx", [
7971
- "prisma-case-format",
7972
- "--file",
7973
- schemaPath
7974
- ], cwd);
7973
+ let binPath;
7974
+ try {
7975
+ const _require2 = (0, import_node_module2.createRequire)(importMetaUrl);
7976
+ binPath = _require2.resolve("prisma-case-format/bin/cli.js");
7977
+ } catch {
7978
+ }
7979
+ const [cmd, args] = binPath ? [
7980
+ process.execPath,
7981
+ [
7982
+ binPath,
7983
+ "--file",
7984
+ schemaPath
7985
+ ]
7986
+ ] : [
7987
+ "npx",
7988
+ [
7989
+ "prisma-case-format",
7990
+ "--file",
7991
+ schemaPath
7992
+ ]
7993
+ ];
7994
+ const { code, stdout, stderr } = await run(cmd, args, cwd);
7975
7995
  return {
7976
7996
  ok: code === 0,
7977
7997
  output: `${stdout}