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 get = (index, keep = null) => {
if (keep === true) {
return parse(LocalStorage.get.item(index))
}
if (keep === false) {
return parse(LocalStorage.get.item(index))
}
const local = LocalStorage.get.item(index)
if (isValid(local)) {
return local
}
const session = SessionStorage.get.item(index)
if (isValid(session)) {
return session
}
}