-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
32aa01b
commit 1b5b89e
Showing
8 changed files
with
93 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
'use strict'; | ||
|
||
var _ = require('underscore'); | ||
|
||
// check if object contains any of expected keys | ||
exports.hasSome = function(obj, keys) { | ||
var objKeys = _(obj).keys(); | ||
return _(keys).some(function(key) { | ||
return _(objKeys).contains(key); | ||
}); | ||
}; | ||
|
||
exports.isSimpleValue = function(value) { | ||
return ( | ||
_.isString(value) || | ||
_.isNumber(value) || | ||
_.isBoolean(value) || | ||
_.isNull(value) || | ||
_.isUndefined(value) || | ||
_.isRegExp(value) || | ||
_.isDate(value) | ||
); | ||
}; | ||
|
||
exports.isObjectObject = function(obj) { | ||
return _.isObject(obj) && Object.prototype.toString.call(obj) === '[object Object]'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters