
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@comodinx/query-filters
Advanced tools
@comodinx/query-filters is a module for parsing filters in string to object.
@comodinx/query-filters is a module for parsing filters in string to object.
$ npm install @comodinx/query-filters
$ git clone https://github.com/comodinx/query-filters.git
$ cd query-filters
$ npm install
const { Parser } = require('@comodinx/query-filters');
const parser = new Parser();
parser.parse('active eq 1,description li %casa');
// { "active": { "eq": "1" }, "description": { "li": "%casa" } }
parser.parse('active eq 1,description li %casa,description eq depto');
// { "active": { "eq": "1" }, "description": { "li": "%casa", "eq": "depto" } }
,active eq 1,description li %casa
|active eq 1|description li %casa
( and )active eq 1,(description li %casa|description eq depto)
AND has higher precedence than ORactive eq 1,description li %casa|age ge 18
active eq 1,(description li %casa|age ge 18)
parser.parse('active eq 1,(deleted_at is null|age ge 18)');
/*
{
active: { eq: 1 },
or: [
{ deleted_at: { is: 'null' } },
{ age: { ge: 18 } }
]
}
*/
| Name | Example | Description |
|---|---|---|
| eq | id eq 1 | Check equality. id = 1 |
| ne | name ne nico | Check inequality. name != 'nico' |
| gt | id gt 1 | Check greater than. id > 1 |
| ge | id ge 10 | Check greater than or equal. id >= 10 |
| lt | id lt 1 | Check less than. id < 1 |
| le | id le 10 | Check less than or equal. id <= 10 |
| li | name li nico% | Check matches with nico*. name like nico% |
| nl | name nl nico% | Check not matches with nico*. name not like nico% |
| in | id in [1;2;3] | Check if included on [1,2,3]. id in (1,2,3) |
| ni | id ni [1;2;3] | Check if not included on [1,2,3]. id not in (1,2,3) |
| be | id be [1;10] | Check if it is between a and b. id between (1 and 10) |
| nb | id nb [1;10] | Check if it is not between a and b. id not between (1 and 10) |
| is | deleted_at is null | Check if it is null. |
| no | deleted_at is not null | Check if it is not null. |
| Name | Type | Default | Description |
|---|---|---|---|
| logicals | object | `{ or: ' | ', and: ',' }` |
| key | string | "[A-Za-z0-9_]+" | RegExp string for matching keys. |
| value | string | ".+" | RegExp string for matching values. |
| operators | array | ['eq','ne','gt','ge','lt','le','li','nl','in','ni','be','nb','is','no'] | |
| operatorPrefix | string | " " | Operator prefix. |
| operatorSuffix | string | " " | Operator suffix. |
| operatorFlags | string | "i" | Operator regexp flag. |
| separatorGroups | string | ";" | List values separator. |
| groups | object | { start: '(', end: ')' } | Conditions group delimiters. |
const parser = new Parser();
parser.format({
active: { eq: 1 },
description: { li: '%casa' },
or: [
{ deleted_at: { is: 'null' } },
{ age: { ge: 18 } }
]
});
// "active eq 1,description li %casa,(deleted_at is null|age ge 18)"
In order to see more concrete examples, I INVITE YOU TO LOOK AT THE TESTS :)
npm install
npm test
FAQs
@comodinx/query-filters is a module for parsing filters in string to object.
The npm package @comodinx/query-filters receives a total of 45 weekly downloads. As such, @comodinx/query-filters popularity was classified as not popular.
We found that @comodinx/query-filters demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.