mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
Attempts to fix more TS2339 errors.
``` knex/knex-tests.ts(498,45): error TS2339: Property 'map' does not exist on type 'QueryBuilder'. knex/knex-tests.ts(506,45): error TS2339: Property 'reduce' does not exist on type 'QueryBuilder'. ``` https://travis-ci.org/DefinitelyTyped/DefinitelyTyped/builds/119590526
This commit is contained in:
+11
-7
@@ -495,19 +495,23 @@ query.then(function(x: any) {
|
||||
return x;
|
||||
});
|
||||
|
||||
knex.select('name').from('users').limit(10).map(function(row: any) {
|
||||
return row.name;
|
||||
knex.select('name').from('users').limit(10).then(function (rows: any[]) {
|
||||
return rows.map(function (row: string) {
|
||||
return row.name;
|
||||
});
|
||||
}).then(function(names: string) {
|
||||
console.log(names);
|
||||
}).catch(function(e: Error) {
|
||||
console.error(e);
|
||||
});
|
||||
|
||||
knex.select('name').from('users').limit(10).reduce(function(memo: any, row: any) {
|
||||
memo.names.push(row.name);
|
||||
memo.count++;
|
||||
return memo;
|
||||
}, {count: 0, names: []}).then(function(obj: any) {
|
||||
knex.select('name').from('users').limit(10).then(function (rows: any[]) {
|
||||
return rows.reduce(function(memo: any, row: any) {
|
||||
memo.names.push(row.name);
|
||||
memo.count++;
|
||||
return memo;
|
||||
}, {count: 0, names: []})
|
||||
}).then(function(obj: any) {
|
||||
console.log(obj);
|
||||
}).catch(function(e: Error) {
|
||||
console.error(e);
|
||||
|
||||
Reference in New Issue
Block a user