Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

find-hashtags

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

find-hashtags - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

index.js
var XRegExp = require('xregexp').XRegExp;
var hashtagExp = XRegExp('\\S*#[\\p{L}\\d]+', 'i');
var hashtagExp = XRegExp('#[\\p{L}\\d]+', 'i');

@@ -4,0 +4,0 @@ function FindHashtags() {

{
"name": "find-hashtags",
"version": "1.0.0",
"version": "1.0.1",
"description": "Extracts the hashtags from a string",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -52,1 +52,15 @@ var test = require('tape');

});
test('hashtag with no space after preceding word', function (t) {
var content = 'Example content like#This should correctly handle hashtags.';
t.deepEqual(hashtags(content), ['this']);
t.end();
});
test('two hashtags with no space between', function (t) {
var content = 'Example content#like#This should correctly handle hashtags.';
t.deepEqual(hashtags(content), ['like', 'this']);
t.end();
})
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc