@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.
15 lines • 646 B
JavaScript
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 = 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