Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@antongolub
Copy link
Collaborator

  • Tests pass
  • Appropriate changes to README are included in PR

@antongolub antongolub added the refactoring Internal code improvements label Jul 27, 2025
@antongolub antongolub requested a review from Copilot July 27, 2025 09:22

This comment was marked as outdated.

@antongolub antongolub requested a review from Copilot July 27, 2025 11:00

This comment was marked as outdated.

@antongolub antongolub requested a review from Copilot July 27, 2025 11:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the internal storage mechanism by replacing separate arrays for snapshots and delimiters with a unified "box" storage system. The refactoring consolidates two distinct internal buffers into a single reusable container that handles both snapshot and delimiter storage through a type-safe interface.

  • Replaces separate snapshots and delimiters arrays with a unified box storage mechanism
  • Introduces a new storage API with push and loot methods for managing internal state
  • Updates all references to use the new unified storage system

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
src/core.ts Implements the new unified box storage system and updates all snapshot/delimiter usage
build/core.cjs Generated build file reflecting the TypeScript changes
test/core.test.js Fixes error class reference from custom Err to standard Error
.size-limit.json Updates bundle size limits to accommodate the refactoring changes
Comments suppressed due to low confidence (2)

src/core.ts:165

  • [nitpick] The variable name 'box' is ambiguous and doesn't clearly indicate its purpose as an internal storage mechanism. Consider renaming to something more descriptive like 'internalStorage' or 'argsBuffer'.
const box = (<B extends Snapshot | Snapshot['delimiter']>(box: B[] = []) => ({

src/core.ts:170

  • [nitpick] The method name 'loot' is unclear and doesn't convey its purpose as a data retrieval operation. Consider using a more descriptive name like 'pop', 'take', or 'retrieve'.
  loot: box.pop.bind(box) as <T extends B>() => T | undefined,

@antongolub antongolub merged commit 7cc6136 into google:main Jul 27, 2025
28 checks passed
@antongolub antongolub deleted the refactor-intl-store branch July 27, 2025 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Internal code improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant