Skip to content

Commit e95da45

Browse files
committed
fix: NW.js module is not defined fix.
Now the factory assignment for localforage is applied to `global.modules.exports` instead of `modules.exports` if `module` is undefined. `module` is undefined in an NW.js environment (for whatever reason). So now we check for module and we uses global if `module` is undefined. Otherwise we proceed as before. Thank @ashleyhindle for fix. Fixes #77
1 parent ee0de4a commit e95da45

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dist/angular-localForage.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
return factory(angular, localforage);
1515
});
1616
} else if(typeof exports === 'object' || typeof global === 'object') {
17-
module.exports = factory(angular, require('localforage')); // Node/Browserify
17+
if(typeof module === 'undefined') {
18+
global.module.exports = factory(angular, require('localforage')); // NW.js
19+
} else {
20+
modules.exports = factory(angular, require('localforage')); // Node/Browserify
21+
}
1822
} else {
1923
return factory(angular, root.localforage); // Browser
2024
}

0 commit comments

Comments
 (0)