Simple emoji support for Deno (validate, detect, trim, extract)
import { isEmoji } from "https://deno.land/x/emoji/mod.ts";
or
import { isEmoji } from "https://raw.githubusercontent.com/s1mpson/emoji/master/mod.ts";
Returns true if provided string is a valid emoji.
isEmoji('🤔'); // true
isEmoji('?'); // false
Returns true if there is at least one emoji in string.
hasEmoji('Sadly, no unicorns found..'); // false
hasEmoji('But we have one here: 🦄'); // true
Returns the string cleaned from emoji.
trimEmoji('Just 👏 Do 👏 It'); // "Just Do It"
Returns an array of emoji extracted from the string.
extractEmoji('🦕 ❤️ 🦄'); // ["🦕", "❤️", "🦄"]
s1mpson
on Githubs1mpson4real
on Twitter
Copyright © Max Mikhalchuk. Licensed under the MIT License.