mirror of
https://github.com/debug-js/debug.git
synced 2026-01-25 16:42:28 +00:00
LocalStorage returns undefined for any key not present (#431)
This commit is contained in:
parent
ce4d93e71d
commit
0fb8ea4730
@ -148,14 +148,17 @@ function save(namespaces) {
|
||||
*/
|
||||
|
||||
function load() {
|
||||
var r;
|
||||
try {
|
||||
return exports.storage.debug;
|
||||
r = exports.storage.debug;
|
||||
} catch(e) {}
|
||||
|
||||
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
||||
if (typeof process !== 'undefined' && 'env' in process) {
|
||||
return process.env.DEBUG;
|
||||
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
||||
r = process.env.DEBUG;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user