From afa91cf018f35cdd928f62ab7b6d6b990c12f3b5 Mon Sep 17 00:00:00 2001 From: Kristian Dupont Date: Sun, 8 Oct 2023 19:31:44 +0000 Subject: [PATCH] Bump versions --- package-lock.json | 4 ++-- package.json | 2 +- src/extractSchemas.ts | 24 +++++++++++------------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index cce086f7..5c8cdebb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "extract-pg-schema", - "version": "4.2.2", + "version": "4.2.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "extract-pg-schema", - "version": "4.2.2", + "version": "4.2.4", "license": "MIT", "dependencies": { "jsonpath": "^1.1.1", diff --git a/package.json b/package.json index 5a1b1407..ec4dc067 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "extract-pg-schema", - "version": "4.2.2", + "version": "4.2.4", "keywords": [ "postgresql", "schema" diff --git a/src/extractSchemas.ts b/src/extractSchemas.ts index 7dcb2d0e..4f6ff0c8 100644 --- a/src/extractSchemas.ts +++ b/src/extractSchemas.ts @@ -52,22 +52,20 @@ const emptySchema: Omit = { compositeTypes: [], }; -type Populator = ( +type Populator = ( db: Knex, pgType: PgType, ) => Promise; -// @ts-ignore Why is this broken? I don't understand. :-/ -const populatorMap: Record = { - domain: extractDomain, - enum: extractEnum, - range: extractRange, - - table: extractTable, - view: extractView, - materializedView: extractMaterializedView, - compositeType: extractCompositeType, -} as const; +const populatorMap = { + domain: extractDomain as Populator<"domain">, + enum: extractEnum as Populator<"enum">, + range: extractRange as Populator<"range">, + table: extractTable as Populator<"table">, + view: extractView as Populator<"view">, + materializedView: extractMaterializedView as Populator<"materializedView">, + compositeType: extractCompositeType as Populator<"compositeType">, +}; /** * This is the options object that can be passed to `extractSchemas`. @@ -153,7 +151,7 @@ async function extractSchemas( const populated = await Promise.all( typesToExtract.map(async (pgType) => { - const result = await populatorMap[pgType.kind](db, pgType); + const result = await populatorMap[pgType.kind](db, pgType as any); // Now this is broken. I am not sure why! options?.onProgress?.(); return result; }),