Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
continue;
}
//subString
if(operator === 'like'){
var or = []
for(var v = 0; v < value.length; v++){
or.push(new ldap.SubstringFilter({
attribute: name,
any: [value[v]]
}))
}
if(or.length > 0){
tmp.addFilter(new ldap.OrFilter({filters: or}));
}
continue;
}
}else{
var query = conditions[i].query;
var args = conditions[i].args;
//TODO: put args into query
var custom = ldap.parseFilter(query);
if(conditions.length === 1){
operator.filter = custom;
}else{
tmp.addFilter(custom);
function(attr, value, options) {
options.filter.filters.push(
new ldap.OrFilter({
filters: [
new ldap.LessThanEqualsFilter({
attribute: attr,
value: value.toString()
}),
new ldap.NotPresenceFilter({ attribute: attr })
]
})
)
},
{
if(BASIC_FILTERS[operator]){
var or = []
for(var v = 0; v < value.length; v++){
or.push(new BASIC_FILTERS[operator]({
attribute: name,
value: value[v] ? value[v].toString() : null,
original: value[v]
}))
}
if(or.length > 0){
filter = or[0];
if(or.length > 1){
filter = new ldap.OrFilter({filters: or});
}
if(NOT_OPERATORS.indexOf(operator) != -1){
filter = new ldap.NotFilter({filter:filter});
}
tmp.addFilter(filter);
}
continue;
}
//subString
if(operator === 'like'){
var or = []
for(var v = 0; v < value.length; v++){