Test if the elements in the array exactly matches the elements placed at the same indices in the predicates array. @param predicates - Predicates to test the array against. Describes what the tested array should look like. @example ``` ow(['1', 2], ow.array.exactShape([ow.string, ow.number]));
(predicates: BasePredicate[])
| 160 | ``` |
| 161 | */ |
| 162 | exactShape(predicates: BasePredicate[]): this { |
| 163 | const shape = predicates as unknown as Shape; |
| 164 | |
| 165 | return this.addValidator({ |
| 166 | message: (_, label, message) => `${(message as string).replace('Expected', 'Expected element')} in ${label}`, |
| 167 | validator: object => exact(object as unknown as Record<string, unknown>, shape, undefined, true), |
| 168 | }); |
| 169 | } |
| 170 | } |
no test coverage detected