Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(kebabCase): Add kebabCase function #162

Merged
merged 7 commits into from
Jul 12, 2024

Conversation

bertyhell
Copy link
Contributor

@bertyhell bertyhell commented Jul 11, 2024

similar to: https://lodash.com/docs/4.17.15#kebabCase

Also adds more tests to snakeCase which revealed a bug for this case:

snakeCase('FOO_BAR'); // Would wrongly output: f_o_o_bar instead of the correct foo_bar

Usage:

import { kebabCase } from 'es-toolkit/string';

kebabCase('camelCase'); // returns 'camel-case'
kebabCase('some whitespace'); // returns 'some-whitespace'
kebabCase('hyphen-text'); // returns 'hyphen-text'
kebabCase('HTTPRequest'); // returns 'http-request'

@bertyhell bertyhell requested a review from raon0211 as a code owner July 11, 2024 19:14
Copy link

vercel bot commented Jul 11, 2024

@bertyhell is attempting to deploy a commit to the Toss Team on Vercel.

A member of the Team first needs to authorize it.

Very similar to snakeCase
@haejunejung
Copy link
Contributor

Oh, when I implemented snakeCase, so many typos! Thanks you for correcting the typos.

However, when writing the documetation for kabab case, I think that overwrite the documentation for snake case. Could you check about this?
(I think, /reference/string/snakeCase -> /reference/string/kebabCase

raon0211
raon0211 previously approved these changes Jul 12, 2024
Copy link
Collaborator

@raon0211 raon0211 left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

docs/.vitepress/ko.mts Outdated Show resolved Hide resolved
@raon0211 raon0211 merged commit 541b89d into toss:main Jul 12, 2024
4 of 7 checks passed
@bertyhell bertyhell deleted the feat/kebab-case branch July 12, 2024 07:19
@raon0211 raon0211 mentioned this pull request Jul 14, 2024
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.

3 participants