Repository URL to install this package:
|
Version:
3.7.2 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const exotic_1 = require("exotic");
const isValidLength_1 = 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