@toss/hangul
Advanced tools
Comparing version 1.6.1 to 1.7.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.7.0](https://github.com/toss/slash/compare/@toss/hangul@1.6.1...@toss/hangul@1.7.0) (2024-03-26) | ||
### Features | ||
* **packages:** add repository information in package.json ([#446](https://github.com/toss/slash/issues/446)) ([063cc5d](https://github.com/toss/slash/commit/063cc5d4699b1ba0dc20db3d2bb7dc673947500b)) | ||
# [1.6.0](https://github.com/toss/slash/compare/@toss/hangul@1.5.0...@toss/hangul@1.6.0) (2023-10-04) | ||
@@ -8,0 +19,0 @@ |
/** @tossdocs-ignore */ | ||
export declare const COMPLETE_HANGUL_START_CHARCODE: number; | ||
export declare const COMPLETE_HANGUL_END_CHARCODE: number; | ||
export declare const NUMBER_OF_JONGSUNG = 28; | ||
export declare const NUMBER_OF_JUNGSUNG = 21; | ||
/** | ||
@@ -18,3 +20,9 @@ * ㄱ -> 'ㄱ' | ||
export declare const HANGUL_CHARACTERS_BY_FIRST_INDEX: string[]; | ||
/** | ||
* 중성으로 올 수 있는 한글 글자 | ||
*/ | ||
export declare const HANGUL_CHARACTERS_BY_MIDDLE_INDEX: string[]; | ||
/** | ||
* 종성으로 올 수 있는 한글 글자 | ||
*/ | ||
export declare const HANGUL_CHARACTERS_BY_LAST_INDEX: string[]; |
@@ -140,2 +140,4 @@ 'use strict'; | ||
var COMPLETE_HANGUL_END_CHARCODE = '힣'.charCodeAt(0); | ||
var NUMBER_OF_JONGSUNG = 28; | ||
var NUMBER_OF_JUNGSUNG = 21; | ||
/** | ||
@@ -208,3 +210,11 @@ * ㄱ -> 'ㄱ' | ||
var HANGUL_CHARACTERS_BY_FIRST_INDEX = ['ㄱ', 'ㄲ', 'ㄴ', 'ㄷ', 'ㄸ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅃ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅉ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ']; | ||
/** | ||
* 중성으로 올 수 있는 한글 글자 | ||
*/ | ||
var HANGUL_CHARACTERS_BY_MIDDLE_INDEX = Object.values(DISASSEMBLED_VOWELS_BY_VOWEL); | ||
/** | ||
* 종성으로 올 수 있는 한글 글자 | ||
*/ | ||
var HANGUL_CHARACTERS_BY_LAST_INDEX = ['', 'ㄱ', 'ㄲ', 'ㄳ', 'ㄴ', 'ㄵ', 'ㄶ', 'ㄷ', 'ㄹ', 'ㄺ', 'ㄻ', 'ㄼ', 'ㄽ', 'ㄾ', 'ㄿ', 'ㅀ', 'ㅁ', 'ㅂ', 'ㅄ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ'].map(function (consonant) { | ||
@@ -224,5 +234,5 @@ return DISASSEMBLED_CONSONANTS_BY_CONSONANT[consonant]; | ||
var hangulCode = charCode - COMPLETE_HANGUL_START_CHARCODE; | ||
var lastIndex = hangulCode % 28; | ||
var middleIndex = (hangulCode - lastIndex) / 28 % 21; | ||
var firstIndex = Math.floor((hangulCode - lastIndex) / 28 / 21); | ||
var lastIndex = hangulCode % NUMBER_OF_JONGSUNG; | ||
var middleIndex = (hangulCode - lastIndex) / NUMBER_OF_JONGSUNG % NUMBER_OF_JUNGSUNG; | ||
var firstIndex = Math.floor((hangulCode - lastIndex) / NUMBER_OF_JONGSUNG / NUMBER_OF_JUNGSUNG); | ||
return { | ||
@@ -229,0 +239,0 @@ first: HANGUL_CHARACTERS_BY_FIRST_INDEX[firstIndex], |
{ | ||
"name": "@toss/hangul", | ||
"version": "1.6.1", | ||
"version": "1.7.0", | ||
"sideEffects": false, | ||
@@ -18,2 +18,7 @@ "exports": { | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/toss/slash.git", | ||
"directory": "packages/common/hangul" | ||
}, | ||
"scripts": { | ||
@@ -29,3 +34,3 @@ "build": "rm -rf dist esm && tsc -p tsconfig.build.json --declaration --emitDeclarationOnly --declarationDir dist && rollup -c rollup.config.js", | ||
"@testing-library/jest-dom": "^5.16.4", | ||
"@toss/rollup-config": "^0.1.5", | ||
"@toss/rollup-config": "^0.2.0", | ||
"@tossteam/jest": "^17", | ||
@@ -57,4 +62,4 @@ "@types/jest": "^28.1.8", | ||
}, | ||
"gitHead": "6a4434621e29e014d537ae3dc0f026364b893a69", | ||
"gitHead": "e5bee62c99fb08dbd6306c1259636571e91991cf", | ||
"module": "./esm/index.mjs" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
37121
793
0