"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StepResultWithName = void 0;
const step_name_extractor_1 = require("./utils/step-name-extractor");
class StepResultWithName {
    constructor(stepIndex, dateConstructor = Date) {
        this.dateConstructor = dateConstructor;
        this.index = 0;
        this.startTimestamp = this.dateConstructor.now();
        this.index = stepIndex;
    }
    get name() {
        return step_name_extractor_1.extractStepName(this);
    }
    toJSON() {
        const obj = { ...this };
        delete obj.dateConstructor;
        obj.name = this.name;
        return obj;
    }
}
exports.StepResultWithName = StepResultWithName;
