From a21120305b654c87638f3620613c572e8aa9590a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kh=C3=A1nh=20Ho=C3=A0ng?= <6380436+hckhanh@users.noreply.github.com> Date: Wed, 4 May 2022 10:57:09 +0700 Subject: [PATCH] capturePostgres is the default function It must be equivalent to require import: ```js var capturePostgres = require('aws-xray-sdk-postgres'); ``` I get this error when try to follow the type definition of this package with TypeScript ```ts import { capturePostgres } from "aws-xray-sdk-postgres"; ``` Then I get this error: ```sh TypeError: (0 , external_aws_xray_sdk_postgres_namespaceObject.capturePostgres) is not a function ``` --- packages/postgres/lib/postgres_p.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/postgres/lib/postgres_p.d.ts b/packages/postgres/lib/postgres_p.d.ts index 631256cf..49eec419 100644 --- a/packages/postgres/lib/postgres_p.d.ts +++ b/packages/postgres/lib/postgres_p.d.ts @@ -1,7 +1,7 @@ import * as AWSXRay from 'aws-xray-sdk-core'; import * as PG from 'pg'; -export function capturePostgres(pg: typeof PG): capturePostgres.PatchedPostgres; +export default function capturePostgres(pg: typeof PG): capturePostgres.PatchedPostgres; declare namespace capturePostgres { interface CaptureQueryMethod {