rest-client-sdk
Advanced tools
Comparing version 0.11.1 to 0.11.2
@@ -26,3 +26,4 @@ 'use strict'; | ||
if (!value || !(value instanceof Promise)) { | ||
var isPromise = !!value && typeof value.then === 'function'; | ||
if (!isPromise) { | ||
throw new Error('Memoization Error, Async function returned non-promise value'); | ||
@@ -29,0 +30,0 @@ } |
{ | ||
"name": "rest-client-sdk", | ||
"version": "0.11.1", | ||
"version": "0.11.2", | ||
"description": "Rest Client SDK for API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -16,3 +16,4 @@ // memoize promise returning function so that it returns | ||
if (!value || !(value instanceof Promise)) { | ||
const isPromise = !!value && typeof value.then === 'function'; | ||
if (!isPromise) { | ||
throw new Error('Memoization Error, Async function returned non-promise value'); | ||
@@ -22,6 +23,6 @@ } | ||
// Delete the value regardless of whether it resolves or rejects | ||
return value.then(internalValue => { | ||
return value.then((internalValue) => { | ||
cache[cacheKey] = false; | ||
return internalValue; | ||
}, err => { | ||
}, (err) => { | ||
cache[cacheKey] = false; | ||
@@ -28,0 +29,0 @@ throw err; |
61347
1296