UNPKG

glitchkit

Version:

A lightweight toolkit to create and manage expressive, structured, and reusable error types. Perfect for APIs, services, and glitchy adventures

55 lines (54 loc) 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class GlitchKitTraceability { get traceId() { return this._traceId; } set traceId(id) { this._traceId = id; } withTraceId(id) { this._traceId = id; return this; } get operation() { return this._operation; } set operation(op) { this._operation = op; } withOperation(op) { this._operation = op; return this; } get reported() { return this._reported; } set reported(val) { this._reported = val; } withReported(val) { this._reported = val; return this; } get source() { return this._source; } set source(src) { this._source = src; } withSource(src) { this._source = src; return this; } toJson() { const traceability = { traceId: this.traceId, operation: this.operation, reported: this.reported, source: this.source, }; return traceability; } } exports.default = GlitchKitTraceability;