fixed problem with multiple carts and a whole load of problems with crazy delivery destination logic / if I didn't write it i would have thought it was written by a drug abuser during high
This commit is contained in:
@@ -1,17 +1,28 @@
|
||||
var Validations = {
|
||||
_emailRe: /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
||||
isValidEmail: function(value) {
|
||||
return this._emailRe.test(value);
|
||||
var _ = require('underscore');
|
||||
|
||||
},
|
||||
var Validations = {
|
||||
_emailRe: /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
||||
isValidEmail: function(value) {
|
||||
return this._emailRe.test(value);
|
||||
|
||||
},
|
||||
isValidRequired: function(value) {
|
||||
if(value === undefined || value === "") {
|
||||
if (value === undefined || value === "") {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
},
|
||||
|
||||
safeString: function(item) {
|
||||
if (!_.isString(item)) {
|
||||
return "";
|
||||
} else {
|
||||
return item;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
module.exports = Validations;
|
||||
module.exports = Validations;
|
||||
Reference in New Issue
Block a user