UNPKG

@scalar/api-client

Version:

the open source API testing client

18 lines (17 loc) 634 B
import { getResolvedRef as n } from "@scalar/workspace-store/helpers/get-resolved-ref"; import { isParamDisabled as m } from "../../request-block/helpers/is-param-disabled.js"; import { getExample as f } from "./get-example.js"; const s = (e) => e == null ? !0 : typeof e == "string" ? e.trim() === "" : !1, c = (e = [], o = "default") => { const r = []; for (const i of e) { const t = n(i); if (t.in !== "path") continue; const a = f(t, o, void 0); m(t, a) || s(a?.value) && r.push(t.name); } return r.length > 0 ? { ok: !1, invalidParams: r } : { ok: !0 }; }; export { c as validatePathParameters };