Skip to content

Add repeat function#8

Merged
injoonH merged 2 commits into
mainfrom
feat/repeat
Aug 3, 2025
Merged

Add repeat function#8
injoonH merged 2 commits into
mainfrom
feat/repeat

Conversation

@injoonH

@injoonH injoonH commented Aug 3, 2025

Copy link
Copy Markdown
Owner

Features

  • Add repeat() function.

@injoonH injoonH requested a review from Copilot August 3, 2025 04:15
@injoonH injoonH self-assigned this Aug 3, 2025
@injoonH injoonH added the enhancement New feature or request label Aug 3, 2025

Copilot AI left a comment

Copy link
Copy Markdown

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 introduces a new repeat() function to the common stdlib utilities that executes a given action function a specified number of times, with each iteration receiving a zero-based index parameter.

Key changes:

  • Implements the repeat() function with proper JSDoc documentation
  • Adds comprehensive test coverage for positive, zero, and negative input scenarios
  • Updates documentation and navigation to include the new function

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/stdlib/common/repeat.ts Core implementation of the repeat function
src/stdlib/common/repeat.spec.ts Unit tests covering various scenarios
src/stdlib/common/index.ts Export statement for the new function
docs/api/core/kotlin-stdlib/kotlin/repeat.md API documentation with usage examples
docs/.vitepress/config.mts Navigation menu entry for the documentation
Comments suppressed due to low confidence (2)

src/stdlib/common/repeat.spec.ts:5

  • The test description 'should repeat a value n times' is misleading. The function doesn't repeat a value, it executes an action function n times. Consider changing to 'should execute action n times'.
  it('should repeat a value n times', () => {

src/stdlib/common/repeat.spec.ts:8

  • The test verifies that the action is called 3 times but doesn't verify that the correct index values (0, 1, 2) are passed to each call. Consider adding assertions to verify the action is called with the expected index values.
    expect(action).toHaveBeenCalledTimes(3)

@injoonH injoonH merged commit 3c22b6c into main Aug 3, 2025
@injoonH injoonH deleted the feat/repeat branch August 3, 2025 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants