+4
-27
| "use strict"; | ||
| const defer = require('../promise/defer'); | ||
| const isNumber = require('mout/lang/isNumber'); | ||
| module.exports = function(fn, timeout, ctx) { | ||
| if(!timeout) | ||
| return fn; | ||
| if(!isNumber(timeout)) | ||
| throw "timeout must be a number"; | ||
| var my = async function () { | ||
| var args = [].slice.call(arguments); | ||
| var self = ctx || this; | ||
| var defered = defer(); | ||
| setTimeout(defered.reject.bind(defered, "timeout"), timeout); | ||
| let job = async function() { | ||
| var response = await fn.apply(self, args); | ||
| defered.resolve(response); | ||
| }; | ||
| await Promise.all([job(), defered]); | ||
| return defered; | ||
| }; | ||
| return my; | ||
| module.exports = (delay, reason) => { | ||
| return new Promise((resolve, reject) => { | ||
| setTimeout(reject.bind(this, reason || 'timeout'), delay); | ||
| }); | ||
| }; |
+1
-1
| { | ||
| "name": "nyks", | ||
| "version": "5.12.4", | ||
| "version": "5.12.5", | ||
| "description": "nodejs exupery style", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance 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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance 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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
68934
-0.7%1817
-0.87%