MCPcopy
hub / github.com/apify/crawlee / getObjectType

Function getObjectType

packages/utils/src/internals/debug.ts:59–74  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

57}
58
59export function getObjectType(value: unknown): string {
60 const simple = typeof value;
61
62 if (['string', 'number', 'boolean', 'bigint'].includes(simple)) {
63 return simple;
64 }
65
66 const objectType = Object.prototype.toString.call(value);
67 const type = objectType.match(/\[object (\w+)]/)![1];
68
69 if (type === 'Uint8Array') {
70 return 'Buffer';
71 }
72
73 return ['Date', 'Buffer', 'RegExp'].includes(type) ? type : type.toLowerCase();
74}

Callers 3

addRequestsFunction · 0.90
addRequestsBatchedFunction · 0.90
addRequestsMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…