Skip to content
View themaiby's full-sized avatar

Organizations

@HorizonRepublic

Block or report themaiby

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse

Pinned Loading

  1. nominal-types nominal-types Public

    Nominal Types is a TypeScript library for creating strongly typed values, ensuring type safety and reducing programming errors.

    TypeScript 6

  2. Make query params serialization be l... Make query params serialization be like filter[createdBy]=10&filter[name]=John for @nestjs/swagger
    1
    export const ApiNestedQuery = <TQuery extends Type>(query: TQuery) => {
    2
      const constructor = query.prototype;
    3
      const properties = Reflect.getMetadata('swagger/apiModelPropertiesArray', constructor).map((prop) => prop.substr(1));
    4
    
                  
    5
      const decorators = properties
  3. NestJS Filters with Swagger deepObje... NestJS Filters with Swagger deepObject (example: `?filters[name]=thing1&filters[description]=thing2`)
    1
    import { applyDecorators } from '@nestjs/common';
    2
    import { ApiExtraModels, ApiQuery, getSchemaPath } from '@nestjs/swagger';
    3
    
                  
    4
    /**
    5
     * Combines Swagger Decorators to create a description for `filters[name]=something`
  4. Calculate entity page depends on ID,... Calculate entity page depends on ID, filters and sorting of all table for MySql < 8
    1
    SET @per_page = 10;
    2
    SET @entity_id = 51;
    3
    
                  
    4
    SELECT FLOOR((rowNumbers.serialRow - 1) / @per_page) + 1 AS pageNumber
    5
    FROM (
  5. Automatically name swagger operation... Automatically name swagger operation for generator in @nestjs/swagger
    1
    export function AutoOperationName(): ClassDecorator {
    2
      return (target: any) => {
    3
        for (const key of Object.getOwnPropertyNames(target.prototype)) {
    4
          let descriptor = Object.getOwnPropertyDescriptor(target.prototype, key);
    5
          if (descriptor) {
  6. @nestjs/swagger wrapped responses @nestjs/swagger wrapped responses
    1
    export const ApiOkCollectionResponse = <TModel extends Type>(model: TModel, status: HttpStatus = HttpStatus.OK) => {
    2
      return applyDecorators(
    3
        ApiExtraModels(PaginationMeta, model),
    4
        ApiOkResponse({
    5
          status,