File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,8 +61,17 @@ export function withSchemaMatrix<S extends json.Schema>(
6161 `value-for-${ String ( key ) } ` ,
6262 ] ;
6363
64- // Constructs an array of test objects, starting with `required` and adding
65- // acceptable values for any
64+ // Constructs an array of test objects, starting with `required` and combining it with all
65+ // possible states of each optional property. For example, with default settings:
66+ //
67+ // For { requiredKey: string }, we get: `[{ requiredKey: "some-string-value" }]`
68+ //
69+ // For { requiredKey: string, optionalKey?: string }, we get:
70+ // [ { requiredKey: "some-string-value" },
71+ // { requiredKey: "some-string-value", optionalKey: undefined },
72+ // { requiredKey: "some-string-value", optionalKey: null },
73+ // { requiredKey: "some-string-value", optionalKey: "some-value" },
74+ // ]
6675 const permutations = ( keys : Array < keyof S > ) => {
6776 if ( keys . length === 0 ) return [ required ] ;
6877
You can’t perform that action at this time.
0 commit comments