refactor: remove lodash.isfunction dependency#4604
Conversation
Replace lodash.isfunction with native typeof check in Process.test.ts to reduce dependencies and improve code consistency with existing typeof checks in the same file
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
There was a problem hiding this comment.
Pull request overview
This pull request removes the lodash.isfunction dependency and replaces it with JavaScript's native typeof operator to reduce external dependencies and improve code consistency.
Changes:
- Replaced
lodash.isfunctionimport and usage with nativetypeof message === "function"check in Process.test.ts - Removed
lodash.isfunctionand@types/lodash.isfunctionfrom package.json devDependencies - Updated yarn.lock to reflect the removal of these packages
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| @commitlint/cz-commitlint/src/Process.test.ts | Removed lodash.isfunction import and replaced with native typeof check for function type validation |
| @commitlint/cz-commitlint/package.json | Removed lodash.isfunction and its type definitions from devDependencies |
| yarn.lock | Removed package entries for lodash.isfunction and @types/lodash.isfunction |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
User description
Replace lodash.isfunction with native typeof check in Process.test.ts to reduce dependencies and improve code consistency with existing typeof checks in the same file
PR Type
Enhancement
Description
Remove
lodash.isfunctiondependency from codebaseReplace with native
typeofoperator checkReduce package dependencies and improve consistency
Simplify code by using JavaScript built-in functionality
Diagram Walkthrough
File Walkthrough
Process.test.ts
Replace lodash.isfunction with typeof check@commitlint/cz-commitlint/src/Process.test.ts
lodash.isfunctionimport statementisFunction(message)call withtypeof message === "function"check
package.json
Remove lodash.isfunction package dependencies@commitlint/cz-commitlint/package.json
lodash.isfunctionfrom devDependencies@types/lodash.isfunctiontype definitions