on-error-resume-next
Advanced tools
Comparing version 2.0.0 to 2.0.1-main.1621ef8
@@ -26,3 +26,9 @@ "use strict"; | ||
module.exports = __toCommonJS(index_async_exports); | ||
var import_types = require("util/types"); | ||
// src/private/isPromise.ts | ||
function isPromise(value) { | ||
return !!((typeof value === "function" || typeof value === "object") && value && "then" in value && typeof value.then === "function"); | ||
} | ||
// src/index.async.ts | ||
function onErrorResumeNext(fn, context) { | ||
@@ -32,3 +38,3 @@ return new Promise((resolve) => { | ||
const result = fn.call(context); | ||
if ((0, import_types.isPromise)(result)) { | ||
if (isPromise(result)) { | ||
result.then(resolve, () => resolve(void 0)); | ||
@@ -35,0 +41,0 @@ } else { |
{ | ||
"name": "on-error-resume-next", | ||
"version": "2.0.0", | ||
"version": "2.0.1-main.1621ef8", | ||
"description": "Run a function, synchronously or asynchronously, and ignore errors.", | ||
@@ -89,4 +89,4 @@ "files": [ | ||
"dependencies": { | ||
"on-error-resume-next": "^2.0.0" | ||
"on-error-resume-next": "^2.0.1-main.1621ef8" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
27058
212
1