8000 lib: expose constants in a more intuitive way (#299) · cloudevents/sdk-javascript@a7e0aa0 · GitHub
[go: up one dir, main page]

Skip to content

Commit a7e0aa0

Browse files
authored
lib: expose constants in a more intuitive way (#299)
* Constants can now be accessed more easily from the top level import/require users can now do `const { CONSTANTS } = require('cloudevents')` fixes #298 Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
1 parent bc81242 commit a7e0aa0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { Receiver, Mode } from "./transport/receiver";
88
import { Protocol } from "./transport/protocols";
99
import { Headers, headersFor } from "./transport/http/headers";
1010

11+
import CONSTANTS from "./constants";
12+
1113
export {
1214
// From event
1315
CloudEvent,
@@ -25,4 +27,6 @@ export {
2527
TransportOptions,
2628
Headers,
2729
headersFor,
30+
// From Constants
31+
CONSTANTS,
2832
};

test/integration/constants_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from "chai";
2-
import CONSTANTS from "../../src/constants";
2+
import { CONSTANTS } from "../../src";
33

44
describe("Constants exposed by top level exports", () => {
55
it("Exports an ENCODING_BASE64 constant", () => {

0 commit comments

Comments
 (0)
0