Repository URL to install this package:
|
Version:
2.0.4 ▾
|
"use strict";
var __importDefault = this && this.__importDefault || function (mod) {
return mod && mod.__esModule ? mod : {
"default": mod
};
};
Object.defineProperty(exports, "__esModule", {
value: true
});
const exotic_1 = require("exotic");
const isValidLength_1 = __importDefault(require("./isValidLength"));
const matchAlphaNumeric = /^[A-Za-z0-9 -]+$/;
function isValidCoupon(value) {
const coerced = exotic_1.isNumber(value) ? String(value) : value;
const isStringWithLength = exotic_1.isString(coerced) && isValidLength_1.default(value, 2, 16) && matchAlphaNumeric.test(value);
return isStringWithLength;
}
exports.isValidCoupon = isValidCoupon; //# sourceMappingURL=isValidCoupon.js.map