UNPKG

@aurigma/design-atoms-model

Version:

Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.

17 lines 724 B
import { ArgumentException } from "../Exception"; import { isNullOrEmptyOrWhiteSpace } from "../Utils/Utils"; export function validateStringProperty(value) { if (isNullOrEmptyOrWhiteSpace(value)) throw new ArgumentException("Value must be a non-empty string"); return value; } export function validateComponent(value, min, max) { if (min === void 0) { min = 0; } if (max === void 0) { max = 255; } if (typeof value != "number") throw new ArgumentException("Value must be a number"); if (value < min || value > max) throw new ArgumentException("Value must be in range [" + min + ", " + max + "]"); return value; } //# sourceMappingURL=ValidationUtils.js.map