Skip to content

TS: Array setters/getters for unbounded (max: *) slices#129

Merged
ryukzak merged 7 commits intomainfrom
worktree-agent-a4909618
Apr 7, 2026
Merged

TS: Array setters/getters for unbounded (max: *) slices#129
ryukzak merged 7 commits intomainfrom
worktree-agent-a4909618

Conversation

@ryukzak
Copy link
Copy Markdown
Collaborator

@ryukzak ryukzak commented Apr 6, 2026

Summary

  • For slices with max: * (unbounded), setter accepts an array and getter returns an array
  • For max: 1 slices, keep existing single-element API unchanged
  • Added getArraySliceAll / setArraySliceAll runtime helpers to profile-helpers.ts

Before (unbounded slice like OrganizationEntry):

bundle.setOrganizationEntry({ resource: org1 });
bundle.setOrganizationEntry({ resource: org2 }); // replaces org1!
const entry = bundle.getOrganizationEntry(); // single item

After:

bundle.setOrganizationEntry([{ resource: org1 }, { resource: org2 }]);
const entries = bundle.getOrganizationEntry(); // array of items

Closes #125

@ryukzak ryukzak force-pushed the worktree-agent-a4909618 branch from a68b6a6 to e386c4f Compare April 6, 2026 20:45
@ryukzak ryukzak changed the title TS: Array setters/getters for max:* slices TS: Array setters/getters for unbounded (max: *) slices Apr 6, 2026
@ryukzak ryukzak merged commit 5d6449d into main Apr 7, 2026
31 checks passed
@ryukzak ryukzak deleted the worktree-agent-a4909618 branch April 7, 2026 15:29
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.

TS: Slice setters for max:* slices should accept arrays, not single elements

1 participant