Skip to content

Commit 0fb3530

Browse files
committed
refactor(semver): 🧹 clean up version stream
1 parent dcf483d commit 0fb3530

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

packages/semver/src/executors/version/version.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,16 @@ export function versionWorkspace({
8080
)
8181
)
8282
),
83-
map(
84-
(packageFiles) =>
85-
packageFiles.filter((packageFile) => packageFile !== null) as string[]
86-
)
83+
map((paths) => paths.filter(isNotNull))
8784
),
8885
]).pipe(
89-
concatMap((pathsToStage) => {
90-
return addToStage({
91-
paths: pathsToStage.flat(),
86+
map((paths) => paths.flat()),
87+
concatMap((paths) =>
88+
addToStage({
89+
paths,
9290
dryRun,
93-
});
94-
}),
91+
})
92+
),
9593
concatMap(() =>
9694
commit({
9795
dryRun,
@@ -228,3 +226,7 @@ export function _generateChangelogs({
228226
)
229227
);
230228
}
229+
230+
function isNotNull(path: string | null): path is string {
231+
return path !== null;
232+
}

0 commit comments

Comments
 (0)