MCPcopy
hub / github.com/panva/jose / isObject

Function isObject

src/lib/type_checks.ts:5–17  ·  view source on GitHub ↗
(input: unknown)

Source from the content-addressed store, hash-verified

3const isObjectLike = (value: unknown) => typeof value === 'object' && value !== null
4
5export function isObject<T = object>(input: unknown): input is T {
6 if (!isObjectLike(input) || Object.prototype.toString.call(input) !== '[object Object]') {
7 return false
8 }
9 if (Object.getPrototypeOf(input) === null) {
10 return true
11 }
12 let proto = input
13 while (Object.getPrototypeOf(proto) !== null) {
14 proto = Object.getPrototypeOf(proto)
15 }
16 return Object.getPrototypeOf(input) === proto
17}
18
19export function isDisjoint(...headers: Array<object | undefined>) {
20 const sources = headers.filter(Boolean) as object[]

Callers 11

generalDecryptFunction · 0.85
flattenedDecryptFunction · 0.85
isJWKFunction · 0.85
validateClaimsSetFunction · 0.85
constructorMethod · 0.85
generalVerifyFunction · 0.85
flattenedVerifyFunction · 0.85
importJWKFunction · 0.85
isJWKLikeFunction · 0.85
EmbeddedJWKFunction · 0.85
decodeProtectedHeaderFunction · 0.85

Calls 1

isObjectLikeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…