Skip to content

Commit 1c70290

Browse files
committed
fix: make TS happy again
1 parent e8f80db commit 1c70290

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

package-lock.json

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"npm": ">=7"
3434
},
3535
"dependencies": {
36-
"@sinclair/typebox": "^0.19.2",
36+
"@sinclair/typebox": "^0.21.0",
3737
"pg": "^8.7.1",
3838
"pg-format": "^1.0.4",
3939
"pgsql-parser": "^13.1.11",

src/lib/PostgresMetaFunctions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export default class PostgresMetaFunctions {
244244
config_params
245245
? Object.entries(config_params)
246246
.map(
247-
([param, value]) =>
247+
([param, value]: string[]) =>
248248
`SET ${param} ${value[0] === 'FROM CURRENT' ? 'FROM CURRENT' : 'TO ' + value}`
249249
)
250250
.join('\n')

src/lib/PostgresMetaPublications.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ident, literal } from 'pg-format'
22
import { publicationsSql } from './sql'
3-
import { PostgresMetaResult, PostgresPublication } from './types'
3+
import { PostgresMetaResult, PostgresPublication, PostgresTable } from './types'
44

55
export default class PostgresMetaPublications {
66
query: (sql: string) => Promise<PostgresMetaResult<any>>
@@ -175,9 +175,10 @@ CREATE PUBLICATION ${ident(name)} ${tableClause}
175175
} else if (old!.tables.length === 0) {
176176
tableSql = ''
177177
} else {
178-
// @ts-ignore: Suppress TS2589
179178
tableSql = `ALTER PUBLICATION ${ident(old!.name)} DROP TABLE ${old!.tables
180-
.map((table) => `${ident(table.schema)}.${ident(table.name)}`)
179+
.map(
180+
(table: { schema: string; name: string }) => `${ident(table.schema)}.${ident(table.name)}`
181+
)
181182
.join(',')};`
182183
}
183184

test/lib/config.ts

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { pgMeta } from './utils'
22

33
test('list', async () => {
44
const res = await pgMeta.config.list()
5-
// @ts-ignore: Suppress TS2589
65
expect(res.data?.find(({ name }) => name === 'autovacuum')).toMatchInlineSnapshot(`
76
Object {
87
"boot_val": "on",

0 commit comments

Comments
 (0)