schm icon indicating copy to clipboard operation
schm copied to clipboard

Composable schemas for JavaScript and Node.js

Results 39 schm issues
Sort by recently updated
recently updated
newest added

A variant of [PR #48](https://github.com/diegohaz/schm/pull/48), to address CI build errors.

When using translation for nested schemas, the package ignores the new parse function for deep level schemas. This pull request fixes the issue assuring that deeper level schemas are correctly...

Hey guys, is there a way to return Promise.reject() if the array is empty? ```js // should return Promise.reject() validate({foo: []}) ```

According to the [Mongoose arrays documentation](https://mongoosejs.com/docs/schematypes.html#arrays), an array default value is possible. But in schm, when array of schema is validatate, the default value is always an empty array. Inspired...

I needed to validate whether the startDate is before the endDate and whether both dates have the right format: ``` var dateSchema = new schema({ dateRange: { type: { startDate:...

In defaultSchema merge function you have: ```js const merged = merge({}, this, ...schemas) ``` is there a reason for using lodash' deepMerge instead of a simple reduce: ```js const merged...

Resolved issue with trying to run on undefined by wrapping in try catch block and defaulting to undefined.

Validation nesting schemas throws an error if Composite Schema --- ``` const user = schema({ email: String }); const querySchema = schema({ user, startDate: Date, endDate: Date }); ``` Validation...

bug
PR welcome

Like me and you struggled to read the docs and the code to understand how to use parsers and validators, I've thrown together an example to help people get their...