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