Datasets:

blob_id
large_stringlengths
40
40
language
large_stringclasses
1 value
repo_name
large_stringlengths
5
119
path
large_stringlengths
4
271
score
float64
2.52
4.84
int_score
int64
3
5
text
stringlengths
26
4.09M
ed1489a12f28f9d19ed2a90a3553a76b35129246
TypeScript
ithiris/Training
/typescript-promise/promisetest.ts
3.03125
3
/** * Created by ithir on 01-03-2018. */ import PromiseAsync from '../typescript-promise/promiseasynchronus' class PromiseTest { constructor() { } database1() { return new PromiseAsync(function (resolve, reject) { let a:number = 5; let b:number = 25; set...
2fc6793ba9121e062dc5338716f60b676a171c71
TypeScript
Backbase/autoconfig-app
/src/app/types/notification.ts
2.78125
3
export enum NotificationType { ERROR, INFO, SUCCESS, WARNING } export interface Notification { id: number; message: string; type: NotificationType; }
72c98ef1d31bc4921c461b3ded46f69ec32a1bdd
TypeScript
thehig/autofilebot
/src/wrap/console.ts
2.71875
3
import chalk from "chalk"; const preamble = () => new Promise((resolve) => { console.log( chalk.magenta(`=====Autofilebot=====`) ); resolve(null); }); /** * Wrap a promise-generating function in some CLI-behavior */ export const ConsoleWrapper = (func: (...params: any[]) => Promise<any>) => ( ...
1bc973d8689d3f33481d9a167d4cdc9c0840f8b9
TypeScript
yedu-YK/node_express_mongo_crud_example
/src/controller/classController.ts
2.71875
3
//module for class controller import { Request, Response } from "express"; //importing class model // import Classes from "../model"; import Classes from "../model/classModel"; //async function to get all registered classes export const getAllClasses = async (req: Request, res: Response) => { console.log("get all...
8138387ad89380c09b35b3995aa98fb75487f093
TypeScript
Koquay/hsupp02
/src/app/cart/cart.service.ts
2.59375
3
import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { tap } from 'rxjs/operators'; import {of} from 'rxjs/observable/of'; import { Cart, CartSummary, Product } from '../shared/models/data-model'; import { ErrorService } from '../shared/error/error.service'; @Injectabl...
ada35284153c6da1dbca76e423907ec74541585c
TypeScript
xiongz945/chat-room-project
/src/controllers/earthquake.ts
2.515625
3
import { Request, Response, NextFunction } from 'express'; import { EarthquakeReport, IEarthquakeReportDocument, } from '../models/EarthquakeReport'; import { EarthquakePrediction } from '../models/EarthquakePrediction'; export const postEarthquakeReport = async ( req: Request, res: Response, next: NextFunc...
889fec903cbbe5849707993d87e9076c274ae841
TypeScript
IPVS-AS/MMP-Frontend
/src/app/timeout/timeout.component.ts
2.625
3
import {Subscription} from 'rxjs'; export class TimeoutComponent { timeout = false; TIMEOUT_TIME = 3000; number; waitForTimeOut(subscription: Subscription) { this.number = setTimeout(() => { subscription.unsubscribe(); this.timeout = true; }, this.TIMEOUT_TIME); } cancelTimeout() { ...
c75e3398d43f15e749ec0bae991c57a933f7b19f
TypeScript
ts-tooling/source-analyzer
/sample-source-1/sample-source.ts
2.578125
3
// root for sample source 1 - analysis starts from here import { SomeClassA } from './some-class-a'; import { SomeClassB } from "./some-class-b"; import { TestFunction1, TestFunction2 } from "./some-exports-1"; export class SampleSource { constructor( a: SomeClassA, b: SomeClassB ) {} tes...
ae67183265d1d3f255d3bec19e1d4b93d5c70d8b
TypeScript
vuepress-theme-hope/vuepress-theme-hope
/packages/theme/src/shared/frontmatter/projectHome.ts
2.90625
3
import type { ThemeHopePageFrontmatter } from "./home.js"; export interface ThemeProjectHomeActionOptions { /** * Action name * * 操作名称 */ text: string; /** * Action link * * 操作链接 */ link: string; /** * Type of action * * 操作类型 * * @default "default" */ type?: "pri...
97ce56c509ea6f1c595e1aa14edc8f6e9a959f90
TypeScript
weyoss/redis-smq
/tests/tests/consuming-messages/test00008.test.ts
2.609375
3
import { Message } from '../../../src/lib/message/message'; import { events } from '../../../src/common/events/events'; import { delay } from 'bluebird'; import { getConsumer } from '../../common/consumer'; import { getProducer } from '../../common/producer'; import { createQueue, defaultQueue, } from '../../common...
f13cf3bbabd2a3b9a15828f3e2a5fcb595285d1d
TypeScript
jsmack/learn
/old/language/typescript/udemy/developer/src/array.ts
3.546875
4
export {}; let numbers: number[] = [1, 2, 3]; console.log(numbers) // not recoomended // <> generics 型を抽象化 let numbers2: Array<number> = [1, 2, 3]; let strings2: Array<string> = ['Tokyo', 'Osaka', 'Kyoto']; let strings: string[] = ['Type', 'Java', 'Coffee']; let twodimensionalarray: number[][] = [ [50, 100], ...
acb58eb0d18d2d904b97efe31f9061bdd3e5a446
TypeScript
andrii-bo/NodeMent
/HW_4_1/src/utils.ts
2.671875
3
export enum lstCRUD { Create = "CREATE", Read = "READ", Update = "UPDATE", Delete = "DELETE", Clear = "CLEAR" } export interface iExecResult { code?: number; message?: string; stack?: string; request?: string; result?: any; } export function retResult( result?: any, code: num...
9361609b410a5ed4cd337f3fd2de43ceb52f58e8
TypeScript
nxttx/ReactNative---Runconnect_App
/src/core/mapper/SegmentMapper.ts
3.265625
3
import SegmentResponseDTO from '../dto/SegmentResponseDTO'; import {Segment} from '../domain/Segment'; import {SegmentDTO} from '../dto/SegmentDTO'; export class SegmentMapper { /** * Maps a single Segment DTO to a domain. * @param {SegmentResponseDTO} DTO * @returns {Segment} */ static toDomain(DTO: S...
d8a017f09aad87f5624dcae29bf266bccf753c81
TypeScript
lovefishs/leetcode
/src/javascript/intersectionOfTwoLinkedLists/iterative.ts
3.734375
4
/* 解这道题之前,我们需要首先明确一个概念: 如果两个单链表有共同的节点,那么从第一个共同节点开始,后面的节点都会重叠,直到链表结束。 这个概念很重要, 千万不要与 数组 互为混淆!!! 解题思路: 1. 遍历数组得到两个链表的长度差及长短链表 2. 遍历长链表消除长度差, 然后长短链表节点做等式判断, 如果相等则相交, 否则不相交 */ import SinglyLinkedListNode from '../struct/SinglyLinkedListNode' const iterative = (headA: SinglyLinkedListNode, headB: SinglyLinkedListNode): nu...
9e0eb218ce5e5be3a8821e2e763b5aa729932f83
TypeScript
toyobayashi/vuemodel
/src/util.ts
2.921875
3
import type { Store } from './Store' import type { IAction, IMutation, ISubscriberEvent } from './types' // eslint-disable-next-line @typescript-eslint/no-invalid-void-type export function forEach<T> (arr: T[], fn: (value: T, index: number, self: T[]) => void | 'break'): void { for (let i = 0; i < arr.length; i++) {...
fb937cf5726a8fb9fc1b85feb163830392d81956
TypeScript
mamazu/p5-projects
/Crossword Puzzle/sketch/CrosswordPuzzleFactory.ts
3.515625
4
class CrosswordPuzzleFactory { private readonly wordList: WordToGuess[]; constructor(wordList: string[], optimized?: boolean) { this.wordList = []; for (let wordString of wordList) { let word = this.parseWord(wordString) if (word !== undefined) { this.wordList.push(word); } } if(optimized === t...
ee528ba196e6efbc872b81aa736795313b16caed
TypeScript
elbernante/cs572-store-app
/src/app/cart/cart.ts
3.0625
3
import { Product } from '../product'; export class LineItem { constructor ( public product: Product, public quantity: number = 0 ) {} } export class Cart { items: LineItem[] = []; size: number = 0; addItem(product: Product): LineItem { if (!product) return null; let lineItem : LineItem...
35bbc8a0b1951689863be4ff19f7159c2dec7abe
TypeScript
Avinashkumar8694/Angular-resolvers-example
/server/src/utils/Logger.ts
2.734375
3
import { createLogger, format, transports } from 'winston'; import * as DailyRotateFile from 'winston-daily-rotate-file'; import config from '../config/config'; const { combine, timestamp, label, printf, colorize } = format; class WinstonLogger { constructor() { } getWinstonTransportConfig(transportTyp...
19224136c541392432c7d8ce5569139cbac22c12
TypeScript
Antoonds/Aloys
/src/app/store/reducers/fill-in.reducers.ts
2.5625
3
import * as FillInsActions from '../actions/fill-in.actions'; import {FillIn} from '../../_models/fill-in'; import {FillInModel} from '../../_models/fill-in.model'; import * as moment from 'moment'; export interface State{ fillIns: FillIn[]; } const initialState: State = { fillIns: [] }; export function fill...
d9a99307a4a33459b6b2daa8ea59653ba55441ef
TypeScript
shi444363988/raduis-battle
/server/controller/GameController.ts
2.59375
3
import Global from "../global/Global"; import Clone from "../util/Clone"; import Uuid from "../util/Uuid"; import Vector from "../util/Vector"; import { Code, IUserInfo, IUserStatusFlags, IWindInfo, IBaseInfo, IWeaponInfo, ISkillInfo, IPositionInfo, IMoveReq, IMoveRsp, IRsp, IShootReq, ISkillStatusInfo, ISkillHitSt...
259f217b90472ac148bf07e92ac042ed217746cc
TypeScript
RavilAxmadyllin/social-network
/src/redux/profile-reducer.ts
2.640625
3
import {PhotosType, profileAPI, ProfileType} from '../api/api' import {FormAction, stopSubmit} from 'redux-form' import {Dispatch} from 'redux'; import {AppRootStateType} from './redux-store'; import {ThunkAction} from 'redux-thunk'; const ADD_POST = 'SOCIAL_NETWORK/PROFILE/ADD_POST' const SET_PROFILE_USERS = 'SOCIAL_...
62a8a597d754f0896957cc700834df21b417a3e0
TypeScript
jamataran/programacion-servicios-procesos-ejemplos
/src/app/services/login-service.service.ts
2.703125
3
import {Injectable} from '@angular/core'; import {BehaviorSubject, Observable} from "rxjs"; import {LoginModel} from "../model/login.model"; import {Router} from "@angular/router"; import {HttpClient} from "@angular/common/http"; import {map} from "rxjs/operators"; @Injectable({ providedIn: 'root' }) export class Lo...
68c6fba438b85227d5c32533bebe403171221af8
TypeScript
JSideris/gearbox2d
/assembly/shapes/box.ts
3.15625
3
//type i16=number; type i32=number;type i64=number;type u16=number; type u32=number;type u64=number;type f32=number; // var vec2 = require('../math/vec2') // , Shape = require('./Shape') // , shallowClone = require('../utils/Utils').shallowClone // , Convex = require('./Convex'); import Convex from "./convex"; ...
7e867316f9146fc577cae145a2aa44ce3e989fa4
TypeScript
coder-th/mock-platform
/packages/core/src/lifecycle.ts
2.859375
3
import chalk from "chalk"; import { MockApp } from "./types"; /** * 路由注册之前想做的事情 * @param {*} app * @returns */ export function beforeRouterMounted(app: MockApp) { // 在路由创建之前,用户不能使用router属性 return createBaseHanlder(app, false); } /** * 路由挂在后想完成的事情 * @param {*} app * @returns */ export function routerMounted(...
0b8973596e351cb68666992b59cb3587b1d1f99a
TypeScript
ajcrites/rxjs-visualize
/src/app/visualizations/operators/observeOn.ts
2.515625
3
import { Component } from '@angular/core'; import { animationFrameScheduler, timer } from 'rxjs'; import { observeOn, take } from 'rxjs/operators'; @Component({ selector: 'rx-observe-on', template: ` <h1>observeOn</h1> <p> This allows you to change the scheduler used for a source Observable for ...
ff6057e4397c0585ebd4f02565a28387f00f6f68
TypeScript
AndrewLang/matrix-node-kit
/src/io/file.ts
3.109375
3
import * as EventStream from 'event-stream'; import * as fs from 'fs'; import * as path from 'path'; import { ConsoleLogger } from '../logging/index'; import { FileSizeCalculator } from './filesize'; export class File { private static logger = new ConsoleLogger('File '); /** * Check whether given file is...
9570e93b71202718159d8546e06e6bdd92cf83f2
TypeScript
markormesher/money-dashboard
/src/models/IUser.tests.ts
2.578125
3
import { expect } from "chai"; import { describe } from "mocha"; import { DEFAULT_PROFILE } from "./IProfile"; import { IUser, mapUserFromApi, mapUserForApi } from "./IUser"; describe(__filename, () => { describe("mapUserFromApi()", () => { it("should return undefined for null/undefined/empty-string inputs", () ...
9544e712d772db24ed60bb9ea5878a4046df105f
TypeScript
DefinitelyTyped/DefinitelyTyped
/types/react-edit-text/index.d.ts
2.859375
3
// Type definitions for react-edit-text 5.0 // Project: https://github.com/bymi15/react-edit-text#readme // Definitions by: Brian Min <https://github.com/bymi15> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as React from 'react'; export type inputTextType = | 'date' | 'datetime-...
b1ccc63799b933eb41663649826139d2dbf7b852
TypeScript
12kb/jira.js
/src/version2/models/issueLink.ts
3.015625
3
import { IssueLinkType } from './issueLinkType'; import { LinkedIssue } from './linkedIssue'; /** * Details of a link between issues. */ export interface IssueLink { /** The ID of the issue link. */ id?: string; /** The URL of the issue link. */ self?: string; /** The type of link between the issues. */ t...
3590041961745b1b6fa7fc54eb0c8fedde999ea1
TypeScript
juazsh/codingChallenge
/src/app/challenge/challenge.component.ts
3.125
3
import { Component, OnInit } from '@angular/core'; import { Employee } from '../Employee'; @Component({ selector: 'app-challenge', templateUrl: './challenge.component.html', styleUrls: ['./challenge.component.css'] }) export class ChallengeComponent implements OnInit { buttonText: string; buttonFlag: boolean...
2c7a670c70a95517d9cdeecfd0300daf8885c6de
TypeScript
adrianndwiga/store
/index.ts
2.734375
3
import * as fs from 'fs'; export class Store { constructor(private baseFolder: string) { } public read(file: string): string { return fs.readFileSync(`${this.baseFolder}${file}`, 'utf8'); } public write(file: string, data: string): void { fs.writeFileSync(`${this.baseFold...
de77cfa2b3af92ffe02cd6436a676b9dd883c435
TypeScript
glitchwizard/handbook
/src/lib/getGitHistory.ts
2.578125
3
import path from 'path' import { gitlogPromise as gitlog } from 'gitlog' import { CONTENT_FOLDER } from './constants' export default async function getGitHistory( file: string ): Promise<(Record<'hash' | 'authorName' | 'committerDateRel' | 'status', string> & { files: string[] })[]> { const filepath = path.j...
78290dcfdeba13f650851eaf8cf9d7675cc9576e
TypeScript
flotos/prisme-rpg
/src/routes.ts
2.53125
3
import test from "./intentHandlers/test"; import travel from "./intentHandlers/travel"; export default (request: IPrismeRequest) => { const { body: { intent: { inputs = {}, name = "" } = {}, fulfillment = {}, query = "", } = {}, } = request; console.log("got request", name, fulfillment...
7a2d33a204ec1ccaf56f9ebe9d832cc0d8bfa6b0
TypeScript
bmbell/wolverine-websites
/maze/src/app/mazes/_shared/models/maze-cell.model.ts
2.671875
3
import { Direction } from "../enumerations/direction.enum"; export interface MazeCell { /** * The cell's id */ id: string; /** * The available passages from this cell */ passages: Direction[]; }
fb5e10bf6b0b8731628649173a5cb00e4d06164a
TypeScript
stschoelzel/dungeonsAndDragonsAndReceipts
/types/Monster.ts
2.703125
3
export interface Monster { name: string; source: string; page: number; srd?: boolean; size: Size; type: Type; alignment: Alignment[]; ac: ArmorClass[]; hp: HP; speed: Speed; str: number; dex: number; con: number; int: number; wis: number; cha: number; save?: Save; resist?: (string | ...
76df97885e4e002777b92ee6b607110a86ab40f7
TypeScript
Telematica/TypeScript
/typescript-book/Future JavaScript Now/arrow-functions.ts
4.0625
4
//var inc = (x) => x + 1; /* 1) function Person(age) { this.age = age; this.growOld = function() { this.age++; } } */ /* 1.1) function Person(age) { this.age = age; this.growOld = function() { this.age++; }; this.growOld = this.growOld.bind(this); } */ /* // 2) function Person(age) { this...
267cb9959ed9f7bbfe76fa97dbda3ac7f2f834b8
TypeScript
Ibrahim9595/schools
/src/groups-permissions/new-permission-group.ts
2.703125
3
export class NewPermissionGroup { groupName: string; description: string; updating: boolean; id: number; constructor(updating: boolean, groupName="", description="", id?: number){ this.groupName = groupName; this.description = description; this.updating = updating; t...
cd7c64d3a1affe3efe735e4a2531746383bc7d2d
TypeScript
robbie-cahill/hcard-hybrid-react-app
/tests/save-hcard.spec.ts
2.546875
3
import saveHCard from "../src/save-hcard"; import HCard from "../src/hcard"; /** * Mocking multiple async functions that return Promises */ jest.mock('../src/hcard-repository', function() { return { default : { addOne : async function() { return Promise.resolve(); ...
93ed16618482593d40b7e978402788e01efc1af7
TypeScript
determined-ai/determined
/webui/react/src/ee/SamlAuth.test.ts
2.65625
3
import * as utils from './SamlAuth'; describe('SamlAuth', () => { describe('samlUrl', () => { const BASE_PATHS = ['/abc/def-ghi', '/HelloWorld/What%20is%20up?']; const QUERIES = [ { default: 'columns=id&columns=user&sortDesc=false&tableLimit=20', encoded: 'columns%3Did%26columns%3Duser%...
a729daf9526460056ca255881919462a9a23e31d
TypeScript
praneybehl/toybot
/src/parser.ts
3.078125
3
import Table, { IPosition } from "./table"; import { Directions, DirectionsTypes } from "./toybot"; import { showError, simpleLog } from "./utils"; import { ConsoleMessage } from "./constants/console-message"; export interface PlaceOptions { position: IPosition; direction: DirectionsTypes; } export function isValid...
1d6a535fb2486884f6cacba73a117289ebd08de2
TypeScript
fozeu-jm/the_mower
/models/Mower.ts
3.28125
3
import {Cardinal} from "./cardinalDirection"; import {Coordinate} from "./Coordinate"; import {Imow} from "../Interfaces/Imow"; import {Ipoint} from "../Interfaces/Ipoint"; import {IOrientation} from "../Interfaces/IOrientation"; export class Mower implements Imow { private _coordinates : Ipoint; private _orie...
95d7e71f927516149bb390ae35a38740fd51e04b
TypeScript
JoritVergalle/T4T
/src/app/models/session.model.ts
2.828125
3
import {Talk} from './talk.model'; export class Session { private _talks: Talk[]; private _maxTime: number; constructor(time: number) { this._talks = new Array<Talk>(); this._maxTime = time; } get talks(): Talk[] { return this._talks; } addTalk(talk: Talk) { this._talks.push(talk); }...
88ce1edea28a015ede1248bc0d0fa1fba42690c3
TypeScript
awjae/TypeScript
/exercise/src/18-function-types-with-promises.problem.ts
3.1875
3
import { expect, it } from "vitest"; import { Equal, Expect } from "./helpers/type-utils"; interface User { id: string; firstName: string; lastName: string; } const createThenGetUser = async ( createUser: () => Promise<string>, getUser: (id: string) => Promise<User>, ): Promise<User> => { const userId: st...
ade4bbacf72dff060dd3e07320cb8bca8aea05b5
TypeScript
stozuka/marvel-api-challenge
/src/module/marvel/marvel.controller.spec.ts
2.640625
3
import { InternalServerErrorException, NotFoundException, } from '@nestjs/common'; import { RedisService } from 'nestjs-redis'; import { MarvelController } from './marvel.controller'; import { MervelService } from './marvel.service'; describe('MarvelController', () => { let marvelController: MarvelController; ...
fb1bc1cdf4a0ede093ce96c3505eccf20fbfaac2
TypeScript
jkhaui/anchor-web-app
/app/src/@anchor-protocol/webapp-charts/interactions/useCoordinateSpace.ts
2.78125
3
import { CSSProperties, useMemo } from 'react'; import { Gutter, SpaceRect } from '../types'; interface CoordinateSpaceParams { width: number; height: number; margin?: Gutter; gutter?: Gutter; } export interface CoordinateSpaceComponent { margin?: Gutter; gutter?: Gutter; } export function useCoordinateS...
4b07c670ba3458eb9f16bc55a01c41a870183063
TypeScript
pinojs/pino
/test/transport/core.test.ts
2.609375
3
import * as os from 'os' import { join } from 'path' import { once } from 'events' import fs from 'fs' import { watchFileCreated } from '../helper' import { test } from 'tap' import pino from '../../' import * as url from 'url' import { default as strip } from 'strip-ansi' import execa from 'execa' import writer from '...
0a5eadf2d43e8d53808bf338abaad406b4ff5d68
TypeScript
skoldborg/foundation-lib-spa-core
/dist/Components/LazyComponent.d.ts
2.625
3
import React from 'react'; import { SpinnerProps } from './Spinner'; export declare type LazyComponentProps<T = any> = { /** * The name of the component to load, this is the component path after * app/Components/ e.g. a value of CheckoutPage will load the default export * of app/Components/CheckoutPa...
2ec4edd33ebe0674a016346d23f569cdee1baaef
TypeScript
rkumar0099/CSCI3100_project
/server/routes/index.ts
2.828125
3
import express from 'express' // super class of all routes export abstract class Routes { router: express.Router name: string // name of the group of routes constructor(router: express.Router, name: string) { this.router = router this.name = name this.configureRoutes() } /** * return name of...
5f23ce113b93faf1d143a4a29d2c16c26b6d73ae
TypeScript
Ompluscator/ompluscript
/src/typescript/Model/Attribute/Attribute.ts
3.5625
4
/// <reference path="../../Core/Observer/Observable.ts" /> /// <reference path="../../Core/Interfaces/ICloneable.ts" /> /// <reference path="../Event/OnUpdateAttribute.ts" /> /// <reference path="../Event/OnInvalidAttribute.ts" /> /** * Module that contains attributes' classes. * * @module Ompluscript.Model.Attribu...
9ec46075717dc719af24985a1fd876e5ed824a52
TypeScript
bhagyashreeWalanj/TypescriptWithGit
/day1/function.ts
3.96875
4
// with typed parameters function sum(num1: number, num2: number): number{ return num1+num2; } let value= sum(5,3); console.log("result-------->"+value); //----------------------------------------------------- // return string function sum1(num1, num2): string{ return num1+num2; } let value1= sum1('5',3)...
68398a7417b4b94e9e60512c231aaac35a1e69c3
TypeScript
RobertoMalatesta/bitflow
/packages/core/src/lerpColor.ts
3
3
export function lerpColor(a: string, b: string, amount: number): string { let ah = +a.replace("#", "0x"), ar = ah >> 16, ag = (ah >> 8) & 0xff, ab = ah & 0xff, bh = +b.replace("#", "0x"), br = bh >> 16, bg = (bh >> 8) & 0xff, bb = bh & 0xff, rr = ar + amount * (br - ar), rg = ag + ...
9264d23ec8c32f62446e1de99c12a06d8449a411
TypeScript
dfmurillo/symmetrical-octo-barnacle-api
/src/quizzes/quizzes.controller.ts
2.546875
3
import { Request, Response } from "express"; import QuizzesService from "./quizzes.service"; import { IAnsweredSchema } from "./quizzes.schema.answered"; import { ValidatedRequest } from "express-joi-validation"; class QuizzesController { private static instance: QuizzesController; static getInstance(): Quizz...
1ff95814558c7173b732a121af95be2bbbc62b28
TypeScript
cartant/rxjs-tslint-rules
/source/rules/rxjsNoIgnoredObservableRule.ts
2.515625
3
/** * @license Use of this source code is governed by an MIT-style license that * can be found in the LICENSE file at https://github.com/cartant/rxjs-tslint-rules */ import { tsquery } from "@phenomnomnominal/tsquery"; import * as Lint from "tslint"; import * as ts from "typescript"; import * as peer from "../suppo...
4bcec952c17797087c02f49bfbd49cede7fd87cb
TypeScript
Krlozz/Deber-6-Middleware
/project/src/usuario.controller.ts
2.546875
3
import {Controller, Get, Req, Res} from "@nestjs/common"; @Controller('usuario') export class UsuarioController { @Get('logueo') usuarioLogueoCookie(@Res() res, @Req() req) { const parametros = { nombre: "Tu cookie", valor: "Tu cache" }; /...
8453ff739fd87ba29eb66bffb381d28b045b8bdc
TypeScript
Andrewalr/node-lint-config
/test/base/good.ts
3.25
3
// tslint:disable:no-unused-expression declare var require: any; import 'tslint'; import 'tslint-config-airbnb'; require('tslint'); const variable = ''; const singleConcat = 'a' + 'b'; const array: number[] = [1]; if (true) { /**/ } class MyClass { public static defaultName: string; protected static defaultA...
25cd28f7599ebc9309501edc798a0f13023a13b1
TypeScript
YouSafe/tgi-pages
/src/assets/decompiler.ts
3.09375
3
export interface ParsedInstruction { aMux: boolean; mbr: boolean; mar: boolean; rdWr: boolean; ms: boolean; enS: boolean; cond: number; alu: number; sh: number; sBus: number; bBus: number; aBus: number; adr: number; } export function parse(binaryCode: string): ParsedInstruction { let getRan...
0033b1943bee56b51371fde9ee21c014b6b6b9c2
TypeScript
jingu76/iot
/poc_iot_client/public/app/shared/utils/string/string-utils.ts
2.640625
3
export class StringUtils { static format(str: string, params: any[]) { return params.reduce((result, param, i) => result.replace(new RegExp(`\\{${i}\\}`, 'gi'), param), str); } }
b5fc1ad47001489cd8acd16d5973bebf3d18563b
TypeScript
V4Fire/Core
/src/core/kv-storage/engines/string/spec.ts
3.03125
3
/*! * V4Fire Core * https://github.com/V4Fire/Core * * Released under the MIT license * https://github.com/V4Fire/Core/blob/master/LICENSE */ import * as kv from 'core/kv-storage'; import StringEngine from 'core/kv-storage/engines/string'; import { defaultDataSeparators as separators } from 'core/kv-storage/eng...
193dfbb776694fa14576e3fd6bcff356c42ba2b4
TypeScript
Sambl4/123
/src/app/core/+store/list/list.reducer.ts
2.78125
3
import { ListActions, ListActionTypes } from './list.actions'; import { ListState, initialListState } from './list.state'; import { ListItem } from '../../../model/list-item.model'; export function listReducer(state = initialListState, action: ListActions): ListState { console.log('reducer', action.type); sw...
fd66d988c864ca8991a090e5d69ba3dfc94f8ea7
TypeScript
loop-revolution/display-api-js
/src/components/blocklist.ts
2.671875
3
export type BlockList = { cid: "blocklist" args: BlocklistArgs } export type BlocklistArgs = { /** Initial list of ids. Breadcrumbs need to be queried from front-end */ initial_value?: number[] /** * The name of the arg to return, should replace instances of this (like input) * but the value should be an arra...
a86be51ca55a697f2b896fff73de6b9260b24652
TypeScript
dgzlg/ligang123
/src/modules/common/MapViewer/TileLayerWMTS.ts
2.734375
3
import {TileLayer, TileLayerOptions, Point, Util} from 'leaflet'; export enum ValuesType { KVP = 'KVP', REST = 'REST', RESTFUL = 'RESTFUL', } interface Dimension{ key: string; default: string; values?: string[]; } export interface WMTSOptions extends TileLayerOptions { valuesType?: ValuesT...
b8a3db4dc2eac0aa437fa37c2d7ab1b0e1274277
TypeScript
Yaduo/MaterialUI_Typescript
/src/store/environment/actions.ts
2.859375
3
import { Dispatch } from 'react-redux'; export const ACTION = { INIT_ENVIRONMENT: "INIT_ENVIRONMENT", CHANGE_IS_MOBILE: "CHANGE_IS_MOBILE", CHANGE_WIDTH_AND_HEIGHT: "CHANGE_WIDTH_AND_HEIGHT", CHANGE_LANGUAGE: "CHANGE_LANGUAGE", UPDATE_LANGUAGE: "UPDATE_LANGUAGE", } export const initEnvironment = (): any => ({ ...
2d6e9eda8d1f804223710c971f7da2405012dd12
TypeScript
pmuellr/catbo
/docs/scripts/model/types.ts
3
3
export interface CreateBoardParams { boards: number; // number of 4x6 boards to use; 1, 2, or 4 currently } export interface IBoard { squares: ILocation[][]; } export interface CreateLocationParams { x: number; y: number; isPort: boolean; islandNumber?: number | null | undefined; } export interface ILoca...
21dfc546e7ffe4bcdd8b0d9bcfb23c194faefe5b
TypeScript
caderek/aoc2019
/src/day03/index.ts
2.84375
3
import { test, readInput } from "../utils" import { pipe } from "@arrows/composition" type Wire = { dir: "R" | "L" | "U" | "D"; dis: number }[] type Wires = [Wire, Wire] type XYSteps = [number, number, number] type Paths = [XYSteps[], XYSteps[]] type XYStepsAStepsB = [string, number, number] type Intersections = XYSte...
c5997b63b5873fa8abeeae8ec4d854ac3e74cd2a
TypeScript
AssemblyScript/assemblyscript
/tests/parser/type-signature.ts.fixture.ts
2.78125
3
type foo = () => void; type foo = (() => void) | null; type foo = (() => void) | null; type foo = Array<() => void>; type foo = Array<() => void> | null; type foo = Array<() => void> | null; type foo = (a: i32) => i32; type foo = (a?: i32) => i32; type foo = (this: AClass, a: i32) => i32; type foo = () => () => void; t...
bb9cf4dd3e1024405dbdf74690e9a5c411abdb7f
TypeScript
vmarc/knooppuntnet
/client/libs/planner/src/lib/domain/commands/planner-command-reset.spec.ts
2.671875
3
import { PlannerTestSetup } from '../context/planner-test-setup'; import { PlanFlag } from '../plan/plan-flag'; import { PlanUtil } from '../plan/plan-util'; import { PlannerCommandAddLeg } from './planner-command-add-leg'; import { PlannerCommandAddStartPoint } from './planner-command-add-start-point'; import { Planne...
673cea92fe5cbf79281adf14bd41098f3cd43c74
TypeScript
FormidableLabs/prism-react-renderer
/packages/demo/src/sample-code.ts
2.90625
3
export const sampleCode = { ["TypeScript with React"]: { language: "tsx", code: ` import React from 'react'; interface GroceryItemProps { item: { name: string; price: number; quantity: number; } } const GroceryItem: React.FC<GroceryItemProps> = ({ item }) => { return ( <div> <h2>...
f1b66de408b828480e81714ff33abed3a61554dc
TypeScript
mccaulleyg94/laughing-tribble
/src/Utils/Random.ts
3.390625
3
export function randomEnum<T>(anEnum: T): T[keyof T] { const enumValues = Object.keys(anEnum).map(n => Number.parseInt(n)).filter(n => !Number.isNaN(n)) as unknown as T[keyof T][] const randomIndex = Math.floor(Math.random() * enumValues.length) const randomEnumValue = enumValues[randomIndex] return randomEnumV...
a1be0017ce6dbd81b8b74d126c81b90344de8bf6
TypeScript
NativeScript/nativescript-picker
/demo/app/examples/value-api/value-api-model.ts
2.703125
3
import { Observable } from 'tns-core-modules/data/observable'; import { ObservableArray } from "tns-core-modules/data/observable-array"; export class ValueApiModel extends Observable { public pickerItems: ObservableArray<DataItem>; constructor() { super(); this.pickerItems = this.getItems(20)...
a3d6751c0a5b681210844defd88f1ccba23a57bb
TypeScript
GlitchEnzo/Cacophony
/ProgressBar.ts
3.140625
3
/** * Represents a progress bar that displays the current time and total time of the current song. * @class Represents a ProgressBar */ class ProgressBar { // Example: //<div onmousedown="progressClicked(event)" id="progressWrapper" style="width: 320px; position: relative; border: 1px solid black;"> //...
0029120168837348d70e5a37fcffb64d4dd819db
TypeScript
reactdenver/reactdenver.com
/app/utils/files.server.ts
3.0625
3
import nodePath from "path"; import { readFile, readdir } from "fs/promises"; /** * * @param relativeMdxFileOrDirectory the path to the content. For example: * content/events/2001-01-01.mdx * @returns A promise that resolves to an object of the full path and the file content */ async function downloadMdxFile( r...
80113d28c64c681ec7a7284b13055ec158a24cf7
TypeScript
steps798/google_maps_example
/packages/design-systems/dist/types/components/atoms/skeleton/Skeleton.d.ts
2.71875
3
import React from 'react'; declare type DefaultProps = { /** 'Indexer: use for other props */ [x: string]: any; } & Partial<PropTypes>; declare type PropTypes = { /** total skeleton to render. default is 1 */ count: number; /** animation duration. default is 1.2 */ duration: number; /** skel...
7e9ae611fc9d2b0cebf6086698f773377ab06f44
TypeScript
virtual1680/qhy-ui
/src/api/action.ts
2.53125
3
import axios from '@/utils/request' // //post function postAction(url:string,data?:object) { return axios({ url: url, method:'post', data: data }) } // //put function putAction(url:string,data?:object) { return axios({ url: url, method:'put', data: data }...
fcf691434266617a130410775f669c22b047e1b6
TypeScript
tokovenko/bet-analyzer
/ts/strategies/DogonStrategyWithLimit.ts
2.734375
3
import {Strategy} from './../Strategy'; class DogonStrategyWithLimit extends Strategy { public title: 'Dogon Strategy with limits'; public betPercent: number = 10; public betMaximum: number = 500; public setBetPercent(percent: number) { this.betPercent = percent; } public setBetMaxi...
acefcd8929f20d2b0036341b6dfc18b8f17cd4d5
TypeScript
jayfreestone/priority-plus
/src/events/eventHandler.ts
3.0625
3
import { Events } from './createEvent'; import eventTarget from './eventTarget'; export type EventCallback = (eventDetail: CustomEvent<{}>) => void; interface CallbackRef { eventType: Events; wrappedCallback: EventCallback; } function createEventHandler() { const state = { eventReady: false }; const eventCha...
83c64e52d5c9f1bcce991dc23e4d7e636b307a9b
TypeScript
kelvinsjk/math-edu
/src/classes/exponential/expClass.ts
3.6875
4
import Fraction from '../fractionClass'; import Ln from './lnClass'; import Term from '../algebra/termClass'; import convertNumberToFraction from '../../internal/convertNumberToFraction'; /** * ln class * * @exponent Fraction | Exp * * class representing exponentiation by Euler's number * * as a extension of th...
d77f9b773b06ef5e5888472b24e6fd24e1364e5e
TypeScript
sergeevtoll/conformition-email
/src/user/repositories/user.repository.ts
2.578125
3
import { confirmEmailLink } from '../../utils/confirmEmailLink'; import { User } from '../entities/user.entitiy'; import { UserDto } from '../dto/user.dto'; import { Injectable } from "@nestjs/common"; import { EntityManager, EntityRepository, FindOneOptions, getManager } from 'typeorm'; import { sendEmail } from '../....
7dbc9b5818260e5a3374aefb5206b958b3544e9a
TypeScript
Brandux/SPA-Angular
/fundamentos_typescript/4-poo/poo.ts
3.5625
4
class Coche{ private color : string ; private modelo : string; private velocidad : number; // con el signo de ? quiere decir que puede llegar dicha variable y en ocaciones no. constructor(colorDefault ?:string){ this.color= colorDefault; } public getColor(){ return thi...
f549592ea323b192440542d443dbbc5d9eecf0d4
TypeScript
rafgraph/current-input
/src/index.ts
2.609375
3
import * as detectIt from 'detect-it'; import { eventFrom } from 'event-from'; function setupCurrentInput() { const body = document.querySelector('body'); type CurrentInput = 'mouse' | 'touch'; // set initial state based on primaryInput let currentInput: CurrentInput = detectIt.primaryInput; body?.classLis...
791891a3adeab1c26c18833f787597899755a7bf
TypeScript
jhbertra/data-grace
/test/maybe.spec.ts
3.09375
3
import * as fc from "fast-check"; import { Maybe } from "../src"; import { constant, simplify } from "../src/prelude"; /*------------------------------ UNIT TESTS ------------------------------*/ describe("fromArray", () => { it("returns nothing when input is empty", () => { expect(simplify(Maybe.fromArray(...
301e0cf0459aaf2c2ca44346b5c7420375f06560
TypeScript
cgbinho/chocoanimato-frontend-public
/src/validations/fieldMasks.ts
3.1875
3
export const lowerCaseMask = (event: React.ChangeEvent<HTMLInputElement>) => { if (event.target.value) { event.target.value = event.target.value.toLowerCase(); } }; // Formatação de dd/mm/aaaa export const fullDateMask = (event: React.ChangeEvent<HTMLInputElement>) => { if (event.target.value) { event.ta...
71f56faa965c19bdf072be05383431d4a2750d97
TypeScript
UPCSocialNetwork/backend
/src/models/Cursada.ts
2.640625
3
import { Model, Schema, model } from 'mongoose'; import TimeStampPlugin, { ITimeStampedDocument } from './plugins/timestamp-plugin'; export interface ICursada extends ITimeStampedDocument { /** FK ID de l'estudiant */ estudiantID: string; /** FK ID de l'assigntura */ assignaturaID: string; ...
0b156197d8ffb2e4ce10fa79d719d33e65c76580
TypeScript
GeorgeCiocan/CF-CR6-GeorgeCiocan
/js/index.ts
2.984375
3
let places: Array<{}> = []; let restaurants: Array<{}> = []; let events: Array<{}> = []; class Locations { name: string zipCode: string address: string image: string constructor(name: string, zipCode: string, address: string, image: string) { this.name = name this.zipCode = zipCode; this.address...
9f9ab63ba4f7bb3a8a2b73965a188e118af57442
TypeScript
loctong/mapper
/packages/core/src/lib/member-map-functions/convert-using.ts
2.578125
3
import type { Converter, ConvertUsingFunction, Dictionary, Selector, SelectorReturn, } from '@automapper/types'; import { TransformationType } from '@automapper/types'; export function convertUsing< TSource extends Dictionary<TSource> = unknown, TDestination extends Dictionary<TDestination> = unknown, ...
c52dccfdd8e7aadee5f89252b9914c57a48168cc
TypeScript
Selbinyyaz/typeScriptPractice
/day02/function.ts
3.15625
3
// Parameter type annotation function greet(name: string) { console.log("Hello, " + name.toUpperCase() + "!!"); }
19f939205fabcfa17e6272ef39ede1c363c83dbb
TypeScript
AkroutiHamza/BookStoreApp
/frontend/src/app/models/Book.ts
2.75
3
import {BookInOrder} from "./BookInOrder"; export class Book { BookId: number; author: string; title: string; price: number; BookIcon: string; releaseDate: string; stock: number; bookStatus: number; // 0: onsale 1: offsale /* createTime: string; updateTime: string; */ ...
cc0942dc53c13e95a3b5474f372192ab5f364f47
TypeScript
ltzenteno/my-car-value
/src/reports/service/reports.service.ts
2.6875
3
import { Injectable, NotFoundException } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { Repository } from 'typeorm'; import { User } from '../../users/entity/users.entity'; import { CreateReportDto } from '../dto/create-report.dto'; import { GetEstimateDto } from '../dto/get-estimat...
9c84338fd5c382220944f160e995ccf3cfc4acb2
TypeScript
Alarid/Spotify-Browser
/src/requests/albums/albums.request.ts
2.890625
3
import api from '../api' import { SearchAlbumsResponse } from './albums.request.types' /** * Perform an album search with Spotify's API * * @param {string} search - the query * @param {number} offset - for pagination */ export const searchAlbums = async ( search: string, offset = 0 ): Promise<SearchAlbumsResp...
3af9ebf918b67cf01cc1e7814cd066d177979c7d
TypeScript
kabeleced77/foxfm2
/src/Common/Toolkit/SplitString.ts
3.40625
3
import { NumberFromString } from './NumberFromString'; import { Value } from './Value'; export interface ISplitString<T1, T2> { firstValue(): T1; secondValue(): T2; } export class SplitStringToNumbers implements ISplitString<Number, Number> { private readonly string: String; private readonly splitBy: String; ...
97f9f358aefc1ed60f7f337986ee541cf16b3110
TypeScript
dessoya/gravity-modules-ts
/Hash/Navigator/3.0/Navigator.ts
2.8125
3
// alias: Navigator interface MyWindow extends Window { onhashchange(): void } declare var window: MyWindow /* fire: -> onHashChange catch: <- onSectionMatch */ export class Navigator extends Manager { private _currentSection: HashSection = null getDefaultSection(): HashSection { return null } start(...
a6ee81f88d80f4e154bb69c369572210d45f7be8
TypeScript
omariosouto/mvp-devsoutinho
/packages/ui/src/components/foundation/Text.ts
2.546875
3
import styled, { css } from 'styled-components'; interface TextProps { textAlign?: 'center' | 'right' | 'left' | 'justify'; } const Text = styled.span<TextProps>` ${({ textAlign }) => textAlign && css` text-align: ${textAlign}; `} `; export default Text;
36258283c6d4e3d57ca2a24be71f58230792f9cf
TypeScript
jitsi/jitsi-meet
/react/features/app/reducer.native.ts
2.65625
3
import ReducerRegistry from '../base/redux/ReducerRegistry'; import { _ROOT_NAVIGATION_READY } from '../mobile/navigation/actionTypes'; /** * Listen for actions which changes the state of the app feature. * * @param {Object} state - The Redux state of the feature features/app. * @param {Object} action - Action obj...
8160736bdfaa3ec07a3e4280327416d7d363575d
TypeScript
NurimOnsemiro/algorithm_solution
/fence_cut/nodejs/index.ts
3.171875
3
/** * https://www.algospot.com/judge/problem/read/FENCE * 결과: 208ms */ import * as readline from 'readline'; import * as process from 'process'; let rl: readline.Interface = readline.createInterface({ input: process.stdin, output: process.stdout }); let input: string[] = []; class stack_base { data: number...
a708cf3ce7219aa5c761d6565e2d08ab0cf8e22a
TypeScript
sergefontain/reactHW6-tsThunk
/src/store/actions.ts
2.625
3
import { createAction } from "typesafe-actions" export const setJoke = createAction("SET_JOKE", (data) => data)() export const setUser = createAction("SET_USER", (data) => data)() export const loginSuccess = createAction("LOGIN_SUCCESS", (data) => data)() export const fetchJoke = (chainDispatch: any) => () => { s...
5c3b0511dc9e9f1e3b1afb8de2fbc4ce63f5a4c9
TypeScript
SardineFish/zogra-renderer
/zogra-renderer/src/plugins/assets-importer/assets-importer.ts
2.640625
3
import { Asset } from "../../core/asset"; import { GlobalContext } from "../../core/global"; import { AssetImporterPlugin, AssetsPack } from "./types"; export * from "./types"; interface Importers { [key: string]: AssetImporterPlugin<any, Asset | AssetsPack> } // const importers = { // img: Texture...
a2704592e0694697fcefbfe016a210dad5cbd313
TypeScript
valdisz/ngrx-lib
/reducers/utils.ts
3.25
3
export interface Comparer<T> { (a: T, b: T): number; } export interface EqualityComparer<T> { (a: T, b: T): boolean; } export interface IdSelector<T> { (value: T): string; } export function equalityComparer<T>(a: T, b: T): boolean { return a === b; } export function selectByName(field: string): IdSe...
f46216ec660da6f513d0f32fc5b8fa4cc4afb926
TypeScript
micahscopes/davinci-eight
/src/davinci-eight/geometries/simplicesToDrawPrimitive.ts
2.9375
3
import copyToArray = require('../collections/copyToArray') import dataFromVectorN = require('../geometries/dataFromVectorN') import DrawMode = require('../core/DrawMode') import simplicesToGeometryMeta = require('../geometries/simplicesToGeometryMeta'); import computeUniqueVertices = require('../geometries/computeUniqu...
e9f95b518c7a26727ff7131d4194f41d90185da6
TypeScript
Maverick95/challenges
/sameNecklace.test.ts
3.109375
3
import same_necklace from './sameNecklace'; describe('Verify functions returns true/false for appropriate values', () => { test.each([ ["nicole", "coneli"], ["abc", "cba"], ["xxyyy", "xxxyy"], ["xyxxz", "xxyxz"], ["x", "xx"], ["x", ""], ["xxx", "yyy"], ])('Strings are...
34bdb415aedde13ce1f3f6057e03dc286f6549e3
TypeScript
patriciopenamunoz/deno_hipica
/src/hipica/models/track.model.ts
2.5625
3
export class TrackModel { id: string | number; tipo_pista: string; cancha: string; humedad: string; dureza: string; rodillo: string; corte_pasto: string; rastra: string; acondicionador: string; profundidad_de_rastra: string; constructor(id?: string | number, tipo_pista?: st...
781384012caa34f5546ad636e276e34bd8ede74d
TypeScript
node-projects/hyperion-node
/tests/hyperion.test.ts
2.796875
3
import '../src/helper/stringExtensions'; import { HyperionSerializer, HyperionType } from '../src/HyperionDeserializer'; class Temp { SubArray: [] = []; } test('testHyperion', () => { const st = [254, 1, 0, 254, 0, 0, 3, 0, 0, 0, 8, 1, 0, 0, 0, 4, 2, 8, 3, 0, 0, 0]; let buffer = Buffer.from(st)...