Comparing version 5.0.0 to 5.0.1
{ | ||
"name": "nyks", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "nodejs exupery style", | ||
@@ -42,4 +42,4 @@ "keywords": [ | ||
"mocha": "node node_modules/mocha/bin/_mocha", | ||
"jscs": "jscs --config=node_modules/ivs-jssc/ivs-node.jscsrc test", | ||
"eslint": "eslint --config=node_modules/ivs-jssc/ivs-node.eslintrc.js test", | ||
"jscs": "jscs --config=node_modules/ivs-jssc/ivs-node.jscsrc test array async buffer child_process collection color crypto date fs function http lang math object os path process promise require stream string", | ||
"eslint": "eslint --config=node_modules/ivs-jssc/ivs-node.eslintrc.js test array async buffer child_process collection color crypto date fs function http lang math object os path process promise require stream string", | ||
"checkall": "npm run jscs && npm run eslint", | ||
@@ -46,0 +46,0 @@ "cover": "node node_modules/istanbul/lib/cli.js cover --report text-summary --report html --report lcov node_modules/mocha/bin/_mocha --recursive", |
@@ -211,5 +211,5 @@ # Async | ||
<a name="timeout"></a> | ||
## timeout(time) : Promise | ||
## timeout(fn, time[, ctx]) : Promise | ||
Reject (throw) if timeout is reached. | ||
return a Promise that throw if 'fn' is not finished avec 'time'. | ||
@@ -221,7 +221,11 @@ ```javascript | ||
let zzz = sleep(3000); | ||
let crash = timeout(2000); | ||
let fn = async function() { | ||
sleep(2000); | ||
return 'ok'; | ||
} | ||
await Promise.all([zzz, crash]); // this is going to throw after 2 secondes | ||
await timeout(fn, 3000); // return 'ok' | ||
await timeout(fn, 1000); // this will throw with message 'timeout' | ||
})(); | ||
@@ -228,0 +232,0 @@ ``` |
"use strict"; | ||
module.exports = function(str) { | ||
var hex = String(str).match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/); | ||
return (hex) ? hex.slice(1) : null; | ||
}; | ||
//alias | ||
const that = require('../color/hexToRgb'); | ||
module.exports = that; |
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
60767
110
1520
8