A Pen by Nikolay Debroh on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const isArray = Array.isArray; | |
| const keyList = Object.keys; | |
| const hasProp = Object.prototype.hasOwnProperty; | |
| export const isDeeplyEqual = <T = any>(a: T, b: T): boolean => { | |
| if (a === b) return true; | |
| if (typeof a === 'function' && typeof b === 'function') return true; | |
| if (!a || !b || typeof a !== 'object' || typeof b !== 'object') | |
| return a !== a && b !== b; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // app/modules/authentication/authentication.controller.ts | |
| import { Body, Controller, Post } from '@nestjs/common' | |
| import { RegisterRequest } from './requests' | |
| import { User } from '../../modules/user' | |
| import { UsersService } from '../users/users.service' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Inspirado en el video de Bettatech https://www.youtube.com/watch?v=K--Lmy8qUCQ | |
| // Esta es mi propia solución sobre una máquina de estado pero eliminando los posibles problemas referentes al consumo de memoria | |
| interface DisconnectSocket { | |
| connect(): ConnectSocket; | |
| } | |
| interface ConnectSocket { | |
| emit(event: string): void; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Options = { | |
| page: number | |
| perPage: number | |
| } | |
| export class Paginator { | |
| private page: number | |
| private perPage: number | |
| constructor(readonly options: Options) { | |
| Object.assign(this, options) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * npm install axios dotenv ngrok | |
| * or | |
| * yarn add axios dotenv ngrok | |
| */ | |
| import axios from 'axios' | |
| import dotenv from 'dotenv' | |
| import ngrok from 'ngrok' | |
| dotenv.config() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import axios, { InternalAxiosRequestConfig } from 'axios' | |
| type MockData = { | |
| [x: string]: any | |
| } | |
| class MockError extends Error { | |
| mockData?: MockData | |
| config?: InternalAxiosRequestConfig<any> | |
| code?: number |
NewerOlder