From 0763e7a141c31ec8e001a79a50cf68f81dbc6f9f Mon Sep 17 00:00:00 2001 From: Lucas Holmquist Date: Mon, 3 Aug 2020 15:11:09 -0400 Subject: [PATCH] feat: expose constants in a more inuitive way * Constants can now be accessed more easily from the top level import/require fixes #298 Signed-off-by: Lucas Holmquist --- src/index.ts | 4 ++++ test/integration/constants_test.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 2c20efab..266d3af9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,6 +8,8 @@ import { Receiver, Mode } from "./transport/receiver"; import { Protocol } from "./transport/protocols"; import { Headers, headersFor } from "./transport/http/headers"; +import CONSTANTS from "./constants"; + export { // From event CloudEvent, @@ -25,4 +27,6 @@ export { TransportOptions, Headers, headersFor, + // From Constants + CONSTANTS, }; diff --git a/test/integration/constants_test.ts b/test/integration/constants_test.ts index f44c5a3b..f76c98f2 100644 --- a/test/integration/constants_test.ts +++ b/test/integration/constants_test.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import CONSTANTS from "../../src/constants"; +import { CONSTANTS } from "../../src"; describe("Constants exposed by top level exports", () => { it("Exports an ENCODING_BASE64 constant", () => {