MCPcopy
hub / github.com/teambit/bit / objectToStringifiedTupleArray

Function objectToStringifiedTupleArray

src/utils/object-to-stringified-tuple-array.ts:3–9  ·  view source on GitHub ↗
(obj: { [key: string]: any })

Source from the content-addressed store, hash-verified

1import forEach from './object/foreach';
2
3export default function objectToStringifiedTupleArray(obj: { [key: string]: any }): [string | number][] {
4 const arr: any[] = [];
5 forEach(obj, (val, key) => {
6 arr.push([key, typeof val === 'object' ? JSON.stringify(val) : val]);
7 });
8 return arr;
9}

Callers 4

reportMethod · 0.90
reportMethod · 0.90
reportMethod · 0.90
reportMethod · 0.90

Calls 3

forEachFunction · 0.85
pushMethod · 0.45
stringifyMethod · 0.45

Tested by

no test coverage detected