Skip to content

Commit

Permalink
Add ESM support
Browse files Browse the repository at this point in the history
This switches to tsup and tsx for building and testing, which lets us
add ESM support easily.
  • Loading branch information
EvanHahn committed Jun 30, 2024
1 parent 08eb609 commit 4752208
Show file tree
Hide file tree
Showing 7 changed files with 2,902 additions and 45 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Added

- ESM support

### Removed

- **Breaking:** Dropped support for old Node versions. Node 18+ is now required
Expand Down
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function getHeaderValueFromOptions(options: unknown): string {
return result;
}

export = function featurePolicy(options: Readonly<FeaturePolicyOptions>) {
export default function featurePolicy(options: Readonly<FeaturePolicyOptions>) {
const headerValue = getHeaderValueFromOptions(options);

return function featurePolicy(
Expand All @@ -138,4 +138,4 @@ export = function featurePolicy(options: Readonly<FeaturePolicyOptions>) {
res.setHeader("Feature-Policy", headerValue);
next();
};
};
}
Loading

0 comments on commit 4752208

Please sign in to comment.