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
As a suggested fix, why not modify utils.test.ts as follows?
describe('deepMerge', () => {
it('should return the source object if the target object is not an object', () => {
const target = null
- const source = { a: 1 }+ const source = 'not object' as unknown as Record<string, unknown>
As another suggestion, if we assume that only objects are passed to the source argument of the deepMerge function, the conditional expression of the if statement could be as follows.
export function deepMerge<T>(target: T, source: Record<string, unknown>): T {
- if (!isObject(target) && !isObject(source)) {+ if (!isObject(target)) {
return source as T
}
If this modification is necessary, I will make a PR.
The text was updated successfully, but these errors were encountered:
What is the feature you are proposing?
In utils.test.ts it looks like early return statements are not executed in the test code.
https://app.codecov.io/gh/honojs/hono/blob/main/src%2Fclient%2Futils.ts#L40
As a suggested fix, why not modify utils.test.ts as follows?
As another suggestion, if we assume that only objects are passed to the source argument of the deepMerge function, the conditional expression of the if statement could be as follows.
If this modification is necessary, I will make a PR.
The text was updated successfully, but these errors were encountered: