You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lodash's path parameter should always use array syntax. This approach is more secure against injection attacks, reduces the risk of accidental errors, and improves performance as it avoids the unnecessary stringToPath conversion.
Preferred:
constvalue=get(obj,[key])
Avoid:
constvalue=get(obj,key)
Why is this needed:
Security: Prevents potential injection attacks or errors from dynamically generated string paths.
Performance: Using array syntax skips the stringToPath conversion, as detailed in the Lodash source code.
This rule should be enforced across the codebase to maintain consistency and leverage these benefits.
The text was updated successfully, but these errors were encountered:
What would you like to be added:
Lodash's
path
parameter should always use array syntax. This approach is more secure against injection attacks, reduces the risk of accidental errors, and improves performance as it avoids the unnecessarystringToPath
conversion.Preferred:
Avoid:
Why is this needed:
stringToPath
conversion, as detailed in the Lodash source code.This rule should be enforced across the codebase to maintain consistency and leverage these benefits.
The text was updated successfully, but these errors were encountered: