Skip to content

Comments

Update: Extract getDescendants utility function (fixes #84)#85

Open
taylortom wants to merge 3 commits intomasterfrom
issue/84
Open

Update: Extract getDescendants utility function (fixes #84)#85
taylortom wants to merge 3 commits intomasterfrom
issue/84

Conversation

@taylortom
Copy link
Contributor

Summary

  • Extract getDescendants from ContentModule into a standalone parameterised utility in lib/utils/getDescendants.js
  • The new function accepts a findFn callback instead of relying on this.find(), making it testable in isolation
  • Update AbstractApiUtils.stringifyValues() usage in clone method to use named stringifyValues export from adapt-authoring-api
  • Add deprecated delegation stub on ContentModule for backwards compatibility
  • Bump adapt-authoring-api to ^2.0.0 and adapt-authoring-core to ^2.0.0
  • Add 9 unit tests for the extracted function

Test plan

  • All 9 new getDescendants utility tests pass
  • All 71 existing ContentModule tests pass (80 total)
  • Verify integration after adapt-authoring-api@2.0.0 is published

🤖 Generated with Claude Code

taylortom and others added 3 commits February 21, 2026 17:31
Extract getDescendants from ContentModule into a standalone, parameterised
utility function that accepts a findFn callback instead of relying on
this.find(). Also updates AbstractApiUtils.stringifyValues usage to use
the named export from adapt-authoring-api. Adds 9 unit tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
getDescendants is only used internally by ContentModule.delete with
no external consumers. Call the standalone function directly and
remove the class method and re-export from index.js.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant