Skip to content

Commit

Permalink
Fix bug on deepMergeRight, where standard objects like Date were not …
Browse files Browse the repository at this point in the history
…treated as values but recursively mergeable objects
  • Loading branch information
acelaya committed Nov 26, 2023
1 parent 6938467 commit e171f8a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org).

## [1.0.2] - 2023-11-26
### Added
* *Nothing*

### Changed
* *Nothing*

### Deprecated
* *Nothing*

### Removed
* *Nothing*

### Fixed
* Make sure `isObject` returns `true` for "regular" objects, excluding things like Date instances and such.


## [1.0.1] - 2023-11-01
### Added
* *Nothing*
Expand Down
2 changes: 1 addition & 1 deletion src/is-object/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const isObject = (item: any): boolean => !!item && typeof item === 'object' && !Array.isArray(item);
export const isObject = (item: any): boolean => Object.prototype.toString.call(item) === '[object Object]';
2 changes: 1 addition & 1 deletion src/is-object/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('isObject', () => {
[null, false],
[[], false],
[{}, true],
[new Date(), true],
[new Date(), false],
])('returns expected result', (obj, expected) => {
expect(isObject(obj)).toEqual(expected);
});
Expand Down

0 comments on commit e171f8a

Please sign in to comment.