From 84ae09b62434e524ea043498fb2f7ea4f9744353 Mon Sep 17 00:00:00 2001 From: Ryan Smith <0ryansmith1994@gmail.com> Date: Wed, 30 Mar 2016 18:29:30 +0100 Subject: [PATCH] Attempts to fix remaining errors. ``` knex/knex-tests.ts(502,9): error TS2345: Argument of type '(names: string) => void' is not assignable to parameter of type '(value: string[]) => void | PromiseLike'. Types of parameters 'names' and 'value' are incompatible. Type 'string' is not assignable to type 'string[]'. knex/knex-tests.ts(522,4): error TS2339: Property 'bind' does not exist on type 'QueryBuilder'. knex/knex-tests.ts(533,35): error TS2339: Property 'return' does not exist on type 'QueryBuilder'. ``` https://travis-ci.org/DefinitelyTyped/DefinitelyTyped/builds/119593429 --- knex/knex-tests.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/knex/knex-tests.ts b/knex/knex-tests.ts index cd67a08736..e983ec1084 100644 --- a/knex/knex-tests.ts +++ b/knex/knex-tests.ts @@ -499,7 +499,7 @@ knex.select('name').from('users').limit(10).then(function (rows: any[]): string[ return rows.map(function (row: any): string { return row.name; }); -}).then(function(names: string) { +}).then(function(names: string[]) { console.log(names); }).catch(function(e: Error) { console.error(e); @@ -519,19 +519,16 @@ knex.select('name').from('users').limit(10).then(function (rows: any[]) { knex.select('name').from('users') .limit(10) - .bind(console) - .then(console.log) - .catch(console.error); + .then(console.log.bind(console)) + .catch(console.error.bind(console)); var values: any[]; -// Without return: + knex.insert(values).into('users') .then(function() { return {inserted: true}; }); -knex.insert(values).into('users').return({inserted: true}); - knex.select('name').from('users') .where('id', '>', 20) .andWhere('id', '<', 200)