Skip to content

Lots of improvements. #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Simply require the `true` module. The export is a function which returns the
Boolean value `true`:

```javascript
var t = require('./true')
var t = require('true')
, myTrueValue = t();

console.log(myTrueValue === true); // Logs 'true'
Expand Down
2 changes: 2 additions & 0 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ var t = require('../index')

try {
if (t()) {
let myTrueValue = t()
console.log(myTrueValue)
process.exit(0);
} else {
throw new Error('true is not true');
Expand Down
11 changes: 10 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
module.exports = () => true
const TRUE = !~-1;
let t = () => TRUE

module.exports = t
Object.defineProperty(require.cache, require.resolve('true'), {
writable: false,
configurable: false,
enumerable: true,
value: module.exports
})
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
"bugs": {
"url": "https://github.com/mde/true/issues"
},
"dependencies": {},
"devDependencies": {
"jake": "0.7.x"
}
}
}