MCPcopy Create free account
hub / github.com/ShareDropio/sharedrop / isTransferableBundle

Function isTransferableBundle

app/components/peer-avatar.js:122–142  ·  view source on GitHub ↗
(files)

Source from the content-addressed store, hash-verified

120 },
121
122 isTransferableBundle(files) {
123 if (files.length === 1 && files[0] instanceof window.File) return true;
124
125 const fileSizeLimit = 50 * 1024 * 1024;
126 const bundleSizeLimit = 200 * 1024 * 1024;
127 let aggregatedSize = 0;
128 // eslint-disable-next-line no-restricted-syntax
129 for (const file of files) {
130 if (!(file instanceof window.File)) {
131 return false;
132 }
133 if (file.size > fileSizeLimit) {
134 return false;
135 }
136 aggregatedSize += file.size;
137 if (aggregatedSize > bundleSizeLimit) {
138 return false;
139 }
140 }
141 return true;
142 },
143});

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected