@thangk/easythemer
Version:
Easily generate shades from a colour palette for use in your app
15 lines • 510 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function limiter(input, limitStringArray) {
const mode = limitStringArray.split("-")[0];
const limit = parseInt(limitStringArray.split("-")[1]);
// for max mode
if (mode === "max")
return input > limit ? limit : input;
if (mode === "min")
return input < limit ? limit : input;
// for neither mode
return input;
}
exports.default = limiter;
//# sourceMappingURL=limiter.js.map