sindresorhus / import-fresh

Import a module while bypassing the cache
MIT License
283 stars 24 forks source link

Add handling of parent being absent from cache and parent being self #16

Closed stroncium closed 5 years ago

stroncium commented 5 years ago

Fixes #15

Now falls back to normal require(parent being import-fresh then) if actual parent is not in cache.

Also, handles parent being the same as target by changing parent to import-fresh too. (I'd suspect it is a really rare edge case, but memory leak from repeated import-freshing itself would be quite hard to debug.)

//NOTE additionally tested with https://github.com/eslint/eslint/pull/12529

sindresorhus commented 5 years ago

Thanks for fixing :)

mdjermanovic commented 5 years ago

Thanks! :-)