$ open source · GPL-3.0 — need a commercial license? imqueue.com →

Modify type

Replaces every member of T that R also declares with R's version of it.

Signature:

export type Modify<T, R> = Pick<T, Exclude<keyof T, keyof R>> & R;

Remarks

The mechanism behind each widened option type in this module. Sequelize types returning as a boolean; this package needs it to accept a column list as well, and intersecting the two would leave a member that has to be both. Removing the keys R redeclares before intersecting is what lets the override win instead.

T is the type to start from and R the members to override it with, so the widened save options are Sequelize's own with only returning replaced.