/emoji

😁 Simple emoji support for Deno 🦕 (validate, detect, trim, extract)

Primary LanguageTypeScriptMIT LicenseMIT

emoji GitHub

Simple emoji support for Deno (validate, detect, trim, extract)

Contents

Import

import { isEmoji } from "https://deno.land/x/emoji/mod.ts";

or

import { isEmoji } from "https://raw.githubusercontent.com/s1mpson/emoji/master/mod.ts";

Methods

isEmoji (string)

Returns true if provided string is a valid emoji.

isEmoji('🤔'); // true
isEmoji('?'); // false

hasEmoji (string)

Returns true if there is at least one emoji in string.

hasEmoji('Sadly, no unicorns found..'); // false
hasEmoji('But we have one here: 🦄'); // true

trimEmoji (string)

Returns the string cleaned from emoji.

trimEmoji('Just 👏 Do 👏 It'); // "Just  Do  It"

extractEmoji (string)

Returns an array of emoji extracted from the string.

extractEmoji('🦕 ❤️ 🦄'); // ["🦕", "❤️", "🦄"]

Author

License

Copyright © Max Mikhalchuk. Licensed under the MIT License.