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

Method toProxy

packages/core/src/plugin/plugin-runtime.ts:93–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

91 }
92
93 toProxy() {
94 if (!this._inited) {
95 this.logger.warn('Could not call toProxy before init')
96 }
97
98 const exports = this.config.exports?.()
99 return new Proxy(this, {
100 get(target, prop, receiver) {
101 if ({}.hasOwnProperty.call(exports, prop)) {
102 return exports?.[prop as string]
103 }
104 return Reflect.get(target, prop, receiver)
105 },
106 })
107 }
108}

Callers

nothing calls this directly

Calls 2

warnMethod · 0.80
exportsMethod · 0.80

Tested by

no test coverage detected