Repository URL to install this package:
|
Version:
2.7.6 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const exotic_1 = require("exotic");
const isAlphaNumeric_1 = require("./isAlphaNumeric");
const matchAlphaNumericSpecialCharacters = /^[ A-Za-z0-9,/#-]*$/;
const matchSpaces = /\s/g;
function isValidShippingAddress(value) {
const withoutSpaces = String(value).replace(matchSpaces, '');
if (exotic_1.isEmpty(withoutSpaces)) {
return false;
} else {
return isAlphaNumeric_1.isAlphaNumericWithSpace(value) || matchAlphaNumericSpecialCharacters.test(value);
}
}
exports.isValidShippingAddress = isValidShippingAddress;
function EmptyOrValidShippingAddress(value) {
if (exotic_1.isEmpty(value)) {
return true;
} else {
return isValidShippingAddress(value);
}
}
exports.EmptyOrValidShippingAddress = EmptyOrValidShippingAddress; //# sourceMappingURL=isValidShippingAddress.js.map