MCPcopy
hub / github.com/appwrite/sdk-for-react-native / flatten

Method flatten

src/service.ts:13–26  ·  view source on GitHub ↗
(data: Payload, prefix = '')

Source from the content-addressed store, hash-verified

11 }
12
13 static flatten(data: Payload, prefix = ''): Payload {
14 let output: Payload = {};
15
16 for (const [key, value] of Object.entries(data)) {
17 let finalKey = prefix ? prefix + '[' + key +']' : key;
18 if (Array.isArray(value)) {
19 output = { ...output, ...Service.flatten(value, finalKey) };
20 } else {
21 output[finalKey] = value;
22 }
23 }
24
25 return output;
26 }
27}

Callers 15

callMethod · 0.80
getFileDownloadMethod · 0.80
getFilePreviewMethod · 0.80
getFileViewMethod · 0.80
getFileDownloadURLMethod · 0.80
getFilePreviewURLMethod · 0.80
getFileViewURLMethod · 0.80
getBrowserMethod · 0.80
getCreditCardMethod · 0.80
getFaviconMethod · 0.80
getFlagMethod · 0.80
getImageMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected