mirror of
https://github.com/tcsenpai/emoji-encoder.git
synced 2025-06-06 18:45:21 +00:00
fix i think
This commit is contained in:
parent
dac64bd184
commit
ca003917e4
@ -12,7 +12,7 @@ export function toVariationSelector(byte: number): string | null {
|
|||||||
if (byte >= 0 && byte < 16) {
|
if (byte >= 0 && byte < 16) {
|
||||||
return String.fromCodePoint(VARIATION_SELECTOR_START + byte)
|
return String.fromCodePoint(VARIATION_SELECTOR_START + byte)
|
||||||
} else if (byte >= 16 && byte < 256) {
|
} else if (byte >= 16 && byte < 256) {
|
||||||
return String.fromCodePoint(VARIATION_SELECTOR_SUPPLEMENT_START + byte)
|
return String.fromCodePoint(VARIATION_SELECTOR_SUPPLEMENT_START + byte - 16)
|
||||||
} else {
|
} else {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
@ -22,7 +22,7 @@ export function fromVariationSelector(codePoint: number): number | null {
|
|||||||
if (codePoint >= VARIATION_SELECTOR_START && codePoint <= VARIATION_SELECTOR_END) {
|
if (codePoint >= VARIATION_SELECTOR_START && codePoint <= VARIATION_SELECTOR_END) {
|
||||||
return codePoint - VARIATION_SELECTOR_START
|
return codePoint - VARIATION_SELECTOR_START
|
||||||
} else if (codePoint >= VARIATION_SELECTOR_SUPPLEMENT_START && codePoint <= VARIATION_SELECTOR_SUPPLEMENT_END) {
|
} else if (codePoint >= VARIATION_SELECTOR_SUPPLEMENT_START && codePoint <= VARIATION_SELECTOR_SUPPLEMENT_END) {
|
||||||
return codePoint - VARIATION_SELECTOR_SUPPLEMENT_START
|
return codePoint - VARIATION_SELECTOR_SUPPLEMENT_START + 16
|
||||||
} else {
|
} else {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user