Download webui/src/features/apiTester/fileAccountBinding.js from a3216/ds2api: direct link, hf CLI and curl.
- Browser
- Download file 578 Bytes
-
https://huggingface.co/spaces/a3216/ds2api/resolve/ce5a019598af8a3a8fa70d3880098df3e850ecd7/webui/src/features/apiTester/fileAccountBinding.js
- Command line
-
hf download hf://spaces/a3216/ds2api@ce5a019598af8a3a8fa70d3880098df3e850ecd7/webui/src/features/apiTester/fileAccountBinding.js
-
curl -L -o fileAccountBinding.js https://huggingface.co/spaces/a3216/ds2api/resolve/ce5a019598af8a3a8fa70d3880098df3e850ecd7/webui/src/features/apiTester/fileAccountBinding.js
578 Bytes
| export function getAttachedFileAccountIds(attachedFiles = []) { | |
| const ids = [] | |
| const seen = new Set() | |
| for (const file of attachedFiles || []) { | |
| const raw = file?.account_id ?? file?.accountId ?? file?.owner_account_id ?? file?.ownerAccountId ?? '' | |
| const id = String(raw).trim() | |
| if (!id || seen.has(id)) continue | |
| seen.add(id) | |
| ids.push(id) | |
| } | |
| return ids | |
| } | |
| export function getAttachedFileAccountId(attachedFiles = []) { | |
| const ids = getAttachedFileAccountIds(attachedFiles) | |
| return ids.length > 0 ? ids[0] : '' | |
| } | |