Skip to content

Commit

Permalink
Use Object.create
Browse files Browse the repository at this point in the history
Co-Authored-By: Hans Ott <[email protected]>
  • Loading branch information
timokoessler and hansott committed Nov 25, 2024
1 parent 6834db0 commit c237e85
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions library/sources/Hono.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,17 @@ export class Hono implements Wrapper {
.addPackage("hono")
.withVersion("^4.0.0")
.onRequire((exports, pkgInfo) => {
return {
Hono: wrapNewInstance(
exports.Hono,
undefined,
pkgInfo,
(instance) => {
METHODS.forEach((method) => {
wrapExport(instance, method, pkgInfo, {
modifyArgs: this.wrapArgs,
});
});
}
),
};
const newExports = Object.create(exports);

wrapNewInstance(newExports, "Hono", pkgInfo, (instance) => {
METHODS.forEach((method) => {
wrapExport(instance, method, pkgInfo, {
modifyArgs: this.wrapArgs,
});
});
});

return newExports;
});
}
}

0 comments on commit c237e85

Please sign in to comment.