Releases: eklem/words-n-numbers
Smaller library size + better demo explanation on custom emoji regex
- Defined files to only
./dist
in package.json, cutting size to approximately 1/5 of previous. - Explained flags needed for custom emoji extraction in demo
- Fixed leftover text in header from "query" to "input"
Emoji extraction based on mathiasbynens' rgi-emoji-regex-pattern
- rgi-emoji-regex-pattern can extract all (almost) unicode emojis. Regex added to words-n-numbers.
- Demo updated. Regex flags can now be defined. Standard is
giu
, but custom emojis regex needs it to be without theu
-flag (unicode). - Tests added, both CJS, ESM and for the HTML-demo (UMD)
Extracting single emojis instead of emoji words - breaking change
No more "words" formed by several emojis. This because each emoji in a sense are words. Will also work better with search engines as each can be used as a filter if you have an emoji facet to filter on.
So instead of:
cons stringOfWords = 'A ticket to 大阪 costs ¥2000 👌😄 😢'
extract(stringOfWords, { regex: emojis})
// ['👌😄', '😢']
...you will get:
cons stringOfWords = 'A ticket to 大阪 costs ¥2000 👌😄 😢'
extract(stringOfWords, { regex: emojis})
// ['👌', '😄', '😢']
Workflow/tests.yml got added Node v18.x tests
AvaJS version bump Fixing nodejs v18.8.0 issues. And adding 18.x to workflow/tests.yml
Better error handling for input
- Checking if string inpug is actually a string.
- Added test for CJS and ESM. Throwing error on array fed to function instead of string.
- Changed from
let
toconst
in readme examples since nothing is changing with the variables
Breaking changes! More modular system for combining regexes and better word extraction
Breaking changes to API (named exports on CJS and ESM)
- modular system for combining regexes.
- better word extraction (with apostrophes)
- demo showcasing modular system
- UI-tests
- More CJS/ESM tests
Swapping TravisCI with GitHub Actions workflow
- Less hassle, easier to set up and better overview.
- Also latest batr version
New dist files and new bundle & test framework
New major version since files are changing name. Now bundles CJS, ESM and UMD files. So far, testing CJS and ESM. Will add demo and UI tests later.
More robust email extraction
Also catering to email addresses in plaintext sentences where there is a trailing .
right after an email address, like this: name.nameson@example.com. This will extract name.nameson@example.com
and not name.nameson@example.com.
Email extraction
Added quite okay email extraction. Not "
(double quotes) or
space. Can't be used for email validation, but that's not the purpose. If it looks and smells like an email address it will extract.