Socket
Socket
Sign inDemoInstall

lunr

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lunr - npm Package Compare versions

Comparing version 2.0.0-alpha.3 to 2.0.0-alpha.4

2

lib/query_parser.js

@@ -94,3 +94,3 @@ lunr.QueryParser = function (str, query) {

parser.currentClause.term = lexeme.str
parser.currentClause.term = lexeme.str.toLowerCase()

@@ -97,0 +97,0 @@ if (lexeme.str.indexOf("*") != -1) {

{
"name": "lunr",
"description": "Simple full-text search in your browser.",
"version": "2.0.0-alpha.3",
"version": "2.0.0-alpha.4",
"author": "Oliver Nightingale",

@@ -6,0 +6,0 @@ "keywords": ["search"],

@@ -40,2 +40,30 @@ suite('lunr.QueryParser', function () {

suite('single term, uppercase', function () {
setup(function () {
this.clauses = parse('FOO')
})
test('has 1 clause', function () {
assert.lengthOf(this.clauses, 1)
})
suite('clauses', function () {
setup(function () {
this.clause = this.clauses[0]
})
test('term', function () {
assert.equal('foo', this.clause.term)
})
test('fields', function () {
assert.sameMembers(['title', 'body'], this.clause.fields)
})
test('usePipeline', function () {
assert.ok(this.clause.usePipeline)
})
})
})
suite('single term with wildcard', function () {

@@ -108,2 +136,27 @@ setup(function () {

suite('uppercase field with uppercase term', function () {
setup(function () {
// Using a different query to the rest of the tests
// so that only this test has to worry about an upcase field name
var query = new lunr.Query (['TITLE']),
parser = new lunr.QueryParser("TITLE:FOO", query)
parser.parse()
this.clauses = query.clauses
})
test('has 1 clause', function () {
assert.lengthOf(this.clauses, 1)
})
test('clause contains downcased term', function () {
assert.equal(this.clauses[0].term, 'foo')
})
test('clause contains only scoped field', function () {
assert.sameMembers(this.clauses[0].fields, ['TITLE'])
})
})
suite('multiple terms scoped to different fields', function () {

@@ -110,0 +163,0 @@ setup(function () {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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