-
Notifications
You must be signed in to change notification settings - Fork 9
feat(runner): add resolveAsCell() method to Cell API
#1916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a new Cell API method resolveAsCell() to resolve a cell reference to the actual underlying cell, along with tests demonstrating its use.
- Introduces resolveAsCell() on Cell and RegularCell implementations.
- Updates public API typings to include resolveAsCell().
- Adds a unit test validating resolution of a nested cell reference.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/runner/src/cell.ts | Implements resolveAsCell() and updates JSDoc. |
| packages/api/index.ts | Exposes resolveAsCell() on the public Cell interface. |
| packages/runner/test/cell.test.ts | Adds test for resolving a nested cell reference. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 4 files
Adds a new `resolveAsCell()` method that resolves a cell reference to the actual cell it points to. This is useful when accessing data via .key() and wanting a direct reference to the final underlying document, e.g. to create an id for it. The method is equivalent to wrapping the current schema in `Cell<>` and calling `.get()`, providing a more convenient API for this common pattern. Includes test coverage for resolving nested cell references.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
a1234d4 to
e5fca47
Compare
Adds a new
resolveAsCell()method that resolves a cell reference to the actual cell it points to. This is useful when accessing data via .key() and wanting a direct reference to the final underlying document, e.g. to create an id for it.The method is equivalent to wrapping the current schema in
Cell<>and calling.get(), providing a more convenient API for this common pattern.Includes test coverage for resolving nested cell references.
Summary by cubic
Added resolveAsCell() to the Cell API to resolve a linked cell to the actual target cell. Helpful after .key() to get a direct cell for the final document.