Socket
Socket
Sign inDemoInstall

node-emoji

Package Overview
Dependencies
5
Maintainers
3
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.2 to 2.1.0

lib/index.d.ts

14

.github/Development.md

@@ -38,1 +38,15 @@ # Development

```
## Type Checking
Separately from building, [TypeScript](https://typescriptlang.org)'s compiler can be used to type check code:
```shell
npm run compile
```
You can run with with [TypeScript's `-w`/`--watch` mode](https://www.typescriptlang.org/docs/handbook/compiler-options.html) to continuously rerun the type checker as you make changes:
```shell
npm run compile -- -w
```

4

jest.config.json

@@ -10,3 +10,5 @@ {

},
"transform": {}
"transform": {
"src.+\\.(t|j)s$": "@swc/jest"
}
}

@@ -1,11 +0,11 @@

// src/emojify.js
// src/emojify.ts
import { assert as assert2, default as is } from "@sindresorhus/is";
// src/findByName.js
// src/findByName.ts
import { assert } from "@sindresorhus/is";
// src/data.js
// src/data.ts
import emojilib from "emojilib";
// src/utils.js
// src/utils.ts
import charRegex from "char-regex";

@@ -28,3 +28,3 @@ var charRegexMatcher = charRegex();

// src/data.js
// src/data.ts
var emojiData = Object.entries(emojilib.lib).map(

@@ -38,3 +38,3 @@ ([name, { char: emoji }]) => [name, emoji]

// src/findByName.js
// src/findByName.ts
var findByName = (name) => {

@@ -47,7 +47,7 @@ assert.string(name);

// src/emojify.js
// src/emojify.ts
var emojify = (input, { fallback, format = (name) => name } = {}) => {
const fallbackFunction = fallback === void 0 ? fallback : asFunction(fallback);
assert2.string(input);
assert2.any([is.undefined, is.function], fallbackFunction);
assert2.any([is.undefined, is.function_], fallbackFunction);
assert2.function_(format);

@@ -66,3 +66,3 @@ return input.replace(/:([a-zA-Z0-9_\-+]+):/g, (part) => {

// src/findByCode.js
// src/findByCode.ts
import { assert as assert3 } from "@sindresorhus/is";

@@ -76,3 +76,3 @@ var findByCode = (code) => {

// src/find.js
// src/find.ts
var find = (codeOrName) => {

@@ -82,3 +82,3 @@ return findByCode(codeOrName) || findByName(codeOrName);

// src/get.js
// src/get.ts
import { assert as assert4 } from "@sindresorhus/is";

@@ -90,3 +90,3 @@ var get = (codeOrName) => {

// src/has.js
// src/has.ts
import { assert as assert5 } from "@sindresorhus/is";

@@ -98,3 +98,3 @@ var has = (codeOrName) => {

// src/random.js
// src/random.ts
var random = () => {

@@ -105,3 +105,3 @@ const [name, emoji] = randomItem(emojiData);

// src/replace.js
// src/replace.ts
import { assert as assert6 } from "@sindresorhus/is";

@@ -129,3 +129,3 @@ var replace = (input, replacement, { preserveSpaces = false } = {}) => {

// src/search.js
// src/search.ts
import { assert as assert7 } from "@sindresorhus/is";

@@ -138,9 +138,9 @@ var search = (keyword) => {

// src/strip.js
// src/strip.ts
var strip = (input, { preserveSpaces } = {}) => replace(input, "", { preserveSpaces });
// src/unemojify.js
// src/unemojify.ts
import { assert as assert9 } from "@sindresorhus/is";
// src/which.js
// src/which.ts
import { assert as assert8 } from "@sindresorhus/is";

@@ -158,3 +158,3 @@ import skinTone from "skin-tone";

// src/unemojify.js
// src/unemojify.ts
var unemojify = (input) => {

@@ -161,0 +161,0 @@ assert9.string(input);

{
"name": "node-emoji",
"version": "2.0.2",
"version": "2.1.0",
"description": "Friendly emoji lookups and parsing utilities for Node.js",

@@ -26,14 +26,18 @@ "author": "Daniel Bugl <me@omnidan.net>",

"dependencies": {
"@sindresorhus/is": "^5.3.0",
"char-regex": "^2.0.1",
"@sindresorhus/is": "^3.1.2",
"char-regex": "^1.0.2",
"emojilib": "^2.4.0",
"skin-tone": "^3.0.0",
"tsup": "^6.7.0"
"skin-tone": "^2.0.0"
},
"devDependencies": {
"@swc/core": "^1.3.58",
"@swc/jest": "^0.2.26",
"cross-env": "^7.0.3",
"jest": "^29.5.0"
"jest": "^29.5.0",
"tsup": "^6.7.0",
"typescript": "^5.0.4"
},
"scripts": {
"build": "tsup ./src/index.js --format esm,cjs --out-dir lib",
"build": "tsup ./src/index.ts --format esm,cjs --out-dir lib --dts",
"compile": "tsc",
"coverage": "npm run test -- --coverage",

@@ -49,2 +53,3 @@ "prepublishOnly": "npm run coverage",

},
"types": "./lib/index.d.ts",
"main": "./lib/index.js",

@@ -51,0 +56,0 @@ "license": "MIT",

@@ -142,3 +142,3 @@ # node-emoji

- **`input`** (`string`): The input string.
- **`replacement`** (`string | (emoji: string, index: number, string: InputValueType) => string`): The character to replace the emoji with. Can be either a string or a callback that returns a 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.

@@ -207,3 +207,3 @@ ```js

### emoji.which(emoji)
### emoji.which(emoji, options?)

@@ -215,2 +215,4 @@ Get an emoji name from an emoji.

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"`

@@ -217,0 +219,0 @@ ```js

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc