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

async-try-catch

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-try-catch - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

10

browser/AsyncTryCatch.js

@@ -230,3 +230,9 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.AsyncTryCatch = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

{
try {
AsyncTryCatch.addListenerWrapper.call( this , AsyncTryCatch.NodeEvents.__addListenerOnce , eventName , fn ) ;
} catch ( error ) {
console.log( AsyncTryCatch.NodeEvents ) ;
console.log( AsyncTryCatch.NodeEvents.__addListenerOnce ) ;
throw error ;
}
} ;

@@ -272,3 +278,3 @@

// Global is checked first, in case we are running into browsers
// Global is checked first, in case we are running inside a browser
try {

@@ -291,3 +297,3 @@ AsyncTryCatch.NodeEvents = global.EventEmitter || require( 'events' ) ;

{
AsyncTryCatch.NodeEvents.__addListenerOnce = AsyncTryCatch.NodeEvents.prototype.addListenerOnce ;
AsyncTryCatch.NodeEvents.__addListenerOnce = AsyncTryCatch.NodeEvents.prototype.once ;
}

@@ -294,0 +300,0 @@

2

browser/AsyncTryCatch.min.js

@@ -1,1 +0,1 @@

(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.AsyncTryCatch=e()}})(function(){var e,t,n;return function r(e,t,n){function i(s,a){if(!t[s]){if(!e[s]){var p=typeof require=="function"&&require;if(!a&&p)return p(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var d=t[s]={exports:{}};e[s][0].call(d.exports,function(t){var n=e[s][1][t];return i(n?n:t)},d,d.exports,r,e,t,n)}return t[s].exports}var o=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i}({1:[function(e,t,n){(function(n,r){"use strict";function i(){throw new Error("Use AsyncTryCatch.try() instead.")}t.exports=i;r.AsyncTryCatch=i;if(n.browser&&!r.setImmediate){r.setImmediate=function o(e){return setTimeout(e,0)};r.clearImmediate=function s(e){return clearTimeout(e)}}if(!r.Vanilla){r.Vanilla={};if(!r.Vanilla.setTimeout){r.Vanilla.setTimeout=setTimeout}if(!r.Vanilla.setImmediate){r.Vanilla.setImmediate=setImmediate}if(!r.Vanilla.nextTick){r.Vanilla.nextTick=n.nextTick}}i.stack=[];i.substituted=false;i.try=function a(e){var t=Object.create(i.prototype,{fn:{value:e,enumerable:true},parent:{value:i.stack[i.stack.length-1]}});return t};i.prototype.catch=function p(e){Object.defineProperties(this,{catchFn:{value:e,enumerable:true}});if(!i.substituted){i.substitute()}try{i.stack.push(this);this.fn();i.stack.pop()}catch(t){i.stack.pop();this.callCatchFn(t)}};i.prototype.callCatchFn=function c(e){if(!this.parent){this.catchFn(e);return}try{i.stack.push(this.parent);this.catchFn(e);i.stack.pop()}catch(e){i.stack.pop();this.parent.callCatchFn(e)}};i.timerWrapper=function d(e,t){var t,n,r,o=Array.prototype.slice.call(arguments,1);if(typeof t!=="function"||!i.stack.length){return e.apply(this,o)}n=i.stack[i.stack.length-1];r=function(){try{i.stack.push(n);t.apply(this,arguments);i.stack.pop()}catch(e){i.stack.pop();n.callCatchFn(e)}};o[0]=r;return e.apply(this,o)};i.addListenerWrapper=function f(e,t,n,r){var n,o,s;if(typeof n==="object"){r=n;n=r.fn;delete r.fn}if(typeof n!=="function"||!i.stack.length){return e.call(this,t,n,r)}o=i.stack[i.stack.length-1];if(this.__fnToWrapperMap){s=this.__fnToWrapperMap.get(n)}else{Object.defineProperty(this,"__fnToWrapperMap",{value:new WeakMap})}if(!s){s=function(){try{i.stack.push(o);n.apply(this,arguments);i.stack.pop()}catch(e){i.stack.pop();o.callCatchFn(e)}};this.__fnToWrapperMap.set(n,s)}return e.call(this,t,s,r)};i.removeListenerWrapper=function u(e,t,n){if(typeof n==="function"&&this.__fnToWrapperMap){n=this.__fnToWrapperMap.get(n)||n}return e.call(this,t,n)};i.setTimeout=i.timerWrapper.bind(undefined,r.Vanilla.setTimeout);i.setImmediate=i.timerWrapper.bind(undefined,r.Vanilla.setImmediate);i.nextTick=i.timerWrapper.bind(n,r.Vanilla.nextTick);i.addListener=function l(e,t){i.addListenerWrapper.call(this,i.NodeEvents.__addListener,e,t)};i.addListenerOnce=function v(e,t){i.addListenerWrapper.call(this,i.NodeEvents.__addListenerOnce,e,t)};i.removeListener=function h(e,t){i.removeListenerWrapper.call(this,i.NodeEvents.__removeListener,e,t)};i.ngevAddListener=function m(e,t,n){i.addListenerWrapper.call(this,i.NextGenEvents.on,e,t,n)};i.ngevAddListenerOnce=function y(e,t,n){i.addListenerWrapper.call(this,i.NextGenEvents.once,e,t,n)};i.ngevRemoveListener=function E(e,t){i.removeListenerWrapper.call(this,i.NextGenEvents.off,e,t)};i.substitute=function L(){i.substituted=true;r.setTimeout=i.setTimeout;r.setImmediate=i.setTimeout;n.nextTick=i.nextTick;try{i.NodeEvents=r.EventEmitter||e("events")}catch(t){}try{i.NextGenEvents=r.NextGenEvents||e("nextgen-events")}catch(t){}if(i.NodeEvents){if(!i.NodeEvents.__addListener){i.NodeEvents.__addListener=i.NodeEvents.prototype.on}if(!i.NodeEvents.__addListenerOnce){i.NodeEvents.__addListenerOnce=i.NodeEvents.prototype.addListenerOnce}if(!i.NodeEvents.__removeListener){i.NodeEvents.__removeListener=i.NodeEvents.prototype.removeListener}i.NodeEvents.prototype.on=i.addListener;i.NodeEvents.prototype.addListener=i.addListener;i.NodeEvents.prototype.once=i.addListenerOnce;i.NodeEvents.prototype.removeListener=i.removeListener}if(i.NextGenEvents){i.NextGenEvents.prototype.on=i.ngevAddListener;i.NextGenEvents.prototype.addListener=i.ngevAddListener;i.NextGenEvents.prototype.once=i.ngevAddListenerOnce;i.NextGenEvents.prototype.off=i.ngevRemoveListener;i.NextGenEvents.prototype.removeListener=i.ngevRemoveListener}};i.restore=function N(){i.substituted=false;r.setTimeout=r.Vanilla.setTimeout;r.setImmediate=r.Vanilla.setImmediate;n.nextTick=r.Vanilla.nextTick;if(i.NodeEvents){i.NodeEvents.prototype.on=i.NodeEvents.__addListener;i.NodeEvents.prototype.addListener=i.NodeEvents.__addListener;i.NodeEvents.prototype.once=i.NodeEvents.__addListenerOnce;i.NodeEvents.prototype.removeListener=i.NodeEvents.__removeListener}if(i.NextGenEvents){i.NextGenEvents.prototype.on=i.NextGenEvents.on;i.NextGenEvents.prototype.addListener=i.NextGenEvents.on;i.NextGenEvents.prototype.once=i.NextGenEvents.once;i.NextGenEvents.prototype.off=i.NextGenEvents.off;i.NextGenEvents.prototype.removeListener=i.NextGenEvents.removeListener}}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{_process:3,events:2,"nextgen-events":2}],2:[function(e,t,n){},{}],3:[function(e,t,n){var r=t.exports={};var i=[];var o=false;var s;var a=-1;function p(){if(!o||!s){return}o=false;if(s.length){i=s.concat(i)}else{a=-1}if(i.length){c()}}function c(){if(o){return}var e=setTimeout(p);o=true;var t=i.length;while(t){s=i;i=[];while(++a<t){if(s){s[a].run()}}a=-1;t=i.length}s=null;o=false;clearTimeout(e)}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1){for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}}i.push(new d(e,t));if(i.length===1&&!o){setTimeout(c,0)}};function d(e,t){this.fun=e;this.array=t}d.prototype.run=function(){this.fun.apply(null,this.array)};r.title="browser";r.browser=true;r.env={};r.argv=[];r.version="";r.versions={};function f(){}r.on=f;r.addListener=f;r.once=f;r.off=f;r.removeListener=f;r.removeAllListeners=f;r.emit=f;r.binding=function(e){throw new Error("process.binding is not supported")};r.cwd=function(){return"/"};r.chdir=function(e){throw new Error("process.chdir is not supported")};r.umask=function(){return 0}},{}]},{},[1])(1)});
(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.AsyncTryCatch=e()}})(function(){var e,t,n;return function r(e,t,n){function i(s,a){if(!t[s]){if(!e[s]){var c=typeof require=="function"&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var p=new Error("Cannot find module '"+s+"'");throw p.code="MODULE_NOT_FOUND",p}var d=t[s]={exports:{}};e[s][0].call(d.exports,function(t){var n=e[s][1][t];return i(n?n:t)},d,d.exports,r,e,t,n)}return t[s].exports}var o=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i}({1:[function(e,t,n){(function(n,r){"use strict";function i(){throw new Error("Use AsyncTryCatch.try() instead.")}t.exports=i;r.AsyncTryCatch=i;if(n.browser&&!r.setImmediate){r.setImmediate=function o(e){return setTimeout(e,0)};r.clearImmediate=function s(e){return clearTimeout(e)}}if(!r.Vanilla){r.Vanilla={};if(!r.Vanilla.setTimeout){r.Vanilla.setTimeout=setTimeout}if(!r.Vanilla.setImmediate){r.Vanilla.setImmediate=setImmediate}if(!r.Vanilla.nextTick){r.Vanilla.nextTick=n.nextTick}}i.stack=[];i.substituted=false;i.try=function a(e){var t=Object.create(i.prototype,{fn:{value:e,enumerable:true},parent:{value:i.stack[i.stack.length-1]}});return t};i.prototype.catch=function c(e){Object.defineProperties(this,{catchFn:{value:e,enumerable:true}});if(!i.substituted){i.substitute()}try{i.stack.push(this);this.fn();i.stack.pop()}catch(t){i.stack.pop();this.callCatchFn(t)}};i.prototype.callCatchFn=function p(e){if(!this.parent){this.catchFn(e);return}try{i.stack.push(this.parent);this.catchFn(e);i.stack.pop()}catch(e){i.stack.pop();this.parent.callCatchFn(e)}};i.timerWrapper=function d(e,t){var t,n,r,o=Array.prototype.slice.call(arguments,1);if(typeof t!=="function"||!i.stack.length){return e.apply(this,o)}n=i.stack[i.stack.length-1];r=function(){try{i.stack.push(n);t.apply(this,arguments);i.stack.pop()}catch(e){i.stack.pop();n.callCatchFn(e)}};o[0]=r;return e.apply(this,o)};i.addListenerWrapper=function f(e,t,n,r){var n,o,s;if(typeof n==="object"){r=n;n=r.fn;delete r.fn}if(typeof n!=="function"||!i.stack.length){return e.call(this,t,n,r)}o=i.stack[i.stack.length-1];if(this.__fnToWrapperMap){s=this.__fnToWrapperMap.get(n)}else{Object.defineProperty(this,"__fnToWrapperMap",{value:new WeakMap})}if(!s){s=function(){try{i.stack.push(o);n.apply(this,arguments);i.stack.pop()}catch(e){i.stack.pop();o.callCatchFn(e)}};this.__fnToWrapperMap.set(n,s)}return e.call(this,t,s,r)};i.removeListenerWrapper=function l(e,t,n){if(typeof n==="function"&&this.__fnToWrapperMap){n=this.__fnToWrapperMap.get(n)||n}return e.call(this,t,n)};i.setTimeout=i.timerWrapper.bind(undefined,r.Vanilla.setTimeout);i.setImmediate=i.timerWrapper.bind(undefined,r.Vanilla.setImmediate);i.nextTick=i.timerWrapper.bind(n,r.Vanilla.nextTick);i.addListener=function u(e,t){i.addListenerWrapper.call(this,i.NodeEvents.__addListener,e,t)};i.addListenerOnce=function v(e,t){try{i.addListenerWrapper.call(this,i.NodeEvents.__addListenerOnce,e,t)}catch(n){console.log(i.NodeEvents);console.log(i.NodeEvents.__addListenerOnce);throw n}};i.removeListener=function h(e,t){i.removeListenerWrapper.call(this,i.NodeEvents.__removeListener,e,t)};i.ngevAddListener=function m(e,t,n){i.addListenerWrapper.call(this,i.NextGenEvents.on,e,t,n)};i.ngevAddListenerOnce=function y(e,t,n){i.addListenerWrapper.call(this,i.NextGenEvents.once,e,t,n)};i.ngevRemoveListener=function E(e,t){i.removeListenerWrapper.call(this,i.NextGenEvents.off,e,t)};i.substitute=function N(){i.substituted=true;r.setTimeout=i.setTimeout;r.setImmediate=i.setTimeout;n.nextTick=i.nextTick;try{i.NodeEvents=r.EventEmitter||e("events")}catch(t){}try{i.NextGenEvents=r.NextGenEvents||e("nextgen-events")}catch(t){}if(i.NodeEvents){if(!i.NodeEvents.__addListener){i.NodeEvents.__addListener=i.NodeEvents.prototype.on}if(!i.NodeEvents.__addListenerOnce){i.NodeEvents.__addListenerOnce=i.NodeEvents.prototype.once}if(!i.NodeEvents.__removeListener){i.NodeEvents.__removeListener=i.NodeEvents.prototype.removeListener}i.NodeEvents.prototype.on=i.addListener;i.NodeEvents.prototype.addListener=i.addListener;i.NodeEvents.prototype.once=i.addListenerOnce;i.NodeEvents.prototype.removeListener=i.removeListener}if(i.NextGenEvents){i.NextGenEvents.prototype.on=i.ngevAddListener;i.NextGenEvents.prototype.addListener=i.ngevAddListener;i.NextGenEvents.prototype.once=i.ngevAddListenerOnce;i.NextGenEvents.prototype.off=i.ngevRemoveListener;i.NextGenEvents.prototype.removeListener=i.ngevRemoveListener}};i.restore=function L(){i.substituted=false;r.setTimeout=r.Vanilla.setTimeout;r.setImmediate=r.Vanilla.setImmediate;n.nextTick=r.Vanilla.nextTick;if(i.NodeEvents){i.NodeEvents.prototype.on=i.NodeEvents.__addListener;i.NodeEvents.prototype.addListener=i.NodeEvents.__addListener;i.NodeEvents.prototype.once=i.NodeEvents.__addListenerOnce;i.NodeEvents.prototype.removeListener=i.NodeEvents.__removeListener}if(i.NextGenEvents){i.NextGenEvents.prototype.on=i.NextGenEvents.on;i.NextGenEvents.prototype.addListener=i.NextGenEvents.on;i.NextGenEvents.prototype.once=i.NextGenEvents.once;i.NextGenEvents.prototype.off=i.NextGenEvents.off;i.NextGenEvents.prototype.removeListener=i.NextGenEvents.removeListener}}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{_process:3,events:2,"nextgen-events":2}],2:[function(e,t,n){},{}],3:[function(e,t,n){var r=t.exports={};var i=[];var o=false;var s;var a=-1;function c(){if(!o||!s){return}o=false;if(s.length){i=s.concat(i)}else{a=-1}if(i.length){p()}}function p(){if(o){return}var e=setTimeout(c);o=true;var t=i.length;while(t){s=i;i=[];while(++a<t){if(s){s[a].run()}}a=-1;t=i.length}s=null;o=false;clearTimeout(e)}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1){for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}}i.push(new d(e,t));if(i.length===1&&!o){setTimeout(p,0)}};function d(e,t){this.fun=e;this.array=t}d.prototype.run=function(){this.fun.apply(null,this.array)};r.title="browser";r.browser=true;r.env={};r.argv=[];r.version="";r.versions={};function f(){}r.on=f;r.addListener=f;r.once=f;r.off=f;r.removeListener=f;r.removeAllListeners=f;r.emit=f;r.binding=function(e){throw new Error("process.binding is not supported")};r.cwd=function(){return"/"};r.chdir=function(e){throw new Error("process.chdir is not supported")};r.umask=function(){return 0}},{}]},{},[1])(1)});

@@ -228,3 +228,9 @@ /*

{
try {
AsyncTryCatch.addListenerWrapper.call( this , AsyncTryCatch.NodeEvents.__addListenerOnce , eventName , fn ) ;
} catch ( error ) {
console.log( AsyncTryCatch.NodeEvents ) ;
console.log( AsyncTryCatch.NodeEvents.__addListenerOnce ) ;
throw error ;
}
} ;

@@ -270,3 +276,3 @@

// Global is checked first, in case we are running into browsers
// Global is checked first, in case we are running inside a browser
try {

@@ -289,3 +295,3 @@ AsyncTryCatch.NodeEvents = global.EventEmitter || require( 'events' ) ;

{
AsyncTryCatch.NodeEvents.__addListenerOnce = AsyncTryCatch.NodeEvents.prototype.addListenerOnce ;
AsyncTryCatch.NodeEvents.__addListenerOnce = AsyncTryCatch.NodeEvents.prototype.once ;
}

@@ -292,0 +298,0 @@

{
"name": "async-try-catch",
"version": "0.1.6",
"version": "0.1.7",
"description": "Async try catch",

@@ -5,0 +5,0 @@ "main": "lib/AsyncTryCatch.js",

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