cb2promise
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -0,1 +1,12 @@ | ||
<a name="1.0.5"></a> | ||
## 1.0.5 (2017-03-02) | ||
* Refactor ([009123c](https://github.com/kikobeats/cb2promise/commit/009123c)) | ||
* Remove browser build ([d4c19c7](https://github.com/kikobeats/cb2promise/commit/d4c19c7)) | ||
* Update bumped ([2cb5c94](https://github.com/kikobeats/cb2promise/commit/2cb5c94)) | ||
* Update node version ([589ae5a](https://github.com/kikobeats/cb2promise/commit/589ae5a)) | ||
* Use const when is possible ([9319164](https://github.com/kikobeats/cb2promise/commit/9319164)) | ||
<a name="1.0.4"></a> | ||
@@ -2,0 +13,0 @@ ## 1.0.4 (2017-03-02) |
33
index.js
@@ -1,3 +0,30 @@ | ||
'use strict'; | ||
require('coffee-script/register'); | ||
module.exports = require(__dirname + '/lib/cb2promise'); | ||
'use strict' | ||
const Promise = require('pinkie-promise') | ||
const sliced = require('sliced') | ||
function cb2promise () { | ||
let args = sliced(arguments) | ||
const fn = args.shift() | ||
let resolve | ||
let reject | ||
function callbackHandle () { | ||
let err | ||
args = sliced(arguments) | ||
err = args.shift() | ||
return (!err) ? resolve.apply(null, args) : reject(err) | ||
}; | ||
function promiseFactory (resolvePromise, rejectPromise) { | ||
resolve = resolvePromise | ||
reject = rejectPromise | ||
return fn.apply(null, args) | ||
} | ||
args.push(callbackHandle) | ||
return new Promise(promiseFactory) | ||
}; | ||
module.exports = cb2promise |
@@ -5,4 +5,4 @@ { | ||
"homepage": "https://github.com/Kikobeats/cb2promise", | ||
"version": "1.0.4", | ||
"main": "./dist/cb2promise.js", | ||
"version": "1.0.5", | ||
"main": "index.js", | ||
"author": { | ||
@@ -29,21 +29,19 @@ "email": "josefrancisco.verdu@gmail.com", | ||
"dependencies": { | ||
"coffee-script": "*", | ||
"pinkie-promise": "*" | ||
"pinkie-promise": "~2.0.1", | ||
"sliced": "~1.0.1" | ||
}, | ||
"devDependencies": { | ||
"browserify": "*", | ||
"coffeeify": "*", | ||
"gulp": "*", | ||
"gulp-header": "*", | ||
"gulp-uglify": "*", | ||
"gulp-util": "*", | ||
"mocha": "*", | ||
"should": "*", | ||
"vinyl-buffer": "*", | ||
"vinyl-source-stream": "*" | ||
"browserify": "latest", | ||
"coffee-script": "latest", | ||
"mocha": "latest", | ||
"should": "latest", | ||
"standard": "latest" | ||
}, | ||
"engines": { | ||
"node": ">= 0.10.0", | ||
"npm": ">= 1.4.0" | ||
"node": ">= 4" | ||
}, | ||
"files": [ | ||
"dist", | ||
"index.js" | ||
], | ||
"scripts": { | ||
@@ -50,0 +48,0 @@ "test": "sh test/test.sh" |
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
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
5
0
0
0
5695
5
23
+ Addedsliced@~1.0.1
+ Addedsliced@1.0.1(transitive)
- Removedcoffee-script@*
- Removedcoffee-script@1.12.7(transitive)
Updatedpinkie-promise@~2.0.1