Skip to content

Commit 619a5a6

Browse files
committedApr 15, 2024
minor aestetic changes
1 parent a824fe0 commit 619a5a6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed
 

‎esm/mitm.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ const set = (handlers, handler) => {
1919
*/
2020
const mitm = (target, handler) => {
2121
const ws = handlers.get(handler) || set(handlers, handler);
22-
if (!ws.has(target)) {
23-
ws.add(target);
24-
setPrototypeOf(target, new Proxy(getPrototypeOf(target), handler));
25-
}
26-
return target;
22+
return ws.has(target) ? target : (
23+
ws.add(target),
24+
setPrototypeOf(target, new Proxy(getPrototypeOf(target), handler))
25+
);
2726
};
2827

2928
export default mitm;

0 commit comments

Comments
 (0)