Socket
Socket
Sign inDemoInstall

@nodeteam/nestjs-pipes

Package Overview
Dependencies
478
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.3 to 1.2.0

test/helpers/parse-object-literal.spec.ts

3

.eslintrc.json
{
"env": {
"es2021": true,
"node": true
"node": true,
"jest": true,
},

@@ -6,0 +7,0 @@ "extends": [

{
"name": "@nodeteam/nestjs-pipes",
"version": "1.1.3",
"version": "1.2.0",
"description": "Pipes collection for Nest.JS app",
"main": "./dist/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "jest",
"test:watch": "jest --watch"
},

@@ -25,2 +26,4 @@ "repository": {

"devDependencies": {
"@jest/globals": "^29.4.2",
"@types/jest": "^29.4.0",
"@typescript-eslint/eslint-plugin": "^5.51.0",

@@ -35,2 +38,5 @@ "@typescript-eslint/parser": "^5.51.0",

"@nestjs/common": "^9.3.8",
"@nestjs/testing": "^9.3.8",
"jest": "^29.4.2",
"ts-jest": "^29.0.5",
"typescript": "^4.9.5"

@@ -42,3 +48,20 @@ },

}
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}

@@ -34,4 +34,8 @@ # Installation

**in** - `where=zipCode: in array(11111, 22222)`
**lt** - `where=age: lt int(12)`
**lt** - `where=age: lt int(12)`
**lte** - `where=age: lte int(12)`

@@ -75,2 +79,4 @@

**array** - `where=zipCode: in array(int(111111), int(222222))`
```typescript

@@ -77,0 +83,0 @@ @Query('where', WherePipe) where?: Pipes.Where

@@ -5,3 +5,3 @@ import { BadRequestException, Injectable, PipeTransform } from '@nestjs/common';

const parseValue = (ruleValue: string) => {
const parseStringTo = (ruleValue: string) => {
if (ruleValue.endsWith(')')) {

@@ -54,2 +54,17 @@ if (ruleValue.startsWith('int(')) {

};
const parseValue = (ruleValue: string) => {
if (ruleValue.startsWith('array(')) {
const validRegExec = /\(([^]+)\)/.exec(ruleValue);
if (validRegExec) {
return validRegExec[1]
.split(',')
.map((value) => parseStringTo(value));
}
}
return parseStringTo(ruleValue);
};
/**

@@ -84,2 +99,3 @@ * @description Convert a string like

'none',
'in'
].forEach((val) => {

@@ -86,0 +102,0 @@ if (rule[1].startsWith(`${val} `) && typeof ruleValue === 'string') {

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc