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
5b34a49bed48ed708451f5fbe13015e555c31365
TypeScript
branc116/FER-irg
/Drawables/Drawable.ts
2.53125
3
import { DrawableString } from "./DrawableString"; import { mat4 } from "../mat4/mat4"; export interface DrawableTyped<T extends Drawable> extends Drawable { readonly type: DrawableString<T>; } export interface Drawable { buffer: WebGLBuffer | null; readonly type: string; readonly id: number; ...
432d48bb2e133a4f1cace9e254df8054261faaa6
TypeScript
user30072/OpenPro
/services/assets.ts
2.734375
3
import { Template, Schema } from './templates'; import { Collection } from './collections'; import { toQueryString } from '../utils'; import { getFromApi } from '../utils/browser-fetch'; export type Asset = { name: string; data: Record<string, unknown>; owner: string; template: Template; asset_id: ...
1b42476b8960f54e152827581857318825ddd2ef
TypeScript
velidan/rpn-calculator-cli
/build/module/operations/OperationRegistry.d.ts
2.75
3
import { Operation } from './index'; interface RegistryType { [index: string]: Operation; } /** * A Registry that keeps our {@link Operation} instances. * {@link Node} doesn't contain an operation instance * even if it has an operation type otherwise it would * waste the memory resources. * The node contains o...
00afce95a4934d52b581856a918e1bd7c0db8bc1
TypeScript
kamranayub/presentations
/typescript-in-action/demo/DemoApp/Scripts/app/Book.ts
2.796875
3
import {DateStringConverter} from './Decorators' export class Book { private _id: number = 0; public get id(): number { return this._id; } public set id(value: number) { this._id = value; } private _title: string = null; public get title(): string { return this._title; } publi...
c91bc36c4dcb916463cdccf4daf3b29f9cd80c0f
TypeScript
zdenek-horak/entis-timeline
/src/RenderModel/renderedcircle.ts
3.28125
3
import { RenderedElement } from "./renderedelement"; import { PointSpec } from "./pointspec"; import { TimelineElement } from "../DataModel/timelineelement"; export { RenderedCircle } /** * Rendered Circle Model */ class RenderedCircle extends RenderedElement { /** * Circle center specification */ ...
d5be9b892c45caeb80eeee95fc973e3e5137236a
TypeScript
MatteoPieroni/inspect-api-extension
/src/background/store.ts
3.21875
3
import { Statuses, Methods } from "../types"; export interface StoreData { [id: string]: Entry; } export type PartEntry = { endTime: number; status?: keyof typeof Statuses; }; export type Entry = { id: string; url: string; startTime: number; endTime?: number; status: keyof typeof Statuses; method: ...
54e7f587050f8d43d45625a5b7c1cf25ccd2d802
TypeScript
RobinMnk/Emojoy
/app/src/services/connection.ts
2.625
3
import { getCookies, setCookie } from "../util/util" import Peer from 'simple-peer' import { Emotion } from "../components/faceapi"; interface Message { type: 'register' | 'init' | 'offer' | 'answer' | 'userId', signal: object | undefined, id: string | undefined, } interface Coords { x?: number, y: number ...
aef5ab0aaf4823574ecead0eb7150a9d69e222de
TypeScript
DLeasure/MyThoughts
/src/app/socialPosts/postForm/postform.component.ts
2.578125
3
import { Component, EventEmitter, OnInit, Output } from '@angular/core'; interface Thought { Title: string, ThoughtContent: string } @Component({ selector: 'postform', templateUrl: './postform.component.html', styleUrls: ['./postform.component.css'] }) export class PostFormComponent implements OnInit { ...
2237192d0736a210b113d70c992051a2bdf0818a
TypeScript
fazilathfathima5656/cloud-tool
/toolbox_2.0/packages/nodes-base/nodes/Airtable/GenericFunctions.ts
2.65625
3
import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions, } from '@toolbox/toolbox-core'; import { OptionsWithUri } from 'request'; import { IDataObject } from '@toolbox/toolbox-workflow'; /** * Make an API request to Airtable * * @param {IHookFunctions} this * @param {string} method * @param {strin...
ef16d67ff85744b60d42619f5c3bee43d7d191b0
TypeScript
EricLeeN1/typeScriptStudy
/src/class-static.ts
3.8125
4
class Grid { static origin = { x: 0, y: 0, }; calculateDistanceFromOrigin(point: { x: number; y: number }) { let xDist = point.x - Grid.origin.x; let yDist = point.y - Grid.origin.y; return Math.sqrt(xDist * xDist + yDist * yDist) / this.scale; } constructor(public scale: number) {} } let...
3d3fc2577cbf2e9188f1f567129797b86c88eb28
TypeScript
ua9msn/middle.messenger.praktikum.yandex
/src/utils/http.ts
3.1875
3
enum METHOD { GET = 'GET', POST = 'POST', PUT = 'PUT', PATCH = 'PATCH', DELETE = 'DELETE', } type Options = { method: METHOD; headers?: Record<string, string>; data?: any; timeout?: number; }; type OptionsWithoutMethod = Omit<Options, 'method'>; const queryStringify = (obj: Record<string, any>) => ...
fbdc44c232ba4edb023542062a274661c1700d75
TypeScript
redjolr/throwable-http-exceptions
/src/exceptions/client-errors/ExpectationFailed.ts
2.625
3
import { HttpException } from '../../HttpException' import { ExpectationFailedParams } from '../../definitions/exception-parameters/ExpectationFailedParams' import { HTTP_EXPECTATION_FAILED } from '../../http-error-codes' /** * RFC 7231 Section 6.5.14 * * The 417 (Expectation Failed) status code indicates that the ...
6091fee7dfad646ad5b60c0b1873dcbc1beccd63
TypeScript
mayuriwagh27/TY_CG_HTD_PuneMumbai_JFS_MayuriWagh
/Capgemini HTD/Frontend/typeScript/demo.ts
4.09375
4
let myname: String = 'Mayuri'; //String //myname = 123; => cannot change data type //any let company; company = 123; company = "Mayuri"; //can change data type company = true; //union let age : String | number; // can use multiple data types age = 12; age = 'twelve'; //age = true; => only string or n...
458330a24cc2580c0bb54a7208b5e50f7c087d11
TypeScript
GlermS/nextjs
/src/database/DB/mongodb/mongodb.ts
2.78125
3
import UserModel from './models/User' import CallModel from './models/Call' import dbConnect from './dbConnect' import DataBaseInterface,{UserInterface} from '../../interface/database'; import {hash,compare} from 'bcrypt' class User implements UserInterface{ approved: boolean; name:string; id:string; ...
5b18dcaef323f7c850368ca46764e856512b7fb4
TypeScript
evmar/smash
/web/src/smash.ts
2.703125
3
import { ServerConnection } from './connection'; import { Shell } from './shell'; import { Tabs } from './tabs'; import { html, htext } from './html'; const tabs = new Tabs(); async function connect() { const conn = new ServerConnection(); const hello = await conn.connect(); const shell = new Shell(); shell....
76667afc2e2ff68b300b26dc97d9a519db98df60
TypeScript
NaridaL/composer
/src/renderer/app/util/file-watcher.ts
2.671875
3
import * as chokidar from 'chokidar'; /** * Creating multiple chokidar watchers results in memory leaks and high memory usage in general. * Therefore, here, we provide only one chokidar listener. We dispatch events manually. */ export class FileWatcher { public chokidarWatcher = new chokidar.FSWatcher(); c...
c00d6bfd86007578ba7ad10b9f7d73ccee17fe0c
TypeScript
peter-nikitin/aviasales-frontend-test
/src/utils/useSortableTickets.ts
2.734375
3
import React from "react"; import { TicketType, SortingType } from "../data/types.d"; import sortTickets from "./sortTickets"; const useSortableTickets = ( tickets: TicketType[], sortingType: SortingType ): TicketType[] => { const sortedTickets: TicketType[] = React.useMemo(() => { const ticketsToSort = [....
2f45aba5fac668f038c3c3dce3274bba541bd066
TypeScript
krcasper/red-badge-client
/src/Services/AdminService.ts
2.6875
3
import APIURL from "../Helpers/environment"; import { User } from "../Types/User"; export async function getUsers(): Promise<User[]> { const token = localStorage.getItem('token'); if (token === null) { throw new Error('Not Authenticated'); } const response = await fetch(`${APIURL}/users`, { ...
61dfea84affaa0c5bc87ddbbb5264b82099a69cf
TypeScript
sebas-mora28/VS-Code-Memory-Manager
/vsptr-memory-manager/src/HeapVIsualizer.ts
2.578125
3
/** * * This class generate a WebView to visualize the heap visualizer */ import * as path from 'path'; import * as vscode from 'vscode' import * as fs from 'fs' export class HeapVisualizer { /** * Track the currently panel. Only allow a single panel to exist at a time. */ public static currentPanel: H...
5f5e335c255491e9ce3472a10cd782c40891757a
TypeScript
liuxinqiong/street-view
/src/utils/dom.ts
2.9375
3
type StyleType = { [key: string]: any; }; export function addStyle(el: HTMLElement, style: StyleType) { for (const attr in style) { if (style.hasOwnProperty(attr)) { el.style[attr as any] = style[attr]; } } }
e4971b8462afbccf429feb085ef80727c36e4d8c
TypeScript
motion-canvas/motion-canvas
/packages/core/src/meta/MetaFile.ts
2.734375
3
import type {MetaField} from './MetaField'; import {Semaphore, useLogger} from '../utils'; /** * Represents the meta file of a given entity. * * @remarks * This class is used exclusively by our Vite plugin as a bridge between * physical files and their runtime representation. * * @typeParam T - The type of the ...
a2172bc63485cd9f34261993f0c8c3bbc404bfa1
TypeScript
maxiste/mongoose_Angular
/src/app/productos/listado-productos/listado-productos.component.ts
2.609375
3
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; import { FormGroup,FormControl } from '@angular/forms'; import { Producto } from 'src/app/models/producto.model'; import { ProductosService } from 'src/app/servicios/productos.service'; import { MensajesService } from 'src/app/servicios/mensajes....
ee40353ff6ce439f0d2c16170fa9ed38ac47b5c8
TypeScript
SamSalvatico/test_rabbit
/src/Utils.ts
2.734375
3
import http from 'http'; import * as dotenv from 'dotenv'; dotenv.config(); class Utils { /** * If valueToSet is not empty set it, * otherwise check env key otherwise sets defaultValue * * setProperty */ static getPropertyValueComparing( valueToSet: any, envPropertyNameToCheck: string, ...
a5672dd85795e430f69fd29e4173ed45e8e5fd70
TypeScript
OrbitalEnterprises/evekit-frontend-ui
/src/app/store/auth-model.ts
2.703125
3
import {EveKitUserAccount, EveKitUserAuthSource} from '../platform-service-api'; import {Action} from '@ngrx/store'; /** * User authentication info state. */ export interface UserAuthInfo { account: EveKitUserAccount; source: EveKitUserAuthSource; sourceList: Array<EveKitUserAuthSource>; } // Default state co...
eb30d603be19dfde6cfcc6b6f9273f919633ddba
TypeScript
NRoboto/movie-organiser
/src/tests/fixtures/db.ts
2.734375
3
import mongoose from "mongoose"; import jwt from "jsonwebtoken"; import { User, List } from "../../models"; import type { UserDocument, ListDocument } from "../../models"; const user1Id = new mongoose.Types.ObjectId(); const user2Id = new mongoose.Types.ObjectId(); type OptionalUserDoc = Partial<UserDocument>; type O...
59c6796a6923fc67d80733967a40a999c4612eec
TypeScript
jonelantha/gatsby-s3-action
/src/input.ts
2.984375
3
import { getInput } from '@actions/core' export function getIntInput(name: string): number { const stringValue = getInput(name) const intValue = parseInt(stringValue, 10) if (Number.isNaN(intValue)) { throw new RangeError(`Invalid '${name}': ${stringValue}`) } return intValue } export function getBoo...
3760a9fc154cc3845428568778553221c424d105
TypeScript
asimyildiz/perf-dashboard
/src/utils/helpers.ts
3.921875
4
/** * groupBy an array using a getter function * @param {Array<V>} list - array data * @param {Function} keyGetter - getter function * @returns {Map<K, Array<V>>} */ export const groupBy = <K, V>( list: Array<V>, keyGetter: (input: V) => K, ): Map<K, Array<V>> => { const map = new Map<K, Array<V>>(); list....
991322c121b5b35e786b66a71e5b85be5ba19504
TypeScript
bawilderman1/MyCodeRepo
/thinkscript2022/TS_Hurst_ExponentSTUDY.ts
2.515625
3
declare lower; input Length = 30; input Price = close; Assert(Length % 2 == 0, "Length must be even number"); #SuperSmoother def cutoffLength = 20; def a1 = Exp(-Double.Pi * Sqrt(2) / cutoffLength); def c2 = 2 * a1 * Cos(Sqrt(2) * Double.Pi / cutoffLength); def c3 = - Sqr(a1); def c1 = 1 - c2 - c3; def hh3 = Highes...
caadf18a235ea8dafc1195ffe4c0e85f616e3796
TypeScript
snakeninja110/angular-bscroll
/src/common/js/dom.ts
2.53125
3
export function getRect(el) { if (el instanceof (<any>window).SVGElement) { const rect: any = el.getBoundingClientRect(); return { top: rect.top, left: rect.left, width: rect.width, height: rect.height }; } else { return { top: el.offsetTop, left: el.offsetLeft, ...
0030de2ac17cd83c2c0e82be2e0adc409305f9cd
TypeScript
MapGIS/MapGIS-Mobile-React-Native
/src/geoobject/LinInfo.ts
3.0625
3
/** * @content 线图形信息功能组件 * @author fangqi 2021-09-12 */ import GeomInfo from './GeomInfo'; /** * @class LinInfo */ export default class LinInfo extends GeomInfo { getClassName(): String { return this.CLASS_LIN_INFO; } /** * 构造一个新的 LinInfo 对象 * @memberOf LinInfo * @return {...
0d04f09b53b1b82c239f1caf57a5c35e00bfbc2c
TypeScript
git2WorkPH/task
/index.ts
2.546875
3
import * as mysql from 'mysql' import * as fs from 'fs' import * as axios from 'axios' import { IStore } from './model/store' import { OpenConnection } from './serivces/sql.service' /** * TODO: * 1. establish mysql connection - Done * 2. get locations from TASK API - Done * 3. map locations based on the store fiel...
fc8629b14d8f7333b0abe59cac0d2f8b5eb6210f
TypeScript
Elena3416/AutoevaluacionGradodeMadurezenInnovacion
/src/app/Services/messageerrors.service.ts
2.875
3
import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root' }) export class MessageerrorsService { constructor() { } public ErrorMessage(errorRecibido: any) { let message: string = ""; if (errorRecibido == null) { return { error: false } } switch (true) {...
fda1d9affd2a24f9686870e3595badc5e12852a6
TypeScript
Xesin/XEngine
/source/core/Render/Resources/Shader/Shader.ts
2.640625
3
import {IDict} from "../../../Game"; import {ShaderVariant} from "./ShaderVariant"; import {ShaderCompileStatus} from "../../ShaderCompilerStatus"; import {ShaderCompiler} from "../../ShaderCompiler"; import {Uniform} from "./Uniform"; import {VertexAttribute} from "./VertexAttribute"; import {ShaderType} from "../Enum...
8b6088ae6cadebc97e7ee557df705c2f5e955f81
TypeScript
Blackbaud-SteveBrush/skyux-lib-tabs
/src/app/visual/tabset-visual.component.ts
2.640625
3
import { Component } from '@angular/core'; @Component({ selector: 'app-tabset-visual', templateUrl: './tabset-visual.component.html' }) export class TabsetVisualComponent { public activeIndex = 1; public tabConfigs: { content: string; heading: string; disabled?: boolean; headingCount?: numb...
4593806f48c0d0be6cc88dff24d313e58811be79
TypeScript
nima-ab/knock-off-rest
/parsers/parser.ts
2.75
3
import { Request } from "../server"; import qs from "query-string"; import { UndefinedRefrenceError } from "../error"; interface IParser { parse: (input: any) => any; } abstract class ParserChain implements IParser { protected nextParser?: ParserChain; abstract contentType: string; get parser() { if (!th...
7d92c9af810bd44d7bb508db7d0880f83790a55f
TypeScript
MilesWilde/d2-discord-bot
/src/models/item_models/item.ts
2.515625
3
import * as ramda from "ramda"; import { getRandomInt } from "utils"; let prefixes = require("d2data/MagicPrefixesNew.json") as Affix[]; let suffixes = require("d2data/MagicSuffixesNew.json") as Affix[]; export const enum HexItemColor { Magic = `#5050ac`, White = `#c4c4c4`, // Rare , // Unique , //...
99f1d0f123645ad30b18c2a41a4acc788c421361
TypeScript
mariela21180/institucional-cfp
/proyecto/src/persona/services/persona.service.ts
2.5625
3
import { Injectable, HttpException } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import Persona from '../entities/persona.entity'; import { Repository } from 'typeorm'; import { PersonaDto } from '../dto/persona-dto'; @Injectable() export class PersonaService { public constructor( ...
72342c2d001fa57be19415e9b6967642d8c8c281
TypeScript
shinujohn/dash-lance-alpha
/providers/Factory.ts
2.515625
3
import * as nconf from "nconf"; /** * TODO: re-implement in an object oriented way */ class Factory { constructor() { } /** * Gets the given provider for file storage */ static getStorageProvider() { // let Provider= require(`./storage/${name}`); // return new Provider(nco...
e7c47bf6bbf0d08db5b40489bd527fd54241539f
TypeScript
maana-io/q-template-service-typescript-typegraphql
/src/types/person-event.ts
2.859375
3
import { Field, ObjectType, ID } from "type-graphql"; @ObjectType({ description: "A Person subscription event" }) export class PersonEvent { @Field(() => ID, { description: "The unique identifier of the person" }) id: string; @Field({ description: "The full name of the person" }) name: string; @Field({ des...
9a5c51a363f3e5ca1290a8df98cc97878768d213
TypeScript
sebinsua/chalk-mobile
/src/Source.ts
2.796875
3
export const SOURCE_TYPE_VIDEO = 'video'; export const SOURCE_TYPE_AUDIO = 'audio'; export const SOURCE_TYPE_IMAGE = 'image'; export const SOURCE_TYPE_GRADIENT = 'gradient'; export const SOURCE_TYPE_TEXT = 'text'; export type AudioSource = Readonly<{ type: typeof SOURCE_TYPE_AUDIO; title: string; uri: string; }>...
5d01990fc5e1f052422a127ee5440362a6eb95ce
TypeScript
tristanmkernan/runwcm
/src/app/utils.ts
3.171875
3
import { db } from './db'; interface IGeoPoint { lat: number; lng: number; } export interface ILocation { name: string; short: string; coordinates: IGeoPoint; } interface ICourse { name: string; location: ILocation; } export interface ISchedule { monday: ICourse[]; tuesday: ICourse[]; wednesday:...
4e4fcc0ed4599c783fb32a54d6e86e6b889350d8
TypeScript
kblincoe/VisualGit_SE701_2019_2
/src/app/model/graph/display.ts
3.171875
3
import * as data from './data'; // Honestly, im just having a bit of fun with these names. export interface NodePos { railing: number; segment: number; node: number; } // Some day we should use this instead of LayoutLine for the railing export interface LineSegment { nodes: data.Node[]; // Contains only node...
232458bd9a4ea46a20957b7499c82dea44444c8f
TypeScript
palisadoes/talawa-api
/src/resolvers/Query/eventsByOrganization.ts
2.703125
3
import { QueryResolvers } from "../../types/generatedGraphQLTypes"; import { Event, InterfaceUserAttende } from "../../models"; import { STATUS_ACTIVE } from "../../constants"; import { getSort } from "./helperFunctions/getSort"; /** * This query will fetch all events for the organization which have `ACTIVE` status fr...
565197bd83c1a3d7ace736832ca109866058e92c
TypeScript
eteries/ts-for-ng22012019
/lesson-2/Julia Ki/basics-2.ts
4.25
4
class A {} class B {} // эту фабрику используют для разных ситуаций: userFactory<B>(B); type callback<T> = { new(): T; }; function userFactory<T>(type: callback<T>): T { return new type(); // тут возвращаем конструктор } let a: { new(): A; } = A; // a(); // происходит с ошибкой // new a(); //создается новый объ...
7a105959426b777d0552f3108d8ff34b26e0a25c
TypeScript
bisu8018/p2p_exchange_front_end
/src/vuex/controller/StateController.ts
2.625
3
import {VuexTypes} from "@/vuex/config/VuexTypes"; import {Store} from "vuex"; export default class StateController { store: Store<any>; constructor (vuexStore: Store<any>) { this.store = vuexStore } // 모바일 체크 setMobile(isMobile: boolean) { this.store.dispatch(VuexTypes.SET_IS_MOB...
aabef596dfcabd5a1026a1ff6af1dc318e8f1902
TypeScript
qasim9872/question-answering-system-main-js-api
/lib/controller/helper/knowledge-graphs/db-pedia.results.ts
2.671875
3
import IResult from "../../../interface/result.interface" import { dbPediaResults } from "./utils" export function getResponseForEmptyResult(): IResult[] { return [ { source: "DBPedia", varName: "anonymous", lang: "en", value: ["No response available for the provided query"].join("\n") ...
83db07c72490d395c0e940171a698e94bdadb4a7
TypeScript
andy-schulz/thekla-core_outdated
/app/screenplay/lib/matcher/See.ts
3
3
import {AnswersQuestions, PerformsTask} from "../../Actor"; import {Question} from "../questions/Question"; import {Activity, Oracle} from "../actions/Activities"; import {stepDetails} from "../decorators/step_decorators"; export class See<PT, MPT> implements Oracle<PT,...
cbaf577fdc2a75fbd236adf1f229536fc18a1b41
TypeScript
andreashouben/wordstonumbers
/app/calc.component.ts
2.8125
3
import {Component} from '@angular/core'; import * as _ from 'lodash'; const diff0 = 97; const diff1 = 96; const modes = { A0: 97, A1: 96, A26: 123, A25: 122 }; const templateUrl = require('./calc.template.html'); const styles = require('./calc.style.scss'); @Component({ selector: 'my-app', //m...
f34dec16216d99acfd88af95b232f8fe84a63221
TypeScript
bilalesi/auth-bulk-ddd
/src/core/Identity.ts
3.109375
3
import { v4 } from "uuid"; class Identity{ private readonly id: string constructor(value?: string){ this.id = value ? value : v4() as string } equals(id?: Identity): boolean{ if(id === null || id === undefined){ return false } else if(!(id instanceof this.c...
f89a449c85cab1761a160bf5444223e0541a9db3
TypeScript
jasonwong26/dndbeyond-developer-challenge
/API/src/business/hpCalculations.ts
3.53125
4
import * as Types from "../types"; // Rules: // Hp total equals sum of: // 1) character level * constitution modifier (including adjustments) // 2) class level * average dice roll for class // 3) a character can have multiple classes export const calculateFixedHp = (character: Types.CreateCharacterRequest | Types....
022fb48a23e9c6eed6af171fd2faea9b4544a84a
TypeScript
elushnikova/weather-widget
/src/classes/Visibility.ts
3
3
import DistanceUnit from "@/assets/units/DistanceUnit"; import PhysicalQuantity from "@/classes/PhysicalQuantity"; import VisibilityInterface from "@/interfaces/quantities/VisibilityInterface"; class Visibility extends PhysicalQuantity implements VisibilityInterface { constructor(value: number) { super(value, Di...
24126b94e92338760a640e891e3356aa7d031e93
TypeScript
alexander-lebed/electron-react-app
/app/actions/emails.ts
2.53125
3
import { EmailModel } from '../models'; import { EmailApi } from '../transports/email'; import { FOLDERS } from '../types'; export enum EmailsTypeKeys { SELECT_FOLDER = 'emails/SELECT_FOLDER', SELECT_EMAIL = 'emails/SELECT_EMAIL', REFETCH_EMAILS = 'email/REFETCH_EMAILS' } type SelectFolderAction = { type: Ema...
e4d68d55e4012e39c947c6dc617e4616f69986c4
TypeScript
Mohammad-Afaque/prisma1
/cli/packages/prisma-datamodel/src/datamodel/renderer/renderer.ts
2.78125
3
import { ISDL, IGQLType, IDirectiveInfo, IGQLField, IIndexInfo, IdStrategy, } from '../model' import { GraphQLSchema } from 'graphql/type/schema' import { GraphQLObjectType, GraphQLEnumType, GraphQLField, GraphQLFieldConfig, } from 'graphql/type/definition' import { GraphQLDirective } from 'graphql/...
2b1ab75a27c73005e22753f602245d70075e44d6
TypeScript
tbilaszewski/slack-app
/functions/src/index.ts
2.703125
3
import functions = require('firebase-functions'); import { addQuoteToDB, getQuoteFromDB, QuoteData } from './database'; import { authenticate } from './authentications'; enum UserResponse { Accept = "accept", Cancel = "cancel", WrongInput = "wrongInput" } exports.quotes = functions.https.onRequest((req, respons...
d38db463553684d36e776c32265ea41cba69e776
TypeScript
leecr97/city-generation
/src/lsystem/texturereader.ts
3.296875
3
export default class TextureReader { textureData: Uint8Array; width: number; height: number; constructor(td: Uint8Array, w: number, h: number) { this.textureData = td; this.width = w; this.height = h; // console.log("dim: " + this.width + ", " + this.height); } ...
02de9f31c1fc6843e1977ae8a72a7fc704f0c9a9
TypeScript
RandomSeeded/NateGB
/src/cpu/z80.ts
3.484375
3
type EightBitRegister = 'a' | 'b' | 'c' | 'd' | 'e' | 'h' | 'l'; interface Clock { // I BELIEVE that t is always m * 4. T is actual mhz, m is 'machine cycles' m: number; t: number; } interface Registers { // 8-bit registers a: number; b: number; c: number; d: number; e: number; h: number; l: num...
b2282b675657afbd4cce3462eafd555e39d7e28e
TypeScript
jrubins/coursera-ucsd-alg-toolbox
/src/week2/fibonacciLastDigit.ts
3.96875
4
/** * This function will not work for large numbers since adding the two large fibonacci numbers would * cause overflow. */ export function getFibonacciLastDigitNaive(n: number): number { if (n <= 1) { return n } let previous = 0 let current = 1 for (let i = 0; i < n - 1; ++i) { let tmpPrevious =...
9c7eb8636847772ae016bfbf8def1a1d74ce2638
TypeScript
chayton-c/haida-okr-frontstage
/src/app/shared/pipe/kilometer-pipe.ts
2.625
3
import {Pipe, PipeTransform} from "@angular/core"; @Pipe({name: 'kilometerPipe'}) export class KilometerPipe implements PipeTransform { transform(value: any, ...args: any[]): any { let kilometer = value; return "K" + Number(Math.floor(kilometer / 1000).toFixed(0)) + "+" + Number(kilometer % 1000).toFixed(0);...
7549daf354ff2ed1f619e3e699ff0733e034e7ce
TypeScript
Sunimali/service-station-app
/src/app/payments/vehicle-appointment.service.ts
2.796875
3
/*import { Injectable } from "@angular/core"; import { HttpClient } from "@angular/common/http"; import { Subject } from "rxjs"; import { map } from 'rxjs/operators'; import { Appointment } from "./appointment.model"; import { Router } from '@angular/router'; import { StaffService } from '../staff/staff.service'; impo...
cae9ae9c6289d22d5ee787740eae12414b376a2b
TypeScript
academician42069/typescript-personal-project
/source/school/lmsModel.ts
2.734375
3
import { ISubjectsModelScheme } from "./subjectsModel"; export interface ILMSModelScheme { subjMap: Map<string, ISubjectsModelScheme>; } export class LMSModel implements ILMSModelScheme { public subjMap: Map<string, ISubjectsModelScheme>; constructor() { this.subjMap = new Map(); } publ...
0eb5ec1cbef012666556d4dc702f262063e411b3
TypeScript
TarVK/SAT
/src/formula/parsing/createLanguage.ts
3.0625
3
import P, {Parser} from "parsimmon"; import {Result} from "parsimmon"; import {IFormula} from "../../_types/IFormula"; import {IOperator} from "../../_types/IOperator"; import {IOperatorFactory} from "../../_types/IOperatorFactory"; import { IOperatorBinaryParser, IOperatorNonBinaryParser, } from "../../_types/...
86e578409a2fc0a9b11d37693a7ebebf6e19690a
TypeScript
tedslittlerobot/curi
/packages/core/src/utils/match.ts
2.625
3
import { join, stripLeadingSlash, withLeadingSlash } from './path'; import { InternalRoute } from '../route'; import { Params, RawParams } from '../interface'; export interface Match { route: InternalRoute; params: Params; } export default function matchRoute( route: InternalRoute, pathname: string, matches...
574004ad8f2f68ec731b9fab8ef249fdf63fca20
TypeScript
k4-1/jom-display
/LCD_display.ts
2.703125
3
/******************************************************************************* * LCM1602-14 LCD Micro:Bit extension * * Author: Arif Haikal *******************************************************************************/ /** * Board initialization and helper function. */ //Instruction Set const CLEARDISPLAY = 0x01;...
0d219a5a21fc9da879f89b9036915d11aba8f535
TypeScript
GabrielCosta-stack/CRUD-Typescript
/src/services/products/UpdateProductService.ts
2.8125
3
import { getCustomRepository } from 'typeorm'; import { ProductRepository } from '@models/products/typeorm/repositories/ProductRepository'; import Product from '@models/products/typeorm/entities/Product'; import { UpdateRequest } from '@interfaces/products/ProductRequest'; import AppError from '@shared/errors/AppError'...
eaabc092f3ccee58af8c2c2cf6b95bd28a022e27
TypeScript
deema089786/ts-react-boilerplate
/src/services/api/clients.ts
2.59375
3
import fetch from './fetch'; import { API } from '../../types'; const list = () => fetch<API.Client[]>('/clients'); const remove = ({ id }: { id: string }) => fetch<{ status: boolean }>(`/clients/${id}`, { method: 'DELETE' }); const get = (id: string) => fetch<API.Client>(`/clients/${id}`); const create = (data: { ...
398b782fb8e13b392668c2f3aef04b3da49195ce
TypeScript
GustavoEmmel/dynamoose
/lib/utils/capitalize_first_letter.ts
2.875
3
// This function will captalize the first letter of the string and return it export = (str: string): string => `${str[0].toUpperCase()}${str.slice(1)}`;
daa7ba084e0036482a98863edc03ab22c8d72d2d
TypeScript
Ankitsinh-personal/nodeJS-typescript
/features/arrays.ts
4.21875
4
const cars = ['ford','maruti'] const dtaes = [new Date() , new Date()] // const array1: string [][] = [] const array1 = [ ['data1'], ['data2'] ] //help with inferences to etracting the value // const car = cars[0]; const mycar = cars.pop() //prevent incompetabile value // cars.push(1000); // only string ...
88fca83b13ca94cc3b8605bf6d6941c5a9a6d74d
TypeScript
tapesec/CITYZENS
/src/application/domain/hotspot/Author.ts
2.578125
3
import CityzenId from '../cityzen/CityzenId'; import ImageLocation from './ImageLocation'; class Author { protected _pseudo: string; protected _id: CityzenId; protected _pictureExtern: ImageLocation; protected _pictureCityzen: ImageLocation; constructor( pseudo: string, id: Cityzen...
945c1b7d099204c5dfba9be7a6f118fd6ebb21a0
TypeScript
usvc/boilerplate-js
/src/types/index.ts
2.546875
3
export interface Health { data?: object; message?: string; status: boolean; } export type HealthCheck = (...args: any[]) => Promise<Health>; export interface HealthCheckList { [key: string]: HealthCheck; }
96c5c2b2b6bce6720b799e8c763ecd8fed0ad287
TypeScript
kcsuraj/blogging-app
/code/api/src/services/errorService.ts
3.15625
3
import HttpStatus from 'http-status-codes' /** This class provides custom error handling service that helps throw HTTP errors using defined structure. * It also enlists helper classes that can be used to throw errors in common error case scenarios */ class HttpError extends Error { /** * name of error message ...
9734ca788caecb338e52c66f065979aaee32cd69
TypeScript
anuj9196/angular-boilerplate
/src/app/@shared/client/app-http.client.ts
2.796875
3
import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; import {Injectable} from '@angular/core'; import {Observable} from 'rxjs'; import {ResourceProviderService} from '../services/resources/resource-provider.service'; /** * Request options interface * @param headers HttpHeaders * @param observe ...
be8508732a003b15eb035aa6947d2b0527fb1ff8
TypeScript
grawcho/tfs-cli
/app/exec/build/definitions/delete.ts
2.578125
3
import { TfCommand, CoreArguments } from "../../../lib/tfcommand"; import buildContracts = require('azure-devops-node-api/interfaces/BuildInterfaces'); import args = require("../../../lib/arguments"); import trace = require('../../../lib/trace'); import fs = require("fs"); export function getCommand(args: string[]): D...
66be92871160fa443125c5427f748a8690dc47c9
TypeScript
LukeMwila/aws-lambda-with-dynamo-db
/dynamodb-actions/index.ts
2.515625
3
import * as AWS from "aws-sdk"; import * as uuid from "uuid/v4"; const dynamoDB = new AWS.DynamoDB.DocumentClient(); /** put a to-do item in the db table */ export function saveItemInDB(item: string, complete: boolean) { const params = { TableName: "to-do-list", Item: { id: uuid(), item, c...
8f05a30420921f205984a0a556b7bc04d59e85fd
TypeScript
haroldbrinkhof/electron-translator
/src/test/services/ProjectServiceTest.ts
2.875
3
import test from 'ava'; import { ProjectService } from '../../app/services/project.service'; import { Project } from '../../app/Project'; test('isProjectnameUnique: filenames must be unique among known projects - no projects yet - success - returns true', t => t.is(new ProjectService().isProjectnameUnique("diffe...
4a3bdd1b7ad1af37ef925158628ddb45ef615286
TypeScript
mistakenot/react-seed
/src/services/index.ts
2.53125
3
import {HttpService} from "./http/http.service"; import {SignalRService} from "./signalr/signalr.service"; import {TimeService} from "./time/time.service"; import { Dispatch, Action } from "utils"; import { ZoneService } from "services/zones/zone.service"; export interface Services { dispose: () => void; dispa...
b5095932fed2d9235686e0925590108f1dd32410
TypeScript
Scotsoo/cloudflare-tensorflow-toxicity
/src/TensorflowDurable.ts
2.546875
3
import * as tensorflow from '@tensorflow/tfjs' import * as toxicity from '@tensorflow-models/toxicity' interface Value { toxicityModel: toxicity.ToxicityClassifier } interface RequestBody { messages: string[] } const THRESHOLD = 0.7 function splitArrayIntoChunksOfLen (arr: ArrayBuffer, len: number): ArrayBuffer[]...
f915e2632a0cc4a37be21678e17b938bd3d89807
TypeScript
SirKitBreaker/cgimmersive20
/user-app-security-with-frontend/authenticate-authorize-frontend/src/app/authservice.ts
2.671875
3
import { Injectable } from '@angular/core'; import { HttpClient, HttpHeaders } from '@angular/common/http'; import { observable, Observable } from 'rxjs'; import { Constants } from './constants'; @Injectable() export class AuthenticationService{ readonly userKey="username"; constructor(private http:HttpClient...
521b2c9f4d9ef082ce6e0739b92342a7c973f5e5
TypeScript
expo/expo-cli
/packages/create-expo-app/src/log.ts
2.984375
3
import chalk from 'chalk'; import { ExitError } from './error'; export function error(...message: string[]): void { console.error(...message); } /** Print an error and provide additional info (the stack trace) in debug mode. */ export function exception(e: Error): void { const { env } = require('./utils/env'); ...
8fa8c7eab43bb0b4622e0987683c05f7cd811420
TypeScript
idongliming/EBook-template
/src/wtcd/FlowReader.ts
3.109375
3
import { ContentOutput, Interpreter } from './Interpreter'; import { Random } from './Random'; import { WTCDRoot } from './types'; /** Data persisted in the localStorage */ interface Data { random: string; decisions: Array<number>; } /** * This is one of the possible implementation of a WTCD reader. * * In thi...
f3e88217db972c33496a78c6fb48087062313420
TypeScript
dhodges351/angular-deploy
/src/app/models/fileHelper.ts
2.921875
3
export class fileHelper { public static getFilesFromImageName(imageName: string) { var files = new Array<string>(); var index = 0; var newImageName = ''; if (imageName.indexOf(',') > 0) { imageName.split(',').forEach(element => { index = element.lastIndexOf('/'); newImag...
30bcbeecc6d0b3a4c0c2e8894ea72f5251468516
TypeScript
ananyalohani/mausam
/src/types.ts
2.890625
3
export type LoadStatus = 'OK' | 'ERROR' | 'LOADING'; export type TemperatureUnit = 'celsius' | 'farenheit'; export enum TempUnitEnum { 'celsius' = '°C', 'farenheit' = '°F', } export enum PressureUnitEnum { 'mbar' = 'mb', 'mpa' = 'mPa', } export interface Forecast { location: string; sixDayWeather: Array...
463737258ef8d3cc8694bd9bb2d71da0c307884e
TypeScript
siggame/Viseur
/src/games/stardash/body.ts
3
3
// This is a class to represent the Body object in the game. // If you want to render it in the game do so here. import { Immutable } from "src/utils"; import { Viseur } from "src/viseur"; import { makeRenderable } from "src/viseur/game"; import { GameObject } from "./game-object"; import { BodyState, StardashDelta } f...
3aa90bc4e22dc1b72d78ba972c8152142e9173b1
TypeScript
fullstackoverflow/doc
/src/index.ts
2.640625
3
import "reflect-metadata"; import { Project, SourceFile, createWrappedNode, ClassDeclaration } from "ts-morph"; export enum Type { Response = 0, Request } const project = new Project({ tsConfigFilePath: "tsconfig.json" }); let type: Type; const TypeSymbol = Symbol("Type"); export const Doc = (Type: Type): Class...
0ebaaa897990f0734227758b7d8f834d7f7755ad
TypeScript
Tom910/remirror
/packages/remirror__react-components/src/react-component-types.ts
2.65625
3
import type { ComponentType, MouseEvent as ReactMouseEvent } from 'react'; import type { MenuStateReturn } from 'reakit/Menu'; import type { ToolbarItem as ReakitToolbarItem, ToolbarStateReturn } from 'reakit/Toolbar'; import type { AnyExtension, ProsemirrorAttributes } from '@remirror/core'; import type { CoreIcon } f...
2e8a7ec40685d06f2e8ab1ab7d15029cc4df8f16
TypeScript
OpenSlides/openslides-client
/client/src/app/domain/models/meeting-users/meeting-user.ts
2.703125
3
import { Id } from '../../definitions/key-types'; import { BaseDecimalModel } from '../base/base-decimal-model'; /** * Representation of a meeting_user in contrast to the operator. */ export class MeetingUser extends BaseDecimalModel<MeetingUser> { public static COLLECTION = `meeting_user`; public readonly ...
cca7601d2aee7c77778b3dbffe45c0ccc50fc585
TypeScript
Angular2Guy/AngularPortfolioMgr
/frontend/src/angular/src/app/financial-data/model/financials-data-utils.ts
2.875
3
/** * Copyright 2019 Sven Loesekann Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
8df66ced7fb76c7a2871f69d1ae1b50ba7e90008
TypeScript
rodrigopivi/PlayApp
/definitions/graphql-relay.d.ts
2.75
3
// Compiled using typings@0.6.9 // Source: https://raw.githubusercontent.com/nitintutlani/typed-graphql-relay/master/graphql-relay.d.ts declare module "graphql-relay" { // connection/connection.js import { GraphQLBoolean, GraphQLInt, GraphQLNonNull, GraphQLList, GraphQLObje...
87ddca260e27048977927e6afd9441736a39840c
TypeScript
wjjunior/big-bang-challenge
/src/data/usecases/load-playlist/db-load-playlist.ts
2.59375
3
import { LoadPlaylist, LoadPlaylistParams } from '../../../domain/usecases/music/load-playlist' import { LoadPlaylistRepository } from '../../../data/protocols/db/music/load-playlist-repository' import { CurrentTemperatureRepository } from '../../../data/protocols/db/weather/current-temperature-repository' export ...
8aa814967f36801f757cbfbbacfe16007a84c553
TypeScript
dcaponi/vsts-extensions
/src/Common/Flux/Stores/ClassificationNodeStore.ts
2.65625
3
import { ClassificationNodeActionsHub } from "Common/Flux/Actions/ActionsHub"; import { BaseStore } from "Common/Flux/Stores/BaseStore"; import { WorkItemClassificationNode } from "TFS/WorkItemTracking/Contracts"; export interface IClassificationNodeItem { areaPathRoot: WorkItemClassificationNode; iterationPat...
c389cd762f5307138f2e7b6007eabde170bb9817
TypeScript
arunonsite/dobado_Koppu
/client/src/store/actions/root.actions.ts
2.578125
3
export const UPDATE_CURRENT_PATH: string = "UPDATE_CURRENT_PATH"; export function updateCurrentPath(area: string, subArea: string): IUpdateCurrentPathActionType { return { type: UPDATE_CURRENT_PATH, area: area, subArea: subArea }; } interface IUpdateCurrentPathActionType { type: string, area: string, subArea: s...
5844fa954a669afd93137a8c01fcf223af64f0d7
TypeScript
NasadiukVlad/guards-local-storage
/src/app/auth/models/user.model.ts
2.625
3
import {UserRole} from './user-role.enum'; interface IUserModel { username: string; password: string; role: UserRole; } export class UserModel implements IUserModel { username: string; password: string; role: UserRole; constructor (username: string, password: string, role: UserRole) { th...
a229112223866041306cb9a46ca891f7b4fce03e
TypeScript
sixty-nine/ts-pathfinder
/src/Model/PathFinder.ts
3.203125
3
import Point from "./Point"; import { Queue } from "./VisitQueue"; import { Distance, manhattanDistance } from "./Distance"; export type Visitor = (iteration: number, p: Point) => boolean; export const nullVisitor = (i: number, p: Point) => true; class PathFinder { private readonly goal: Point; private read...
1659c8c1454467a54a5579e1f27adc15ccf28c39
TypeScript
vitalybe/nx-test
/libs/common/src/utils/hooks/useDeepCompareMemoize.ts
3.125
3
import * as _ from "lodash"; import { useRef } from "react"; // usage: useEffect(() => {...}, [useDeepCompareMemoize(obj)]) export function useDeepCompareMemoize<T>(value: T): T { const ref = useRef<T>(value); // it can be done by using useMemo as well // but useRef is rather cleaner and easier if (!_.isEqual...
93ddde12648cb5b9a9b08eccc63796c5d40baf2a
TypeScript
rmolinamir/machine-learning-notes
/utils/helpers/getFiles.ts
2.984375
3
// Libraries import { resolve } from 'path'; import { promises } from 'fs'; const { readdir } = promises; const DIR_BLACKLIST = [ 'node_modules', 'jupyter-notebooks', '.git', ]; /** * Recursive Files Async Iterator Generator. Allow us to iterate over data that * comes asynchronously, in this case the data wi...
f5b88966eeb46559e90e10f69965cd23f6b06bed
TypeScript
mgancarczyk/Webowe_wprowadzenie_AP
/forms/app.ts
3.265625
3
enum FieldType { textInput = 'text', dateInput = 'date', emailInput = 'email', radioInput = 'radio', checkboxInput = 'checkbox', textAreaInput = 'textarea' } interface Field { name: string; label: string; type: FieldType; render(): HTMLElement; getValue(): any; } class App{ ...
0450124f580b310de1bd78c1ed8346cfa9360dd0
TypeScript
nguyentienlinh2611/vnuonline
/src/repositories/StudentRepo.ts
2.53125
3
import Student from "../entities/Student"; import {EntityRepository, Repository} from "typeorm"; @EntityRepository(Student) class StudentRepo extends Repository<Student>{ async getStudentByUserId(userId:string) { let student = await this.createQueryBuilder("student") .leftJoin("student.user","u...
c99fe9cfca8dac87f13217374eeb4537dee26edc
TypeScript
petargelo/Servers
/src/app/servers/edit-server/can-deactivate-guard.service.ts
2.78125
3
import { ActivatedRouteSnapshot, CanDeactivate, RouterStateSnapshot } from "@angular/router"; import { Observable } from "rxjs"; export interface CanDeactivateComponent{ canDeactivate_: () => Observable<boolean> | Promise<boolean> | boolean /*defining type of canDeactivate method. Method without arguments tha...
f1e1d4c0f4b73b3ed620be60b7c5c9631f283733
TypeScript
julienCarret/pastanaga-angular
/projects/pastanaga/src/lib/avatar/avatar.model.ts
2.703125
3
import { Observable } from 'rxjs'; interface IAvatar { username: string; id?: string; backgroundColor?: string; image?: Observable<Blob>; badgeIcon?: string; } export class Avatar implements IAvatar { username: string; id?: string; backgroundColor?: string; image?: Observable<Blob>...
65f67ca1a3ab13397744732ba6de655a998dd9b9
TypeScript
Jumpaku/AsyncResult
/src/AsyncResult.ts
3.15625
3
import { Result } from "./Result"; export class AsyncResult<V, E> implements PromiseLike<Result<V, E>> { static of<V, E>(result: Result<V, E>): AsyncResult<V, E>; static of<V, E>(result: Promise<Result<V, E>>): AsyncResult<V, unknown>; static of<V, E, F>( result: Promise<Result<V, E>>, catchFun: (error: ...
a61a24a0eb9e776cad08d0dc0aa9b4640f4d057f
TypeScript
Igorynich/MovieSearch
/src/app/services/http.service.ts
2.546875
3
import {Injectable} from '@angular/core'; import {HttpClient, HttpErrorResponse, HttpHeaders} from '@angular/common/http'; import {FavoriteMovie} from '../classes/favorite-movie'; import {catchError, retry} from 'rxjs/operators'; import {throwError} from 'rxjs'; @Injectable() export class HttpService { private apiL...