Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/ui / dist / forms / deps / isValidShippingAddress.js
Size: Mime:
"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