Skip to content

Commit

Permalink
chore: fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
Yizack committed Jun 19, 2024
1 parent 700a263 commit e835cc7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/runtime/utils/twemojify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type EmojiEntity = {
type: string
text: string
url: string
indices: Array<number>
indices: number[]
}

type ParsingOptions = {
Expand All @@ -16,7 +16,7 @@ type ParsingOptions = {

export const TypeName = 'emoji'

export function parse(text: string, options?: ParsingOptions): Array<EmojiEntity> {
export function parse(text: string, options?: ParsingOptions): EmojiEntity[] {
const assetType = options && options.assetType ? options.assetType : 'svg'
const getTwemojiUrl = (codepoints: string, assetType: ParsingOptions['assetType']) =>
assetType === 'png'
Expand Down Expand Up @@ -52,7 +52,7 @@ const zeroWidthJoiner = String.fromCharCode(0x200D)

const removeVS16s = (rawEmoji: string) => (!rawEmoji.includes(zeroWidthJoiner) ? rawEmoji.replace(vs16RegExp, '') : rawEmoji)

export function toCodePoints(unicodeSurrogates: string): Array<string> {
export function toCodePoints(unicodeSurrogates: string): string[] {
const points = []
let char = 0
let previous = 0
Expand Down

0 comments on commit e835cc7

Please sign in to comment.