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: removeLastHangulCharacter 추가 #56

Merged
merged 4 commits into from
Apr 18, 2024

Conversation

evan-moon
Copy link
Member

@evan-moon evan-moon commented Apr 17, 2024

Overview

인자로 받은 한글 문자열에서 마지막 한글 문자 하나를 제거하여 반환하는 removeLastHangulCharacter 함수를 추가합니다.

removeLastHangulCharacter('안녕하세요 값') // '안녕하세요 갑'
removeLastHangulCharacter('프론트엔드') // '프론트엔ㄷ'
removeLastHangulCharacter('일요일') // '일요이'

이 함수는 개별적으로 사용되기도 하겠지만, #18 에서 제안된 assemble 함수의 연음법칙을 구현할 때도 사용됩니다.

PR Checklist

  • I read and included theses actions below
  1. I have read the Contributing Guide
  2. I have written documents and tests, if needed.

@evan-moon evan-moon added the enhancement New feature or request label Apr 17, 2024
@evan-moon evan-moon self-assigned this Apr 17, 2024
Copy link

changeset-bot bot commented Apr 17, 2024

🦋 Changeset detected

Latest commit: 12ce776

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Apr 17, 2024

Deploy Preview for es-hangul ready!

Name Link
🔨 Latest commit 12ce776
🔍 Latest deploy log https://app.netlify.com/sites/es-hangul/deploys/6620b2dd5aa1d60008fca145
😎 Deploy Preview https://deploy-preview-56--es-hangul.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@evan-moon evan-moon requested a review from okinawaa April 17, 2024 09:24
@@ -0,0 +1,4 @@
export function excludeLastElement(array: string[]): [string[], string] {
Copy link
Member Author

Choose a reason for hiding this comment

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

#36 (review) 에서 언급되었던 "라이브러리 내부에서만 사용될 함수"를 위해 _internal.ts 모듈을 생성했습니다.

import { describe, it, expect } from 'vitest';
import { removeLastHangulCharacter } from './removeLastHangulCharacter';

describe('removeLastCharacter', () => {
Copy link
Member

Choose a reason for hiding this comment

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

마이너합니다! 파일명, 함수명과 describe를 맞춰도 좋을 것 같아서요!

Suggested change
describe('removeLastCharacter', () => {
describe('removeLastHangulCharacter', () => {

Copy link
Member Author

Choose a reason for hiding this comment

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

오 바로 반영하도록 하겠습니다!

Copy link
Member Author

Choose a reason for hiding this comment

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

a72646e 에서 반영 완료하였습니다 🙇

* removeLastHangulCharacter('프론트엔드') // 프론트엔ㄷ
* removeLastHangulCharacter('일요일') // 일요이
*/
export function removeLastHangulCharacter(words: string) {
Copy link
Member

@okinawaa okinawaa Apr 18, 2024

Choose a reason for hiding this comment

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

한 단어를 받는 인자라면 복수인 words가 아닌, word로 해도 좋을 것 같아요!

Suggested change
export function removeLastHangulCharacter(words: string) {
export function removeLastHangulCharacter(word: string) {

Copy link
Member Author

Choose a reason for hiding this comment

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

"안녕하세요 값"처럼 2개 이상의 word도 받을 수 있어서 복수형으로 정의했습니다!

Copy link
Member

Choose a reason for hiding this comment

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

오오 맞네요! 좋아요~!

Copy link
Member

@okinawaa okinawaa left a comment

Choose a reason for hiding this comment

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

매번 PR을 리뷰하기 좋은 단위로 구분하여 만들어주셔서 너무 좋은 것 같아요!

Copy link
Member

@okinawaa okinawaa left a comment

Choose a reason for hiding this comment

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

LGTM 😃

@okinawaa okinawaa merged commit e25b8b5 into toss:main Apr 18, 2024
4 checks passed
@github-actions github-actions bot mentioned this pull request Apr 18, 2024
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