Repository URL to install this package:
|
Version:
2.7.6 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const tslib_1 = require("tslib");
const exotic_1 = require("exotic");
const isValidLength_1 = tslib_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, 65) && matchAlphaNumeric.test(value);
return isStringWithLength;
}
exports.isValidCoupon = isValidCoupon; //# sourceMappingURL=isValidCoupon.js.map