@palmares/schemas
Version:
This defines a default schema definition for validation of data, it abstract popular schema validation libraries like zod, yup, valibot and others"
41 lines (39 loc) • 2.32 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/constants.ts
var constants_exports = {};
__export(constants_exports, {
DEFAULT_NUMBER_INTEGER_EXCEPTION: () => DEFAULT_NUMBER_INTEGER_EXCEPTION,
DEFAULT_NUMBER_MAX_EXCEPTION: () => DEFAULT_NUMBER_MAX_EXCEPTION,
DEFAULT_NUMBER_MIN_EXCEPTION: () => DEFAULT_NUMBER_MIN_EXCEPTION,
DEFAULT_NUMBER_POSITIVE_EXCEPTION: () => DEFAULT_NUMBER_POSITIVE_EXCEPTION
});
module.exports = __toCommonJS(constants_exports);
var DEFAULT_NUMBER_MAX_EXCEPTION = /* @__PURE__ */ __name((max, inclusive) => `The number is greater than the allowed ${max}.${inclusive ? ` The value ${max} is accepted as well.` : ""}`, "DEFAULT_NUMBER_MAX_EXCEPTION");
var DEFAULT_NUMBER_MIN_EXCEPTION = /* @__PURE__ */ __name((min, inclusive) => `The number is less than the allowed ${min}.${inclusive ? ` The value ${min} is accepted as well.` : ""}`, "DEFAULT_NUMBER_MIN_EXCEPTION");
var DEFAULT_NUMBER_POSITIVE_EXCEPTION = /* @__PURE__ */ __name((allowZero) => `The number should be positive.${allowZero ? ` The value 0 is accepted as well.` : ""}`, "DEFAULT_NUMBER_POSITIVE_EXCEPTION");
var DEFAULT_NUMBER_INTEGER_EXCEPTION = /* @__PURE__ */ __name(() => `The number should be an integer.`, "DEFAULT_NUMBER_INTEGER_EXCEPTION");
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
DEFAULT_NUMBER_INTEGER_EXCEPTION,
DEFAULT_NUMBER_MAX_EXCEPTION,
DEFAULT_NUMBER_MIN_EXCEPTION,
DEFAULT_NUMBER_POSITIVE_EXCEPTION
});