Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
AmauryD committed Feb 12, 2024
1 parent ede21be commit f7b9a22
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ All decorators accept an object of options that apply to the type being used, fo

[**@Any({})**](https://github.com/icebob/fastest-validator#any) - Applies { type: "any" }

[**@Multi({})**](https://github.com/icebob/fastest-validator#multi) - Applies { type: "multi" }

Also resolves to multi if multiple decorators are stacked on a single field.

```ts
@String()
@Number()
prop1: string | number;
```

**@Nested({})** - Applies { type: "object", props: {} } (The props are gathered from the nested schema)

**@NestedArray({ validator: `<ValidatorSchema>` })** - Applies { type: "array", "items": { type :"object", props: { ... } }} (The props are gathered from the nested schema)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/get-prototype-chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { Class } from "type-fest";
* Used for schema inheritance detection
* Maybe find a way to do the same thing with reflect metadata ?
*/
export function getPrototypeChain (object: Class<any>): Class<any>[] {
export function getPrototypeChain (object: any): Class<any>[] {
let proto = object;
const protos: Class<any>[] = [object];

Expand Down

0 comments on commit f7b9a22

Please sign in to comment.