Skip to content

Commit

Permalink
Merge pull request #53 from KhaledElAnsari/patch-1
Browse files Browse the repository at this point in the history
shortened return expressions
  • Loading branch information
tsironis authored Sep 22, 2017
2 parents 7a1bafc + b2ac8a3 commit 2f0de42
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.grunt
node_modules
_SpecRunner.html
package-lock.json
lockr.min.js
15 changes: 6 additions & 9 deletions lockr.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@
value = null;
}
}
if(value === null) {

if(!value) {
return missing;
} else if (typeof value === 'object' && typeof value.data !== 'undefined') {
}
else if (typeof value === 'object' && typeof value.data !== 'undefined') {
return value.data;
} else {
return missing;
}
};

Expand Down Expand Up @@ -111,11 +111,8 @@
} catch (e) {
value = null;
}

if (value === null)
return [];
else
return (value.data || []);

return (value && value.data) ? value.data : [];
};

Lockr.sismember = function(key, value, options) {
Expand Down
1 change: 0 additions & 1 deletion lockr.min.js

This file was deleted.

0 comments on commit 2f0de42

Please sign in to comment.