This commit is contained in:
2024-03-22 03:47:51 +05:30
parent 8bcf3d211e
commit 89819f6fe2
28440 changed files with 3211033 additions and 2 deletions

22
node_modules/node-emoji/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,22 @@
# MIT License
Copyright (c) 2014-2023 Daniel Bugl
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

302
node_modules/node-emoji/README.md generated vendored Normal file
View File

@@ -0,0 +1,302 @@
<h1 align="center">node-emoji</h1>
<p align="center">Friendly emoji lookups and parsing utilities for Node.js. 💖</p>
<p align="center">
<!-- prettier-ignore-start -->
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
<a href="#contributors" target="_blank"><img alt="All Contributors: 32 👪" src="https://img.shields.io/badge/all_contributors-32_👪-21bb42.svg" /></a>
<!-- ALL-CONTRIBUTORS-BADGE:END -->
<!-- prettier-ignore-end -->
<a href="https://codecov.io/gh/JoshuaKGoldberg/node-emoji" target="_blank"><img alt="Codecov Test Coverage" src="https://codecov.io/gh/JoshuaKGoldberg/node-emoji/branch/main/graph/badge.svg"/></a>
<a href="https://github.com/JoshuaKGoldberg/node-emoji/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank"><img alt="Contributor Covenant" src="https://img.shields.io/badge/code_of_conduct-enforced-21bb42" /></a>
<a href="https://github.com/JoshuaKGoldberg/node-emoji/blob/main/LICENSE.md" target="_blank"><img alt="License: MIT" src="https://img.shields.io/github/license/JoshuaKGoldberg/node-emoji?color=21bb42"></a>
<a href="https://github.com/sponsors/omnidan" target="_blank"><img alt="Sponsor: On GitHub" src="https://img.shields.io/badge/sponsor-on_github-21bb42.svg" /></a>
<img alt="Style: Prettier" src="https://img.shields.io/badge/style-prettier-21bb42.svg" />
<img alt="TypeScript: Strict" src="https://img.shields.io/badge/typescript-strict-21bb42.svg" />
<img alt="npm package version" src="https://img.shields.io/npm/v/node-emoji?color=21bb42" />
<img alt="Contributor Covenant" src="https://img.shields.io/badge/code_of_conduct-enforced-21bb42" />
</p>
`node-emoji` provides a fun, straightforward interface on top of the following excellent libraries:
- [`emojilib`](https://npmjs.org/package/emojilib): provides a list of emojis and keyword search on top of it
- [`skin-tone`](https://npmjs.org/package/skin-tone): parses out base emojis from skin tones
## Install
```sh
npm install node-emoji
```
### 2.0 Release 🚀
This is the new 2.0 release of node-emoji, supporting ESM, new emoji and a new API.
If you want to use the old version, please check out the [legacy branch](https://github.com/omnidan/node-emoji/tree/legacy).
## Usage
```js
import * as emoji from 'node-emoji'
emoji.emojify('I :heart: :coffee:!') // 'I ❤️ ☕️!'
emoji.find('heart') // { emoji: '❤', name: 'heart' }
emoji.find('❤️') // { emoji: '❤', name: 'heart' }
emoji.get('unicorn') // 🦄
emoji.get(':unicorn:') // 🦄
emoji.has(':pizza:') // true
emoji.has('🍕') // true
emoji.has('unknown') // false
emoji.random() // { name: 'house', emoji: '🏠' }
emoji.replace('I ❤️ coffee!', 'love', { preserveSpaces: true }) // 'I love coffee!'
emoji.search(':uni:') // [ { emoji: '🦄', name: 'unicorn' }, ... ]
emoji.strip('I ❤️ coffee!') // 'I coffee!'
emoji.unemojify('🍕 for 💃') // ':pizza: for :dancer:'
emoji.which('🦄') // 'unicorn'
```
## API
### emoji.emojify(input, options?)
Parse all markdown-encoded emojis in a string.
Parameters:
1. **`input`** (`string`): The input string containing the markdown-encoding emojis.
1. **`options`** _(optional)_:
- **`fallback`** (`string`; default: `""`): The string to fallback to if an emoji was not found.
- **`format`** (`() => (emoji: string, part: string, string: string) => string`; default: `value => value`): Add a middleware layer to modify each matched emoji after parsing.
```js
import * as emoji from 'node-emoji'
console.log(emoji.emojify('The :unicorn: is a fictitious animal.'))
// 'The 🦄 is a fictitious animal.'
```
### emoji.find(emoji)
Get the name and character of an emoji.
Parameters:
1. **`emoji`** (`string`): The emoji to get the data of.
```js
import * as emoji from 'node-emoji'
console.log(emoji.find('🦄'))
// { name: 'unicorn', emoji: '🦄' }
```
### emoji.get(name)
Get an emoji from an emoji name.
Parameters:
1. **`name`** (`string`): The name of the emoji to get.
```js
import * as emoji from 'node-emoji'
console.log(emoji.get('unicorn'))
// '🦄'
```
### emoji.has(emoji)
Check if this library supports a specific emoji.
Parameters:
1. **`emoji`** (`string`): The emoji to check.
```js
import * as emoji from 'node-emoji'
console.log(emoji.has('🦄'))
// true
```
### emoji.random()
Get a random emoji.
```js
import * as emoji from 'node-emoji'
console.log(emoji.random())
// { name: 'unicorn', emoji: '🦄' }
```
### emoji.replace(input, replacement)
Replace the emojis in a string.
Parameters:
- **`input`** (`string`): The input string.
- **`replacement`** (`string | (emoji: string, index: number, string: string) => string`): The character to replace the emoji with.
Can be either a string or a callback that returns a string.
```js
import * as emoji from 'node-emoji'
console.log(emoji.replace('The 🦄 is a fictitious animal.', 'unicorn'))
// 'The unicorn is a fictitious animal.'
```
### emoji.search(keyword)
Search for emojis containing the provided name in their name.
Parameters:
1. **`keyword`** (`string`): The keyword to search for.
```js
import * as emoji from 'node-emoji'
console.log(emoji.search('honey'))
// [ { name: 'honeybee', emoji: '🐝' }, { name: 'honey_pot', emoji: '🍯' } ]
```
### emoji.strip(input, options?)
Remove all of the emojis from a string.
Parameters:
1. **`input`** (`string`): The input string to strip the emojis from.
1. **`options`** _(optional)_:
- **`preserveSpaces`** (`boolean`): Whether to keep the extra space after a stripped emoji.
```js
import * as emoji from 'node-emoji'
console.log(emoji.strip('🦄 The unicorn is a fictitious animal.'))
// 'The unicorn is a fictitious animal.'
console.log(
emoji.strip('🦄 The unicorn is a fictitious animal.', {
preserveSpaces: true,
}),
)
// ' The unicorn is a fictitious animal.'
```
### emoji.unemojify(input)
Convert all emojis in a string to their markdown-encoded counterparts.
Parameters:
1. **`input`** (`string`): The input string containing the emojis.
```js
import * as emoji from 'node-emoji'
console.log(emoji.unemojify('The 🦄 is a fictitious animal.'))
// 'The :unicorn: is a fictitious animal.'
```
### emoji.which(emoji, options?)
Get an emoji name from an emoji.
Parameters:
1. **`emoji`** (`string`): The emoji to get the name of.
1. **`options`** _(optional)_:
- **`markdown`** (`boolean`; default: `false`): Whether to return a `":emoji:"` string instead of `"emoji"`
```js
import * as emoji from 'node-emoji'
console.log(emoji.which('🦄'))
// 'unicorn'
```
## Development
See _[`.github/Development.md`](./github/Development.md)_.
## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fomnidan%2Fnode-emoji.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fomnidan%2Fnode-emoji?ref=badge_large)
### Special Thanks
...to Anand Chowdhary (@AnandChowdhary) and his company [Pabio](https://github.com/pabio) for sponsoring this project via [GitHub Sponsors](https://github.com/sponsors/omnidan)!
## Contributors
<!-- spellchecker: disable -->
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/cagataycali/"><img src="https://avatars.githubusercontent.com/u/9213230?v=4?s=100" width="100px;" alt="./c²"/><br /><sub><b>./c²</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=cagataycali" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/askoufis"><img src="https://avatars.githubusercontent.com/u/5663042?v=4?s=100" width="100px;" alt="Adam Skoufis"/><br /><sub><b>Adam Skoufis</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=askoufis" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://adriancarolli.surge.sh/"><img src="https://avatars.githubusercontent.com/u/3059371?v=4?s=100" width="100px;" alt="Adrian Carolli"/><br /><sub><b>Adrian Carolli</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=watadarkstar" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/alexlitel"><img src="https://avatars.githubusercontent.com/u/12000084?v=4?s=100" width="100px;" alt="Alex Litel"/><br /><sub><b>Alex Litel</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=alexlitel" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://alex-rudenko.com/"><img src="https://avatars.githubusercontent.com/u/399150?v=4?s=100" width="100px;" alt="Alex Rudenko"/><br /><sub><b>Alex Rudenko</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=OrKoN" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ahanriat"><img src="https://avatars.githubusercontent.com/u/1374161?v=4?s=100" width="100px;" alt="Antoine Hanriat"/><br /><sub><b>Antoine Hanriat</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=ahanriat" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://omnidan.net/"><img src="https://avatars.githubusercontent.com/u/668674?v=4?s=100" width="100px;" alt="Daniel Bugl"/><br /><sub><b>Daniel Bugl</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/issues?q=author%3Aomnidan" title="Bug reports">🐛</a> <a href="https://github.com/omnidan/node-emoji/commits?author=omnidan" title="Code">💻</a> <a href="#fundingFinding-omnidan" title="Funding Finding">🔍</a> <a href="#ideas-omnidan" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-omnidan" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#tool-omnidan" title="Tools">🔧</a> <a href="#maintenance-omnidan" title="Maintenance">🚧</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/DanielHilton"><img src="https://avatars.githubusercontent.com/u/28859662?v=4?s=100" width="100px;" alt="Daniel Hilton"/><br /><sub><b>Daniel Hilton</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=DanielHilton" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/emctackett"><img src="https://avatars.githubusercontent.com/u/19399698?v=4?s=100" width="100px;" alt="Elizabeth"/><br /><sub><b>Elizabeth</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=emctackett" title="Code">💻</a> <a href="#maintenance-emctackett" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.gabrielcsapo.com/"><img src="https://avatars.githubusercontent.com/u/1854811?v=4?s=100" width="100px;" alt="Gabriel Csapo"/><br /><sub><b>Gabriel Csapo</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=gabrielcsapo" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://greenkeeper.io/"><img src="https://avatars.githubusercontent.com/u/14790466?v=4?s=100" width="100px;" alt="Greenkeeper"/><br /><sub><b>Greenkeeper</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=greenkeeperio-bot" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://www.joshuakgoldberg.com/"><img src="https://avatars.githubusercontent.com/u/3335181?v=4?s=100" width="100px;" alt="Josh Goldberg ✨"/><br /><sub><b>Josh Goldberg ✨</b></sub></a><br /><a href="#tool-JoshuaKGoldberg" title="Tools">🔧</a> <a href="https://github.com/omnidan/node-emoji/commits?author=JoshuaKGoldberg" title="Code">💻</a> <a href="#infra-JoshuaKGoldberg" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-JoshuaKGoldberg" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://cooperka.com/"><img src="https://avatars.githubusercontent.com/u/2047062?v=4?s=100" width="100px;" alt="Kevin Cooper"/><br /><sub><b>Kevin Cooper</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=cooperka" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/merceyz"><img src="https://avatars.githubusercontent.com/u/3842800?v=4?s=100" width="100px;" alt="Kristoffer K."/><br /><sub><b>Kristoffer K.</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=merceyz" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ludorenzetti"><img src="https://avatars.githubusercontent.com/u/8739517?v=4?s=100" width="100px;" alt="Ludo Renzetti"/><br /><sub><b>Ludo Renzetti</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=ludorenzetti" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://charpeni.com/"><img src="https://avatars.githubusercontent.com/u/7189823?v=4?s=100" width="100px;" alt="Nicolas Charpentier"/><br /><sub><b>Nicolas Charpentier</b></sub></a><br /><a href="#maintenance-charpeni" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://ngryman.sh/"><img src="https://avatars.githubusercontent.com/u/892048?v=4?s=100" width="100px;" alt="Nicolas Gryman"/><br /><sub><b>Nicolas Gryman</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=ngryman" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/HistoireDeBabar"><img src="https://avatars.githubusercontent.com/u/6544057?v=4?s=100" width="100px;" alt="Paul Barber"/><br /><sub><b>Paul Barber</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=HistoireDeBabar" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://richienb.github.io/"><img src="https://avatars.githubusercontent.com/u/29491356?v=4?s=100" width="100px;" alt="Richie Bendall"/><br /><sub><b>Richie Bendall</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=Richienb" title="Code">💻</a> <a href="#maintenance-Richienb" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://thetechinfinite.com/"><img src="https://avatars.githubusercontent.com/u/47841501?v=4?s=100" width="100px;" alt="Ritik Banger"/><br /><sub><b>Ritik Banger</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=ritikbanger" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://roopakv.com/"><img src="https://avatars.githubusercontent.com/u/678239?v=4?s=100" width="100px;" alt="Roopak Venkatakrishnan"/><br /><sub><b>Roopak Venkatakrishnan</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=roopakv" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://shivkanth.com/"><img src="https://avatars.githubusercontent.com/u/3232159?v=4?s=100" width="100px;" alt="Shivkanth Bagavathy"/><br /><sub><b>Shivkanth Bagavathy</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=shivkanthb" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://siddharthbatra.com/"><img src="https://avatars.githubusercontent.com/u/622674?v=4?s=100" width="100px;" alt="Siddharth Batra"/><br /><sub><b>Siddharth Batra</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=sidbatra" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/smeijer"><img src="https://avatars.githubusercontent.com/u/1196524?v=4?s=100" width="100px;" alt="Stephan Meijer"/><br /><sub><b>Stephan Meijer</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=smeijer" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Thomas101"><img src="https://avatars.githubusercontent.com/u/103586?v=4?s=100" width="100px;" alt="Thomas Beverley"/><br /><sub><b>Thomas Beverley</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/issues?q=author%3AThomas101" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://timr.co/"><img src="https://avatars.githubusercontent.com/u/249800?v=4?s=100" width="100px;" alt="Tim Ruffles"/><br /><sub><b>Tim Ruffles</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=timruffles" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://toddmazierski.com/"><img src="https://avatars.githubusercontent.com/u/544541?v=4?s=100" width="100px;" alt="Todd Mazierski"/><br /><sub><b>Todd Mazierski</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/issues?q=author%3Atoddmazierski" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://fossa.com/"><img src="https://avatars.githubusercontent.com/u/29791463?v=4?s=100" width="100px;" alt="fossabot"/><br /><sub><b>fossabot</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=fossabot" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/goodjun"><img src="https://avatars.githubusercontent.com/u/18377597?v=4?s=100" width="100px;" alt="goodjun"/><br /><sub><b>goodjun</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/issues?q=author%3Agoodjun" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://jackieluo.com/"><img src="https://avatars.githubusercontent.com/u/8452682?v=4?s=100" width="100px;" alt="jackie luo"/><br /><sub><b>jackie luo</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=jackiehluo" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tgbtyty"><img src="https://avatars.githubusercontent.com/u/10119245?v=4?s=100" width="100px;" alt="tgbtyty"/><br /><sub><b>tgbtyty</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=tgbtyty" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/wtgtybhertgeghgtwtg"><img src="https://avatars.githubusercontent.com/u/18507762?v=4?s=100" width="100px;" alt="wtgtybhertgeghgtwtg"/><br /><sub><b>wtgtybhertgeghgtwtg</b></sub></a><br /><a href="https://github.com/omnidan/node-emoji/commits?author=wtgtybhertgeghgtwtg" title="Code">💻</a></td>
</tr>
</tbody>
</table>
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
<!-- spellchecker: enable -->

214
node_modules/node-emoji/lib/index.cjs generated vendored Normal file
View File

@@ -0,0 +1,214 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var src_exports = {};
__export(src_exports, {
emojify: () => emojify,
find: () => find,
get: () => get,
has: () => has,
random: () => random,
replace: () => replace,
search: () => search,
strip: () => strip,
unemojify: () => unemojify,
which: () => which
});
module.exports = __toCommonJS(src_exports);
// src/emojify.ts
var import_is2 = __toESM(require("@sindresorhus/is"), 1);
// src/findByName.ts
var import_is = require("@sindresorhus/is");
// src/data.ts
var import_emojilib = __toESM(require("emojilib"), 1);
// src/utils.ts
var import_char_regex = __toESM(require("char-regex"), 1);
var charRegexMatcher = (0, import_char_regex.default)();
function asFunction(input) {
return typeof input === "function" ? input : () => input;
}
var NON_SPACING_MARK = String.fromCharCode(65039);
var nonSpacingRegex = new RegExp(NON_SPACING_MARK, "g");
function normalizeCode(code) {
return code.replace(nonSpacingRegex, "");
}
function normalizeName(name) {
return /:.+:/.test(name) ? name.slice(1, -1) : name;
}
function randomItem(array) {
return array[Math.floor(Math.random() * array.length)];
}
// src/data.ts
var emojiData = Object.entries(import_emojilib.default.lib).map(
([name, { char: emoji }]) => [name, emoji]
);
var emojiCodesByName = new Map(emojiData);
var emojiNamesByCode = new Map(
emojiData.map(([name, emoji]) => [normalizeCode(emoji), name])
);
// src/findByName.ts
var findByName = (name) => {
import_is.assert.string(name);
const nameNormalized = normalizeName(name);
const emoji = emojiCodesByName.get(nameNormalized);
return emoji ? { emoji, key: nameNormalized } : void 0;
};
// src/emojify.ts
var emojify = (input, { fallback, format = (name) => name } = {}) => {
const fallbackFunction = fallback === void 0 ? fallback : asFunction(fallback);
import_is2.default.assert.string(input);
import_is2.default.assert.any([import_is2.default.default.undefined, import_is2.default.default.function_], fallbackFunction);
import_is2.default.assert.function_(format);
return input.replace(/:[\w\-+]+:/g, (part) => {
const found = findByName(part);
if (found) {
return format(found.emoji, part, input);
}
if (fallbackFunction) {
return format(fallbackFunction(normalizeName(part)));
}
return format(part);
});
};
// src/findByCode.ts
var import_is3 = require("@sindresorhus/is");
var findByCode = (code) => {
import_is3.assert.string(code);
const emojiNormalized = normalizeCode(code);
const key = emojiNamesByCode.get(emojiNormalized);
return key ? { emoji: emojiNormalized, key } : void 0;
};
// src/find.ts
var find = (codeOrName) => {
return findByCode(codeOrName) ?? findByName(codeOrName);
};
// src/get.ts
var import_is4 = require("@sindresorhus/is");
var get = (codeOrName) => {
import_is4.assert.string(codeOrName);
return emojiCodesByName.get(normalizeName(codeOrName));
};
// src/has.ts
var import_is5 = require("@sindresorhus/is");
var has = (codeOrName) => {
import_is5.assert.string(codeOrName);
return emojiCodesByName.has(normalizeName(codeOrName)) || emojiNamesByCode.has(normalizeCode(codeOrName));
};
// src/random.ts
var random = () => {
const [name, emoji] = randomItem(emojiData);
return { emoji, name };
};
// src/replace.ts
var import_is6 = require("@sindresorhus/is");
var replace = (input, replacement, { preserveSpaces = false } = {}) => {
const replace2 = asFunction(replacement);
import_is6.assert.string(input);
import_is6.assert.function_(replace2);
import_is6.assert.boolean(preserveSpaces);
const characters = input.match(charRegexMatcher);
if (characters === null) {
return input;
}
return characters.map((character, index) => {
const found = findByCode(character);
if (!found) {
return character;
}
if (!preserveSpaces && characters[index + 1] === " ") {
characters[index + 1] = "";
}
return replace2(found, index, input);
}).join("");
};
// src/search.ts
var import_is7 = require("@sindresorhus/is");
var search = (keyword) => {
import_is7.assert.string(keyword);
keyword = normalizeName(keyword);
return emojiData.filter(([name]) => name.includes(keyword)).map(([name, emoji]) => ({ emoji, name }));
};
// src/strip.ts
var strip = (input, { preserveSpaces } = {}) => replace(input, "", { preserveSpaces });
// src/unemojify.ts
var import_is9 = require("@sindresorhus/is");
// src/which.ts
var import_is8 = require("@sindresorhus/is");
var import_skin_tone = __toESM(require("skin-tone"), 1);
var which = (emoji, { markdown = false } = {}) => {
import_is8.assert.string(emoji);
import_is8.assert.boolean(markdown);
const result = findByCode((0, import_skin_tone.default)(emoji, "none"));
if (result === void 0) {
return void 0;
}
return markdown ? `:${result.key}:` : result.key;
};
// src/unemojify.ts
var unemojify = (input) => {
import_is9.assert.string(input);
const characters = input.match(charRegexMatcher);
if (characters === null) {
return input;
}
return characters.map((character) => which(character, { markdown: true }) ?? character).join("");
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
emojify,
find,
get,
has,
random,
replace,
search,
strip,
unemojify,
which
});
//# sourceMappingURL=index.cjs.map

1
node_modules/node-emoji/lib/index.cjs.map generated vendored Normal file

File diff suppressed because one or more lines are too long

49
node_modules/node-emoji/lib/index.d.cts generated vendored Normal file
View File

@@ -0,0 +1,49 @@
type EmojifyFormat = (name: string, part?: string, input?: string) => string;
interface EmojifyOptions {
fallback?: ((part: string) => string) | string;
format?: EmojifyFormat;
}
declare const emojify: (input: string, { fallback, format }?: EmojifyOptions) => string;
declare const find: (codeOrName: string) => {
emoji: string;
key: string;
} | undefined;
declare const get: (codeOrName: string) => string | undefined;
declare const has: (codeOrName: string) => boolean;
declare const random: () => {
emoji: string;
name: string;
};
interface Emoji {
emoji: string;
key: string;
}
type ReplaceReplacement = (emoji: Emoji, index: number, string: string) => string;
declare const replace: (input: string, replacement: ReplaceReplacement | string, { preserveSpaces }?: {
preserveSpaces?: boolean | undefined;
}) => string;
declare const search: (keyword: string) => {
emoji: string;
name: string;
}[];
interface StripOptions {
preserveSpaces?: boolean;
}
declare const strip: (input: string, { preserveSpaces }?: StripOptions) => string;
declare const unemojify: (input: string) => string;
interface WhichOptions {
markdown?: boolean;
}
declare const which: (emoji: string, { markdown }?: WhichOptions) => string | undefined;
export { EmojifyFormat, EmojifyOptions, ReplaceReplacement, StripOptions, WhichOptions, emojify, find, get, has, random, replace, search, strip, unemojify, which };

49
node_modules/node-emoji/lib/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,49 @@
type EmojifyFormat = (name: string, part?: string, input?: string) => string;
interface EmojifyOptions {
fallback?: ((part: string) => string) | string;
format?: EmojifyFormat;
}
declare const emojify: (input: string, { fallback, format }?: EmojifyOptions) => string;
declare const find: (codeOrName: string) => {
emoji: string;
key: string;
} | undefined;
declare const get: (codeOrName: string) => string | undefined;
declare const has: (codeOrName: string) => boolean;
declare const random: () => {
emoji: string;
name: string;
};
interface Emoji {
emoji: string;
key: string;
}
type ReplaceReplacement = (emoji: Emoji, index: number, string: string) => string;
declare const replace: (input: string, replacement: ReplaceReplacement | string, { preserveSpaces }?: {
preserveSpaces?: boolean | undefined;
}) => string;
declare const search: (keyword: string) => {
emoji: string;
name: string;
}[];
interface StripOptions {
preserveSpaces?: boolean;
}
declare const strip: (input: string, { preserveSpaces }?: StripOptions) => string;
declare const unemojify: (input: string) => string;
interface WhichOptions {
markdown?: boolean;
}
declare const which: (emoji: string, { markdown }?: WhichOptions) => string | undefined;
export { EmojifyFormat, EmojifyOptions, ReplaceReplacement, StripOptions, WhichOptions, emojify, find, get, has, random, replace, search, strip, unemojify, which };

168
node_modules/node-emoji/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,168 @@
// src/emojify.ts
import is from "@sindresorhus/is";
// src/findByName.ts
import { assert } from "@sindresorhus/is";
// src/data.ts
import emojilib from "emojilib";
// src/utils.ts
import charRegex from "char-regex";
var charRegexMatcher = charRegex();
function asFunction(input) {
return typeof input === "function" ? input : () => input;
}
var NON_SPACING_MARK = String.fromCharCode(65039);
var nonSpacingRegex = new RegExp(NON_SPACING_MARK, "g");
function normalizeCode(code) {
return code.replace(nonSpacingRegex, "");
}
function normalizeName(name) {
return /:.+:/.test(name) ? name.slice(1, -1) : name;
}
function randomItem(array) {
return array[Math.floor(Math.random() * array.length)];
}
// src/data.ts
var emojiData = Object.entries(emojilib.lib).map(
([name, { char: emoji }]) => [name, emoji]
);
var emojiCodesByName = new Map(emojiData);
var emojiNamesByCode = new Map(
emojiData.map(([name, emoji]) => [normalizeCode(emoji), name])
);
// src/findByName.ts
var findByName = (name) => {
assert.string(name);
const nameNormalized = normalizeName(name);
const emoji = emojiCodesByName.get(nameNormalized);
return emoji ? { emoji, key: nameNormalized } : void 0;
};
// src/emojify.ts
var emojify = (input, { fallback, format = (name) => name } = {}) => {
const fallbackFunction = fallback === void 0 ? fallback : asFunction(fallback);
is.assert.string(input);
is.assert.any([is.default.undefined, is.default.function_], fallbackFunction);
is.assert.function_(format);
return input.replace(/:[\w\-+]+:/g, (part) => {
const found = findByName(part);
if (found) {
return format(found.emoji, part, input);
}
if (fallbackFunction) {
return format(fallbackFunction(normalizeName(part)));
}
return format(part);
});
};
// src/findByCode.ts
import { assert as assert2 } from "@sindresorhus/is";
var findByCode = (code) => {
assert2.string(code);
const emojiNormalized = normalizeCode(code);
const key = emojiNamesByCode.get(emojiNormalized);
return key ? { emoji: emojiNormalized, key } : void 0;
};
// src/find.ts
var find = (codeOrName) => {
return findByCode(codeOrName) ?? findByName(codeOrName);
};
// src/get.ts
import { assert as assert3 } from "@sindresorhus/is";
var get = (codeOrName) => {
assert3.string(codeOrName);
return emojiCodesByName.get(normalizeName(codeOrName));
};
// src/has.ts
import { assert as assert4 } from "@sindresorhus/is";
var has = (codeOrName) => {
assert4.string(codeOrName);
return emojiCodesByName.has(normalizeName(codeOrName)) || emojiNamesByCode.has(normalizeCode(codeOrName));
};
// src/random.ts
var random = () => {
const [name, emoji] = randomItem(emojiData);
return { emoji, name };
};
// src/replace.ts
import { assert as assert5 } from "@sindresorhus/is";
var replace = (input, replacement, { preserveSpaces = false } = {}) => {
const replace2 = asFunction(replacement);
assert5.string(input);
assert5.function_(replace2);
assert5.boolean(preserveSpaces);
const characters = input.match(charRegexMatcher);
if (characters === null) {
return input;
}
return characters.map((character, index) => {
const found = findByCode(character);
if (!found) {
return character;
}
if (!preserveSpaces && characters[index + 1] === " ") {
characters[index + 1] = "";
}
return replace2(found, index, input);
}).join("");
};
// src/search.ts
import { assert as assert6 } from "@sindresorhus/is";
var search = (keyword) => {
assert6.string(keyword);
keyword = normalizeName(keyword);
return emojiData.filter(([name]) => name.includes(keyword)).map(([name, emoji]) => ({ emoji, name }));
};
// src/strip.ts
var strip = (input, { preserveSpaces } = {}) => replace(input, "", { preserveSpaces });
// src/unemojify.ts
import { assert as assert8 } from "@sindresorhus/is";
// src/which.ts
import { assert as assert7 } from "@sindresorhus/is";
import skinTone from "skin-tone";
var which = (emoji, { markdown = false } = {}) => {
assert7.string(emoji);
assert7.boolean(markdown);
const result = findByCode(skinTone(emoji, "none"));
if (result === void 0) {
return void 0;
}
return markdown ? `:${result.key}:` : result.key;
};
// src/unemojify.ts
var unemojify = (input) => {
assert8.string(input);
const characters = input.match(charRegexMatcher);
if (characters === null) {
return input;
}
return characters.map((character) => which(character, { markdown: true }) ?? character).join("");
};
export {
emojify,
find,
get,
has,
random,
replace,
search,
strip,
unemojify,
which
};
//# sourceMappingURL=index.js.map

1
node_modules/node-emoji/lib/index.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

118
node_modules/node-emoji/package.json generated vendored Normal file
View File

@@ -0,0 +1,118 @@
{
"name": "node-emoji",
"version": "2.1.3",
"description": "Friendly emoji lookups and parsing utilities for Node.js. 💖",
"keywords": [
"emoji",
"simple",
"emoticons",
"emoticon",
"emojis",
"smiley",
"smileys",
"smilies",
"ideogram",
"ideograms"
],
"bugs": {
"url": "https://github.com/omnidan/node-emoji/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/omnidan/node-emoji"
},
"license": "MIT",
"author": {
"name": "Daniel Bugl",
"email": "me@omnidan.net"
},
"type": "module",
"exports": {
".": {
"types": {
"import": "./lib/index.d.ts",
"require": "./lib/index.d.cts"
},
"import": "./lib/index.js",
"require": "./lib/index.cjs"
}
},
"main": "./lib/index.js",
"files": [
"lib/",
"package.json",
"LICENSE.md",
"README.md"
],
"scripts": {
"build": "tsup",
"format": "prettier \"**/*\" --ignore-unknown",
"lint": "eslint . .*js --max-warnings 0 --report-unused-disable-directives",
"lint:knip": "knip",
"lint:md": "markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line",
"lint:package-json": "npmPkgJsonLint .",
"lint:packages": "pnpm dedupe --check",
"lint:spelling": "cspell \"**\" \".github/**/*\"",
"prepare": "husky install",
"should-semantic-release": "should-semantic-release --verbose",
"test": "vitest",
"test:cjs": "node ./src/e2e.cjs",
"tsc": "tsc"
},
"lint-staged": {
"*": "prettier --ignore-unknown --write"
},
"dependencies": {
"@sindresorhus/is": "^4.6.0",
"char-regex": "^1.0.2",
"emojilib": "^2.4.0",
"skin-tone": "^2.0.0"
},
"devDependencies": {
"@release-it/conventional-changelog": "^8.0.1",
"@swc/core": "^1.3.58",
"@types/eslint": "^8.44.7",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"@vitest/coverage-v8": "^0.34.6",
"console-fail-test": "^0.2.3",
"cspell": "^8.0.0",
"eslint": "^8.53.0",
"eslint-plugin-deprecation": "^2.0.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-jsdoc": "^46.9.0",
"eslint-plugin-jsonc": "^2.10.0",
"eslint-plugin-markdown": "^3.0.1",
"eslint-plugin-n": "^16.3.1",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-perfectionist": "^2.3.0",
"eslint-plugin-regexp": "^2.1.1",
"eslint-plugin-vitest": "^0.3.9",
"eslint-plugin-yml": "^1.10.0",
"husky": "^8.0.3",
"jsonc-eslint-parser": "^2.4.0",
"knip": "^2.41.0",
"lint-staged": "^15.1.0",
"markdownlint": "^0.32.0",
"markdownlint-cli": "^0.37.0",
"npm-package-json-lint": "^7.1.0",
"npm-package-json-lint-config-default": "^6.0.0",
"prettier": "^3.0.3",
"prettier-plugin-curly": "^0.1.3",
"prettier-plugin-packagejson": "^2.4.6",
"release-it": "^17.0.0",
"sentences-per-line": "^0.2.1",
"should-semantic-release": "^0.2.1",
"tsup": "^7.2.0",
"typescript": "^5.2.2",
"vitest": "^0.34.6",
"yaml-eslint-parser": "^1.2.2"
},
"packageManager": "pnpm@8.10.5",
"engines": {
"node": ">=18"
},
"publishConfig": {
"provenance": true
}
}