-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DefinePlugin JSDoc types #7656
Conversation
For maintainers only:
|
Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon. |
lib/DefinePlugin.js
Outdated
@@ -60,6 +70,10 @@ const toCode = (code, parser) => { | |||
}; | |||
|
|||
class DefinePlugin { | |||
/** | |||
* Create a new define plugin | |||
* @param {Object} definitions A map of global object definitions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be of type Record<string, CodeValue>
lib/DefinePlugin.js
Outdated
@@ -9,6 +9,10 @@ const BasicEvaluatedExpression = require("./BasicEvaluatedExpression"); | |||
const ParserHelpers = require("./ParserHelpers"); | |||
const NullFactory = require("./NullFactory"); | |||
|
|||
/** @typedef {import("./Compiler")} Compiler */ | |||
/** @typedef {import("./Parser")} Parser */ | |||
/** @typedef {null|undefined|RegExp|Function|Object} CodeValue */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null|undefined|RegExp|Function|string|number|Record<string, CodeValue>|RuntimeValue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming this is not recursive I ended up with:
/** @typedef {null|undefined|RegExp|Function|string|number} CodeValuePrimitive */
/** @typedef {CodeValuePrimitive|Record<string, CodeValuePrimitive>|RuntimeValue} CodeValue */
Thanks |
No description provided.