Conversation
Adds TypeScript type definitions for objectorarray, which checks if a value is an object or array.
|
@gasp Thank you for submitting this PR! This is a live comment that I will keep updated. 1 package in this PRCode ReviewsThis PR adds a new definition, so it needs to be reviewed by a DT maintainer before it can be merged. You can test the changes of this PR in the Playground. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 74472,
"author": "gasp",
"headCommitOid": "adb5a34151303983c44d6c76a977e1ae73c278eb",
"mergeBaseOid": "982edf5d9655b7eca3825d113f90ebdbed4aaa39",
"lastPushDate": "2026-02-04T16:46:34.000Z",
"lastActivityDate": "2026-02-04T23:33:36.000Z",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Well-liked by everyone",
"pkgInfo": [
{
"name": "objectorarray",
"kind": "add",
"files": [
{
"path": "types/objectorarray/.npmignore",
"kind": "package-meta-ok"
},
{
"path": "types/objectorarray/index.d.ts",
"kind": "definition"
},
{
"path": "types/objectorarray/objectorarray-tests.ts",
"kind": "test"
},
{
"path": "types/objectorarray/package.json",
"kind": "package-meta-ok"
},
{
"path": "types/objectorarray/tsconfig.json",
"kind": "package-meta-ok"
}
],
"owners": [],
"addedOwners": [
"gasp"
],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
}
],
"reviews": [
{
"type": "changereq",
"reviewer": "sheetalkamat",
"date": "2026-02-04T23:33:36.000Z"
}
],
"mainBotCommentID": 3848548193,
"ciResult": "pass"
} |
|
🔔 @gasp — you're the only owner, but it would still be good if you find someone to review this PR in the next few days, otherwise a maintainer will look at it. (And if you do find someone, maybe even recruit them to be a second owner to make future changes easier...) |
| * isObjectOrArray(123); // false | ||
| * ``` | ||
| */ | ||
| declare function objectorarray(val: unknown): val is object; |
There was a problem hiding this comment.
this is incorrect because it doesnt guarantee that val is object but rather object or array
|
@gasp One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you! |
Summary
Adds TypeScript type definitions for objectorarray, which checks if a value is an object or array (but not null or RegExp).
API:
Usage:
Package stats:
Test plan
pnpm test objectorarraypasses