Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
boosterfilters
Advanced tools
BoostFilters is a JavaScript package that generates Sequelize filters from a provided dictionary. It supports a wide range of filter types, including full-text search, greater than, less than, equals, and more.
Install BoostFilters via npm:
npm install boostfilters
or via yarn:
yarn add boostfilters
First, import the generateFilterConditions function from the boostfilters package:
import { generateFilterConditions } from "boostfilters";
you can use it to build Sequelize queries:
const filters = {
"name.fulltext": "John Doe",
"age.greaterThan": 30,
"createdAt.range": ["2022-01-01", "2023-01-01"],
};
const sequelizeFilters = generateFilterConditions(filters);
// Use `sequelizeFilters` in your Sequelize queries
In this example, sequelizeFilters will be an object suitable for use in a Sequelize where clause.
Query Types The generateFilterConditions function supports a variety of query types:
The keys of the query object should be the name of the field you want to query on, followed by a period and the type of the query. Here's a brief overview of each type:
fieldName.fulltext
: Performs a "LIKE" search on fieldName. Matches any records where fieldName contains the provided value.
fieldName.equals
: Matches any records where fieldName is exactly equal to the provided value.
fieldName.greaterThan
: Matches any records where fieldName is greater than the provided value.
fieldName.lessThan
: Matches any records where fieldName is less than the provided value.
fieldName.range
: Matches any records where fieldName is within the provided range. The value for this query type should be an array with two elements: the start of the range and the end of the range.
fieldName.between
: Matches any records where fieldName is between the two provided values.
fieldName.lessThanOrEqual
: Matches any records where fieldName is less than or equal to the provided value.
fieldName.greaterThanOrEqual
: Matches any records where fieldName is greater than or equal to the provided value.
You can also query associated tables by using the name of the associated table as a prefix to the field name, separated by a period. For example, to query the name field on an associated users
table entries, you would use the key users.name.fulltext
.
FAQs
Sequalize filter DSL
The npm package boosterfilters receives a total of 1 weekly downloads. As such, boosterfilters popularity was classified as not popular.
We found that boosterfilters demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.