MCPcopy
hub / github.com/CapSoftware/Cap / getFileExtensionFromKey

Function getFileExtensionFromKey

packages/web-backend/src/Videos/index.ts:74–83  ·  view source on GitHub ↗
(fileKey: string)

Source from the content-addressed store, hash-verified

72 return candidates[0]?.key ?? null;
73};
74const getFileExtensionFromKey = (fileKey: string) => {
75 const fileName = fileKey.split("/").at(-1) ?? "";
76 const extension = fileName.split(".").at(-1)?.toLowerCase();
77
78 if (!extension || extension === fileName.toLowerCase()) {
79 return null;
80 }
81
82 return extension;
83};
84
85type UploadProgressUpdateInput = Schema.Type<
86 typeof Video.UploadProgressUpdateInput

Callers 1

VideosClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected