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
58a5e21a07dcb804c8011a91bd20f2f0e85dc8d0
TypeScript
jobayersarkar/ivr-tester
/packages/ivr-tester/src/call/transcription/PromptTranscriptionBuilder.ts
2.953125
3
import { TranscriptEvent } from "./plugin/TranscriberPlugin"; export class PromptTranscriptionBuilder { private static readonly EMPTY_TRANSCRIPTION = ""; private transcriptions: TranscriptEvent[] = []; public add(event: TranscriptEvent): void { this.transcriptions.push(event); } public clear(): void {...
d74ad17f0ee971ee7800446074694f38c5d9dd2f
TypeScript
mauricio-alves/curso_typescript
/src/005-type-array/005-type-array.ts
4.1875
4
// Há duas maneiras criar um array: // Array<T> ou T[] // forma Array<T> (tipos): export function multiplicaArgs(...args: Array<number>): number { return args.reduce((ac, valor) => ac * valor, 1); } const result = multiplicaArgs(1, 2, 3); console.log(result); // forma T[] (string): export function concatenaArgs(....
4eb982688ec7fdce9e80f814e643b41ca03a4185
TypeScript
nadipalli-swetha/news-application
/newsApplicationF/src/app/services/news.service.ts
2.75
3
import { Injectable } from '@angular/core'; import { HttpClient,HttpParams, HttpResponse} from "@angular/common/http"; import { News} from "../models/News"; import { NewsFetcher} from "../interfaces/news-fetcher"; import { throwError} from "rxjs"; import {catchError,retry} from "rxjs/operators"; @Injectable({ provid...
47e65f194cbaed8ec43a3b22def7b7dbdb36b172
TypeScript
Quindon/pokeclicker
/src/scripts/dungeons/DungeonBattle.ts
2.640625
3
class DungeonBattle extends Battle { /** * Award the player with money and exp, and throw a Pokéball if applicable */ public static defeatPokemon() { DungeonRunner.fighting(false); player.gainMoney(this.enemyPokemon().money); player.gainExp(this.enemyPokemon().exp, this.enemyP...
069622dc1051de6e4a6bd7e431bf555db522c8a3
TypeScript
microsoft/accessibility-insights-web
/src/common/stores/client-stores-hub.ts
2.65625
3
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { every, lowerFirst } from 'lodash'; import { BaseStore } from '../base-store'; export class ClientStoresHub<T> { public stores: BaseStore<any, Promise<void>>[]; constructor(stores: BaseStore<any, Promise<vo...
9332640e417312a59f936356e2ba19f9be210481
TypeScript
moses-aronov/angular2-weather-app
/src/weather-widget/pipe/speed-unit.pipe.ts
2.890625
3
import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: "speedUnit" }) export class SpeedUnitPipe implements PipeTransform { transform(speed: number, unitType: string) { switch (unitType) { case 'kph': return this.formatSpeed(this.convertMPHtoKPH(speed)) + unitTy...
09227a8ef35226e0ef25981043798a4adfc46f27
TypeScript
godspeed-you/grafana-checkmk-datasource
/src/RequestSpec.ts
2.703125
3
export interface NegatableOption { value?: string; negated: boolean; } export type ObjectType = 'host' | 'site' | 'service'; export interface MetricFindQuery { filter: Partial<FiltersRequestSpec>; objectType: ObjectType; } export interface RequestSpec { // TODO: we need to rename graph_type, as the graph_t...
2d381ab189d35a94a902a21822b541639533333e
TypeScript
Wikiviews/wikiviews-frontend
/src/app/main/articles/shared/filter/article-selection/article-range.ts
3.421875
3
export class ArticleRange { private _beginning: string; private _end: string; constructor(begining: string, end: string) { if (begining > end) throw new Error("Beginning of range mustn't be lexically bigger than end of range"); this._beginning = begining; this._end = end; } get beginning(): str...
c9fe02f6f79df899da0154bb5c8e0a93aef95bd1
TypeScript
sanket90/Training
/src/app/app.component.spec.ts
2.84375
3
import { ListStack, LinkedListStack, ArrayStack } from './data-structure/stack'; import { Postfix } from './example/postfix'; import { Prefix } from './example/prefix'; import { AddMessage, DeleteMessage, Action } from './store/message.action'; import { messageReducer } from './store/message.reducer' import { Store } ...
f75c83102fbdf577e946253790be9f362a18042f
TypeScript
Yowza-Animation/tba-types
/StoryboardPro/6/index.d.ts
2.859375
3
/// <reference path="../../shared/qtscript.d.ts" /> /// <reference path="../../shared/tba.d.ts" /> /// <reference path="../../shared/15/index.d.ts" /> /** * Action interface is used to perform menu or tool bar functions */ declare namespace Action { /** * using action manager, perform the requested action (slot...
3d118ec45fa05e24d583c31d28cd6b857e91e6b8
TypeScript
Happy-Ferret/FromJS
/packages/babel-plugin-data-flow/src/helperFunctions/OperationLog.ts
3.421875
3
// todo: would be better if the server provided this value const getOperationIndex = (function() { var operationIndexBase = Math.round(Math.random() * 1000 * 1000 * 1000); var operationIndex = 0; return function getOperationIndex() { var index = operationIndex; operationIndex++; return operationIndexB...
a170ae18f342c8e68666253d20051ed2b551776f
TypeScript
evanholt1/projbackendtest
/src/utils/schemas/point.schema.ts
2.65625
3
import { Prop } from '@nestjs/mongoose'; import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; //@Schema() export class Point { @ApiPropertyOptional({ type: String, enum: ['Point'] }) @Prop({ enum: ['Point'], default: 'Point' }) type: string; @ApiPropertyOptional({ type: [Number], isArra...
bca6301cbfa81dfa70249dbb15195d991a274e02
TypeScript
nroper/foundations
/packages/cognito-auth/src/password/reset-password.test.ts
2.546875
3
import { resetPassword } from './reset-password' import { resetPasswordService } from '../services/password/reset-password' import errorStrings from '../constants/error-strings' import { ResetPasswordParams } from '../core/types' jest.mock('../services/password/reset-password') const mockedPasswordService = resetPass...
f731f6aae621834ba203248d6be1e11201272c2b
TypeScript
wellwind/angular-advanced-20190427
/src/app/posts/post.ts
2.53125
3
export interface MutipleArticle { articles: Article[]; } export interface SingleArticle { article: Article; } export interface Article { slug: string; title: string; description: string; body: string; tagList: string[]; createdAt: string; updatedAt: string; author: string; } export interface Arti...
c7c43c4f0d1f81dea46ae47c8eb0fe8f63390227
TypeScript
lmjieSCU/H5game
/Even_look/src/Effects/GridEffect.ts
2.90625
3
/**cells配对成功消失特效 */ class GridEffect { public createAngImgAt(arg1: number, arg2: number): egret.Bitmap { let angle = new egret.Bitmap; angle.texture = RES.getRes("angle_png"); angle.anchorOffsetX = angle.width / 2; angle.anchorOffsetY = angle.height / 2; GameCtrl.I.setpo...
86c018723a873936996da8ba91cea7c5f6231cf8
TypeScript
EmmyLua/VSCode-EmmyLua
/src/findJava.ts
2.640625
3
import * as path from "path"; import * as vscode from "vscode"; import {substituteFolder} from "./substitution"; function validateJava(javaPath: string): boolean { //TODO check java path return false; } export default function(): string|null { var executableFile: string = "java"; if(process["platform"] === "wi...
a1365ca4beef004d2f53907623f8a02061c00238
TypeScript
salilgupta2510/React-Native-Learning-Sapient
/exercise-1-typescript-warmup/src/domain/order.ts
3.109375
3
import { Placement } from './placement'; import { Side } from './types'; export interface OrderStatus { committed: number; done: number; notDone: number; uncommitted: number; pctDone: number; pctNotDone: number; pctUncommitted: number; } /** * An order to buy or sell a security for a spec...
db4d24c56ffc0caaa8441a4764aeb8bc0b9c9b70
TypeScript
AllNamesRTaken/GoodCore
/src/lib/Cookie.ts
2.796875
3
import { find } from "./Arr"; import { getDate, assert } from "./Util"; import { transform } from "./Obj"; export function getCookie(key: string) { let cookie = find(document.cookie.split(";").map((cookie) => cookie.trim()), (cookie) => cookie.indexOf(`${key}=`) === 0); return cookie ? cookie.trim().split("=")[1] : ...
62d0e5489a1382a6377f44084372db35780ebc04
TypeScript
staherianYMCA/test
/TypeScript/test/HelloWorldInTypeScript/HelloWorldInTypeScript/Scripts/ArrayVariables.ts
4.25
4
let arrayOfStrings = ["str1", "str2", "str3"]; // myStr="str1" let myStr = arrayOfStrings[0]; // compiler error // cannot assign an array of numbers // to an array of string. //arrayOfStrings = [1, 2, 3]; // can contain any types like List<object> in C# let arrayOfAny: any[] = [1, "str2", false]; // for any[] reas...
00ed0dc364a80bfbcdaa89dc0a5d8f555cee5e69
TypeScript
si-saude/saude-app
/src/app/controller/gerencia/gerencia.filter.ts
2.578125
3
import { GenericFilter } from './../../generics/generic.filter'; import { EmpregadoFilter } from './../empregado/empregado.filter'; import { BooleanFilter } from './../../generics/boolean.filter'; export class GerenciaFilter extends GenericFilter { private codigo: string; private codigoCompleto: string; ...
67f7ab6ea6103cff0721c25b1dad24258db652a9
TypeScript
samanthabroking/cadmus_web
/libs/parts/philology/philology-ui/src/lib/differ-result-to-msp-adapter.ts
2.578125
3
// library: https://www.npmjs.com/package/diff-match-patch // types: https://www.npmjs.com/package/@types/diff-match-patch import { MspOperation, MspOperator } from './msp-operation'; import { Diff, DIFF_DELETE, DIFF_INSERT, DIFF_EQUAL } from 'diff-match-patch'; import { TextRange } from '@cadmus/core'; class DiffAnd...
14e9172d56b400b4937c81df450a96424fc41cfc
TypeScript
laden666666/my-doc-jsx
/src/docjsx/core/BasePlugin.ts
2.953125
3
/** * 插件库的基础类 */ export class BasePlugin { //输出工具 blockNodeMap = {}; //输出工具 inlineNodeMap = {}; format = {} constructor(){ } /** * 向插件库注册块级标签 * @param format 引擎 * @param name 标签名 * @param blockNode 块级标签扩展 */ registerBlockNo...
0b9e6dd7e726edaf68c75199f147ad09b0e7092b
TypeScript
wdcvalentin/product-checker
/src/index.ts
2.75
3
import axios from 'axios'; import cheerio from 'cheerio'; const AxiosInstance = axios.create(); const productIds = [ 'PB00385045', 'PB00254175', // 👇👇 is an error test // 'PB99993070' ] const logging = async (url: string, id: string) => { const { productName, availability, price } = await getData(url, id)...
b9066b467f614d787268ffe10244f62f48a26e90
TypeScript
wmelani/structured-schema-logger
/src/ILogger.ts
2.53125
3
import { ILoggingEntry } from "./ILoggingEntry"; export interface ILogger { log(entry: ILoggingEntry): void; error(entry: ILoggingEntry, error: Error): void; }
2bc7aaec9c2700bc1a09c2b29ccaba4b7be4e15d
TypeScript
EnssureIT/broleto
/src/utils/getValue.ts
3.34375
3
export const getValueForBankType = (number: string, codeType: string) => { let value = '0'; if (codeType === 'CODIGO DE BARRAS') { value = number.substr(9, 10); } if (codeType === 'LINHA DIGITAVEL') { value = number.substr(-8, 8); } return Number((parseInt(value, 10) / 100.0).toFixed(2)); }; exp...
eca9e890c24af78ca7be3ec2ecdc5df811d0dbf3
TypeScript
DawidRubch/RockPaperScissorsGame
/rpsFrontEnd/rpsfe/src/core/socketUseCases/changePointsCount.ts
2.53125
3
import { Socket } from "../SocketClient/socket"; export const changePointsCount: (setPointsCount: any) => void = ( setPointsCount ) => { let socket = Socket.socket; if (socket) { socket.on("pointsCount", (scoreCount: any) => { setPointsCount(scoreCount); }); } };
abb943acc03897603e2b3ecb40e22daaf52392b7
TypeScript
natura-cosmeticos/natds-js
/packages/web/src/Components/Snackbar/Snackbar.props.ts
2.921875
3
import { SnackbarProps, SnackbarOrigin } from '@material-ui/core/Snackbar' export type HorizontalAnchorOrigin = SnackbarOrigin['horizontal']; export type VerticalAnchorOrigin = SnackbarOrigin['vertical']; export interface ISnackbarProps extends SnackbarProps { /** * The action to display. * * @optional ...
5fea9eef6257dd8dc578465248156a33cdc54606
TypeScript
mikelbua/AngularIpartek
/src/app/directives/HelloDirective.ts
2.5625
3
import { Directive, ElementRef, HostListener, Input } from '@angular/core'; @Directive({ selector: '[subrayado]' }) export class HelloDirective { @Input() subrayado: string; constructor(private element: ElementRef) { } //contructor @HostListener('mouseenter') public onMouseEnter() { debugger; this.e...
dbcd772831132a52e2416dd628d49f2b9459f50b
TypeScript
remoteambition/courier-react
/packages/react-inbox/src/actions/messages.ts
2.515625
3
export interface IGetMessagesParams { after?: string; isRead?: boolean; } export const QUERY_MESSAGES = ` query GetMessages($after: String, $isRead: Boolean){ messages(params: { isRead: $isRead }, after: $after) { totalCount pageInfo { startCursor hasNextPage } nodes {...
973b9fcd76d152aeac614b62903b229808fbeba0
TypeScript
NoManWorkingITPJMnage/sysurs-fe
/src/store/modules/user.ts
2.53125
3
import { Module } from 'vuex'; import httpClient from '@/utils/httpClient'; export interface UserState { userProf: UserProfile | null; isSignedIn: boolean; } export const userModule: Module<UserState, any> = { namespaced: true, state: () => ({ userProf: null, isSignedIn: false, }), getters: { ...
fe59d8f0106de313fbf6e55a232863d067644638
TypeScript
JamieFristrom/dungeonlife
/gamesrc/src/ReplicatedStorage/TS/CheatUtility.ts
2.546875
3
import { PlacesManifest } from "./PlacesManifest" import { Whitelist } from "./Whitelist" class CheatUtilityClass { // use : calling from Lua PlayerWhitelisted( player: Player ) { if( Whitelist.whitelist.find( (value)=> value === player.UserId )!==undefined ) return true; let rank...
7c741d895563178734586e69fa482cb6d435301f
TypeScript
kjhwert/uber-eats-server
/src/entities/restaurant.entity.ts
2.59375
3
import { Field, ObjectType } from '@nestjs/graphql'; import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'; import { IsOptional, IsString, Length } from 'class-validator'; @ObjectType() @Entity() export class Restaurant { @Field(type => Number) @PrimaryGeneratedColumn() id: number; @Field(type => S...
8eeac9c60dcd5d36a80d71557bbe848a4e168dbd
TypeScript
nick-meier/travetto
/module/cache/src/decorator.ts
2.5625
3
import { CacheManager, CacheConfig } from './service'; type TypedMethodDecorator<U> = (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<(...args: any[]) => U>) => void; export function Cacheable<U>(config: Partial<CacheConfig<U>> & { dispose: (k: string, v: U) => any }, keyFn?: (...args: any[]) =...
8bea00bfc5e2484b538c29b23a599ae855896ec9
TypeScript
Flexicon/py-roadmap
/src/app/shared/data/resources.ts
2.6875
3
import { Topic } from '../models/topic.model'; export const topics: Topic[] = [ { title: 'Numbers, Strings and Lists', checklist: [ { title: 'Removing whitespace from a string' }, { title: 'Transforming text to uppercase and lowercase' }, { title: 'Converting strings to integers' }, {...
9d8627f0131c17f360760e3c63021f913d166be4
TypeScript
yosbelms/fun2
/dev-tools/util.ts
2.578125
3
export const hashMap: Map<string, string> = new Map() export const hashMapFileName = 'hashMap.json' export const mapToJson = (hashMap: Map<string, string>) => { const obj: { [k: string]: string } = {} for (let [key, value] of hashMap.entries()) { obj[key] = value } return JSON.stringify(obj, null, 2) }
386993ede07a587a8ed926a378832d35d424bd61
TypeScript
TallerWebSolutions/dojo-tdd
/typescript/src/roman-numbers/index.ts
3.796875
4
export enum Numerals { 'I' = 1, 'V' = 5, 'X' = 10, 'L' = 50, 'C' = 100, 'D' = 500, 'M' = 1000 } export const isAllowed = (numeral: string): boolean => !['IIII', 'XXXX', 'CCCC', 'MMMM'].some( value => numeral.includes(value) ) export const valueOf = (arg: string): number => { if (!isAllowed(arg)) { ...
cc99f6e9f2a24c6cc847c7aa55820f9aa4a9bdc9
TypeScript
lilaw/bookshelf
/src/utils/listItems.ts
3.015625
3
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { useClient } from "@/utils/client"; import type { item, HttpError } from "@/types"; import { isListItemsData, isItemData } from "@/type-guards"; import { areYouABadBody } from "@/utils/client"; import { queryClient } from "@/utils/QueryClien...
5c78df93a8e6ed373ae5db7ed3b69678e8324f3d
TypeScript
Starle21/FullStackOpen-exercises-part9-Typescript
/patientor_backend/src/utils.ts
3.1875
3
import { NewPatient, Gender, EntryType, NewEntryWithoutId, Diagnose, HealthCheckRating, } from "./types"; const isString = (text: unknown): text is string => { return typeof text === "string" || text instanceof String; }; const parseName = (name: unknown): string => { if (!name || !isString(name)) { ...
2aae9590b5fc20d645d158357f121648bd4783b7
TypeScript
NayeliZurita/image-processing
/src/ImageLocal.ts
2.734375
3
import { DefaultSettings } from "./DefaultSettings.js"; import { ImageOp } from "./ImageOp.js"; export class ImageLocal implements ImageOp { //atributos protected img: HTMLImageElement; protected screen: CanvasRenderingContext2D; protected readyToDraw: boolean; protected isScaled: boolean; // protected doc...
9e81318142b4464ecd35c70e0ce00002a1ba2aa0
TypeScript
chefomar/no-data
/src/noDataInClassRule.ts
3.0625
3
import * as Lint from 'tslint'; import * as ts from 'typescript'; import { isClass } from './utils/isClass'; import { isClassProperty } from './utils/isClassProperty'; import { containsWord } from './utils/containsWord'; const ALLOW_CLASS_NAME = 'allow-class-name'; const ALLOW_CLASS_PROPERTIES = 'allow-class-properti...
26fda236d331d5e95ca466be972eef007f25d9da
TypeScript
anishghosh103/ngrx-social-app
/src/app/store/auth/auth.reducer.ts
2.765625
3
import * as Auth from './auth.actions'; import { UserModel } from 'src/app/models/user.model'; export interface State { loggedIn: boolean; loading: boolean; userData: UserModel; } export const initialState: State = { loading: false, loggedIn: false, userData: null }; export function AuthReducer(state = i...
1967bada8f01ee2b9eb36d6f4fe236e39357d68c
TypeScript
levinean/journey_through_health
/journey-through-health-fend/src/app/types/event.ts
2.515625
3
import { Image } from './image'; import { Note } from './note'; export enum EVENT_TYPE { APPOINTMENT = 'appointment', SURGERY = 'surgery', EXAM = 'exam', TEST = 'test', IMAGING = 'imaging', } export enum EVENT_PRIORITY { HIGH = 'high', MEDIUM = 'medium', LOW = 'low', } export type Event = { id: str...
18ae9111a603d9b2d3d5a5791a1eac0b04175301
TypeScript
giladefrati/NearbyAttractions
/services/webapi.ts
2.75
3
import { Attraction } from "../interfaces" const googleKey = 'AIzaSyBPWFwHrsgzYw36bl-ecghaFEqNuRuGDUg' const googleURL = `https://maps.googleapis.com/maps/api/place/nearbysearch/json?` //Create params sending the object to the generator URLSearchParams export const getAttractions = async (params) => { //adding key...
164df1032a62b4d28306a6b767a0a94a3a5f5a6e
TypeScript
gabriel2302/anexos-sec-educacao
/src/modules/institutions/services/UpdateInstitutionService.ts
2.75
3
import AppError from '@shared/errors/AppError'; import { injectable, inject } from 'tsyringe'; import Institution from '../infra/typeorm/entities/Institution'; import IInstitutionsRepository from '../repositories/IInstitutionsRepository'; type IRequest = { id: string; name?: string; director?: string; learning...
3fc8d09cefc2cf1662fb8a11b64e66904dfc6e2e
TypeScript
chuoique/vlc-remote-control
/src/logger.ts
2.578125
3
"use strict"; interface Logger { info: (message: string) => void; error: (message: string) => void; } const logger: Logger = require("eazy-logger").Logger({ prefix: "{blue:[}{magenta:vlc-remote-control}{blue:] }", useLevelPrefixes: true }); export function logInfo(message: string): void { logger.info(messa...
7643c5e1b6cfaa7e94fe478f23b6868d4ac2f092
TypeScript
kalambo/rgo
/src/typings.ts
2.640625
3
export type Obj<T = any> = { [key: string]: T }; export type Falsy = false | null | undefined | void; export type Scalar = 'boolean' | 'int' | 'float' | 'string' | 'date' | 'json'; export interface ScalarField { scalar: Scalar; isList?: true; meta?: any; } export interface RelationField { type: string; isL...
0a310dbef38115fc7339db5095d079a8a96abe02
TypeScript
AndrewJBateman/angular-tutorial-assignments
/section26-animations/src/app/app.component.ts
2.59375
3
import { Component } from '@angular/core'; import { trigger, state, style, transition, animate, keyframes, group } from '@angular/animations'; @Component({ selector: 'app-root', templateUrl: './app.component.html', animations: [ trigger('divState', [ state('normal', style({ 'background-color': ...
dc88d8110072bebf261454cfd4d398c65c6bd552
TypeScript
G0ldenSp00n/tscoin
/src/commmands/ProveWorkCommand.ts
2.609375
3
import hash from 'object-hash'; import {Block} from "../entities/Block"; import {performance} from 'perf_hooks'; const DIFFICULTY = 4; export default class ProveWorkCommand { constructor() { } async prepare(): Promise<void> { } static run({ block }: { block: Block }) { let foundNonce = fals...
f1b94174bc28f31658f23e1b454347fa8b7f2bb2
TypeScript
ExtraHop/controlled-input
/src/interface.ts
3.5625
4
/** * Type definition for `ControlledInput#onChange`. * * * The first argument must always be a complete new value * * The second argument must always be the `name` of the field in the * parent that should be updated. */ export type ChangeHandler<T> = (newVal: T, name?: string) => void; /** * A change handler...
3701fca24ea5db4535e2bd630fd29f731f45ab37
TypeScript
martin-helmich/kube-mail
/src/util.ts
2.859375
3
import {Readable, Stream} from "stream"; export const readStreamIntoBuffer = (stream: Readable): Promise<Buffer> => { return new Promise((res, rej) => { const buffers: Buffer[] = []; stream.on("data", chunk => { if (!(chunk instanceof Buffer)) { chunk = Buffer.from(chun...
6007264cf84d1fb22bd76faebb08f1d5eccd07b4
TypeScript
dgreene1/virtual-alexa
/src/core/SkillRequest.ts
2.546875
3
import * as uuid from "uuid"; import {AudioPlayerActivity} from "../audioPlayer/AudioPlayer"; import {SlotValue} from "../impl/SlotValue"; import {UserIntent} from "../impl/UserIntent"; import {SkillContext} from "./SkillContext"; export class RequestType { public static DISPLAY_ELEMENT_SELECTED_REQUEST = "Display...
6b8d51371afe32419f977e44d218c707aedc85f8
TypeScript
rohit-enzigma/Node_Asynchronous
/Model/RetriveUser.ts
2.703125
3
import * as Promise from 'promise'; let fs = require('fs'); //Retriving data from userDetails file. export function retrieveUs() { return new Promise( function (resolve: any, reject:any) { let entry = 1; if(entry == 1) { console.log('Entered in Retrieve promise bloc...
bfc3f505c3f3c3f1fba7ca6e5067f33559425806
TypeScript
esthermsama/Curso-Javascript-e-Ionic
/mistabs/src/app/tab2/tab2.page.ts
2.78125
3
import { Component } from '@angular/core'; import { Imc } from '../imc'; import { TIMC } from '../timc.enum'; @Component({ selector: 'app-tab2', templateUrl: 'tab2.page.html', styleUrls: ['tab2.page.scss'] }) export class Tab2Page { private imc: Imc; private static readonly FOTO_DELGADO: string = "assets/de...
51d76ae4ccb1a11e653e21a970d5c6d8d5508db2
TypeScript
Findus23/nn_evaluate
/typescript/ui.ts
2.609375
3
import {calculate_grid} from "./calc"; import {valuesToImage} from "./utils"; import throttle from "lodash/throttle" export const massExpEl = <HTMLInputElement>document.getElementById("massExp") export const gammaPercentEl = <HTMLInputElement>document.getElementById("gammaPercent") export const wtFractionEl = <HTMLInp...
d8232d099296d4c036edcfd6e2c52a73220984d4
TypeScript
Fabienraza/Angular_PremierProjetAngular
/src/app/update-hopital/update-hopital.component.ts
2.515625
3
import { Component, OnInit } from '@angular/core'; import { HopitalService } from '../services/hopital.service'; import { Hopital } from '../models/hopital'; import { ActivatedRoute } from '@angular/router'; @Component({ selector: 'app-update-hopital', templateUrl: './update-hopital.component.html', styleUrls: ...
1b5cf10b85667fbc468c23d78b7c1354c22cc064
TypeScript
jowsy/classical-music-timeline
/src/core/ParameterGroup.ts
2.71875
3
import { TimeLineBase, TimeLineGeometry } from "."; export class ParameterGroup<T> { key:T; items:TimeLineBase[]; constructor(key:T, items:TimeLineBase[]){ this.key = key; this.items = items; } getXValues() : number[] { var initial : number[] = []; this.items.f...
c4bf513d7ad6a1ac3b0ee0471799d93f93cc3f5a
TypeScript
D-Brown-Management/Advent-Of-Code-2016
/Day1JS/app.ts
3.25
3
import fs = require("fs"); import readline = require('readline'); const inputArray = readInputArray('input.txt'); let currentDirection = 0; let currentPosition = <Position>{ x: 0, y: 0 }; let positionArray = []; positionArray.push({ x: 0, y: 0 }); let firstCrossFound = false; for (let i = 0; i < inputArr...
f1a38a2dc70b689c70458e46e710082d98b19b54
TypeScript
Streeterxs/livrariaDigitalFront
/src/Services/Utils/utils.ts
2.796875
3
export const enumToObjArrayWithNumbers = (enumToTransform: any, keyName: string, valueKey: string) => { return Object.keys(enumToTransform) .filter(key => { return !!+key || +key === 0 }) .map(key => ({[keyName]: enumToTransform[key], [valueKey]: +key})); }
174470ef388bb9ec0d2a18cd2ff2c4bbbcd5e4e6
TypeScript
raopinwu/LayaAir
/LayaAirTS/LayaAirSample/samples/UI_ColorPicker.ts
2.578125
3
/// <reference path="../../libs/LayaAir.d.ts" /> module ui { import ColorPicker = laya.ui.ColorPicker; import Handler = laya.utils.Handler; export class ColorPickerSample { private skin:string = "res/ui/colorPicker.png"; constructor() { Laya.init(550, 400); ...
c2436592f9158a1047e93f3f9b7f004882dce258
TypeScript
yellyoshua/kata-idukay-react-native
/hooks/useGame.ts
3.1875
3
import { PotionProps } from "../types"; export default function useGame() { const gameResult = (potions: PotionProps[]) => { const potionsAlias = potions.map(val => val.alias) || []; const gameStats = createGameStats(potionsAlias, damageRules); return gameStats; } const resetGame = (cb: () => void) =...
ecf5f6e0e038f54c82c40c7ed6bbfa4cc18af8e0
TypeScript
stephenh/joist.firebase
/test/m2/m2-spec.ts
2.609375
3
import { ModelPromise, Store } from '@src/model'; import { Mock } from 'firemock'; import { Child } from './Child'; import { Parent } from './Parent'; describe('m2 One-to-many with one-way child -> parent', () => { it('should be constructable with a parent instance', async () => { const db = new Mock().useDeter...
3da80d9bc3fc43fad2e2fc7b145a0671ab16308a
TypeScript
tnrich/ve-range-utils-ts
/test/isRangeOrPositionWithinRange.test.ts
2.765625
3
import { isRangeOrPositionWithinRange } from "../src"; import { expect as expect } from "chai"; describe('isRangeOrPositionWithinRange', function () { it('should correctly determine whether a position is within a range', function () { expect(isRangeOrPositionWithinRange(1, { start: 1, end: 1 })).to.equal(false) ...
0ec34b43cd84bc404245715397049d44abac24ed
TypeScript
iamhabee/recipe
/start/routes.ts
2.6875
3
/* |-------------------------------------------------------------------------- | Routes |-------------------------------------------------------------------------- | | This file is dedicated for defining HTTP routes. A single file is enough | for majority of projects, however you can define routes in different | files ...
065b2763490ca24f80af5ae96c592f8b7746cff2
TypeScript
meirelesgabriel/consulta-medica
/backend/src/routes/consultas.routes.ts
2.59375
3
import { Router } from 'express'; import { getRepository } from 'typeorm'; import ConsultasController from '../app/controllers/ConsultasController'; import Consultas from '../app/models/Consultas'; const consultasRouter = Router(); consultasRouter.post('/', async (request, response) => { try { const { ...
9e450755a5015d9814746f647169a7bf0d40821e
TypeScript
plavcik/cucumber
/gherkin-streams/javascript/src/SourceMessageStream.ts
2.671875
3
import { makeSourceEnvelope } from '@cucumber/gherkin' import { Transform, TransformCallback } from 'stream' /** * Stream that reads a string and writes a single Source message. */ export default class SourceMessageStream extends Transform { private buffer = Buffer.alloc(0) constructor(private readonly uri: str...
0d3a9268bd0069bd96e08a089478837221122392
TypeScript
balavignan/Web-ICP-1
/source code/project/jobseek/src/app/_shared/pipes/stringCleaner.ts
2.515625
3
import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'removeExtraComma' }) export class StrinCleaner implements PipeTransform { transform( value: string ): string { return value.replace(/(,\s,)|(^,)/, ''); } }
c9b0a0306c834c2769e2a93b7d14249015e1d1cd
TypeScript
imcuttle/rcp
/packages/hoc.uncontrolled/index.ts
3.046875
3
/** * @file uncontrolled * @author Cuttle Cong * @date 2018/6/16 * @description */ import isComponentClass from '@rcp/util.iscompclass' import displayName from '@rcp/util.displayname' import createLogger from '@rcp/util.createlogger' const logger = createLogger('@rcp/hoc.uncontrolled') function getDefaultName(n...
ce090d66090dc9d9f051251530a63d71d2b96bc7
TypeScript
scarrasco85/proyecto-experts-angular-imagina2
/src/app/modules/experts/components/availability-select/availability-select.component.ts
2.53125
3
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; interface Options { value: string; viewValue: string; } @Component({ selector: 'app-availability-select', templateUrl: './availability-select.component.html', styleUrls: ['./availability-select.component.scss'] }) export class A...
d32f86fd2484eb0174e12493688ccbc40ea44730
TypeScript
Primespark24/WRIntake
/imports/api/formConstants.ts
2.765625
3
// eslint-disable-next-line no-shadow export enum fieldTypes { none, string, bool, file, } export interface Field { type: fieldTypes, name: string, _id: string, description?: string, childFields?: Array<this>, childFieldsUnique?: boolean, // If there are multiple subfields, i...
9ecfb43981927ccc5896a7660de419dc271e8681
TypeScript
anyfiddle/anyfiddle-code-server-extension
/src/extension.ts
2.5625
3
import * as vscode from 'vscode'; type AnyfiddleJSON = { defaultCommand?: string; port?: number; openFiles?: string[]; }; let runCommandStatusBarItem: vscode.StatusBarItem; let portMappingStatusBarItem: vscode.StatusBarItem; export async function activate(context: vscode.ExtensionContext) { if (vscode.worksp...
c1ef5df1311513317431e539742e872ddcda228f
TypeScript
NikoBotDev/Niko-Discord
/src/commands/util/say.ts
2.546875
3
import { Command } from 'discord-akairo'; import { Message } from 'discord.js'; export default class SayCommand extends Command { constructor() { super('say', { aliases: ['say'], category: 'util', description: { content: 'say something' }, args: [ { id: 'te...
e1e7f6b8616f0167edf44637ca44fcc36c88ec55
TypeScript
code3tiger/next-bnb-server
/src/controller/auth/index.ts
2.578125
3
import { Request, Response } from "express"; import bcrypt from "bcryptjs"; import jwt from "jsonwebtoken"; import User from "../../model/User"; export const postLogin = async (req: Request, res: Response) => { const { email, password } = req.body; try { const user = await User.findOne({ email }); if (!use...
d3088e7194b5927eae8e510d5bc08a4fbe87d02a
TypeScript
kwhong95/ts_study
/TypeCompatibility/src/3.3.ts
2.984375
3
export {}; interface Person { name: string; age?: number; } interface Product { name: string; age: number; } const obj = { name: 'mike' } const person: Person = obj; const product: Product = obj;
abd13eb1019623dadada7f3d168a617fc010ee43
TypeScript
keyranz1/DonorApp
/src/pipes/gender-decider/gender-decider.ts
2.671875
3
import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'genderDecider', }) export class GenderDeciderPipe implements PipeTransform { transform(gender: any): string { gender = parseInt(gender); switch (gender) { case 0: return "app-man"; case 1: return "app-girl"; ...
9e3fe8924e4d0d4d7559ab9b08dfdde8b694df4d
TypeScript
James-Yu/LaTeX-Workshop
/src/utils/parser.ts
2.796875
3
import type * as Ast from '@unified-latex/unified-latex-types' function macroToStr(macro: Ast.Macro): string { if (macro.content === 'texorpdfstring') { return (macro.args?.[1].content[0] as Ast.String | undefined)?.content || '' } return `\\${macro.content}` + (macro.args?.map(arg => `${arg.openMa...
3159b6e8655709d3c500b91621bdd2e43732318a
TypeScript
arogozine/LinqToTypeScript
/src/parallel/_private/count.ts
3.234375
3
import { IParallelEnumerable, ParallelGeneratorType } from "../../types" export const count = <TSource>( source: IParallelEnumerable<TSource>, predicate?: (x: TSource) => boolean) => { if (predicate) { return count2(source, predicate) } else { return count1(source) } } const count1...
94ec8e44d62e7fa5576bdc2a6d69c4fabf719bb1
TypeScript
mandric/ionic-example-app
/src/app/home/home.page.ts
2.5625
3
import { Component } from '@angular/core'; import { Router } from '@angular/router'; import { UsersService, User, Gender } from '../services/users.service'; interface FilterInput { label: string, val: Gender, isChecked: boolean } interface AgeStats { oldest: number, youngest: number, average: number } @C...
4af1b0eba20b62572a7a1f3bd0649c0dfa68292e
TypeScript
helloworld121/angular-redux-duck
/src/app/model/to-do.model.ts
2.5625
3
import {IdGenerator} from '../decorator/id-class.decorator'; @IdGenerator() export default class ToDo { // title: string; // completed: boolean; constructor(public title: string, public completed: boolean) { console.log(this); } }
3cde7b85e33ac18e223927103a0f9063fac4efb9
TypeScript
vietanhtran16/axios-types
/types/axios/index.d.ts
2.765625
3
type Method = "get" | "delete" | "head" | "options" | "post" | "put" | "patch"; type ResponseType = "arraybuffer" | "document" | "json" | "text" | "stream"; interface Object { [key: string]: any; } interface BaseRequestConfig { baseURL?: string; transformRequest?: (data: Object, headers: Object) => Object; t...
29d6c8761d06d2ff413f35395410912698e36d53
TypeScript
laotian/codebyai-sdk
/SDKRenderUtils.ts
2.75
3
import {RenderNode, HtmlViewNode, CODE_TYPE} from './DataDefs'; import path from "path"; function objectIsEqual(nodeA:{[key:string]:string}, nodeB:{[key:string]:string}) { const nodeAKeys = Object.keys(nodeA).sort(); const nodeBKeys = Object.keys(nodeB).sort(); if(nodeAKeys.length!=nodeBKeys.length){ ...
bdc1c4faee8d612be235786c638d16b4a8da4535
TypeScript
tim-vu/vu_gunfight
/webui/src/store/match/reducer.ts
2.828125
3
import { MAX_HEALTH } from "common/constants"; import { PlayerInfo, toPlayerInfo } from "models/Player"; import { Team } from "models/Team"; import { Reducer } from "redux"; import { MatchActions, MatchState } from "./types"; const initialState : MatchState = { team: Team.RU, teamSize: 2, map: "Noshar Canals", ...
d46a011acd5bb8ecb58bec3d4c5b0c17ed48f140
TypeScript
leekangtaqi/design_pattern_ts
/src/proxy.ts
3.40625
3
/** * intention: Provides a proxy for other objects to control access to this object. */ interface Subject{ request(); } class RealSubject implements Subject{ request(){ console.log('real request...'); } } class Proxy implements Subject{ realSubject: RealSubject; constructor(){ thi...
08d274a8a75ced2c8deb00b236950b4c3b63bdf7
TypeScript
TamasToth92/Student_Form_Sample
/src/app/pipes/age.pipe.spec.ts
2.578125
3
import { AgePipe } from './age.pipe'; describe('AgePipe', () => { it('create an instance', () => { const pipe = new AgePipe(); expect(pipe).toBeTruthy(); }); it ('should mask old female age', () => { const pipe = new AgePipe(); expect( pipe.transform(45, 'female') ).toBe('40-50'); }); it ...
86427accedb3e772b8ee9aa4283ed3b586a5ad07
TypeScript
jaehyungz/chipstackoverflow-web
/hooks/useCommentCreation.ts
2.640625
3
import { useApolloClient } from "@apollo/react-hooks"; import * as React from "react"; import { AnswerId } from "@@/models/Answer"; import { CommentBody } from "@@/models/Comment"; import { PostId } from "@@/models/Post"; import useAuthentication from "@@/hooks/useAuthentication"; import usePost from "@@/hooks/usePost"...
72cd1972a2bca0514b37a7817ac972fe0f079132
TypeScript
LiubomyrPenkov/tscript
/client/calc.spec.ts
2.640625
3
import {expect} from 'chai'; import {describe, it} from 'mocha'; import mathFuncs from './calc'; let {sum, division, substr, multi} = mathFuncs; describe('mathFunsc', (): void=>{ it('should return proper sum', (): void=>{ expect(sum(1,3)).to.be.equal(1+3); }); it('should return proper multi', ()...
5dc08e6129eee1bfbd7a31dc50cea33284bc8581
TypeScript
ShieldBattery/ShieldBattery
/app/find-install-path.ts
2.890625
3
import { HKCU, HKLM, readRegistryValue } from './registry' // Attempts to find the StarCraft install path from the registry, using a combination of possible // locations for the information. The possible locations are: // HKCU\SOFTWARE\Blizzard Entertertainment\Starcraft\InstallPath // HKLM\SOFTWARE\Blizzard Entertert...
19b372a770eee2c8798f920d2e4e0d3b43da4671
TypeScript
craftingtheinternet/craftingtheinternet.com
/src/reducers/openGraphImage.ts
2.765625
3
export type ActionType = { type: string; }; export default (state = "ABOUT", action: ActionType) => { switch (action.type) { case "ABOUT": return "about.png"; case "CONTACT": return "contact.png"; case "RESUME": return "resume.png"; default: return state; } };
34e70d3f7aec9d98644da18d03da7bcd2c7d9161
TypeScript
Enarchaticy/table-reserve-frontend
/src/app/pages/reservations/date-pipe/date.pipe.ts
2.921875
3
import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'dateWithDay', }) export class DatePipe implements PipeTransform { constructor() {} transform(value: string): string { for (let i = -1; i <= 6; i++) { if (this.areEqualDays(new Date(new Date().setDate(new Date().getDate() + i)), value)...
05143b14c2cb073b52a33a293e637455939d73b6
TypeScript
robence/scotty-client
/src/store/period/reducer.ts
2.703125
3
import SELECT_PERIOD, { PeriodActionTypes } from './types'; import { State } from '../initialState'; export default function periodReducer( state: State, { type, periodId }: PeriodActionTypes, ): State { switch (type) { case SELECT_PERIOD: return { ...state, selectedPeriodId: Number(per...
e922c85ca85c592fe234a1f8fac4e3d8b017c11e
TypeScript
923325596/app
/src/services/smapi/transaction.ts
2.53125
3
export interface ITransaction { // serielized transaction data - hex - including provided gas and gas price txData: string; // signed txData when tx is sigend signature?: string; // hex string of user public address address: string; } export enum TransactionStatus { Pending, // not on mes...
20d4cbf575b023f02d4629fe38e678c1a5b3fb6a
TypeScript
centreon/centreon
/centreon/www/front_src/src/Authentication/Local/TimeInputs/options.ts
2.546875
3
import type { SelectEntry } from '@centreon/ui'; import { PartialUnitValueLimit, UnitValueLimit } from '../models'; const commonEntry = { id: 0, name: '0' }; const getTimeInputOptions = ({ max, min }: UnitValueLimit): Array<SelectEntry> => [ commonEntry, ...Array(max - min + 1) .fill(0) .map((_, ...
0bd30559deda67abbe3df4211d11e22402dcc354
TypeScript
liaujianjie/firebase-to-supabase-auth-migrator
/typings/firebaserc-object.ts
2.84375
3
type FirebasercObject = { projects: { default: string; [label: string]: string; }; }; export function isFirebasercObject(obj: any): obj is FirebasercObject { if (typeof obj !== "object") { return false; } if (!("default" in obj)) { return false; } for (const projectId in Object.values(ob...
c254792a03e5ba3edeb25d179bf51f0f3e58e42c
TypeScript
disco0/sandbox-vscode
/src/htmlView.ts
2.609375
3
import * as vscode from "vscode"; import { JSDOM } from "jsdom"; import { getAttributes } from "./getAttributes"; const buildInitScript = (htmlAttributes: {}, styleId: string) => ` const htmlAttrs = ${JSON.stringify(htmlAttributes)}; for (const [attr, value] of Object.entries(htmlAttrs)) { document.documentE...
db4bf6ffdc597ae476fccea7906c323dacf9471a
TypeScript
restorecommerce/resource-base-interface
/src/core/utils.ts
3.0625
3
import * as _ from 'lodash'; const marshallObj = (val) => { try { return { type_url: '', value: Buffer.from(JSON.stringify(val)) }; } catch(error) { // throw error and it is handled and logged in ServiceBase functions throw error; } }; const updateObject = (obj: any, path: string, va...
0bdb43e1ed9d5a762d02865201400fb2b29597bd
TypeScript
magsout/tools
/internal/js-ast-utils/getRequireSource.ts
2.53125
3
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import {Scope} from "@internal/compiler"; import {AnyNode} from "@internal/ast"; import {doesNodeMatchPattern} from "./doesNodeMat...
dd8bbde11d65a7912350daf4508a2c4f259a748a
TypeScript
hu-tao-supremacy/archive
/src/entities/user.entity.ts
2.65625
3
import { PrimaryGeneratedColumn, Column, Entity, Index } from 'typeorm'; @Entity() export class User { @PrimaryGeneratedColumn() id: number; @Column() firstName: string; @Column() lastName: string; @Column({ unique: true }) email: string; @Column({ nullable: true }) nickname?: string; @Index...
68c013e6bad3b56dcb7e9a316505aeacd6a57790
TypeScript
lifesucx/stats
/src/qrcodes/display-dialog.ts
2.515625
3
import { autoinject } from "aurelia-framework"; import { QrCodeDisplayInput, qrCodeConfigurations } from "./display-input"; import * as qrcode from "qrcode-generator"; import { DialogController, DialogService } from "aurelia-dialog"; import * as lz from "lz-string"; import { FrcStatsContext, makeUserPrefs } from "../pe...
7e4b79ff55edcc65902f6a2d4a98fefe76e75879
TypeScript
jymfony/jymfony
/src/Component/Console/types/Question/Renderer/AbstractRenderer.d.ts
2.6875
3
declare namespace Jymfony.Component.Console.Question.Renderer { import OutputInterface = Jymfony.Component.Console.Output.OutputInterface; import Question = Jymfony.Component.Console.Question.Question; import OutputFormatterInterface = Jymfony.Component.Console.Formatter.OutputFormatterInterface; /** ...
1f13fd84bfd3e7045fea4b1d2a9a5eba3bdee086
TypeScript
Innovalz/InnovalzWebSiteBackEnd
/src/core/typescript/util/transformer.util.ts
2.75
3
export class TransformerUtil { static flatFromTree(list: string | any[]) { let _a, _b; const map: Record<string, unknown> = {}; const root = []; for (let i = 0; i < list.length; i += 1) { map[list[i].id] = i; list[i].children = []; } for (let i = 0; i < list.length; i += 1) { ...
cfdffdb2a1b9ebeb05d9ad392e8228284842f7ac
TypeScript
bhaktiardyan/TypeScript
/pesawat.ts
3.046875
3
import { abstractKendaraan } from "./abstractKendaraan"; export class pesawat extends abstractKendaraan { constructor(pName : string, pKapasitas:number, pJalur:string) { super(pName, pKapasitas, pJalur); } // abstract dari class abstractKendaraan // methode di class abstractKenda...