Closed
Description
🐛 Bug Report
multiple extend was broken here: #69
it was sort of fixed here: #74
however, the result is the hack function below to extend multiple times:
export const extendMultiple = (...schemas: ObjectSchema[]): ObjectSchema =>
schemas.reduce((prev, curr) => curr.extend(prev), S.object());
To Reproduce
// extend is not a function (technically, the second extend doesn't exist)
S.object().extend(S.object()).extend(S.object())
// ...or
const schema = extendMultiple(S.object(), S.object(), S.object());
Expected behavior
extend
shouldn't be excluded from the return value here: https://github.com/fastify/fluent-schema/blob/5ffffb8110a6fe845ca6cd7bbaaf2dc358960b5a/src/ObjectSchema.js#L261-L278
Your Environment
- node version: 12
- os: Mac,
- fluent-schema version: 1.0.3
Metadata
Metadata
Assignees
Labels
No labels