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

Method export

packages/core/src/document/prop/props.ts:110–132  ·  view source on GitHub ↗
(stage: TRANSFORM_STAGE = TRANSFORM_STAGE.SAVE)

Source from the content-addressed store, hash-verified

108 }
109
110 export(stage: TRANSFORM_STAGE = TRANSFORM_STAGE.SAVE) {
111 if (this.items.length < 1) {
112 return {}
113 }
114
115 const props: PropsMap = {}
116 const extras: PropsMap = {}
117
118 this.items.forEach(item => {
119 const key = item.key as string
120 if (key == null || item.isUnset()) return
121 const value = item.export(stage)
122 if (value != null) {
123 if (typeof key === 'string' && isExtraKey(key)) {
124 extras[getOriginalExtraKey(key)] = value
125 } else {
126 props[key] = value
127 }
128 }
129 })
130
131 return { props, extras }
132 }
133
134 merge(value: PropsMap, extras?: PropsMap) {
135 Object.keys(value).forEach(key => {

Callers

nothing calls this directly

Calls 4

isExtraKeyFunction · 0.85
getOriginalExtraKeyFunction · 0.85
isUnsetMethod · 0.80
forEachMethod · 0.45

Tested by

no test coverage detected