New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bitovi/sequelize-querystring-parser

Package Overview
Dependencies
Maintainers
15
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bitovi/sequelize-querystring-parser - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

6

helpers/validation.js

@@ -1,3 +0,3 @@

function isNotValidInteger(number) {
return !Number.isInteger(number) || number < 1;
function isValidInteger(number, min) {
return Number.isInteger(number) && number >= min;
}

@@ -17,5 +17,5 @@

module.exports = {
isNotValidInteger,
isValidInteger,
isObject,
removeHashFromString,
};

@@ -1,2 +0,2 @@

const { isNotValidInteger, isObject } = require("../helpers/validation");
const { isValidInteger, isObject } = require("../helpers/validation");

@@ -16,3 +16,3 @@ function parsePagination(page, pageErrors) {

limit = limit ?? 10;
if (isNotValidInteger(offset) || isNotValidInteger(limit)) {
if (!isValidInteger(offset, 0) || !isValidInteger(limit, 1)) {
errors.push(

@@ -29,3 +29,3 @@ "page[offset] should be non-negative integer and page[limit] should be positive integer",

size = size ?? 10;
if (isNotValidInteger(number) || isNotValidInteger(size)) {
if (!isValidInteger(number, 1) || !isValidInteger(size, 1)) {
errors.push("page[number] and page[size] should be positive integers");

@@ -32,0 +32,0 @@ } else {

{
"name": "@bitovi/sequelize-querystring-parser",
"version": "0.3.2",
"version": "0.3.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -180,6 +180,6 @@ const parsePage = require("../lib/parse-page");

title: "should return valid results for valid parameters",
parameters: [{ offset: 3, limit: 5 }, []],
parameters: [{ offset: 0, limit: 5 }, []],
expectedResults: {
results: {
offset: 3,
offset: 0,
limit: 5,

@@ -186,0 +186,0 @@ subQuery: false,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc