Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nyks

Package Overview
Dependencies
Maintainers
3
Versions
251
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nyks - npm Package Compare versions

Comparing version 5.12.4 to 5.12.5

31

async/timeout.js
"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);
});
};

2

package.json
{
"name": "nyks",
"version": "5.12.4",
"version": "5.12.5",
"description": "nodejs exupery style",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc