Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

462 B
Raw Blame
import { Effect } from "effect";
import { type Label, listWorkspaceLabels } from "../api/labels.js";
import { pickLabels } from "./pick-labels.js";

export const resolveLabels = Effect.fn("labels.resolve")(function* (
  workspaceId: string,
  names: ReadonlyArray<string>,
) {
  if (names.length === 0) return [] as ReadonlyArray<Label>;
  const labels = yield* listWorkspaceLabels(workspaceId);
  return yield* Effect.fromResult(pickLabels(labels, names));
});