MCPcopy Create free account
hub / github.com/Easy-Editor/EasyEditor / getSource

Function getSource

packages/core/src/document/prop/value-to-source.ts:227–243  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

225}
226
227export const getSource = (value: any): string => {
228 if (value && value.__source) {
229 return value.__source
230 }
231 let source = valueToSource(value)
232 if (source === 'undefined') {
233 source = ''
234 }
235 if (value) {
236 try {
237 value.__source = source
238 } catch (ex) {
239 console.error(ex)
240 }
241 }
242 return source
243}

Callers

nothing calls this directly

Calls 2

valueToSourceFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected