-
Notifications
You must be signed in to change notification settings - Fork 373
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
refactor: [M3-8247] - Remove ramda from Utilities #11861
base: develop
Are you sure you want to change the base?
refactor: [M3-8247] - Remove ramda from Utilities #11861
Conversation
…247-remove-ramda-from-utilities
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.
Removed this file since the function is not being imported anywhere in CM.
Coverage Report: ✅ |
Cloud Manager UI test results🎉 540 passing tests on test run #7 ↗︎
|
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.
thanks @harsh-akamai! Left a few comments for now + I also need to look at mergeRight a bit more and wrap my head around the examples 😅 - appreciate your test cases!
import { isEmpty, isNil } from 'ramda'; | ||
|
||
export const isNilOrEmpty = (v: any) => isNil(v) || isEmpty(v); | ||
export const isNilOrEmpty = (v: null | number | object | string | undefined) => |
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.
wondering if we should keep the input type as any
- unless we're trying to explicitly exclude stuff like booleans, etc (which makes sense, we probably wouldn't call isNilOrEmpty(true)
)
|
||
export const isNilOrEmpty = (v: any) => isNil(v) || isEmpty(v); | ||
export const isNilOrEmpty = (v: null | number | object | string | undefined) => | ||
v == null || // covers for null and undefined |
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.
I know it's functionally the same, but I would prefer v === null || v === undefined
for more clarity
it('should return true if variable is null or undefined or empty object', () => { | ||
const x = null; | ||
const y = undefined; | ||
const obj = {}; |
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.
could we add test cases for other types of objects like arrays, sets, etc
Description 📝
Ramda should be completely removed/replaced with native JS equivalent
Changes 🔄
Removed Ramda 🧹 from :
How to test 🧪
Verification steps
Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅