mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-25 09:15:19 +03:00
chore(common/strings): remove unused code
This commit is contained in:
parent
65d88c608b
commit
86fc5a49c8
@ -99,20 +99,6 @@ export const createQueryParams = (params) => {
|
||||
return query;
|
||||
};
|
||||
|
||||
export const getCIDFromIPFS = (url) => {
|
||||
// NOTE(andrew)
|
||||
const cid = url.includes("/ipfs/")
|
||||
? // pull cid from a path format gateway
|
||||
url.split("/ipfs/")[1]
|
||||
: // pull cid from a subdomain format gateway
|
||||
url.match(
|
||||
// regex here performs https://{cid}.ipfs.slate.textile.io => [https://{cid}, {cid}]
|
||||
/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/i
|
||||
)[1];
|
||||
|
||||
return cid;
|
||||
};
|
||||
|
||||
export const formatAsUploadMessage = (added, skipped, slate = false) => {
|
||||
let message = `${added || 0} file${added !== 1 ? "s" : ""} added${
|
||||
slate ? " to collection" : ""
|
||||
|
Loading…
Reference in New Issue
Block a user