@xylabs/assert
Advanced tools
Comparing version 2.13.30 to 2.14.0
@@ -12,6 +12,8 @@ export type AssertExMessageFunc<T> = (value?: T | null) => string; | ||
*/ | ||
declare function assertEx<T>(expr?: T | null, message?: string): T; | ||
declare function assertEx<T>(expr?: T | null, messageFunc?: AssertExMessageFunc<T>): T; | ||
declare function assertEx<T, R extends Error>(expr?: T | null, errorFunc?: AssertExErrorFunc<T, R>): T; | ||
declare function assertEx<T>(expr: T | null | undefined): T; | ||
/** deprecated - replace string with () => string */ | ||
declare function assertEx<T>(expr: T | null | undefined, message?: string): T; | ||
declare function assertEx<T>(expr: T | null | undefined, messageFunc?: AssertExMessageFunc<T>): T; | ||
declare function assertEx<T, R extends Error>(expr: T | null | undefined, errorFunc?: AssertExErrorFunc<T, R>): T; | ||
export { assertEx }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -12,6 +12,8 @@ export type AssertExMessageFunc<T> = (value?: T | null) => string; | ||
*/ | ||
declare function assertEx<T>(expr?: T | null, message?: string): T; | ||
declare function assertEx<T>(expr?: T | null, messageFunc?: AssertExMessageFunc<T>): T; | ||
declare function assertEx<T, R extends Error>(expr?: T | null, errorFunc?: AssertExErrorFunc<T, R>): T; | ||
declare function assertEx<T>(expr: T | null | undefined): T; | ||
/** deprecated - replace string with () => string */ | ||
declare function assertEx<T>(expr: T | null | undefined, message?: string): T; | ||
declare function assertEx<T>(expr: T | null | undefined, messageFunc?: AssertExMessageFunc<T>): T; | ||
declare function assertEx<T, R extends Error>(expr: T | null | undefined, errorFunc?: AssertExErrorFunc<T, R>): T; | ||
export { assertEx }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -53,4 +53,4 @@ { | ||
"sideEffects": false, | ||
"version": "2.13.30", | ||
"version": "2.14.0", | ||
"type": "module" | ||
} |
@@ -13,6 +13,11 @@ export type AssertExMessageFunc<T> = (value?: T | null) => string | ||
*/ | ||
function assertEx<T>(expr?: T | null, message?: string): T | ||
function assertEx<T>(expr?: T | null, messageFunc?: AssertExMessageFunc<T>): T | ||
function assertEx<T, R extends Error>(expr?: T | null, errorFunc?: AssertExErrorFunc<T, R>): T | ||
function assertEx<T, R extends Error, P extends string | AssertExMessageFunc<T> | AssertExErrorFunc<T, R>>(expr?: T | null, messageOrFunc?: P): T { | ||
function assertEx<T>(expr: T | null | undefined): T | ||
/** deprecated - replace string with () => string */ | ||
function assertEx<T>(expr: T | null | undefined, message?: string): T | ||
function assertEx<T>(expr: T | null | undefined, messageFunc?: AssertExMessageFunc<T>): T | ||
function assertEx<T, R extends Error>(expr: T | null | undefined, errorFunc?: AssertExErrorFunc<T, R>): T | ||
function assertEx<T, R extends Error, P extends string | AssertExMessageFunc<T> | AssertExErrorFunc<T, R>>( | ||
expr: T | null | undefined, | ||
messageOrFunc?: P, | ||
): T { | ||
if (expr) return expr | ||
@@ -19,0 +24,0 @@ if (typeof messageOrFunc === 'function') { |
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
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
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31965
159