Skip to content

Commit

Permalink
Require Node.js 20
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Oct 27, 2023
1 parent b0429a9 commit 968317c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
fail-fast: false
matrix:
node-version:
- 16
- 20
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import emojiRegex from 'emoji-regex/es2015/RGI_Emoji.js';
const regex = /\p{RGI_Emoji}/v;

export default function hasEmoji(string) {
return emojiRegex().test(string);
return regex.test(string);
}
21 changes: 13 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"exports": {
"types": "./index.d.ts",
"default": "./index.js"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
"node": ">=20"
},
"scripts": {
"test": "xo && ava && tsd"
Expand All @@ -33,12 +36,14 @@
"detect",
"is"
],
"dependencies": {
"emoji-regex": "^9.2.2"
},
"devDependencies": {
"ava": "^3.15.0",
"tsd": "^0.17.0",
"xo": "^0.44.0"
"ava": "^5.3.1",
"tsd": "^0.29.0",
"xo": "^0.56.0"
},
"xo": {
"rules": {
"unicorn/better-regex": "off"
}
}
}

0 comments on commit 968317c

Please sign in to comment.