Skip to content

Commit

Permalink
double negative whoops
Browse files Browse the repository at this point in the history
  • Loading branch information
adryd325 committed Nov 22, 2023
1 parent 15cb12b commit 05f9a32
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/wpTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ export default function wpTools(module, exports, webpackRequire) {
Object.entries(webpackRequire.c)
.filter(([moduleId, exportCache]) => {
return !keys.some((searchKey) => {
return (
exportCache != undefined && exportCache != window && (exports?.[searchKey] || exports?.default?.[searchKey])
return !(
exportCache != undefined &&
exportCache != window &&
(exports?.[searchKey] || exports?.default?.[searchKey])
);
});
})
Expand All @@ -32,7 +34,7 @@ export default function wpTools(module, exports, webpackRequire) {

function inspectModule(moduleId) {
/* TODO: rewrap modules if not patched.
* This used to isolate modules like wrapping them in the patcher stage did,
* This used to isolate modules like wrapping them in the patcher stage did,
* however this seems to have broken in newer browsers */
return webpackRequire.m[moduleId];
}
Expand All @@ -46,7 +48,6 @@ export default function wpTools(module, exports, webpackRequire) {
// TODO: SWC helpers
// function getDefault() {}


window.wpTools =
module.exports.default =
exports.default =
Expand Down

0 comments on commit 05f9a32

Please sign in to comment.