Skip to content

Commit 22f51a5

Browse files
committed
Fix crash when used with other tools
1 parent 901115d commit 22f51a5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
* @property {Array<SentenceInclusiveDescendant>} nodes
2020
*/
2121

22-
import {ok as assert} from 'devlop'
2322
import emojiRegex from 'emoji-regex'
2423
import {nameToEmoji} from 'gemoji'
2524
import {toString} from 'nlcst-to-string'
@@ -86,10 +85,12 @@ export function emojiModifier(node) {
8685
const child = nodes[index]
8786

8887
if (child.type === 'EmoticonNode') {
88+
// Always exists if we run, but other tools like
89+
// `nlcst-emoticon-modifier` may not have it.
8990
const match = matchMap.get(child)
90-
assert(match)
9191

9292
if (
93+
match &&
9394
previous &&
9495
previous.type === 'EmoticonNode' &&
9596
matchMap.get(previous) === match

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
],
3434
"dependencies": {
3535
"@types/nlcst": "^2.0.0",
36-
"devlop": "^1.0.0",
3736
"emoji-regex": "^10.0.0",
3837
"gemoji": "^8.0.0",
3938
"nlcst-emoticon-modifier": "^3.0.0",

0 commit comments

Comments
 (0)