Skip to content

Commit

Permalink
Correct spelling for 'required' in brand example (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickocoffeyo committed May 23, 2022
1 parent bcc837a commit 78e4758
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions examples/brand/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ export type ID = Static<typeof ID>;
export const ArrayNonEmpty = <T extends Runtype>(element: T) =>
Array(element).withConstraint(a => 0 < a.length || 'array must not be empty');

export const IDRequiedAndOptional = Record({ required: ArrayNonEmpty(ID) })
export const IDRequiredAndOptional = Record({ required: ArrayNonEmpty(ID) })
.And(Partial({ optional: ArrayNonEmpty(ID) }))
.withBrand('IDRequiedAndOptional');
export type IDRequiedAndOptional = Static<typeof IDRequiedAndOptional>;
export type IDRequiedAndOptional = Static<typeof IDRequiredAndOptional>;

const test: IDRequiedAndOptional = IDRequiedAndOptional.check({ required: ['a'], optional: ['b'] });
const test: IDRequiedAndOptional = IDRequiredAndOptional.check({
required: ['a'],
optional: ['b'],
});

export default IDRequiedAndOptional;
export default IDRequiredAndOptional;

0 comments on commit 78e4758

Please sign in to comment.