UNPKG

@kiwicom/orbit-components

Version:

Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.

20 lines (17 loc) 586 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var validateDecrement = function validateDecrement(_ref) { var value = _ref.value, _ref$minValue = _ref.minValue, minValue = _ref$minValue === void 0 ? Number.NEGATIVE_INFINITY : _ref$minValue, _ref$step = _ref.step, step = _ref$step === void 0 ? 1 : _ref$step; var newValue = value - step; var calculatedValue = newValue <= +minValue ? minValue : newValue; return calculatedValue; }; var _default = validateDecrement; exports.default = _default;