Skip to content

Commit cf0247f

Browse files
author
Alexander Mays
committed
Prevent crashing by adding default args
Signed-off-by: Alexander Mays <[email protected]>
1 parent 9405e35 commit cf0247f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/classes/MemoryCache.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ export class MemoryCache {
99
* @param {Object} options - An object of default options
1010
* @param {String} [options.defaultTtl=600000] - The number of milliseconds to use as the default time-to-live of a cache entry
1111
*/
12-
constructor(options) {
13-
options = options || {};
14-
12+
constructor(options = {}) {
1513
this.cache = new Map();
1614
this.debug = false;
1715
this.hitCount = 0;

src/classes/ParseApp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const defaults = {
1111
};
1212

1313
export class ParseApp {
14-
constructor(args) {
14+
constructor(args = {}) {
1515
if (!args.appId || !args.masterKey) {
1616
throw 'You must provide an appId and masterKey!';
1717
}

0 commit comments

Comments
 (0)