Skip to content

esm: fix annotations on getFormat hook doc snippet#33485

Closed
DerekNonGeneric wants to merge 1 commit intonodejs:masterfrom
DerekNonGeneric:fix/get-format-hook-snippet-typings
Closed

esm: fix annotations on getFormat hook doc snippet#33485
DerekNonGeneric wants to merge 1 commit intonodejs:masterfrom
DerekNonGeneric:fix/get-format-hook-snippet-typings

Conversation

@DerekNonGeneric
Copy link
Contributor

@DerekNonGeneric DerekNonGeneric commented May 20, 2020

Prior to this commit, the type annotations on this hook were invalid.
This has been corrected and is ensured to be compatible with both the
TypeScript and Closure type systems.

Checklist
  • tests and/or benchmarks are included (out of band)
  • documentation is changed or added
  • commit message follows commit guidelines

/cc @nodejs/modules-active-members

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. esm Issues and PRs related to the ECMAScript Modules implementation. labels May 20, 2020
@BridgeAR BridgeAR requested a review from GeoffreyBooth May 25, 2020 16:53
Prior to this commit, the type annotations on this hook were invalid.
This has been corrected and is ensured to be compatible with both the
TypeScript and Closure type systems.

Notes:
    https://www.typescriptlang.org/play/index.html?useJavaScript=true#code/PQKhCgAIUgBAHAhgJ0QW0gbwM4BdkCWAdgOYC+kArsgDZQwIrpYDyARgFYCmAxrhTwD2RXFwAeuSAAoe1ZFxE0AnpC5p4uJQEp6cJKgyYAYpSJ8CwigBMuAM0SUauAOJdcRwcjSJcu2PNxqImwsAAVkQTQCbC4AHkxIW09vXAAuSDxCUkgyAD4yemBwcXhPSURsJTNE03NhSBI3Dy8fKWoaABpIIRFxXC6be0cXJuSfLSwoSAJbaQBZHwALADpUIitIqQncyAAGZYBWCYTgYEgAZUiubuErAlwLImWpyEhTyGaMq8hPSEQaGiQACqACUADLYAaCL5oa6yPCRSA0QQkAg8RK-GyiLzEYgkDEtXDPV6vd4AQRoAHdEEoQgEgn8iD9OLxJIJZrhFtckl4sDyUulYpk8fkupSufJIJyuC83md+T5piFhNd2VKuRl8HiQsR1ddcIg2DRrobBAA3LjEkn05BMzCy14KtKQADkaEEVkcXBdHVlZAA3FMCqSzgAROxcZBS6EAOQ9lo4IR5fwBP2lUdBEKtNqZgwcTlc7jGuDatC6PVEEgGdnzIyLhK0gbIQA
    https://closure-compiler.appspot.com/home#code%3D%252F%252F%2520%253D%253DClosureCompiler%253D%253D%250A%252F%252F%2520%2540compilation_level%2520ADVANCED_OPTIMIZATIONS%250A%252F%252F%2520%2540warning_level%2520VERBOSE%250A%252F%252F%2520%2540jscomp_error%2520strictCheckTypes%250A%252F%252F%2520%2540language_out%2520ECMASCRIPT_NEXT%250A%252F%252F%2520%2540checks_only%250A%252F%252F%2520%253D%253D%252FClosureCompiler%253D%253D%250A%250A%252F**%250A%2520*%2520%2540param%2520%257Bstring%257D%2520url%250A%2520*%2520%2540param%2520%257BObject%257D%2520context%2520(currently%2520empty)%250A%2520*%2520%2540param%2520%257BFunction%257D%2520defaultGetFormat%250A%2520*%2520%2540returns%2520%257BPromise%253C%257B%2520format%253A%2520string%2520%257D%253E%257D%250A%2520*%252F%250Aexport%2520async%2520function%2520getFormat(url%252C%2520context%252C%2520defaultGetFormat)%2520%257B%250A%2520%2520if%2520(Math.random()%2520%253E%25200.5)%2520%257B%2520%252F%252F%2520Some%2520condition.%250A%2520%2520%2520%2520%252F%252F%2520For%2520some%2520or%2520all%2520URLs%252C%2520do%2520some%2520custom%2520logic%2520for%2520determining%2520format.%250A%2520%2520%2520%2520%252F%252F%2520Always%2520return%2520an%2520object%2520of%2520the%2520form%2520%257Bformat%253A%2520%253Cstring%253E%257D%252C%2520where%2520the%250A%2520%2520%2520%2520%252F%252F%2520format%2520is%2520one%2520of%2520the%2520strings%2520in%2520the%2520table%2520above.%250A%2520%2520%2520%2520return%2520%257B%250A%2520%2520%2520%2520%2520%2520format%253A%2520'module'%252C%250A%2520%2520%2520%2520%257D%253B%250A%2520%2520%257D%250A%2520%2520%252F%252F%2520Defer%2520to%2520Node.js%2520for%2520all%2520other%2520URLs.%250A%2520%2520return%2520defaultGetFormat(url%252C%2520context%252C%2520defaultGetFormat)%253B%250A%257D
@codecov-commenter
Copy link

Codecov Report

Merging #33485 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #33485   +/-   ##
=======================================
  Coverage   96.77%   96.77%           
=======================================
  Files         201      201           
  Lines       66642    66642           
=======================================
  Hits        64492    64492           
  Misses       2150     2150           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5007611...e030278. Read the comment docs.

@DerekNonGeneric
Copy link
Contributor Author

Superseded by #33563.

@DerekNonGeneric
Copy link
Contributor Author

@himself65, was that Codecov report generated for this PR on purpose? I did laugh. The proofs are in the commit message (although I had forgotten to mention that — fixed now).

@himself65
Copy link
Member

himself65 commented May 26, 2020

I don't know the thing and why the codecov happened here 🤔

@nodejs-github-bot
Copy link
Collaborator

@AshCripps
Copy link
Member

^Ignore that I typed the wrong PRID...

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

Labels

doc Issues and PRs related to the documentations. esm Issues and PRs related to the ECMAScript Modules implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants