Skip to content

Commit

Permalink
�fix: convertQwertyToHangul split 및 Non-null assertion operator 제거, 네…
Browse files Browse the repository at this point in the history
…이밍 오타 수정 (#75)

* refac: convertQwertyToHangul split 및 Non-null assertion operator 제거, 네이밍 오타 수정

* Create young-bears-double.md

---------

Co-authored-by: 박찬혁 <[email protected]>
  • Loading branch information
ssi02014 and okinawaa committed Apr 25, 2024
1 parent 0c784ff commit f2b7cd9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/young-bears-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"es-hangle": patch
---

refac: convertQwertyToHangul split 및 Non-null assertion operator 제거, 네이밍 오타 수정
2 changes: 1 addition & 1 deletion src/convertQwertyToHangulAlphabet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ export function convertQwertyToHangul(word: string): string {
if (!word) {
return '';
}
return assembleHangul([...convertQwertyToHangulAlphabet(word).split('')]);
return assembleHangul([...convertQwertyToHangulAlphabet(word)]);
}
6 changes: 3 additions & 3 deletions src/disassembleCompleteHangulCharacter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export function disassembleCompleteHangulCharacter(
const firstIndex = Math.floor((hangulCode - lastIndex) / NUMBER_OF_JONGSUNG / NUMBER_OF_JUNGSUNG);

return {
first: HANGUL_CHARACTERS_BY_FIRST_INDEX[firstIndex]!,
middle: HANGUL_CHARACTERS_BY_MIDDLE_INDEX[middleIndex]!,
last: HANGUL_CHARACTERS_BY_LAST_INDEX[lastIndex]!,
first: HANGUL_CHARACTERS_BY_FIRST_INDEX[firstIndex],
middle: HANGUL_CHARACTERS_BY_MIDDLE_INDEX[middleIndex],
last: HANGUL_CHARACTERS_BY_LAST_INDEX[lastIndex],
} as const;
}
6 changes: 3 additions & 3 deletions src/removeLastHangulCharacter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ import { excludeLastElement } from './_internal';
* removeLastHangulCharacter('일요일') // 일요이
*/
export function removeLastHangulCharacter(words: string) {
const disassembedGroups = disassembleHangulToGroups(words);
const lastCharacter = disassembedGroups.at(-1);
const disassembledGroups = disassembleHangulToGroups(words);
const lastCharacter = disassembledGroups.at(-1);

if (lastCharacter == null) {
return '';
}

const withoutLastCharacter = disassembedGroups
const withoutLastCharacter = disassembledGroups
.filter(v => v !== lastCharacter)
.map(([first, middle, last]) => {
if (middle != null) {
Expand Down

0 comments on commit f2b7cd9

Please sign in to comment.