mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
This turns WhereOptions and FindOptions into generic types, which can then check that you are using the correct column names, in the find* functions (findOne, findAll etc.). In other places where there is no attributes type available, fall back to the old behaviour of allowing any field names (now with types named AnyWhereOptions and AnyFindOptions).
This allows typescript to catch more errors, e.g.
User.findOne({ where: { firstName: 'Bob' } });
vs.
User.findOne({ where: { first_name: 'Bob' } });
|
||
|---|---|---|
| .. | ||
| v3 | ||
| index.d.ts | ||
| sequelize-tests.ts | ||
| tsconfig.json | ||