Skip to content

true is not always true #5

@patrick-steele-idem

Description

@patrick-steele-idem

I ran into problems when trying to use this module. I added the following code for debugging:

var t = require('true');
var myTrueValue = t();
console.log(myTrueValue === true);

I expected to see the program output true, but I instead saw false!

After spending hours tracing the problem down I found that another library was doing the following:

require.cache[require.resolve('true')].exports = function() {
    return false;
};

I'm not sure why this particular third party library is doing this, but I feel like something should be done to prevent it since truthiness being correct is very important for any application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions