From 32b7b6cab7e3938ce7637201b76cefdea64ecf3c Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Mon, 30 Jan 2017 19:04:23 -0800 Subject: [PATCH] As per the documentation `findOr` methods return an array including the instance and a boolean. --- sequelize/v3/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sequelize/v3/index.d.ts b/sequelize/v3/index.d.ts index 81a4eab0ed..9142dc9a6c 100644 --- a/sequelize/v3/index.d.ts +++ b/sequelize/v3/index.d.ts @@ -3819,8 +3819,8 @@ declare namespace sequelize { * Find a row that matches the query, or build (but don't save) the row if none is found. * The successfull result of the promise will be (instance, initialized) - Make sure to use .spread() */ - findOrInitialize(options: FindOrInitializeOptions): Promise; - findOrBuild(options: FindOrInitializeOptions): Promise; + findOrInitialize(options: FindOrInitializeOptions): Promise<[TInstance, boolean]>; + findOrBuild(options: FindOrInitializeOptions): Promise<[TInstance, boolean]>; /** * Find a row that matches the query, or build and save the row if none is found @@ -3833,13 +3833,13 @@ declare namespace sequelize { * an instance of sequelize.TimeoutError will be thrown instead. If a transaction is created, a savepoint * will be created instead, and any unique constraint violation will be handled internally. */ - findOrCreate(options: FindOrInitializeOptions): Promise; + findOrCreate(options: FindOrInitializeOptions): Promise<[TInstance, boolean]>; /** * A more performant findOrCreate that will not work under a transaction (at least not in postgres) * Will execute a find call, if empty then attempt to create, if unique constraint then attempt to find again */ - findCreateFind(options: FindCreateFindOptions): Promise; + findCreateFind(options: FindCreateFindOptions): Promise<[TInstance, boolean]>; /** * Insert or update a single row. An update will be executed if a row which matches the supplied values on