wesgarland / ctx-module

Load node modules into an alternate context
MIT License
0 stars 6 forks source link

Add support for case insensitive filesystems #6

Open wiwichips opened 7 months ago

wiwichips commented 7 months ago

For example, using NTFS on windows results in this behaviour:

.\\Example.js

exports.hello = 'world';

.\\main.js

...
const hw1 = ctxRequire('.\\example.js');
const hw2 = ctxRequire('.\\EXAMPLE.JS');

hw1.hello = 'Jupiter';

console.log(hw1); // prints { hello: 'Jupiter' }
console.log(hw2); // prints { hello: 'world' } <-- but should be { hello: 'Jupiter' }...

assert.equals(hw1.hello, hw2.hello); // assertion error...
wiwichips commented 1 month ago

This was largely implemented in https://github.com/wesgarland/ctx-module/pull/5

But this PR should close the issue: https://github.com/wesgarland/ctx-module/pull/9