@haibun/core
Advanced tools
Comparing version 1.8.7 to 1.9.0
@@ -20,3 +20,3 @@ import { TNamed, AStepper } from '../defs'; | ||
match: RegExp; | ||
action: ({ param }: TNamed) => Promise<import("../defs").TOKActionResult | import("../defs").TNotOKActionResult>; | ||
action: ({ param }: TNamed) => Promise<import("../defs").TNotOKActionResult | import("../defs").TOKActionResult>; | ||
}; | ||
@@ -23,0 +23,0 @@ throws: { |
@@ -1,2 +0,2 @@ | ||
import { TFeature, TNotOKActionResult, TOKActionResult, TResult, TSpecl, TWorld, TRuntime, TActionResultTopics, TActionResult, TFound, TTag, AStepper, TExtraOptions, CStepper, TTagValue } from '../defs'; | ||
import { TFeature, TNotOKActionResult, TOKActionResult, TResult, TSpecl, TWorld, TRuntime, TActionResultTopics, TActionResult, TFound, TTag, AStepper, TExtraOptions, CStepper, TTagValue, TFeatureResult } from '../defs'; | ||
export declare function use(module: string): Promise<any>; | ||
@@ -65,2 +65,4 @@ export declare function resultOutput(type: string | undefined, result: TResult): Promise<any>; | ||
export declare function friendlyTime(d: Date): string; | ||
export declare const shortNum: (n: number) => number; | ||
export declare const getFeatureTitlesFromResults: (result: TFeatureResult) => string[]; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -29,3 +29,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.friendlyTime = exports.stringOrError = exports.boolOrError = exports.intOrError = exports.descTag = exports.getRunTag = exports.applyResShouldContinue = exports.getFromRuntime = exports.findStepper = exports.findStepperFromOption = exports.getStepperOption = exports.getStepperOptionName = exports.verifyRequiredOptions = exports.getStepperOptionValue = exports.getPre = exports.setWorldStepperOptions = exports.verifyExtraOptions = exports.sleep = exports.isLowerCase = exports.describeSteppers = exports.getActionable = exports.getConfigFromBase = exports.getDefaultOptions = exports.shouldProcess = exports.recurse = exports.debase = exports.getSteppers = exports.createSteppers = exports.getStepper = exports.actionOK = exports.actionNotOK = exports.resultOutput = exports.use = void 0; | ||
exports.getFeatureTitlesFromResults = exports.shortNum = exports.friendlyTime = exports.stringOrError = exports.boolOrError = exports.intOrError = exports.descTag = exports.getRunTag = exports.applyResShouldContinue = exports.getFromRuntime = exports.findStepper = exports.findStepperFromOption = exports.getStepperOption = exports.getStepperOptionName = exports.verifyRequiredOptions = exports.getStepperOptionValue = exports.getPre = exports.setWorldStepperOptions = exports.verifyExtraOptions = exports.sleep = exports.isLowerCase = exports.describeSteppers = exports.getActionable = exports.getConfigFromBase = exports.getDefaultOptions = exports.shouldProcess = exports.recurse = exports.debase = exports.getSteppers = exports.createSteppers = exports.getStepper = exports.actionOK = exports.actionNotOK = exports.resultOutput = exports.use = void 0; | ||
const fs_1 = require("fs"); | ||
@@ -330,2 +330,6 @@ const path_1 = __importDefault(require("path")); | ||
exports.friendlyTime = friendlyTime; | ||
const shortNum = (n) => Math.round((n * 100)) / 100; | ||
exports.shortNum = shortNum; | ||
const getFeatureTitlesFromResults = (result) => result.stepResults.filter(s => s.actionResults.find(a => a.name === 'feature' ? true : false)).map(a => a.in.replace(/^Feature: /, '')); | ||
exports.getFeatureTitlesFromResults = getFeatureTitlesFromResults; | ||
//# sourceMappingURL=index.js.map |
@@ -11,2 +11,3 @@ import { TVStep, TResolvedFeature, TResult, TStepResult, TFeatureResult, TActionResult, TWorld, AStepper, TEndFeatureCallback, CStepper, TFound } from '../lib/defs'; | ||
steppers?: AStepper[]; | ||
startOffset: number; | ||
constructor(csteppers: CStepper[], endFeatureCallback?: TEndFeatureCallback); | ||
@@ -13,0 +14,0 @@ setup(world: TWorld): Promise<void>; |
@@ -48,2 +48,3 @@ "use strict"; | ||
constructor(csteppers, endFeatureCallback) { | ||
this.startOffset = 0; | ||
this.csteppers = csteppers; | ||
@@ -54,2 +55,3 @@ this.endFeatureCallback = endFeatureCallback; | ||
this.world = world; | ||
this.startOffset = world.timer.since(); | ||
const errorBail = (phase, error, extra) => { | ||
@@ -111,3 +113,3 @@ console.error('error', phase, error, extra); | ||
} | ||
return { ok, in: vstep.in, actionResults, seq: vstep.seq }; | ||
return { ok, in: vstep.in, sourcePath: vstep.source.path, actionResults, seq: vstep.seq }; | ||
} | ||
@@ -131,3 +133,3 @@ async onFailure(result) { | ||
try { | ||
await this.endFeatureCallback(this.world, featureResult, this.steppers); | ||
await this.endFeatureCallback({ world: this.world, result: featureResult, steppers: this.steppers, startOffset: this.startOffset }); | ||
} | ||
@@ -134,0 +136,0 @@ catch (error) { |
@@ -13,3 +13,3 @@ import { Context } from '../lib/contexts'; | ||
}>; | ||
isSet(what: string, orCond: string): import("../lib/defs").TOKActionResult | import("../lib/defs").TNotOKActionResult; | ||
isSet(what: string, orCond: string): import("../lib/defs").TNotOKActionResult | import("../lib/defs").TOKActionResult; | ||
steps: { | ||
@@ -48,8 +48,8 @@ concat: { | ||
gwta: string; | ||
action: ({ what, value }: TNamed) => Promise<import("../lib/defs").TOKActionResult | import("../lib/defs").TNotOKActionResult>; | ||
action: ({ what, value }: TNamed) => Promise<import("../lib/defs").TNotOKActionResult | import("../lib/defs").TOKActionResult>; | ||
}; | ||
isSet: { | ||
gwta: string; | ||
action: ({ what }: TNamed, vstep: TVStep) => Promise<import("../lib/defs").TOKActionResult | import("../lib/defs").TNotOKActionResult>; | ||
build: ({ what }: TNamed, vstep: TVStep) => Promise<import("../lib/defs").TOKActionResult | import("../lib/defs").TNotOKActionResult>; | ||
action: ({ what }: TNamed, vstep: TVStep) => Promise<import("../lib/defs").TNotOKActionResult | import("../lib/defs").TOKActionResult>; | ||
build: ({ what }: TNamed, vstep: TVStep) => Promise<import("../lib/defs").TNotOKActionResult | import("../lib/defs").TOKActionResult>; | ||
}; | ||
@@ -56,0 +56,0 @@ background: { |
{ | ||
"name": "@haibun/core", | ||
"version": "1.8.7", | ||
"version": "1.9.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "author": "", |
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
6
272544
137
3622