Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
add boolean type
- Loading branch information
Showing
2 changed files
with
45 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* XadillaX created at 2015-11-02 10:40:53 With ♥ | ||
* | ||
* Copyright (c) 2015 Souche.com, all rights | ||
* reserved. | ||
*/ | ||
"use strict"; | ||
|
||
var _Boolean = {}; | ||
_Boolean.name = "_Boolean"; | ||
_Boolean.needQuotes = false; | ||
|
||
/** | ||
* restore | ||
* @param {_Boolean} parsed the parsed integer | ||
* @return {Number} the integer restored | ||
*/ | ||
_Boolean.restore = function(parsed) { | ||
return (parsed ^ 0) & 1; | ||
}; | ||
|
||
/** | ||
* parse | ||
* @param {Number} orig the original integer | ||
* @return {_Boolean} the boolean value | ||
*/ | ||
_Boolean.parse = function(orig) { | ||
return !!orig; | ||
}; | ||
|
||
_Boolean.defaultValue = 0; | ||
|
||
/** | ||
* equal | ||
* @param {Number|Boolean} a integer I | ||
* @param {Number|Boolean} b integer II | ||
* @return {Boolean} whether they are equal | ||
*/ | ||
_Boolean.equal = function(a, b) { | ||
a = !!a; | ||
b = !!b; | ||
return a === b; | ||
}; | ||
|
||
module.exports = _Boolean; |
This file was deleted.
Oops, something went wrong.