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

fix code build.js #420

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

teenager-ETH
Copy link

Pull Request: Fix Code in build.js

Description

This pull request addresses a bug in the build.js script. Specifically, it replaces the usage of Object.prototype.hasOwnProperty with the modern Object.hasOwn() method for better readability and consistency.

Changes Made:

  1. File: client/scripts/build.js
  2. Line 153:
    • Before:
      if (Object.prototype.hasOwnProperty.call(err, 'postcssNode')) {
    • After:
      if (Object.hasOwn(err, 'postcssNode')) {

This change ensures modern syntax usage and maintains functionality by checking for the postcssNode property within the error object.


Why this change?

  • The use of Object.hasOwn() is a more modern, concise, and readable alternative to Object.prototype.hasOwnProperty.call().
  • Improves code readability and aligns with ECMAScript standards introduced in ES2022.

Testing

  • Verified the change doesn't introduce errors during the build process.
  • Tested with various cases to ensure the postcssNode check behaves as expected.

Checklist

  • Code changes are clear and concise.
  • The script builds successfully without errors.
  • All related functionality has been tested.
  • Ready for review.

Related Issues

  • None

Additional Notes

  • Maintainers can edit this PR if needed.
  • Feedback and suggestions are welcome.

Reviewer

Please confirm the following before merging:

  1. All CI checks pass.
  2. The change is aligned with the project's coding guidelines.

Thanks for reviewing!

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

Successfully merging this pull request may close these issues.

1 participant