Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Conversation

@CorentinTh
Copy link
Member

No description provided.

@CorentinTh CorentinTh requested a review from Copilot June 29, 2025 13:52
@CorentinTh CorentinTh self-assigned this Jun 29, 2025
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 renames the internal languages constant to ocrLanguages, makes it a public export, and updates the parseConfig function to reference the new name and adjust its default behavior.

  • Export ocrLanguages from config.ts via index.ts
  • Update parseConfig to use ocrLanguages for validation and change the fallback logic
  • Adjust error message to list valid ocrLanguages

Reviewed Changes

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

File Description
src/index.ts Added export { ocrLanguages } from ./config
src/config.ts Renamed top-level languages to ocrLanguages, updated parseConfig variable names, error message, and default fallback logic
Comments suppressed due to low confidence (3)

src/config.ts:7

  • [nitpick] The variable languages here shadows the top-level ocrLanguages and can be ambiguous. Consider renaming it to userLanguages or inputLanguages for clarity.
  const languages = rawConfig.tesseract?.languages ?? [];

src/config.ts:4

  • [nitpick] Publicly exporting ocrLanguages should include a JSDoc comment explaining what it contains and how consumers are expected to use it.
export const ocrLanguages = Object.values(tesseractLanguages);

src/index.ts:1

  • Add a unit test to verify that ocrLanguages is correctly exported from the index and matches the values from tesseractLanguages.
export { ocrLanguages } from './config';

@CorentinTh CorentinTh merged commit 1755849 into main Jun 29, 2025
1 check passed
@CorentinTh CorentinTh deleted the export-language branch June 29, 2025 13:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants