Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
jsdoc-import-typedef
Advanced tools
This is a fork of jsdoc to deal with typescript type check import way - https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#import-types
There are some issues in jsdoc related to this problem and a feature is open here: https://github.com/jsdoc/jsdoc/issues/1645. But the feature will be very complex and maybe can take some time to be done. And I need this fix asap.
jsdoc uses catharsis to parse the expressions and catharsis.parse
doesn't accept the typescript import
expression (ex: @param p { import("./a").Pet }
).
This raises Invalid type expression
like seem here https://github.com/hegemonic/catharsis/blob/master/bin/parse.js#L48
Instead of patch catharsis, I apply the fix in jsdoc, using a regexp to remove this pattern before the string is parsed by catharsis.parse
.
In this case, @param p { import("./a").Pet }
will be interpreted like @param p { Pet }
in jsdoc.
Works great if you are using Typescript to type check your jsdoc - (https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html) and is compatible with all jsdoc templates.
npm install jsdoc-import-typedef
This is a patched jsdoc
and all its usage remains the same (https://github.com/jsdoc/jsdoc#installation-and-usage).
jsdoc
to
Stack Overflow.JSDoc is copyright (c) 2011-present Michael Mathews micmath@gmail.com and the contributors to JSDoc.
JSDoc is free software, licensed under the Apache License, Version 2.0. See the
LICENSE
file for more details.
FAQs
An API documentation generator for JavaScript.
The npm package jsdoc-import-typedef receives a total of 30 weekly downloads. As such, jsdoc-import-typedef popularity was classified as not popular.
We found that jsdoc-import-typedef demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.