INNER CODE UNIT · JavaScript
sanitizePromptProviderProfile
kevinchin12/ImageLens · background.js:605
function sanitizePromptProviderProfile(provider, input) {
const defaults = getPromptProviderDefaults(provider);
const merged = { ...defaults, ...(isPlainObject(input) ? input : {}) };
return {
apiKey: String(merged.apiKey || ""),
model: String(merged.model || defaults.model),
baseUrl: String(merged.baseUrl || defaults.baseUrl),
autoAnalyze: Boolean(merged.autoAnalyze)
};
}
function sanitizeImageProviderProfile(provider, input) {
const defaults = getImageProviderDefaults(provider);
const merged = { ...defaults, ...(isPlainObject(input) ? input : {}) };
return {
apiKey: String(merged.apiKey || ""),