A set of mixins for lodash.
var user = {
name: 'Frank'
};
_.getOrElse(user, 'name', 'John');
// -> Frank
_.getOrElse(user, 'age', 20);
// -> 20
var olds = [{
_id: 1,
name: 'Milk'
}, {
_id: 2,
name: 'Eggs'
}];
var news = [{
_id: 2,
name: 'Meat'
}, {
_id: 1,
name: 'Hamburger'
}];
_.mergeArrays(olds, news, '_id');
// -> [{ _id: 1 name: 'Hamburger' }, { _id: 2, name: 'Meat' }]
var url = 'http://google.com';
_.isValidUrl(url);
// -> true
var url = 'http://google';
_.isValidUrl(url);
// -> false
var email = 'me@example.com';
_.isValidEmail(email);
// -> true
var email = 'me@me.t';
_.isValidEmail(email);
// -> false