Skip to content

Commit

Permalink
fix: isObject: use more accurate detect logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jooy2 committed May 28, 2024
1 parent 9a1eacd commit d9b3a5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 1.4.2 (2024--)

- `isObject`: use more accurate detect logic

## 1.4.1 (2024-05-05)

- `safeJSONParse`: Add `safeJSONParse` method
Expand Down
2 changes: 1 addition & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ export default class Qsu {
* Verify
* */
static isObject(data: any): boolean {
return typeof data === 'object' && !Array.isArray(data) && data !== null;
return data !== null && data !== undefined && Object.getPrototypeOf(data) === Object.prototype;
}

static isEqual(leftOperand: any, ...rightOperand: Array<any>): boolean {
Expand Down

0 comments on commit d9b3a5e

Please sign in to comment.