From 5bbb56a05f6c562becddb9d3fb37f43fd7c7c1cc Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 21 Jun 2022 10:46:02 +1000 Subject: [PATCH] potential step and unwrapSteps to be generic --- src/index.ts | 2 +- src/unwrapSteps.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/index.ts b/src/index.ts index c2d7356..460bef0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -38,7 +38,7 @@ export const serializers = { YamlSerializer, }; -export type PotentialStep = Step | Conditional; +export type PotentialStep = S | Conditional; export class Pipeline implements Serializable { public readonly name: string; diff --git a/src/unwrapSteps.ts b/src/unwrapSteps.ts index 398a720..024d301 100644 --- a/src/unwrapSteps.ts +++ b/src/unwrapSteps.ts @@ -1,14 +1,14 @@ import { PotentialStep, Step } from './index'; import { Conditional } from './conditional'; -export type StepCache = Map, Step>; +export type StepCache = Map, S>; -export async function unwrapSteps( - steps: PotentialStep[], - cache: StepCache, +export async function unwrapSteps( + steps: PotentialStep[], + cache: StepCache, acceptAllConditions: boolean, -): Promise { - const ret: Step[] = []; +): Promise { + const ret: S[] = []; for (const s of steps) { if (s instanceof Conditional) { if (cache.has(s)) {