Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@dialexa/pleco-joi
Advanced tools
The Joi validation schemas provide additional protection around what the user inputs.
filterQuerySchema
: a function that returns the schema pertaining to the IFilterQuery
typescript type or the FilterQuery_*
GraphQL type.
The rules for filters are:
import { filterQuerySchema } from '@dialexa/pleco-joi';
import Joi from 'joi';
const vehicleFilterSchema = Joi.object().keys({
AND: Joi.array().items(Joi.lazy(() => vehicleFilterSchema)),
OR: Joi.array().items(Joi.lazy(() => vehicleFilterSchema)),
make: filterQuerySchema('String', Joi.string()),
model: filterQuerySchema('String', Joi.string()),
// We can define any Joi schema
numberOfUsers: filterQuerySchema('Int', Joi.number().integer().min(0)),
highwayMPG: filterQuerySchema('Int', Joi.number().integer().min(0)),
cityMPG: filterQuerySchema('Int', Joi.number().integer().min(0)),
userSurveyRating: filterQUerySchema('Float', Joi.number().min(0).max(100)),
});
sortDirectionSchema
: validates that the argument to a sort operation is 'ASC' or 'DESC' (case insensitive).
Validating against this schema will also automatically convert the input to uppercase.
import { sortDirectionSchema } from '@dialexa/pleco-joi';
import Joi from 'joi';
const vehicleSortSchemaKeys = {
numberOfUsers: sortDirectionSchema,
userSurveyRating: sortDirectionSchema,
};
const vehicleSortSchema = Joi.object().keys(vehicleSortSchemaKeys).oxor(Object.keys(vehicleSortSchemaKeys));
limitOffsetPageSchema
: validates that an object containing optional limit
and offset
are non-negative integers
FAQs
# Pleco Joi
The npm package @dialexa/pleco-joi receives a total of 1 weekly downloads. As such, @dialexa/pleco-joi popularity was classified as not popular.
We found that @dialexa/pleco-joi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.