@scalar/api-client
Version:
the open source API testing client
24 lines (23 loc) • 454 B
JavaScript
function p(n, t) {
const a = n.reduce((e, o) => {
const l = o.teamUid;
return e[l] || (e[l] = []), e[l].push({
id: o.id,
label: o.label
}), e;
}, {}), s = [];
if (t !== "local") {
const e = a[t] ?? [];
e.length > 0 && s.push({
label: "Team Workspaces",
options: e
});
}
return s.push({
label: "Local Workspaces",
options: a.local ?? []
}), s;
}
export {
p as groupWorkspacesByTeam
};