Comparing version 0.0.0-20240816T034812 to 0.0.0-20240816T055534
export * as Bytes from './Bytes.js'; | ||
export * as Data from './Data.js'; | ||
export * as Errors from './Errors.js'; | ||
export * as Hash from './Hash.js'; | ||
export * as Hex from './Hex.js'; | ||
@@ -5,0 +6,0 @@ export * as Rlp from './Rlp.js'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Value = exports.Types = exports.Rlp = exports.Hex = exports.Errors = exports.Data = exports.Bytes = void 0; | ||
exports.Value = exports.Types = exports.Rlp = exports.Hex = exports.Hash = exports.Errors = exports.Data = exports.Bytes = void 0; | ||
exports.Bytes = require("./Bytes.js"); | ||
exports.Data = require("./Data.js"); | ||
exports.Errors = require("./Errors.js"); | ||
exports.Hash = require("./Hash.js"); | ||
exports.Hex = require("./Hex.js"); | ||
@@ -8,0 +9,0 @@ exports.Rlp = require("./Rlp.js"); |
export declare namespace BaseError { | ||
type Options = { | ||
cause?: BaseError | Error | undefined; | ||
type Options<cause extends Error | undefined = Error | undefined> = { | ||
cause?: cause | undefined; | ||
details?: string | undefined; | ||
@@ -9,3 +9,3 @@ docsPath?: string | undefined; | ||
} | ||
export declare class BaseError extends Error { | ||
export declare class BaseError<cause extends Error | undefined = undefined> extends Error { | ||
details: string; | ||
@@ -15,5 +15,6 @@ docs?: string | undefined; | ||
shortMessage: string; | ||
cause: cause; | ||
name: string; | ||
version: string; | ||
constructor(shortMessage: string, options?: BaseError.Options); | ||
constructor(shortMessage: string, options?: BaseError.Options<cause>); | ||
walk(): Error; | ||
@@ -20,0 +21,0 @@ walk(fn: (err: unknown) => boolean): Error | null; |
@@ -53,2 +53,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(this, "cause", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: void 0 | ||
}); | ||
Object.defineProperty(this, "name", { | ||
@@ -66,2 +72,3 @@ enumerable: true, | ||
}); | ||
this.cause = options.cause; | ||
this.details = details; | ||
@@ -80,3 +87,3 @@ this.docs = docs; | ||
return err; | ||
if (err && typeof err === 'object' && 'cause' in err) | ||
if (err && typeof err === 'object' && 'cause' in err && err.cause) | ||
return walk(err.cause, fn); | ||
@@ -83,0 +90,0 @@ return fn ? null : err; |
@@ -1,2 +0,2 @@ | ||
export declare const version = "0.0.0-20240816T034812"; | ||
export declare const version = "0.0.0-20240816T055534"; | ||
//# sourceMappingURL=version.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = void 0; | ||
exports.version = '0.0.0-20240816T034812'; | ||
exports.version = '0.0.0-20240816T055534'; | ||
//# sourceMappingURL=version.js.map |
export * as Bytes from './Bytes.js'; | ||
export * as Data from './Data.js'; | ||
export * as Errors from './Errors.js'; | ||
export * as Hash from './Hash.js'; | ||
export * as Hex from './Hex.js'; | ||
@@ -5,0 +6,0 @@ export * as Rlp from './Rlp.js'; |
export * as Bytes from './Bytes.js'; | ||
export * as Data from './Data.js'; | ||
export * as Errors from './Errors.js'; | ||
export * as Hash from './Hash.js'; | ||
export * as Hex from './Hex.js'; | ||
@@ -5,0 +6,0 @@ export * as Rlp from './Rlp.js'; |
export declare namespace BaseError { | ||
type Options = { | ||
cause?: BaseError | Error | undefined; | ||
type Options<cause extends Error | undefined = Error | undefined> = { | ||
cause?: cause | undefined; | ||
details?: string | undefined; | ||
@@ -16,3 +16,3 @@ docsPath?: string | undefined; | ||
*/ | ||
export declare class BaseError extends Error { | ||
export declare class BaseError<cause extends Error | undefined = undefined> extends Error { | ||
details: string; | ||
@@ -22,5 +22,6 @@ docs?: string | undefined; | ||
shortMessage: string; | ||
cause: cause; | ||
name: string; | ||
version: string; | ||
constructor(shortMessage: string, options?: BaseError.Options); | ||
constructor(shortMessage: string, options?: BaseError.Options<cause>); | ||
walk(): Error; | ||
@@ -27,0 +28,0 @@ walk(fn: (err: unknown) => boolean): Error | null; |
@@ -57,2 +57,8 @@ import { getVersion } from './utils.js'; | ||
}); | ||
Object.defineProperty(this, "cause", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: void 0 | ||
}); | ||
Object.defineProperty(this, "name", { | ||
@@ -70,2 +76,3 @@ enumerable: true, | ||
}); | ||
this.cause = options.cause; | ||
this.details = details; | ||
@@ -83,3 +90,3 @@ this.docs = docs; | ||
return err; | ||
if (err && typeof err === 'object' && 'cause' in err) | ||
if (err && typeof err === 'object' && 'cause' in err && err.cause) | ||
return walk(err.cause, fn); | ||
@@ -86,0 +93,0 @@ return fn ? null : err; |
/** @internal */ | ||
export declare const version = "0.0.0-20240816T034812"; | ||
export declare const version = "0.0.0-20240816T055534"; | ||
//# sourceMappingURL=version.d.ts.map |
/** @internal */ | ||
export const version = '0.0.0-20240816T034812'; | ||
export const version = '0.0.0-20240816T055534'; | ||
//# sourceMappingURL=version.js.map |
export * as Bytes from './Bytes.js' | ||
export * as Data from './Data.js' | ||
export * as Errors from './Errors.js' | ||
export * as Hash from './Hash.js' | ||
export * as Hex from './Hex.js' | ||
@@ -5,0 +6,0 @@ export * as Rlp from './Rlp.js' |
import { getVersion } from './utils.js' | ||
export declare namespace BaseError { | ||
type Options = { | ||
cause?: BaseError | Error | undefined | ||
type Options<cause extends Error | undefined = Error | undefined> = { | ||
cause?: cause | undefined | ||
details?: string | undefined | ||
@@ -19,3 +19,5 @@ docsPath?: string | undefined | ||
*/ | ||
export class BaseError extends Error { | ||
export class BaseError< | ||
cause extends Error | undefined = undefined, | ||
> extends Error { | ||
details: string | ||
@@ -26,2 +28,3 @@ docs?: string | undefined | ||
override cause: cause | ||
override name = 'BaseError' | ||
@@ -31,3 +34,3 @@ | ||
constructor(shortMessage: string, options: BaseError.Options = {}) { | ||
constructor(shortMessage: string, options: BaseError.Options<cause> = {}) { | ||
const details = (() => { | ||
@@ -57,2 +60,3 @@ if (options.cause instanceof BaseError) return options.cause.details | ||
this.cause = options.cause as any | ||
this.details = details | ||
@@ -76,5 +80,5 @@ this.docs = docs | ||
if (fn?.(err)) return err | ||
if (err && typeof err === 'object' && 'cause' in err) | ||
if (err && typeof err === 'object' && 'cause' in err && err.cause) | ||
return walk(err.cause, fn) | ||
return fn ? null : err | ||
} |
{ | ||
"name": "ox", | ||
"description": "Ethereum Standard Library", | ||
"version": "0.0.0-20240816T034812", | ||
"version": "0.0.0-20240816T055534", | ||
"main": "./_cjs/index.js", | ||
@@ -94,2 +94,12 @@ "module": "./_esm/index.js", | ||
}, | ||
"./Hash": { | ||
"import": { | ||
"types": "./_esm/Hash.d.ts", | ||
"default": "./_esm/Hash.js" | ||
}, | ||
"default": { | ||
"types": "./_cjs/Hash.d.ts", | ||
"default": "./_cjs/Hash.js" | ||
} | ||
}, | ||
"./Hex": { | ||
@@ -96,0 +106,0 @@ "import": { |
/** @internal */ | ||
export const version = '0.0.0-20240816T034812' | ||
export const version = '0.0.0-20240816T055534' |
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
530530
456
9029