Comparing version 2.1.4 to 2.1.5
@@ -0,7 +1,9 @@ | ||
// v1.3.0 October 26, 2013 | ||
// https://github.com/bevry/base | ||
if ( require('fs').existsSync('.git') ) { | ||
require('child_process').spawn( | ||
'npm', | ||
process.platform.indexOf('win') === 0 ? process.execPath.replace('node.exe', 'npm.cmd') : 'npm', | ||
['install', '--force', require('./package.json').name], | ||
{env:process.env, cwd:process.cwd(), stdio:'inherit'} | ||
); | ||
).on('error', console.log).on('close', console.log); | ||
} |
@@ -1,6 +0,9 @@ | ||
(The MIT License) | ||
Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me) <us@bevry.me> | ||
Copyright © 2011-2012 [Benjamin Lupton](http://balupton.com) <b@lupton.cc> | ||
<!-- LICENSEFILE/ --> | ||
# License | ||
Copyright © Benjamin Lupton <b@lupton.cc> | ||
## The MIT License | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
@@ -11,1 +14,5 @@ | ||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
<!-- /LICENSEFILE --> | ||
// Generated by CoffeeScript 1.6.3 | ||
var ambi, typeChecker, | ||
__slice = [].slice; | ||
(function() { | ||
var ambi, typeChecker, | ||
__slice = [].slice; | ||
typeChecker = require('typechecker'); | ||
typeChecker = require('typechecker'); | ||
ambi = function() { | ||
var args, completionCallback, err, fireMethod, introspectMethod, isAsynchronousMethod, method, result; | ||
method = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; | ||
if (typeChecker.isArray(method)) { | ||
fireMethod = method[0], introspectMethod = method[1]; | ||
} else { | ||
fireMethod = introspectMethod = method; | ||
} | ||
isAsynchronousMethod = introspectMethod.length === args.length; | ||
completionCallback = args[args.length - 1]; | ||
if (!typeChecker.isFunction(completionCallback)) { | ||
err = new Error('ambi was called without a completion callback'); | ||
throw err; | ||
} | ||
if (isAsynchronousMethod) { | ||
fireMethod.apply(null, args); | ||
} else { | ||
result = fireMethod.apply(null, args); | ||
if (typeChecker.isError(result)) { | ||
err = result; | ||
completionCallback(err); | ||
ambi = function() { | ||
var args, completionCallback, err, fireMethod, introspectMethod, isAsynchronousMethod, method, result; | ||
method = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; | ||
if (typeChecker.isArray(method)) { | ||
fireMethod = method[0], introspectMethod = method[1]; | ||
} else { | ||
completionCallback(null, result); | ||
fireMethod = introspectMethod = method; | ||
} | ||
} | ||
return null; | ||
}; | ||
isAsynchronousMethod = introspectMethod.length === args.length; | ||
completionCallback = args[args.length - 1]; | ||
if (!typeChecker.isFunction(completionCallback)) { | ||
err = new Error('ambi was called without a completion callback'); | ||
throw err; | ||
} | ||
if (isAsynchronousMethod) { | ||
fireMethod.apply(null, args); | ||
} else { | ||
result = fireMethod.apply(null, args); | ||
if (typeChecker.isError(result)) { | ||
err = result; | ||
completionCallback(err); | ||
} else { | ||
completionCallback(null, result); | ||
} | ||
} | ||
return null; | ||
}; | ||
module.exports = ambi; | ||
module.exports = ambi; | ||
}).call(this); |
{ | ||
"title": "Ambi", | ||
"name": "ambi", | ||
"version": "2.1.4", | ||
"version": "2.1.5", | ||
"description": "Execute a function ambidextrously (normalizes the differences between synchronous and asynchronous functions). Useful for treating synchronous functions as asynchronous functions (like supporting both synchronous and asynchronous event definitions automatically).", | ||
"homepage": "https://github.com/bevry/ambi", | ||
"license": { | ||
"type": "MIT" | ||
}, | ||
"badges": { | ||
"travis": true, | ||
"npm": true, | ||
"gittip": "bevry", | ||
"flattr": "344188/balupton-on-Flattr", | ||
"paypal": "QB8GQPZAH84N6" | ||
}, | ||
"keywords": [ | ||
@@ -15,3 +26,3 @@ "sync", | ||
], | ||
"author": "Bevry Pty Ltd <us@bevry.me> (http://bevry.me)", | ||
"author": "Benjamin Lupton <b@lupton.cc>", | ||
"maintainers": [ | ||
@@ -21,3 +32,4 @@ "Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)" | ||
"contributors": [ | ||
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)" | ||
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)", | ||
"sfrdmn (https://github.com/sfrdmn)" | ||
], | ||
@@ -31,3 +43,2 @@ "bugs": { | ||
}, | ||
"license": "MIT", | ||
"engines": { | ||
@@ -37,3 +48,3 @@ "node": ">=0.8" | ||
"dependencies": { | ||
"typechecker": "~2.0.6" | ||
"typechecker": "~2.0.7" | ||
}, | ||
@@ -44,3 +55,4 @@ "devDependencies": { | ||
"joe-reporter-console": "~1.2.0", | ||
"chai": "~1.7.2" | ||
"chai": "~1.8.1", | ||
"projectz": "~0.2.3" | ||
}, | ||
@@ -52,5 +64,5 @@ "directories": { | ||
"preinstall": "node ./cyclic.js", | ||
"test": "node ./out/test/everything-test.js" | ||
"test": "node ./out/test/ambi-test.js" | ||
}, | ||
"main": "./out/lib/ambi.js" | ||
} |
@@ -0,12 +1,29 @@ | ||
<!-- TITLE/ --> | ||
# Ambi | ||
[![Build Status](https://secure.travis-ci.org/bevry/ambi.png?branch=master)](http://travis-ci.org/bevry/ambi "Check this project's build status on TravisCI") | ||
<!-- /TITLE --> | ||
<!-- BADGES/ --> | ||
[![Build Status](http://img.shields.io/travis-ci/bevry/ambi.png?branch=master)](http://travis-ci.org/bevry/ambi "Check this project's build status on TravisCI") | ||
[![NPM version](https://badge.fury.io/js/ambi.png)](https://npmjs.org/package/ambi "View this project on NPM") | ||
[![Gittip donate button](http://badgr.co/gittip/bevry.png)](https://www.gittip.com/bevry/ "Donate weekly to this project using Gittip") | ||
[![Gittip donate button](http://img.shields.io/gittip/bevry.png)](https://www.gittip.com/bevry/ "Donate weekly to this project using Gittip") | ||
[![Flattr donate button](https://raw.github.com/balupton/flattr-buttons/master/badge-89x18.gif)](http://flattr.com/thing/344188/balupton-on-Flattr "Donate monthly to this project using Flattr") | ||
[![PayPayl donate button](https://www.paypalobjects.com/en_AU/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QB8GQPZAH84N6 "Donate once-off to this project using Paypal") | ||
<!-- /BADGES --> | ||
<!-- DESCRIPTION/ --> | ||
Execute a function ambidextrously (normalizes the differences between synchronous and asynchronous functions). Useful for treating synchronous functions as asynchronous functions (like supporting both synchronous and asynchronous event definitions automatically). | ||
<!-- /DESCRIPTION --> | ||
<!-- INSTALL/ --> | ||
## Install | ||
@@ -16,3 +33,3 @@ | ||
- Use: `require('ambi')` | ||
- Install: 'npm install --save ambi' | ||
- Install: `npm install --save ambi` | ||
@@ -23,11 +40,13 @@ ### [Ender](http://ender.jit.su/) | ||
## [Component](http://github.com/component/component) | ||
### [Component](http://github.com/component/component) | ||
- Use: `require('ambi')` | ||
- Install: `component install bevry/ambi` | ||
## [Bower](http://bower.io/) | ||
### [Bower](http://bower.io/) | ||
- Use: `require('ambi')` | ||
- Install: `bower install ambi` | ||
<!-- /INSTALL --> | ||
## Usage | ||
@@ -82,10 +101,59 @@ | ||
<!-- HISTORY/ --> | ||
## History | ||
You can discover the history inside the [History.md](https://github.com/bevry/ambi/blob/master/History.md#files) file | ||
[Discover the change history by heading on over to the `History.md` file.](https://github.com/bevry/ambi/blob/master/History.md#files) | ||
<!-- /HISTORY --> | ||
<!-- CONTRIBUTE/ --> | ||
## Contribute | ||
[Discover how you can contribute by heading on over to the `Contributing.md` file.](https://github.com/bevry/ambi/blob/master/Contributing.md#files) | ||
<!-- /CONTRIBUTE --> | ||
<!-- BACKERS/ --> | ||
## Backers | ||
### Maintainers | ||
These amazing people are maintaining this project: | ||
- Benjamin Lupton <b@lupton.cc> (https://github.com/balupton) | ||
### Sponsors | ||
No sponsors yet! Will you be the first? | ||
[![Gittip donate button](http://img.shields.io/gittip/bevry.png)](https://www.gittip.com/bevry/ "Donate weekly to this project using Gittip") | ||
[![Flattr donate button](https://raw.github.com/balupton/flattr-buttons/master/badge-89x18.gif)](http://flattr.com/thing/344188/balupton-on-Flattr "Donate monthly to this project using Flattr") | ||
[![PayPayl donate button](https://www.paypalobjects.com/en_AU/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QB8GQPZAH84N6 "Donate once-off to this project using Paypal") | ||
### Contributors | ||
These amazing people have contributed code to this project: | ||
- Benjamin Lupton <b@lupton.cc> (https://github.com/balupton) - [view contributions](https://github.com/bevry/ambi/commits?author=balupton) | ||
- sfrdmn (https://github.com/sfrdmn) - [view contributions](https://github.com/bevry/ambi/commits?author=sfrdmn) | ||
[Become a contributor!](https://github.com/bevry/ambi/blob/master/Contributing.md#files) | ||
<!-- /BACKERS --> | ||
<!-- LICENSE/ --> | ||
## License | ||
Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/) | ||
<br/>Copyright © 2013+ [Bevry Pty Ltd](http://bevry.me) | ||
<br/>Copyright © 2011-2012 [Benjamin Arthur Lupton](http://balupton.com) | ||
Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT license](http://creativecommons.org/licenses/MIT/) | ||
Copyright © Benjamin Lupton <b@lupton.cc> | ||
<!-- /LICENSE --> | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30680
7
42
157
5
Updatedtypechecker@~2.0.7