Skip to content

Enhance toBooleanFlag Function to Support 'yes' and 'on' Inputs - #8882

Open
tmdeveloper007 wants to merge 1 commit into
JhaSourav07:mainfrom
tmdeveloper007:fix/8850-to-boolean-flag-yes-on-support
Open

Enhance toBooleanFlag Function to Support 'yes' and 'on' Inputs#8882
tmdeveloper007 wants to merge 1 commit into
JhaSourav07:mainfrom
tmdeveloper007:fix/8850-to-boolean-flag-yes-on-support

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Summary of What Has Been Done

Extended toBooleanFlag to recognize 'yes' and 'on' (case-insensitive) as valid true values in addition to 'true' and '1'.

Changes Made

  • lib/validations.ts: Added 'yes' and 'on' to toBooleanFlag with case-insensitive matching

Impact it Made

  • Increases compatibility with a wider range of boolean string inputs
  • Reduces need for callers to pre-normalize boolean flags

Closes #8850

Note: Please assign this PR to the tmdeveloper007 account.

@retenta-bot

retenta-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown

This pull request extends the toBooleanFlag function to include 'yes' and 'on' as valid true values, which aligns with previous decisions made to enhance compatibility with various boolean string inputs. This change reduces the need for callers to pre-normalize boolean flags, making the function more user-friendly. Thank you for your contribution!

@retenta-bot retenta-bot Bot changed the title fix : added yes and on string support to toBooleanFlag function Enhance toBooleanFlag Function to Support 'yes' and 'on' Inputs Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

✨ No significant bundle size changes detected.

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 4939.33 KB 4939.27 KB +0.06 KB (+0.00%)
Total CSS 348.46 KB 348.46 KB 0 B

@Aamod007 Aamod007 added level:beginner Small changes Usually isolated fixes or simple UI/text updates. quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:feature New features, additions, or enhancements mentor:Aamod007 labels Aug 6, 2026

@Aamod007 Aamod007 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for this update! Adding support for 'yes' and 'on' in \ oBooleanFlag\ within \lib/validations.ts\ is a nice quality of life improvement. The use of .toLowerCase()\ to ensure case-insensitive matching is spot on, and checking !val\ first protects against errors. Looks solid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:beginner Small changes Usually isolated fixes or simple UI/text updates. mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:feature New features, additions, or enhancements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix : add 'yes' string support to toBooleanFlag function

2 participants