X Tutup
Skip to content

helmet: Add featurePolicy#39673

Merged
jessetrinity merged 1 commit intoDefinitelyTyped:masterfrom
tomi:add-feature-policy-for-helmet
Oct 29, 2019
Merged

helmet: Add featurePolicy#39673
jessetrinity merged 1 commit intoDefinitelyTyped:masterfrom
tomi:add-feature-policy-for-helmet

Conversation

@tomi
Copy link
Contributor

@tomi tomi commented Oct 26, 2019

feture-policy provides TS typings with it, but it doesn't export the
interface for the options parameter. We could have used conditional
typings and infered the type of the parameter, but that would have
restricted the minimum TS version to 2.8, so instead I created the
interface definition here.

Resolves #37627

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: https://helmetjs.github.io/docs/feature-policy/
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }. If for reason the any rule need to be disabled, disable it for that line using // tslint:disable-next-line [ruleName] and not for whole package so that the need for disabling can be reviewed.

feture-policy provides TS typings with it, but it doesn't export the
interface for the options parameter. We could have used conditional
typings and infered the type of the parameter, but that would have
restricted the minimum TS version to 2.8, so instead I created the
interface definition here.

Resolves DefinitelyTyped#37627
@typescript-bot typescript-bot added the Popular package This PR affects a popular package (as counted by NPM download counts). label Oct 26, 2019
@typescript-bot
Copy link
Contributor

typescript-bot commented Oct 26, 2019

@tomi Thank you for submitting this PR!

🔔 @cyrilschumacher @EvanHahn @BlueHatbRit @chdanielmueller - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@typescript-bot
Copy link
Contributor

👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings.

Let’s review the numbers, shall we?

Comparison details 📊
master #39673 diff
Batch compilation
Memory usage (MiB) 69.3 65.6 -5.4%
Type count 9218 9228 0%
Assignability cache size 1057 1062 0%
Language service
Samples taken 323 342 +6%
Identifiers in tests 323 342 +6%
getCompletionsAtPosition
    Mean duration (ms) 380.1 382.9 +0.7%
    Mean CV 12.0% 11.9%
    Worst duration (ms) 462.6 497.8 +7.6%
    Worst identifier setTo helmet
getQuickInfoAtPosition
    Mean duration (ms) 396.1 397.2 +0.3%
    Mean CV 12.9% 12.6% -2.1%
    Worst duration (ms) 487.8 521.5 +6.9%
    Worst identifier hpkpTest maxAge

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

@typescript-bot typescript-bot added the Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. label Oct 26, 2019
Copy link
Contributor

@EvanHahn EvanHahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't exactly understand why we can't use the built-in types from the feature-policy module, but I trust that it's the case. Looks good to me.

@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. Merge:Express and removed Awaiting reviewer feedback labels Oct 27, 2019
@typescript-bot
Copy link
Contributor

A definition owner has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped!

@jessetrinity jessetrinity merged commit 91c3deb into DefinitelyTyped:master Oct 29, 2019
@typescript-bot
Copy link
Contributor

I just published @types/helmet@0.0.45 to npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Owner Approved A listed owner of this package signed off on the pull request. Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. Popular package This PR affects a popular package (as counted by NPM download counts).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

featurePolicy is not included in Helmet package

4 participants

X Tutup