-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 2.1.0: * Alternative single-reference don't-make-me-think API, fixes #8 * Fix docs
- Loading branch information
1 parent
22cb6fe
commit bea25d6
Showing
6 changed files
with
253 additions
and
51 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
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
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,34 @@ | ||
function O(a, b){ | ||
if(arguments.length == 1) | ||
if(typeof a == 'function') | ||
if(!(this instanceof O)) | ||
return new O(a) | ||
|
||
else | ||
this.apply = function(c){ | ||
return a(c) | ||
} | ||
|
||
else | ||
return new O(function(c){ | ||
return O(c, a) | ||
}) | ||
|
||
else { | ||
for(var i = 1; i < arguments.length; i++, b = arguments[i]) | ||
for(var key in b) | ||
if(b.hasOwnProperty(key)) | ||
b[key] == O | ||
? delete a[key] | ||
: a[key] = | ||
b[key] instanceof O | ||
? b[key].apply(a[key]) | ||
: b[key] | ||
|
||
return a | ||
} | ||
} | ||
|
||
try { | ||
module.exports = O | ||
} catch(e) {} |
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
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
Oops, something went wrong.