MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / defineWrapper

Function defineWrapper

out/cli.cjs:10056–10080  ·  view source on GitHub ↗
(BaseEvent, proto2)

Source from the content-addressed store, hash-verified

10054 };
10055 }
10056 function defineWrapper(BaseEvent, proto2) {
10057 const keys = Object.keys(proto2);
10058 if (keys.length === 0) {
10059 return BaseEvent;
10060 }
10061 function CustomEvent(eventTarget, event) {
10062 BaseEvent.call(this, eventTarget, event);
10063 }
10064 CustomEvent.prototype = Object.create(BaseEvent.prototype, {
10065 constructor: { value: CustomEvent, configurable: true, writable: true }
10066 });
10067 for (let i3 = 0; i3 < keys.length; ++i3) {
10068 const key = keys[i3];
10069 if (!(key in BaseEvent.prototype)) {
10070 const descriptor = Object.getOwnPropertyDescriptor(proto2, key);
10071 const isFunc = typeof descriptor.value === "function";
10072 Object.defineProperty(
10073 CustomEvent.prototype,
10074 key,
10075 isFunc ? defineCallDescriptor(key) : defineRedirectDescriptor(key)
10076 );
10077 }
10078 }
10079 return CustomEvent;
10080 }
10081 function getWrapper(proto2) {
10082 if (proto2 == null || proto2 === Object.prototype) {
10083 return Event2;

Callers 1

getWrapperFunction · 0.85

Calls 4

defineCallDescriptorFunction · 0.85
defineRedirectDescriptorFunction · 0.85
keysMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…