Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rapiq

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rapiq - npm Package Compare versions

Comparing version 0.2.8 to 0.2.9

2

package.json
{
"name": "rapiq",
"version": "0.2.8",
"version": "0.2.9",
"description": "A tiny library which provides utility types/functions for request and response query handling.",

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

@@ -241,4 +241,3 @@ # rapiq 🌈

import {
applyQueryParseOutput,
parseQuery,
applyQuery,
useDataSource

@@ -256,5 +255,10 @@ } from 'typeorm-extension';

export async function getUsers(req: Request, res: Response) {
// const {fields, filter, include, page, sort} = req.query;
const dataSource = await useDataSource();
const repository = dataSource.getRepository(User);
const query = repository.createQueryBuilder('user');
const output = parseQuery<User>(req.query, {
// -----------------------------------------------------
// parse and apply data on the db query.
const { pagination } = applyQuery(query, req.query, {
defaultPath: 'user',

@@ -278,13 +282,4 @@ fields: {

const dataSource = await useDataSource();
const repository = dataSource.getRepository(User);
const query = repository.createQueryBuilder('user');
// -----------------------------------------------------
// apply parsed data on the db query.
const parsed = applyQueryParseOutput(query, output);
// -----------------------------------------------------
const [entities, total] = await query.getManyAndCount();

@@ -297,3 +292,3 @@

total,
...output.pagination
...pagination
}

@@ -300,0 +295,0 @@ }

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