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:
Senad Uka
2015-03-14 08:17:06 +01:00
parent e7793f0884
commit 8815267a79
12 changed files with 195 additions and 25 deletions

View File

@@ -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;