Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convenience getType functions, bulk load function, addOptions function #49

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next Next commit
Add convenience functions for using getType
  • Loading branch information
patakijv committed Sep 22, 2016
commit 3587f8b93d883fb41e84e1b29c7d7c4536837833
19 changes: 17 additions & 2 deletions joli.js
Expand Up @@ -45,6 +45,21 @@ var joliCreator = function() {
return typeof obj;
}
},
isUndefined: function(obj) {
return obj === void 0;
},
isDefined: function(obj) {
return !(obj === void 0);
},
isObject: function(obj) {
return joli.getType(obj) === "object";
},
isArray: function(obj) {
return joli.getType(obj) === "array";
},
isFunction: function(obj) {
return joli.getType(obj) === "function"
},
jsonParse: function(json) {
return JSON.parse(json);
},
Expand Down Expand Up @@ -242,7 +257,7 @@ var joliCreator = function() {
q.where(field, value);
});
}

if (constraints.whereIn) {
joli.each(constraints.whereIn, function(value, field) {
q.whereIn(field, value);
Expand Down Expand Up @@ -275,7 +290,7 @@ var joliCreator = function() {
q.where(field, value);
});
}

if (constraints.whereIn) {
joli.each(constraints.whereIn, function(value, field) {
q.whereIn(field, value);
Expand Down