Changeset 3d882bd in Klonkt for src/services/guardianship/context.js
- Timestamp:
- 08/04/2026 12:30:11 PM (5 weeks ago)
- Branches:
- main
- Children:
- fa33214
- Parents:
- 30d0e2c
- File:
-
- 1 edited
-
src/services/guardianship/context.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/services/guardianship/context.js
r30d0e2c r3d882bd 24 24 } 25 25 26 export default { SHAER_CONTEXT, GUARDIAN_RELATIONSHIP, GUARDIAN_RELATIONSHIP_COMPACT, isGuardianRelationship }; 26 /** 27 * True when an actor document carries `shaer:guardians` — i.e. it is a ward, 28 * and therefore not a valid guardian (§1). The one question §4 asks, in both 29 * places it asks it: before committing a guardianship (§4.2) and before 30 * delivering an escalation to one (§4.1). 31 * 32 * §2.1 allows the list as an array of URIs, a single URI, or a Collection, so 33 * all three are read here rather than in each caller. 34 */ 35 export function carriesGuardians(doc) { 36 const g = doc && doc['shaer:guardians']; 37 if (Array.isArray(g)) return g.length > 0; 38 if (typeof g === 'string') return g.length > 0; 39 if (g && typeof g === 'object') return Array.isArray(g.items) ? g.items.length > 0 : true; 40 return false; 41 } 42 43 export default { SHAER_CONTEXT, GUARDIAN_RELATIONSHIP, GUARDIAN_RELATIONSHIP_COMPACT, isGuardianRelationship, carriesGuardians };
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)