-
Notifications
You must be signed in to change notification settings - Fork 7
Conversation
|| key2 === "require" | ||
|| key2 === "node-addons" | ||
|| key2 === "default") { | ||
if(conditions.indexOf(key) !== -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use includes()
here.
|| key2 === "require" | ||
|| key2 === "node" | ||
|| key2 === "default") { | ||
if(conditions.indexOf(key) !== -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use includes()
here.
@@ -202,8 +200,7 @@ module.exports = (request, options) => { | |||
targetFilePath = value; | |||
else | |||
for(const [key2, value2] of Object.entries(value)) | |||
if(key2 === "import" | |||
|| key2 === "require" | |||
if(conditions.indexOf(key2) !== -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use includes()
here. Also, it should not check for default
again, it's an error.
Hi @vpzomtrrfrt, your changes inspired me to how to aproach the problem and I think I've fixed it at 900da2e, now conditions are properly enforced and work in (one of) my use cases. Can you update to version 1.1.3 and confirm that it works for you too? If not, please update your PR and I'll merge it :-) |
Yes, the latest release appears to work |
Great, good to know :-) |
See also jestjs/jest#11859
There's probably a better way to do this, but this works for my use case at least. Should fix #5