-
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
claimedenhancementquestionwipIssues and PRs that are still a work in progressIssues and PRs that are still a work in progress
Milestone
Description
The isPlainObject
predicate function is another common convenience function in the JS Object domain.
- It is quite frequently used and would be very helpful to have.
- It is distinct from the very similar
isObject
predicate function from@openinf/util-types
- It is distinct from the
isObjectLike
predicate function, which is often kept private/internal
const isPlainObject = ( obj ) => {
return (
typeof obj === 'object' &&
obj !== null &&
obj.constructor === Object &&
Object.prototype.toString.call( obj ) === '[object Object]'
);
};
- Aside
-
hopefully not a misnomer due to the existence of plain old Java objects (POJOs), which are also a thing in JS
- Open question
- would a more rigorous check be necessary to differentiate btwx the two or is it fine?
Metadata
Metadata
Assignees
Labels
claimedenhancementquestionwipIssues and PRs that are still a work in progressIssues and PRs that are still a work in progress