@scalar/api-client
Version:
the open source API testing client
17 lines (16 loc) • 505 B
JavaScript
import { safeLocalStorage as s, CLIENT_LS_KEYS as m } from "@scalar/helpers/object/local-storage";
const h = (t, o, r, { securitySchemeMutators: n, securitySchemes: a }, S = !1) => {
if (n.edit(t, o, r), !!S)
try {
const e = JSON.parse(s().getItem(m.AUTH) ?? "{}"), c = a[t];
if (e && c?.nameKey) {
const f = e[c.nameKey] ||= {};
f[o] = r, s().setItem(m.AUTH, JSON.stringify(e));
}
} catch (e) {
console.error(e);
}
};
export {
h as updateScheme
};