conjure-client
Advanced tools
Comparing version 2.7.0 to 2.8.0
@@ -31,2 +31,2 @@ /** | ||
} | ||
export declare function isConjureError(error: any): error is ConjureError<never>; | ||
export declare function isConjureError(error: unknown): error is ConjureError<never>; |
@@ -45,6 +45,14 @@ "use strict"; | ||
function isConjureError(error) { | ||
return (error instanceof ConjureError || | ||
(error.__proto__ && error.__proto__.constructor && error.__proto__.constructor.name === ConjureError.name)); | ||
if (error == null) { | ||
return false; | ||
} | ||
if (error instanceof ConjureError) { | ||
return true; | ||
} | ||
var errorPrototype = Object.getPrototypeOf(error); | ||
return (errorPrototype != null && | ||
errorPrototype.constructor != null && | ||
errorPrototype.constructor.name === ConjureError.name); | ||
} | ||
exports.isConjureError = isConjureError; | ||
//# sourceMappingURL=error.js.map |
@@ -1,1 +0,1 @@ | ||
export declare const IMPLEMENTATION_VERSION = "2.7.0"; | ||
export declare const IMPLEMENTATION_VERSION = "2.8.0"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.IMPLEMENTATION_VERSION = '2.7.0'; | ||
exports.IMPLEMENTATION_VERSION = '2.8.0'; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "conjure-client", | ||
"version": "2.7.0", | ||
"version": "2.8.0", | ||
"description": "An HTTP bridge library for use in front end applications and generated conjure code", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
@@ -52,7 +52,18 @@ /** | ||
export function isConjureError(error: any): error is ConjureError<never> { | ||
export function isConjureError(error: unknown): error is ConjureError<never> { | ||
if (error == null) { | ||
return false; | ||
} | ||
if (error instanceof ConjureError) { | ||
return true; | ||
} | ||
const errorPrototype = Object.getPrototypeOf(error); | ||
return ( | ||
error instanceof ConjureError || | ||
(error.__proto__ && error.__proto__.constructor && error.__proto__.constructor.name === ConjureError.name) | ||
errorPrototype != null && | ||
errorPrototype.constructor != null && | ||
errorPrototype.constructor.name === ConjureError.name | ||
); | ||
} |
@@ -1,1 +0,1 @@ | ||
export const IMPLEMENTATION_VERSION = '2.7.0'; | ||
export const IMPLEMENTATION_VERSION = '2.8.0'; |
Sorry, the diff of this file is not supported yet
89098
1714