Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 8, 2025

Addresses code review comments from PR #6738 to improve type safety, syntax, and logic in the getCitationFieldsInputArray() method.

Changes

  • Added explicit return type annotation (string[]) to getCitationFieldsInputArray() for type safety
  • Fixed syntax issues: removed extra space after if keyword, added missing semicolon after .split(',')
  • Refined deprecation warning logic: only log warning when string value is actually provided (not for undefined)
  • Added explicit fallback: return empty array when property is neither array nor string

Before

private getCitationFieldsInputArray() {
  if( Array.isArray(this.fieldsToIncludeInCitations)) {
    return this.fieldsToIncludeInCitations;
  } else {
    this.bindings.engine.logger.warn(/*...*/);
    return (this.fieldsToIncludeInCitations ?? '').split(',')
  }
}

After

private getCitationFieldsInputArray(): string[] {
  if (Array.isArray(this.fieldsToIncludeInCitations)) {
    return this.fieldsToIncludeInCitations;
  } else if (typeof this.fieldsToIncludeInCitations === 'string') {
    this.bindings.engine.logger.warn(/*...*/);
    return this.fieldsToIncludeInCitations.split(',');
  } else {
    return [];
  }
}

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix support for normalized JSON array in attribute input refactor: apply code review feedback to getCitationFieldsInputArray Dec 8, 2025
Copilot AI requested a review from louis-bompart December 8, 2025 21:44
@louis-bompart louis-bompart marked this pull request as ready for review December 8, 2025 23:56
@louis-bompart louis-bompart requested a review from a team as a code owner December 8, 2025 23:56
@louis-bompart louis-bompart merged commit 973068d into fix/KIT-5305 Dec 8, 2025
7 of 8 checks passed
@louis-bompart louis-bompart deleted the copilot/sub-pr-6738 branch December 8, 2025 23:56
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.

2 participants