@ldapjs/filter
Advanced tools
Comparing version 1.0.0-rc.9 to 1.0.0-rc.10
@@ -54,2 +54,6 @@ 'use strict' | ||
get [Symbol.toStringTag] () { | ||
return 'FilterString' | ||
} | ||
/** | ||
@@ -56,0 +60,0 @@ * String or Buffer representing the righthand side of the filter string. |
@@ -13,2 +13,3 @@ 'use strict' | ||
t.equal(f.toString(), '()') | ||
t.equal(Object.prototype.toString.call(f), '[object FilterString]') | ||
}) | ||
@@ -15,0 +16,0 @@ |
@@ -15,2 +15,3 @@ 'use strict' | ||
t.ok(f) | ||
t.equal(Object.prototype.toString.call(f), '[object FilterString]') | ||
t.equal(f.toString(), '(&(foo=bar)(zig=zag))') | ||
@@ -17,0 +18,0 @@ t.same(f.json, { |
@@ -35,2 +35,3 @@ 'use strict' | ||
t.ok(f) | ||
t.equal(Object.prototype.toString.call(f), '[object FilterString]') | ||
t.equal(f.attribute, 'foo') | ||
@@ -37,0 +38,0 @@ t.equal(f.value, 'bar') |
@@ -25,2 +25,3 @@ 'use strict' | ||
t.ok(f) | ||
t.equal(Object.prototype.toString.call(f), '[object FilterString]') | ||
t.equal(f.TAG, search.FILTER_EQUALITY) | ||
@@ -27,0 +28,0 @@ t.equal(f.attribute, 'foo') |
@@ -6,3 +6,3 @@ 'use strict' | ||
const ExtensibleFilter = require('./extensible') | ||
const { parse } = require('../index') | ||
const { parseString } = require('../index') | ||
@@ -34,2 +34,3 @@ tap.test('constructor', t => { | ||
t.ok(f) | ||
t.equal(Object.prototype.toString.call(f), '[object FilterString]') | ||
t.equal(f.matchType, 'foo') | ||
@@ -85,3 +86,3 @@ t.equal(f.value, 'bar') | ||
tap.test('attribute synonym', async t => { | ||
const f = parse('foo:=bar') | ||
const f = parseString('foo:=bar') | ||
t.equal(f.matchType, 'foo') | ||
@@ -88,0 +89,0 @@ t.equal(f.attribute, 'foo') |
@@ -35,2 +35,3 @@ 'use strict' | ||
t.ok(f) | ||
t.equal(Object.prototype.toString.call(f), '[object FilterString]') | ||
t.equal(f.attribute, 'foo') | ||
@@ -37,0 +38,0 @@ t.equal(f.value, 'bar') |
@@ -35,2 +35,3 @@ 'use strict' | ||
t.ok(f) | ||
t.equal(Object.prototype.toString.call(f), '[object FilterString]') | ||
t.equal(f.attribute, 'foo') | ||
@@ -37,0 +38,0 @@ t.equal(f.value, 'bar') |
@@ -17,2 +17,3 @@ 'use strict' | ||
t.ok(f) | ||
t.equal(Object.prototype.toString.call(f), '[object FilterString]') | ||
t.equal(f.type, 'NotFilter') | ||
@@ -19,0 +20,0 @@ t.equal(f.toString(), '(!(foo=bar))') |
@@ -15,2 +15,3 @@ 'use strict' | ||
t.ok(f) | ||
t.equal(Object.prototype.toString.call(f), '[object FilterString]') | ||
t.equal(f.toString(), '(|(foo=bar)(zig=zag))') | ||
@@ -17,0 +18,0 @@ }) |
@@ -17,2 +17,3 @@ 'use strict' | ||
t.ok(f) | ||
t.equal(Object.prototype.toString.call(f), '[object FilterString]') | ||
t.equal(f.TAG, search.FILTER_PRESENT) | ||
@@ -19,0 +20,0 @@ t.equal(f.type, 'PresenceFilter') |
@@ -15,2 +15,3 @@ 'use strict' | ||
t.ok(f) | ||
t.equal(Object.prototype.toString.call(f), '[object FilterString]') | ||
t.equal(f.attribute, 'foo') | ||
@@ -17,0 +18,0 @@ t.equal(f.subInitial, 'bar') |
@@ -18,5 +18,17 @@ 'use strict' | ||
const deprecations = require('./deprecations') | ||
const parseString = require('./string-parsing/parse-string') | ||
module.exports = { | ||
parse: require('./parsing/parse-string'), | ||
parseBer: require('./ber-parsing'), | ||
/** | ||
* @deprecated 2022-06-26 Use `parseString` instead. | ||
*/ | ||
parse: (string) => { | ||
deprecations.emit('LDAP_FILTER_DEP_001') | ||
return parseString(string) | ||
}, | ||
parseString, | ||
// Helper utilties for writing custom matchers | ||
@@ -23,0 +35,0 @@ testValues, |
@@ -9,3 +9,3 @@ // Copyright 2014 Patrick Mooney. All rights reserved. | ||
test('foreach single', function (t) { | ||
const f = filters.parse('(foo=bar)') | ||
const f = filters.parseString('(foo=bar)') | ||
let count = 0 | ||
@@ -22,3 +22,3 @@ f.forEach(function (item) { | ||
test('foreach not', function (t) { | ||
const f = filters.parse('(!(foo=bar))') | ||
const f = filters.parseString('(!(foo=bar))') | ||
const order = [] | ||
@@ -41,3 +41,3 @@ let count = 0 | ||
test('foreach multiple', function (t) { | ||
const f = filters.parse('(|(foo=bar)(baz>=bip))') | ||
const f = filters.parseString('(|(foo=bar)(baz>=bip))') | ||
const order = [] | ||
@@ -71,3 +71,3 @@ let count = 0 | ||
test('foreach complex', function (t) { | ||
const f = filters.parse('(|(!(&(foo=bar)(num<=5)))(baz>=bip))') | ||
const f = filters.parseString('(|(!(&(foo=bar)(num<=5)))(baz>=bip))') | ||
const correct = ['EqualityFilter', 'LessThanEqualsFilter', 'AndFilter', 'NotFilter', 'GreaterThanEqualsFilter', 'OrFilter'] | ||
@@ -87,3 +87,3 @@ const order = [] | ||
test('map single valid', function (t) { | ||
const f = filters.parse('(foo=bar)') | ||
const f = filters.parseString('(foo=bar)') | ||
const n = f.map(function (item) { | ||
@@ -99,3 +99,3 @@ item.value = 'new' | ||
test('map single null', function (t) { | ||
const f = filters.parse('(foo=bar)') | ||
const f = filters.parseString('(foo=bar)') | ||
const n = f.map(function (item) { | ||
@@ -109,3 +109,3 @@ return null | ||
test('map not valid', function (t) { | ||
const f = filters.parse('(!(foo=bar))') | ||
const f = filters.parseString('(!(foo=bar))') | ||
f.map(function (item) { | ||
@@ -122,3 +122,3 @@ if (item.attribute) { | ||
test('map not null', function (t) { | ||
const f = filters.parse('(!(foo=bar))') | ||
const f = filters.parseString('(!(foo=bar))') | ||
const n = f.map(function (item) { | ||
@@ -135,3 +135,3 @@ if (item.attribute) { | ||
test('map multiple', function (t) { | ||
const f = filters.parse('(|(foo=1)(bar=2))') | ||
const f = filters.parseString('(|(foo=1)(bar=2))') | ||
const n = f.map(function (item) { | ||
@@ -148,3 +148,3 @@ if (item.attribute) { | ||
test('map multiple some-null', function (t) { | ||
const f = filters.parse('(|(foo=1)(bar=2))') | ||
const f = filters.parseString('(|(foo=1)(bar=2))') | ||
const n = f.map(function (item) { | ||
@@ -161,3 +161,3 @@ if (item.attribute && item.attribute === 'foo') { | ||
test('map multiple all-null', function (t) { | ||
const f = filters.parse('(|(foo=1)(bar=2))') | ||
const f = filters.parseString('(|(foo=1)(bar=2))') | ||
const n = f.map(function (item) { | ||
@@ -174,3 +174,3 @@ if (item.attribute) { | ||
test('map complex', function (t) { | ||
const f = filters.parse('(|(bad=foo)(num>=1)(!(bad=bar))(&(ok=foo)(good=bar)))') | ||
const f = filters.parseString('(|(bad=foo)(num>=1)(!(bad=bar))(&(ok=foo)(good=bar)))') | ||
const n = f.map(function (item) { | ||
@@ -177,0 +177,0 @@ if (item.attribute && item.attribute === 'bad') { |
@@ -10,3 +10,3 @@ { | ||
"description": "API for handling LDAP-style filters", | ||
"version": "1.0.0-rc.9", | ||
"version": "1.0.0-rc.10", | ||
"license": "MIT", | ||
@@ -22,4 +22,5 @@ "repository": { | ||
"dependencies": { | ||
"@ldapjs/asn1": "1.2.0-rc.2", | ||
"@ldapjs/protocol": "^1.1.0" | ||
"@ldapjs/asn1": "1.2.0-rc.3", | ||
"@ldapjs/protocol": "^1.1.0", | ||
"process-warning": "^2.0.0" | ||
}, | ||
@@ -26,0 +27,0 @@ "devDependencies": { |
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
153935
52
4579
3
+ Addedprocess-warning@^2.0.0
+ Added@ldapjs/asn1@1.2.0-rc.3(transitive)
+ Addedprocess-warning@2.3.2(transitive)
- Removed@ldapjs/asn1@1.2.0-rc.2(transitive)
Updated@ldapjs/asn1@1.2.0-rc.3