Schema validation library for Archetypes.
To install the library, use pnpm:
pnpm install typematter/schemaNPM packages coming soon!
import schema from 'typematter/schema';
schema.valid([1, 2, 3], { type: 'Array', items: { type: 'Number' } }); // trueValidates a value against a schema.
value: any: The value to validate.schema: Schema: The schema to validate against.
boolean:trueif the value is valid,falseotherwise.
Validates a value against a schema and returns detailed information about the validation.
value: any: The value to validate.schema: Schema: The schema to validate against.
ValidationResult: An object containing detailed information about the validation.
Contributions are welcome! Please read the contributing guidelines first.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or suggestions, feel free to open an issue.