We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
schema
Current implementation:
import type {Schema} from 'type-fest'; interface Users { names: Array<{ firstname: string; lastname: string; }>; } type UserMask = Schema<Users, 'mask' | 'hide' | 'show'>; const userMaskSettings: UserMask = { names: 'mask', }
Should be:
const userMaskSettings: UserMask = { names: [ { firstname: 'mask', lastname: 'mask' }, { firstname: 'hide', lastname: 'show' }, ], }
The text was updated successfully, but these errors were encountered:
@sindresorhus, @bvandercar-vt, do you think the implementation should change for arrays in general, or just for arrays of objects?
Given the following example, based on the current implementation:
import type {Schema} from 'type-fest'; interface Users { names: Array<string>; } type UserMask = Schema<Users, 'mask' | 'hide' | 'show'>; const userMaskSettings: UserMask = { names: 'mask' }
should userMaskSettings be changed as follows ?
userMaskSettings
const userMaskSettings: UserMask = { names: ['mask'] }
Sorry, something went wrong.
@grigorischristainas that change makes sense to me.
Schema
#887
No branches or pull requests
Current implementation:
Should be:
Upvote & Fund
The text was updated successfully, but these errors were encountered: