MCPcopy Create free account
hub / github.com/editablejs/editable / defaultUpload

Function defaultUpload

packages/plugins/image/src/utils.ts:81–89  ·  view source on GitHub ↗
(file: File | string)

Source from the content-addressed store, hash-verified

79}
80
81export const defaultUpload = (file: File | string) => {
82 return new Promise<string>((resolve, reject) => {
83 if (file instanceof File) {
84 readBase64(file).then(resolve).catch(reject)
85 } else {
86 resolve(file)
87 }
88 })
89}
90
91export const setPercentage = (editor: Editor, path: Path, percentage: number) => {
92 Transforms.setNodes<Image>(editor, { percentage }, { at: path })

Callers

nothing calls this directly

Calls 1

readBase64Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…