MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / isSerializable

Function isSerializable

packages/ember/index.js:67–89  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

65};
66
67function isSerializable(obj) {
68 if (isScalar(obj)) {
69 return true;
70 }
71
72 if (Array.isArray(obj)) {
73 return !obj.some(arrayItem => !isSerializable(arrayItem));
74 }
75
76 if (isPlainObject(obj)) {
77 // eslint-disable-next-line guard-for-in
78 for (let property in obj) {
79 let value = obj[property];
80 if (!isSerializable(value)) {
81 return false;
82 }
83 }
84
85 return true;
86 }
87
88 return false;
89}
90
91function isScalar(val) {
92 return (

Callers 1

includedFunction · 0.85

Calls 2

isScalarFunction · 0.85
isPlainObjectFunction · 0.70

Tested by

no test coverage detected