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:
Ryan Smith
2016-03-30 18:18:16 +01:00
parent 7fb76f6e39
commit 905ee7e6f5
+11 -7
View File
@@ -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);