New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

js-solr-highlighter

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-solr-highlighter - npm Package Compare versions

Comparing version 0.6.2 to 0.6.3

11

build/index.js

@@ -6,3 +6,5 @@ "use strict";

});
exports.default = highlightByQuery;
exports.hasNonStopWords = hasNonStopWords;
exports.highlightByQuery = highlightByQuery;
exports.STOP_WORDS = void 0;

@@ -14,3 +16,8 @@ var _textAnnotator = _interopRequireDefault(require("text-annotator"));

const STOP_WORDS = ['a', 'an', 'and', 'are', 'as', 'at', 'be', 'but', 'by', 'for', 'if', 'in', 'into', 'is', 'it', 'no', 'not', 'of', 'on', 'or', 's', 'such', 't', 'that', 'the', 'their', 'then', 'there', 'these', 'they', 'this', 'to', 'was', 'will', 'with'];
exports.STOP_WORDS = STOP_WORDS;
function hasNonStopWords(string) {
return STOP_WORDS.includes(string);
}
function highlightByQuery(query, content, options = {}) {

@@ -123,3 +130,3 @@ const excludedFields = options.excludedFields === undefined ? [] : options.excludedFields;

words = words.filter(word => word.length && !STOP_WORDS.includes(word.toLowerCase()) && !['AND', 'OR', 'NOT'].includes(word));
words = words.filter(word => word.length && !hasNonStopWords(word.toLowerCase()) && !['AND', 'OR', 'NOT'].includes(word));
let newContent = content;

@@ -126,0 +133,0 @@

2

package.json
{
"name": "js-solr-highlighter",
"version": "0.6.2",
"version": "0.6.3",
"description": "A JavaScript library for highlighting HTML text based on the query in the lucene/solr query syntax",

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

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