MCPcopy
hub / github.com/bahmutov/code-snippets / objectSize

Function objectSize

keys-vs-values.js:8–13  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

6 }
7
8 function objectSize(obj) {
9 if (typeof obj === 'string') {
10 return stringSize(obj);
11 }
12 return stringSize(JSON.stringify(obj));
13 }
14
15 function values(obj) {
16 return Object.keys(obj).map(function (key) {

Callers 2

listSizeFunction · 0.70
keysValuesFunction · 0.70

Calls 1

stringSizeFunction · 0.70

Tested by

no test coverage detected