Skip to content

refactor: avoid direct Object.prototype builtins usage - #5

Open
deepsource-autofix[bot] wants to merge 1 commit into
v1.xfrom
deepsource-autofix-87bba219
Open

refactor: avoid direct Object.prototype builtins usage#5
deepsource-autofix[bot] wants to merge 1 commit into
v1.xfrom
deepsource-autofix-87bba219

Conversation

@deepsource-autofix

Copy link
Copy Markdown

Fixes are generated by AI. Review them carefully before applying to your codebase.

This PR refactors code to eliminate direct calls to Object.prototype builtins, improving safety and avoiding potential prototype pollution. All instances of direct builtin usage have been replaced with safe, standard alternatives.

  • Object.prototype builtins should not be used directly: DeepSource flagged direct calls like obj.hasOwnProperty(key) which can be unsafe if the object’s prototype chain is altered. We replaced these calls with the modern Object.hasOwn(obj, key) method where supported, and fallback to Object.prototype.hasOwnProperty.call(obj, key) for compatibility.

**Fixes are generated by AI. Review them carefully before applying to your codebase.**

This PR refactors code to eliminate direct calls to Object.prototype builtins, improving safety and avoiding potential prototype pollution. All instances of direct builtin usage have been replaced with safe, standard alternatives.

- `Object.prototype` builtins should not be used directly: DeepSource flagged direct calls like `obj.hasOwnProperty(key)` which can be unsafe if the object’s prototype chain is altered. We replaced these calls with the modern `Object.hasOwn(obj, key)` method where supported, and fallback to `Object.prototype.hasOwnProperty.call(obj, key)` for compatibility.
@deepsource-development

Copy link
Copy Markdown

Here's the code health analysis summary for commits 1339402..577b662. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript✅ Success
🎯 3 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

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.

0 participants