import * as v from "@badrap/valita";
import { unknown } from "@badrap/valita";
import { isProd } from "./config.js";
import { isJSONValue, isJSONObject } from "./json.js";
import "./valita.js";
const path = [];
const jsonSchema = unknown().chain((v2) => {
  if (isProd) {
    return v.ok(v2);
  }
  const rv = isJSONValue(v2, path) ? v.ok(v2) : v.err({
    message: `Not a JSON value`,
    path: path.slice()
  });
  path.length = 0;
  return rv;
});
const jsonObjectSchema = unknown().chain((v2) => {
  if (isProd) {
    return v.ok(v2);
  }
  const rv = isJSONObject(v2, path) ? v.ok(v2) : v.err({
    message: `Not a JSON object`,
    path: path.slice()
  });
  path.length = 0;
  return rv;
});
export {
  jsonObjectSchema,
  jsonSchema
};
//# sourceMappingURL=json-schema.js.map
