Skip to content

Commit 405482c

Browse files
committed
chore(nosecone-sveltekit): expose named export, deprecate default
This commit adds a named export for `nosecone`. The default export is still supported but deprecated. Related-to: GH-4723. Related-to: GH-4860. Related-to: GH-4875. Related-to: GH-4878. Related-to: GH-4879.
1 parent d427c39 commit 405482c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

nosecone-sveltekit/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ export const defaults = {
2424
},
2525
} as const;
2626

27-
// We export `nosecone` as the default so it can be used with `new Response()`
27+
export { nosecone };
28+
29+
/**
30+
* Create security headers.
31+
*
32+
* @deprecated
33+
* Use the named export `nosecone` instead.
34+
*/
2835
export default nosecone;
2936

3037
/**

nosecone-sveltekit/test/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ test("@nosecone/sveltekit", async function (t) {
66
assert.deepEqual(Object.keys(await import("../index.js")).sort(), [
77
"createHook",
88
"csp",
9-
// TODO(@wooorm-arcjet): use named exports.
109
"default",
1110
// TODO(@wooorm-arcjet): use a clearer name: defaults for what, function to generate them?
1211
"defaults",
12+
"nosecone",
1313
"withVercelToolbar",
1414
]);
1515
});

0 commit comments

Comments
 (0)