MCPcopy
hub / github.com/flightcontrolhq/superjson / isPlainObject

Function isPlainObject

src/is.ts:9–17  ·  view source on GitHub ↗
(
  payload: any
)

Source from the content-addressed store, hash-verified

7export const isNull = (payload: any): payload is null => payload === null;
8
9export const isPlainObject = (
10 payload: any
11): payload is { [key: string]: any } => {
12 if (typeof payload !== 'object' || payload === null) return false;
13 if (payload === Object.prototype) return false;
14 if (Object.getPrototypeOf(payload) === null) return true;
15
16 return Object.getPrototypeOf(payload) === Object.prototype;
17};
18
19export const isEmptyObject = (payload: any): payload is {} =>
20 isPlainObject(payload) && Object.keys(payload).length === 0;

Callers 6

deepFreezeFunction · 0.85
is.test.tsFile · 0.85
setDeepFunction · 0.85
isDeepFunction · 0.85
walkerFunction · 0.85
isEmptyObjectFunction · 0.85

Calls

no outgoing calls

Tested by 1

deepFreezeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…