@ldapjs/filter
Advanced tools
Comparing version 1.0.0-rc.5 to 1.0.0-rc.6
@@ -104,3 +104,3 @@ 'use strict' | ||
tap.test('original node-ldap tests', t => { | ||
// This set of subtests are from the original "filters/eq" test suite | ||
// This set of subtests are from the original "filters/approx" test suite | ||
// in the core `ldapjs` module code. | ||
@@ -107,0 +107,0 @@ |
@@ -16,3 +16,3 @@ // Copyright 2014 Mark Cavage, Inc. All rights reserved. | ||
const ExtensibleFilter = require('./filters/extensible') | ||
const GreaterThanEqualsFilter = require('./filters/ge') | ||
const GreaterThanEqualsFilter = require('./filters/greater-than-equals') | ||
const LessThanEqualsFilter = require('./filters/le') | ||
@@ -19,0 +19,0 @@ const NotFilter = require('./filters/not') |
@@ -100,18 +100,18 @@ // Copyright 2014 Mark Cavage, Inc. All rights reserved. | ||
{ str: '(foo<=\n)', type: 'le', val: v1, output: '(foo<=\\0a)' }, | ||
{ str: '(foo>=\n)', type: 'ge', val: v1, output: '(foo>=\\0a)' }, | ||
{ str: '(foo>=\n)', type: 'GreaterThanEqualsFilter', val: v1, output: '(foo>=\\0a)' }, | ||
{ str: '(foo=\\0a)', type: 'EqualityFilter', val: v1, output: '(foo=\\0a)' }, | ||
{ str: '(foo<=\\0a)', type: 'le', val: v1, output: '(foo<=\\0a)' }, | ||
{ str: '(foo>=\\0a)', type: 'ge', val: v1, output: '(foo>=\\0a)' }, | ||
{ str: '(foo>=\\0a)', type: 'GreaterThanEqualsFilter', val: v1, output: '(foo>=\\0a)' }, | ||
{ str: '(foo=bar\n)', type: 'EqualityFilter', val: v2, output: '(foo=bar\\0a)' }, | ||
{ str: '(foo<=bar\n)', type: 'le', val: v2, output: '(foo<=bar\\0a)' }, | ||
{ str: '(foo>=bar\n)', type: 'ge', val: v2, output: '(foo>=bar\\0a)' }, | ||
{ str: '(foo>=bar\n)', type: 'GreaterThanEqualsFilter', val: v2, output: '(foo>=bar\\0a)' }, | ||
{ str: '(foo=bar\\0a)', type: 'EqualityFilter', val: v2, output: '(foo=bar\\0a)' }, | ||
{ str: '(foo<=bar\\0a)', type: 'le', val: v2, output: '(foo<=bar\\0a)' }, | ||
{ str: '(foo>=bar\\0a)', type: 'ge', val: v2, output: '(foo>=bar\\0a)' }, | ||
{ str: '(foo>=bar\\0a)', type: 'GreaterThanEqualsFilter', val: v2, output: '(foo>=bar\\0a)' }, | ||
{ str: '(foo=\nbar)', type: 'EqualityFilter', val: v3, output: '(foo=\\0abar)' }, | ||
{ str: '(foo<=\nbar)', type: 'le', val: v3, output: '(foo<=\\0abar)' }, | ||
{ str: '(foo>=\nbar)', type: 'ge', val: v3, output: '(foo>=\\0abar)' }, | ||
{ str: '(foo>=\nbar)', type: 'GreaterThanEqualsFilter', val: v3, output: '(foo>=\\0abar)' }, | ||
{ str: '(foo=\\0abar)', type: 'EqualityFilter', val: v3, output: '(foo=\\0abar)' }, | ||
{ str: '(foo<=\\0abar)', type: 'le', val: v3, output: '(foo<=\\0abar)' }, | ||
{ str: '(foo>=\\0abar)', type: 'ge', val: v3, output: '(foo>=\\0abar)' } | ||
{ str: '(foo>=\\0abar)', type: 'GreaterThanEqualsFilter', val: v3, output: '(foo>=\\0abar)' } | ||
]) | ||
@@ -127,18 +127,18 @@ }) | ||
{ str: '(foo<=\r)', type: 'le', val: v1, output: '(foo<=\\0d)' }, | ||
{ str: '(foo>=\r)', type: 'ge', val: v1, output: '(foo>=\\0d)' }, | ||
{ str: '(foo>=\r)', type: 'GreaterThanEqualsFilter', val: v1, output: '(foo>=\\0d)' }, | ||
{ str: '(foo=\\0d)', type: 'EqualityFilter', val: v1, output: '(foo=\\0d)' }, | ||
{ str: '(foo<=\\0d)', type: 'le', val: v1, output: '(foo<=\\0d)' }, | ||
{ str: '(foo>=\\0d)', type: 'ge', val: v1, output: '(foo>=\\0d)' }, | ||
{ str: '(foo>=\\0d)', type: 'GreaterThanEqualsFilter', val: v1, output: '(foo>=\\0d)' }, | ||
{ str: '(foo=bar\r)', type: 'EqualityFilter', val: v2, output: '(foo=bar\\0d)' }, | ||
{ str: '(foo<=bar\r)', type: 'le', val: v2, output: '(foo<=bar\\0d)' }, | ||
{ str: '(foo>=bar\r)', type: 'ge', val: v2, output: '(foo>=bar\\0d)' }, | ||
{ str: '(foo>=bar\r)', type: 'GreaterThanEqualsFilter', val: v2, output: '(foo>=bar\\0d)' }, | ||
{ str: '(foo=bar\\0d)', type: 'EqualityFilter', val: v2, output: '(foo=bar\\0d)' }, | ||
{ str: '(foo<=bar\\0d)', type: 'le', val: v2, output: '(foo<=bar\\0d)' }, | ||
{ str: '(foo>=bar\\0d)', type: 'ge', val: v2, output: '(foo>=bar\\0d)' }, | ||
{ str: '(foo>=bar\\0d)', type: 'GreaterThanEqualsFilter', val: v2, output: '(foo>=bar\\0d)' }, | ||
{ str: '(foo=\rbar)', type: 'EqualityFilter', val: v3, output: '(foo=\\0dbar)' }, | ||
{ str: '(foo<=\rbar)', type: 'le', val: v3, output: '(foo<=\\0dbar)' }, | ||
{ str: '(foo>=\rbar)', type: 'ge', val: v3, output: '(foo>=\\0dbar)' }, | ||
{ str: '(foo>=\rbar)', type: 'GreaterThanEqualsFilter', val: v3, output: '(foo>=\\0dbar)' }, | ||
{ str: '(foo=\\0dbar)', type: 'EqualityFilter', val: v3, output: '(foo=\\0dbar)' }, | ||
{ str: '(foo<=\\0dbar)', type: 'le', val: v3, output: '(foo<=\\0dbar)' }, | ||
{ str: '(foo>=\\0dbar)', type: 'ge', val: v3, output: '(foo>=\\0dbar)' } | ||
{ str: '(foo>=\\0dbar)', type: 'GreaterThanEqualsFilter', val: v3, output: '(foo>=\\0dbar)' } | ||
]) | ||
@@ -154,18 +154,18 @@ }) | ||
{ str: '(foo<=\t)', type: 'le', val: v1, output: '(foo<=\\09)' }, | ||
{ str: '(foo>=\t)', type: 'ge', val: v1, output: '(foo>=\\09)' }, | ||
{ str: '(foo>=\t)', type: 'GreaterThanEqualsFilter', val: v1, output: '(foo>=\\09)' }, | ||
{ str: '(foo=\\09)', type: 'EqualityFilter', val: v1, output: '(foo=\\09)' }, | ||
{ str: '(foo<=\\09)', type: 'le', val: v1, output: '(foo<=\\09)' }, | ||
{ str: '(foo>=\\09)', type: 'ge', val: v1, output: '(foo>=\\09)' }, | ||
{ str: '(foo>=\\09)', type: 'GreaterThanEqualsFilter', val: v1, output: '(foo>=\\09)' }, | ||
{ str: '(foo=bar\t)', type: 'EqualityFilter', val: v2, output: '(foo=bar\\09)' }, | ||
{ str: '(foo<=bar\t)', type: 'le', val: v2, output: '(foo<=bar\\09)' }, | ||
{ str: '(foo>=bar\t)', type: 'ge', val: v2, output: '(foo>=bar\\09)' }, | ||
{ str: '(foo>=bar\t)', type: 'GreaterThanEqualsFilter', val: v2, output: '(foo>=bar\\09)' }, | ||
{ str: '(foo=bar\\09)', type: 'EqualityFilter', val: v2, output: '(foo=bar\\09)' }, | ||
{ str: '(foo<=bar\\09)', type: 'le', val: v2, output: '(foo<=bar\\09)' }, | ||
{ str: '(foo>=bar\\09)', type: 'ge', val: v2, output: '(foo>=bar\\09)' }, | ||
{ str: '(foo>=bar\\09)', type: 'GreaterThanEqualsFilter', val: v2, output: '(foo>=bar\\09)' }, | ||
{ str: '(foo=\tbar)', type: 'EqualityFilter', val: v3, output: '(foo=\\09bar)' }, | ||
{ str: '(foo<=\tbar)', type: 'le', val: v3, output: '(foo<=\\09bar)' }, | ||
{ str: '(foo>=\tbar)', type: 'ge', val: v3, output: '(foo>=\\09bar)' }, | ||
{ str: '(foo>=\tbar)', type: 'GreaterThanEqualsFilter', val: v3, output: '(foo>=\\09bar)' }, | ||
{ str: '(foo=\\09bar)', type: 'EqualityFilter', val: v3, output: '(foo=\\09bar)' }, | ||
{ str: '(foo<=\\09bar)', type: 'le', val: v3, output: '(foo<=\\09bar)' }, | ||
{ str: '(foo>=\\09bar)', type: 'ge', val: v3, output: '(foo>=\\09bar)' } | ||
{ str: '(foo>=\\09bar)', type: 'GreaterThanEqualsFilter', val: v3, output: '(foo>=\\09bar)' } | ||
]) | ||
@@ -181,18 +181,18 @@ }) | ||
{ str: '(foo<= )', type: 'le', val: v1, output: '(foo<= )' }, | ||
{ str: '(foo>= )', type: 'ge', val: v1, output: '(foo>= )' }, | ||
{ str: '(foo>= )', type: 'GreaterThanEqualsFilter', val: v1, output: '(foo>= )' }, | ||
{ str: '(foo=\\20)', type: 'EqualityFilter', val: v1, output: '(foo= )' }, | ||
{ str: '(foo<=\\20)', type: 'le', val: v1, output: '(foo<= )' }, | ||
{ str: '(foo>=\\20)', type: 'ge', val: v1, output: '(foo>= )' }, | ||
{ str: '(foo>=\\20)', type: 'GreaterThanEqualsFilter', val: v1, output: '(foo>= )' }, | ||
{ str: '(foo=bar )', type: 'EqualityFilter', val: v2, output: '(foo=bar )' }, | ||
{ str: '(foo<=bar )', type: 'le', val: v2, output: '(foo<=bar )' }, | ||
{ str: '(foo>=bar )', type: 'ge', val: v2, output: '(foo>=bar )' }, | ||
{ str: '(foo>=bar )', type: 'GreaterThanEqualsFilter', val: v2, output: '(foo>=bar )' }, | ||
{ str: '(foo=bar\\20)', type: 'EqualityFilter', val: v2, output: '(foo=bar )' }, | ||
{ str: '(foo<=bar\\20)', type: 'le', val: v2, output: '(foo<=bar )' }, | ||
{ str: '(foo>=bar\\20)', type: 'ge', val: v2, output: '(foo>=bar )' }, | ||
{ str: '(foo>=bar\\20)', type: 'GreaterThanEqualsFilter', val: v2, output: '(foo>=bar )' }, | ||
{ str: '(foo= bar)', type: 'EqualityFilter', val: v3, output: '(foo= bar)' }, | ||
{ str: '(foo<= bar)', type: 'le', val: v3, output: '(foo<= bar)' }, | ||
{ str: '(foo>= bar)', type: 'ge', val: v3, output: '(foo>= bar)' }, | ||
{ str: '(foo>= bar)', type: 'GreaterThanEqualsFilter', val: v3, output: '(foo>= bar)' }, | ||
{ str: '(foo=\\20bar)', type: 'EqualityFilter', val: v3, output: '(foo= bar)' }, | ||
{ str: '(foo<=\\20bar)', type: 'le', val: v3, output: '(foo<= bar)' }, | ||
{ str: '(foo>=\\20bar)', type: 'ge', val: v3, output: '(foo>= bar)' } | ||
{ str: '(foo>=\\20bar)', type: 'GreaterThanEqualsFilter', val: v3, output: '(foo>= bar)' } | ||
]) | ||
@@ -208,3 +208,3 @@ }) | ||
{ str: '(foo<=bar\\5c)', type: 'le', val: v1, output: '(foo<=bar\\5c)' }, | ||
{ str: '(foo>=bar\\5c)', type: 'ge', val: v1, output: '(foo>=bar\\5c)' }, | ||
{ str: '(foo>=bar\\5c)', type: 'GreaterThanEqualsFilter', val: v1, output: '(foo>=bar\\5c)' }, | ||
{ | ||
@@ -218,3 +218,3 @@ str: '(foo=\\5cbar\\5cbaz\\5c)', | ||
str: '(foo>=\\5cbar\\5cbaz\\5c)', | ||
type: 'ge', | ||
type: 'GreaterThanEqualsFilter', | ||
val: v2, | ||
@@ -231,3 +231,3 @@ output: '(foo>=\\5cbar\\5cbaz\\5c)' | ||
{ str: '(foo<=\\5c)', type: 'le', val: v3, output: '(foo<=\\5c)' }, | ||
{ str: '(foo>=\\5c)', type: 'ge', val: v3, output: '(foo>=\\5c)' } | ||
{ str: '(foo>=\\5c)', type: 'GreaterThanEqualsFilter', val: v3, output: '(foo>=\\5c)' } | ||
]) | ||
@@ -253,3 +253,3 @@ }) | ||
{ str: '(foo<=bar\\2a)', type: 'le', val: v1, output: '(foo<=bar\\2a)' }, | ||
{ str: '(foo>=bar\\2a)', type: 'ge', val: v1, output: '(foo>=bar\\2a)' }, | ||
{ str: '(foo>=bar\\2a)', type: 'GreaterThanEqualsFilter', val: v1, output: '(foo>=bar\\2a)' }, | ||
{ | ||
@@ -263,3 +263,3 @@ str: '(foo=\\2abar\\2abaz\\2a)', | ||
str: '(foo>=\\2abar\\2abaz\\2a)', | ||
type: 'ge', | ||
type: 'GreaterThanEqualsFilter', | ||
val: v2, | ||
@@ -276,3 +276,3 @@ output: '(foo>=\\2abar\\2abaz\\2a)' | ||
{ str: '(foo<=\\2a)', type: 'le', val: v3, output: '(foo<=\\2a)' }, | ||
{ str: '(foo>=\\2a)', type: 'ge', val: v3, output: '(foo>=\\2a)' } | ||
{ str: '(foo>=\\2a)', type: 'GreaterThanEqualsFilter', val: v3, output: '(foo>=\\2a)' } | ||
]) | ||
@@ -377,3 +377,3 @@ }) | ||
{ str: '(foo<=<=)', type: 'le', val: '<=', output: '(foo<=<=)' }, | ||
{ str: '(foo>=<=)', type: 'ge', val: '<=', output: '(foo>=<=)' }, | ||
{ str: '(foo>=<=)', type: 'GreaterThanEqualsFilter', val: '<=', output: '(foo>=<=)' }, | ||
{ | ||
@@ -393,3 +393,3 @@ str: '(foo=bar<=baz)', | ||
str: '(foo>=bar<=baz)', | ||
type: 'ge', | ||
type: 'GreaterThanEqualsFilter', | ||
val: 'bar<=baz', | ||
@@ -405,3 +405,3 @@ output: '(foo>=bar<=baz)' | ||
{ str: '(foo<=bar<=)', type: 'le', val: 'bar<=', output: '(foo<=bar<=)' }, | ||
{ str: '(foo>=bar<=)', type: 'ge', val: 'bar<=', output: '(foo>=bar<=)' } | ||
{ str: '(foo>=bar<=)', type: 'GreaterThanEqualsFilter', val: 'bar<=', output: '(foo>=bar<=)' } | ||
]) | ||
@@ -414,3 +414,3 @@ }) | ||
{ str: '(foo<=>=)', type: 'le', val: '>=', output: '(foo<=>=)' }, | ||
{ str: '(foo>=>=)', type: 'ge', val: '>=', output: '(foo>=>=)' }, | ||
{ str: '(foo>=>=)', type: 'GreaterThanEqualsFilter', val: '>=', output: '(foo>=>=)' }, | ||
{ | ||
@@ -430,3 +430,3 @@ str: '(foo=bar>=baz)', | ||
str: '(foo>=bar>=baz)', | ||
type: 'ge', | ||
type: 'GreaterThanEqualsFilter', | ||
val: 'bar>=baz', | ||
@@ -437,3 +437,3 @@ output: '(foo>=bar>=baz)' | ||
{ str: '(foo<=bar>=)', type: 'le', val: 'bar>=', output: '(foo<=bar>=)' }, | ||
{ str: '(foo>=bar>=)', type: 'ge', val: 'bar>=', output: '(foo>=bar>=)' } | ||
{ str: '(foo>=bar>=)', type: 'GreaterThanEqualsFilter', val: 'bar>=', output: '(foo>=bar>=)' } | ||
]) | ||
@@ -446,3 +446,3 @@ }) | ||
{ str: '(foo<=&)', type: 'le', val: '&', output: '(foo<=&)' }, | ||
{ str: '(foo>=&)', type: 'ge', val: '&', output: '(foo>=&)' }, | ||
{ str: '(foo>=&)', type: 'GreaterThanEqualsFilter', val: '&', output: '(foo>=&)' }, | ||
{ | ||
@@ -462,3 +462,3 @@ str: '(foo=bar&baz)', | ||
str: '(foo>=bar&baz)', | ||
type: 'ge', | ||
type: 'GreaterThanEqualsFilter', | ||
val: 'bar&baz', | ||
@@ -469,3 +469,3 @@ output: '(foo>=bar&baz)' | ||
{ str: '(foo<=bar&)', type: 'le', val: 'bar&', output: '(foo<=bar&)' }, | ||
{ str: '(foo>=bar&)', type: 'ge', val: 'bar&', output: '(foo>=bar&)' } | ||
{ str: '(foo>=bar&)', type: 'GreaterThanEqualsFilter', val: 'bar&', output: '(foo>=bar&)' } | ||
]) | ||
@@ -478,3 +478,3 @@ }) | ||
{ str: '(foo<=|)', type: 'le', val: '|', output: '(foo<=|)' }, | ||
{ str: '(foo>=|)', type: 'ge', val: '|', output: '(foo>=|)' }, | ||
{ str: '(foo>=|)', type: 'GreaterThanEqualsFilter', val: '|', output: '(foo>=|)' }, | ||
{ | ||
@@ -494,3 +494,3 @@ str: '(foo=bar|baz)', | ||
str: '(foo>=bar|baz)', | ||
type: 'ge', | ||
type: 'GreaterThanEqualsFilter', | ||
val: 'bar|baz', | ||
@@ -501,3 +501,3 @@ output: '(foo>=bar|baz)' | ||
{ str: '(foo<=bar|)', type: 'le', val: 'bar|', output: '(foo<=bar|)' }, | ||
{ str: '(foo>=bar|)', type: 'ge', val: 'bar|', output: '(foo>=bar|)' } | ||
{ str: '(foo>=bar|)', type: 'GreaterThanEqualsFilter', val: 'bar|', output: '(foo>=bar|)' } | ||
]) | ||
@@ -510,3 +510,3 @@ }) | ||
{ str: '(foo<=!)', type: 'le', val: '!', output: '(foo<=!)' }, | ||
{ str: '(foo>=!)', type: 'ge', val: '!', output: '(foo>=!)' }, | ||
{ str: '(foo>=!)', type: 'GreaterThanEqualsFilter', val: '!', output: '(foo>=!)' }, | ||
{ | ||
@@ -526,3 +526,3 @@ str: '(foo=bar!baz)', | ||
str: '(foo>=bar!baz)', | ||
type: 'ge', | ||
type: 'GreaterThanEqualsFilter', | ||
val: 'bar!baz', | ||
@@ -533,3 +533,3 @@ output: '(foo>=bar!baz)' | ||
{ str: '(foo<=bar!)', type: 'le', val: 'bar!', output: '(foo<=bar!)' }, | ||
{ str: '(foo>=bar!)', type: 'ge', val: 'bar!', output: '(foo>=bar!)' } | ||
{ str: '(foo>=bar!)', type: 'GreaterThanEqualsFilter', val: 'bar!', output: '(foo>=bar!)' } | ||
]) | ||
@@ -541,3 +541,3 @@ }) | ||
t.ok(f) | ||
t.equal(f.type, 'ge') | ||
t.equal(f.type, 'GreaterThanEqualsFilter') | ||
t.equal(f.attribute, 'foo') | ||
@@ -573,3 +573,3 @@ t.equal(f.value, '5') | ||
str: '(foo>=☕⛵ᄨ)', | ||
type: 'ge', | ||
type: 'GreaterThanEqualsFilter', | ||
val: '☕⛵ᄨ', | ||
@@ -592,3 +592,3 @@ output: '(foo>=\\e2\\98\\95\\e2\\9b\\b5\\e1\\84\\a8)' | ||
str: '(foo>=ᎢᏣᎵᏍᎠᏁᏗ)', | ||
type: 'ge', | ||
type: 'GreaterThanEqualsFilter', | ||
val: 'ᎢᏣᎵᏍᎠᏁᏗ', | ||
@@ -595,0 +595,0 @@ output: '(foo>=\\e1\\8e\\a2\\e1\\8f\\a3\\e1\\8e\\b5\\e1\\8f\\8d\\e1\\8e\\a0\\e1\\8f\\81\\e1\\8f\\97)' |
@@ -63,3 +63,3 @@ // Copyright 2014 Patrick Mooney. All rights reserved. | ||
t.equal(count, 3) | ||
t.same(order, ['EqualityFilter', 'ge', 'or']) | ||
t.same(order, ['EqualityFilter', 'GreaterThanEqualsFilter', 'or']) | ||
t.end() | ||
@@ -70,3 +70,3 @@ }) | ||
const f = filters.parse('(|(!(&(foo=bar)(num<=5)))(baz>=bip))') | ||
const correct = ['EqualityFilter', 'le', 'and', 'not', 'ge', 'or'] | ||
const correct = ['EqualityFilter', 'le', 'and', 'not', 'GreaterThanEqualsFilter', 'or'] | ||
const order = [] | ||
@@ -169,3 +169,3 @@ let count = 0 | ||
return null | ||
} else if (item.type === 'ge') { | ||
} else if (item.type === 'GreaterThanEqualsFilter') { | ||
item.value = '' + (parseInt(item.value, 10) + 1) | ||
@@ -172,0 +172,0 @@ } |
@@ -10,3 +10,3 @@ { | ||
"description": "API for handling LDAP-style filters", | ||
"version": "1.0.0-rc.5", | ||
"version": "1.0.0-rc.6", | ||
"license": "MIT", | ||
@@ -13,0 +13,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115045
3718