Skip to content
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

Merged
merged 10 commits into from
Jul 15, 2018
Merged

Add DefinePlugin JSDoc types #7656

merged 10 commits into from
Jul 15, 2018

Conversation

mohsen1
Copy link
Contributor

@mohsen1 mohsen1 commented Jul 5, 2018

No description provided.

@webpack-bot
Copy link
Contributor

For maintainers only:

  • This need to be documented (issue in webpack/webpack.js.org will be filed when merged)

@webpack-bot
Copy link
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@@ -60,6 +70,10 @@ const toCode = (code, parser) => {
};

class DefinePlugin {
/**
* Create a new define plugin
* @param {Object} definitions A map of global object definitions
Copy link
Member

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>

@@ -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 */
Copy link
Member

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

Copy link
Contributor Author

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 */

@webpack-bot
Copy link
Contributor

@mohsen1 Thanks for your update.

I labeled the Pull Request so reviewers will review it again.

@sokra Please review the new changes.

@sokra sokra merged commit db1475c into webpack:master Jul 15, 2018
@sokra
Copy link
Member

sokra commented Jul 15, 2018

Thanks

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

Successfully merging this pull request may close these issues.

None yet

4 participants