Comments (3)
Interesting, I can't repro this, it works fine for me:
Do you think it's maybe because you're using require()
instead of import
?
Maybe because the type declaration module uses declare module { }
it only works if you're using module-style imports?
Also what version of the package are you running?
from emoji-regex.
Yup, I'm assuming that's the problem. I'm using cjs so it doesn't look like the type declaration supports it.
I'm using 10.2.1
from emoji-regex.
The index.d.ts
should be updated to this instead:
diff --git a/index.d.ts b/index.d.ts
index 6f57555090390e09a3b3a2e39bab037c995b47b9..beb73be29022bf20734057e38148282207f5fa2b 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -1,3 +1,4 @@
declare module 'emoji-regex' {
- export default function emojiRegex(): RegExp;
+ function emojiRegex(): RegExp;
+ export = emojiRegex;
}
It looks like it was changed by #89 for the index.mjs
file but that then broke types for the index.js
file. With split files like this, it should probably be defined directly inside those files as JSDoc instead if they're going to vary in typing like that.
from emoji-regex.
Related Issues (20)
- © is recognised as an emoji HOT 2
- Is this lib basically doing /\p{Emoji}|\p{Default_Ignorable_Code_Point}/gu ? HOT 3
- Question around choice of factory HOT 2
- Determine emoji type? HOT 2
- rename License file?
- some variations of emojis are not working with current version of emoji-regex library
- The face-exhaling emoji isn't matched correctly
- Node 20 LTS supports the new proposed RegExp flag linked in the source HOT 1
- Why does the second result return false? HOT 2
- Simplify build by leveraging rgi-emoji-regex-pattern HOT 1
- Certain emoji sequences are not recognized HOT 8
- Shopping Bag emoji doesn't match HOT 1
- typescript synthetic import HOT 2
- npm install emoji-regex returns MODULE_NOT_FOUND HOT 2
- Symbol # and Number 0-9 HOT 3
- .npmrc breaks local install HOT 1
- Does not match some emoji HOT 2
- How to use emoji-regex v10.0.0 with regexp unicode flag HOT 2
- Add changelog HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emoji-regex.