MCPcopy
hub / github.com/pingdotgg/uploadthing / contentFieldToContent

Function contentFieldToContent

packages/shared/src/component-utils.ts:196–207  ·  view source on GitHub ↗
(
  contentField: ContentField<T> | undefined,
  arg: T,
)

Source from the content-addressed store, hash-verified

194};
195
196export const contentFieldToContent = <T extends MinCallbackArg>(
197 contentField: ContentField<T> | undefined,
198 arg: T,
199) => {
200 if (!contentField) return null;
201 if (typeof contentField !== "function") return contentField;
202 if (typeof contentField === "function") {
203 const result = contentField(arg);
204
205 return result;
206 }
207};
208
209export type ClassListMerger = (
210 ...classes: (string | null | undefined | false)[]

Callers 15

getUploadButtonContentsFunction · 0.90
UploadDropzoneFunction · 0.90
renderButtonFunction · 0.90
renderClearButtonFunction · 0.90
renderAllowedContentFunction · 0.90
UploadDropzoneFunction · 0.90
getButtonContentFunction · 0.90
UploadButtonFunction · 0.90
renderUploadIconFunction · 0.90
generateUploadDropzoneFunction · 0.90
renderAllowedContentFunction · 0.90
renderButtonFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected