MCPcopy Index your code
hub / github.com/pingdotgg/uploadthing / isValidFileType

Function isValidFileType

packages/uploadthing/src/client.ts:58–67  ·  view source on GitHub ↗
(
  file: File,
  routeConfig: ExpandedRouteConfig,
)

Source from the content-addressed store, hash-verified

56 * @public
57 */
58export const isValidFileType = (
59 file: File,
60 routeConfig: ExpandedRouteConfig,
61): boolean =>
62 Micro.runSync(
63 matchFileType(file, objectKeys(routeConfig)).pipe(
64 Micro.map((type) => file.type.includes(type)),
65 Micro.orElseSucceed(() => false),
66 ),
67 );
68
69/**
70 * Validate that a file is of a valid size given a route config

Callers 1

novel-plugin.tsFile · 0.90

Calls 2

matchFileTypeFunction · 0.90
objectKeysFunction · 0.90

Tested by

no test coverage detected