Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const set = (index, value, keep = false) => {
if (value === undefined) {
if (keep) {
return LocalStorage.remove(index)
}
return SessionStorage.remove(index)
}
if (keep) {
return LocalStorage.set(index, value)
}
return SessionStorage.set(index, value)
}