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 { INestApplication } from '@nestjs/common'; | |
import { DocumentBuilder, OpenAPIObject, SwaggerModule } from '@nestjs/swagger'; | |
import { SWAGGER_CONFIG } from './swagger.config'; | |
export function createDocument(app: INestApplication): OpenAPIObject { | |
const builder = new DocumentBuilder() | |
.setTitle(SWAGGER_CONFIG.title) | |
.setDescription(SWAGGER_CONFIG.description) |
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
// .eslint.js=> | |
module.exports = { | |
parser: '@typescript-eslint/parser', | |
overrides: [ | |
{ | |
files: ['*.ts', '*.tsx'], // Your TypeScript files extension | |
parserOptions: { | |
project: ['./tsconfig.json'], // Specify it only for TypeScript files | |
}, | |
} |
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 { mergeTypes, mergeResolvers } from "merge-graphql-schemas"; | |
import * as path from "path"; | |
import * as fs from "fs"; | |
import { makeExecutableSchema } from "graphql-tools"; | |
import * as glob from "glob"; | |
export const useSchema = () => { | |
const pathToModules = path.join(__dirname); | |
const graphqlTypes = glob |
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
function sortedSquares(nums: number[]=[-4,-5,0,1,2]): number[] { | |
let left =0 | |
let right=nums.length-1; | |
let arr= new Array(nums.length).fill(0) | |
for(let i=0;i<nums.length;i++){ | |
if(Math.abs (nums[left])>Math.abs (nums[right])){ | |
arr[i]=nums[left]*nums[left] ; | |
left++ |
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
function arrayReplace(inputArray: number[], elemToReplace: number, substitutionElem: number): number[] { | |
let arr:number[]=[] | |
let count=inputArray.filter(x=>x===elemToReplace).length | |
if(count<1){ | |
return inputArray | |
} | |
for(let i=0;i<inputArray.length ;i++){ |
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
function insert(intervals: number[][], newInterval: number[]): number[][] { | |
let i = 0; | |
while (i < intervals.length) { | |
const [a, b] = intervals[i]; | |
const [c, d] = newInterval; | |
if ( | |
(a >= c && a <= d) || | |
(b >= c && b <= d) || | |
(c >= a && c <= 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
function numberSigningSums(num:number =5555531):any{ | |
let arr=[...String(num)].map(x=>Number(x)) | |
if(arr.length<2){ | |
return arr[0] | |
} | |
let sum=0 | |
for(let i=0;i<arr.length;i+=2){ |
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 FuseScrollbars from '@fuse/core/FuseScrollbars'; | |
import Avatar from '@material-ui/core/Avatar'; | |
import Icon from '@material-ui/core/Icon'; | |
import Paper from '@material-ui/core/Paper'; | |
import { makeStyles } from '@material-ui/core/styles'; | |
import Typography from '@material-ui/core/Typography'; | |
import clsx from 'clsx'; | |
import moment from 'moment/moment'; | |
import React, { useEffect, useRef, useState } from 'react'; | |
import { useDispatch, useSelector } from 'react-redux'; |
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 Operation="+"|"-"|"*"|"/" | |
function calcalater(a:Array<number>=[1,2,3],b:Array<number>=[5,2,3],operation:Operation='-'){ | |
let len=a.length>=b.length?a.length:b.length | |
let res:Array<number>=[] | |
for(let i=0;i<len;i++){ | |
let first | |
let secand | |
if(operation==='+' ||operation==="-"){ |
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
// call by value when you are used any the prmitive type like | |
// number ,string ,boolean ,undefined ,null like | |
// are always assigned/passed by | |
// value-copy: null, undefined, string, number, boolean, and ES6’s symbol. | |
// - First: Pass by value example | |
// some hint | |
// The original variable is not modified on changes in other variables. | |
let x=10; |