- Kyiv, Ukraine
Pinned Loading
-
nominal-types
nominal-types PublicNominal Types is a TypeScript library for creating strongly typed values, ensuring type safety and reducing programming errors.
TypeScript 6
-
Make query params serialization be l...
Make query params serialization be like filter[createdBy]=10&filter[name]=John for @nestjs/swagger 1export const ApiNestedQuery = <TQuery extends Type>(query: TQuery) => {
2const constructor = query.prototype;
3const properties = Reflect.getMetadata('swagger/apiModelPropertiesArray', constructor).map((prop) => prop.substr(1));
45const decorators = properties
-
NestJS Filters with Swagger deepObje...
NestJS Filters with Swagger deepObject (example: `?filters[name]=thing1&filters[description]=thing2`) 1import { applyDecorators } from '@nestjs/common';
2import { ApiExtraModels, ApiQuery, getSchemaPath } from '@nestjs/swagger';
34/**
5* Combines Swagger Decorators to create a description for `filters[name]=something`
-
Calculate entity page depends on ID,...
Calculate entity page depends on ID, filters and sorting of all table for MySql < 8 1SET @per_page = 10;
2SET @entity_id = 51;
34SELECT FLOOR((rowNumbers.serialRow - 1) / @per_page) + 1 AS pageNumber
5FROM (
-
Automatically name swagger operation...
Automatically name swagger operation for generator in @nestjs/swagger 1export function AutoOperationName(): ClassDecorator {
2return (target: any) => {
3for (const key of Object.getOwnPropertyNames(target.prototype)) {
4let descriptor = Object.getOwnPropertyDescriptor(target.prototype, key);
5if (descriptor) {
-
@nestjs/swagger wrapped responses
@nestjs/swagger wrapped responses 1export const ApiOkCollectionResponse = <TModel extends Type>(model: TModel, status: HttpStatus = HttpStatus.OK) => {
2return applyDecorators(
3ApiExtraModels(PaginationMeta, model),
4ApiOkResponse({
5status,
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.