@bscotch/blork-shared
Advanced tools
Comparing version 0.30.1 to 0.30.2
@@ -93,2 +93,9 @@ import { Assignments, CommentData, TaskData, UserDataSafe } from './index.js'; | ||
/** | ||
* Returns `true` if the task has multiple assignees, | ||
* where at least one is done and at least one is not done. | ||
* For all other cases returns `false`. | ||
*/ | ||
export declare function taskIsPartiallyComplete(task: TaskData | undefined): boolean; | ||
export declare function taskIsPartiallyComplete(tasks: TaskCache, taskId: string): boolean; | ||
/** | ||
* If the user is an assignee (directly or through a group) to the task, | ||
@@ -95,0 +102,0 @@ * *and* the task is marked as done for that assignment, return `true`. Else `false` (including if the user is not assigned). |
@@ -296,2 +296,25 @@ import { assert, assertNoConflict, assertValidRequest } from './errors.js'; | ||
} | ||
export function taskIsPartiallyComplete(tasks, taskId) { | ||
if (!tasks) | ||
return false; | ||
const task = tasks instanceof Map ? tasks.get(taskId) : tasks; | ||
if (!task) | ||
return false; | ||
const assignees = userAssignmentsToArray(task.assigned); | ||
if (assignees.length < 2) | ||
return false; | ||
let hasDone = false; | ||
let hasNotDone = false; | ||
for (const owner of assignees) { | ||
if (owner.done) { | ||
hasDone = true; | ||
} | ||
else { | ||
hasNotDone = true; | ||
} | ||
if (hasDone && hasNotDone) | ||
return true; | ||
} | ||
return false; | ||
} | ||
/** | ||
@@ -298,0 +321,0 @@ * If the user is an assignee (directly or through a group) to the task, |
{ | ||
"name": "@bscotch/blork-shared", | ||
"version": "0.30.1", | ||
"version": "0.30.2", | ||
"description": "Client and shared utilities for Blork projects.", | ||
@@ -19,4 +19,4 @@ "keywords": [], | ||
"@leeoniya/ufuzzy": "1.0.14", | ||
"marked": "14.1.3", | ||
"shiki": "1.22.2", | ||
"marked": "15.0.2", | ||
"shiki": "1.23.1", | ||
"zod": "^3.23.8" | ||
@@ -26,3 +26,3 @@ }, | ||
"source-map-support": "0.5.21", | ||
"typescript": "5.6.3" | ||
"typescript": "5.7.2" | ||
}, | ||
@@ -29,0 +29,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
533384
8481
+ Added@shikijs/core@1.23.1(transitive)
+ Added@shikijs/engine-javascript@1.23.1(transitive)
+ Added@shikijs/engine-oniguruma@1.23.1(transitive)
+ Added@shikijs/types@1.23.1(transitive)
+ Addedemoji-regex-xs@1.0.0(transitive)
+ Addedmarked@15.0.2(transitive)
+ Addedoniguruma-to-es@0.4.1(transitive)
+ Addedregex@5.0.2(transitive)
+ Addedregex-recursion@4.3.0(transitive)
+ Addedregex-utilities@2.3.0(transitive)
+ Addedshiki@1.23.1(transitive)
- Removed@shikijs/core@1.22.2(transitive)
- Removed@shikijs/engine-javascript@1.22.2(transitive)
- Removed@shikijs/engine-oniguruma@1.22.2(transitive)
- Removed@shikijs/types@1.22.2(transitive)
- Removedmarked@14.1.3(transitive)
- Removedoniguruma-to-js@0.4.3(transitive)
- Removedregex@4.4.0(transitive)
- Removedshiki@1.22.2(transitive)
Updatedmarked@15.0.2
Updatedshiki@1.23.1