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
6b410cd33016870e37438afbab95fa01b957c22a
TypeScript
I-vasilich-I/rslang
/src/store/action-creators/userWords.ts
2.671875
3
import { Dispatch } from 'redux'; import { UserWordsAction, UserWordsActionTypes } from '../../types/userWords'; import { getUserWords } from '../../helpers/helpers'; export const fetchUserWords = (userId: string, token: string) => { return async (dispatch: Dispatch<UserWordsAction>): Promise<void> => { ...
15cf8caa8d39766ae9292f40972099f938ed7a95
TypeScript
YenKaPhuThi/react-bulding
/src/api/APIUtils.ts
2.5625
3
import Axios, { AxiosRequestConfig} from 'axios'; const axiosInstance = Axios.create({ baseURL: process.env.REACT_APP_URL, timeout: 10000, params: {}, headers: {'X-Custom-Header': 'foobar'} }); class API { private coreAPI = axiosInstance; private route: string = ''; private config: AxiosReq...
9bb0e51d4cb7be9ce7dd796fe7fdb2a6ed453c58
TypeScript
josefuentesfsnz/cachipun-front
/src/app/components/game/result/result.component.ts
2.515625
3
import { Component, OnInit } from '@angular/core'; import { RoundModel } from 'src/app/models/round-model'; import { MatchService } from 'src/app/service/match.service'; export interface Iwinners { player_name: string; player: string; } @Component({ selector: 'app-result', templateUrl: './result.component.html'...
7b7fe7a0ab03a39ca8f0e10d99e4b606007bb93b
TypeScript
ItaloFL/Super_Market
/src/modules/products/UseCases/searchProducts/SearchProductsUseCase.ts
2.640625
3
import { IProductRepository } from "@modules/products/Repositories/IProductRepository"; import { inject, injectable } from "tsyringe"; interface IRequest{ productName: string } @injectable() export class SearchProductsUseCase{ constructor( @inject("ProductRepository") private productRepository: IProduct...
433ac48b8114b01ab43c7e9deb60a424bd1cf437
TypeScript
Maissacrement/BruteForce
/src/providers/BruteForceService.ts
2.8125
3
const { spawn } = require('child_process'); export default class BruteForceService { private omega: string; private target: string ; private hashCount: number; public passwordTable: string[] = []; /** * @params: * - ensembleOfLetter: string * description: Interval of letter you want use...
4002470530f73bbbcef7ed956eac5ba99be36fbc
TypeScript
mauriciabad/ALE1-Fall-2019
/src/scripts/gate.ts
3.65625
4
type operator = '¬' | '|' | '&' | '=' | '>' type objectOfBooleans = {[key: string]: boolean} class Gate { operator:operator operands:(Gate|Value)[] constructor(operator:operator, operands:(Gate|Value)[]) { this.operator = operator this.operands = operands } evaluate(values:objectOfBooleans):boolean...
e091668be8edf7b32880300f8d0e2c2775da6d12
TypeScript
antiwise/GameTemplateTS
/assets/scripts/framework/platform/AppBridge.ts
2.796875
3
/** * Created by xujiawei on 2020-07-07 17:05:26 */ /** * Native Bridge * 用法参考:http://wiki.putao-inc.com/display/ZYTech/Webview+JS+Bridge+API * web和native(app)交互使用 */ const callAppBacks = {}; const callWebHandlers = {}; let uniqueId = 1; import { reportError } from './../common/Reportor'; import { Device }...
7e7aad1f43923385dea81c568d9c647f7c57843e
TypeScript
rafaeltgt/nlwValoriza
/src/services/AuthenticateUserService.ts
2.640625
3
import { compare } from "bcryptjs" import { sign } from "jsonwebtoken" import { getCustomRepository } from "typeorm" import { UserRepositories } from "../repositories/userRepositories" interface IAuthRequest { email: string password: string } class AuthenticateUserService { async execute({ email, passwo...
c719f75faba91ee8809ea7e7e21616b5258f1435
TypeScript
mitmedialab/prg-extension-boilerplate
/extensions/scripts/factories/customArgument.ts
2.625
3
import chalk from "chalk"; import path from "path"; import { copyTemplateToDestinationAndIncrementIfExists, processDirectoryArg } from "."; const directory = processDirectoryArg(); const destination = copyTemplateToDestinationAndIncrementIfExists(directory, "CustomArgument.svelte"); const name = path.basename(destina...
04304b17d7d549c389e9051ee9d06a8b5c2c0137
TypeScript
mopcweb/gentool
/src/templates/typescript/fullstack/widget-starter/src/server/middlewares/checkParams.ts
2.6875
3
/* ################################################################### */ /* /* Middleware to check if request include necessary params /* /* ################################################################### */ import { Request, Response, NextFunction } from 'express'; /* ------------------------------------------...
05aaa5a42f1d9c72eb436ecaab52461841ba9ca0
TypeScript
wavesplatform/node-state
/src/utils/console.ts
2.90625
3
import { blue, green, yellow, red } from 'cli-color'; module log { const call = (color: (...args: Array<any>) => string) => (item: any) => color(item); export let level: 'verbose' | 'errors' = 'errors'; export function log(...args: Array<any>) { if (level === 'verbose') { console.log(...
ec1394974757e0a8134fc0c72412df7b10fcb12c
TypeScript
ineveraskedforthis/2
/static/modules/Battle/battle_image_events.ts
2.546875
3
import { battle_position, UnitSocket, unit_id } from "../../../shared/battle_data" import { socket } from "../globals.js"; import { IMAGES } from "../load_images.js"; import { BattleImage, battle_canvas, battle_canvas_context, camera, player_unit_id, units_views } from "./battle_image.js"; import { position_c } from "....
96006ec448f135e2ee621df7884928ff5155122c
TypeScript
maariacasasola/cbd-2021
/src/assets/controllers/artist-tracks.controller.ts
2.53125
3
import 'reflect-metadata'; import { injectable, inject } from 'inversify'; import { interfaces, controller, httpGet, requestParam, } from 'inversify-express-utils'; import { ApiPath, SwaggerDefinitionConstant, ApiOperationGet, } from 'swagger-express-ts'; import * as express from 'express'; ...
bcdde7e74893e56a43c0f9fdd36ad432ac5bea6a
TypeScript
tcgdex/cards-database
/data/Sun & Moon/Celestial Storm/76.ts
2.625
3
import { Card } from '../../../interfaces' import Set from '../Celestial Storm' const card: Card = { name: { en: "Meditite", fr: "Méditikka", es: "Meditite", it: "Meditite", pt: "Meditite", de: "Meditie" }, illustrator: "Shibuzoh.", rarity: "Common", category: "Pokemon", set: Set, dexId: [ 307, ...
ef60a1e054ebf8d7985704bac129de536e5d8f6a
TypeScript
huynv81/react-web-editor
/src/hooks/useResize.ts
2.53125
3
import React, { useEffect, useState } from "react"; import { changeComponentLocationByHandler, convertPointsByUnit } from "../utils/ui"; import { ComponentSize, ComponentStyle, Dispatcher, ResizeProps } from "../types/ui"; import { MIN_HEIGHT, MIN_WIDTH } from "../constants/ui"; interface ComponentInformation { isR...
d05aff1788ea3e68e48366f384d8ac20b452c0e4
TypeScript
dggluz/typescript-node-starter
/scripts/init/init.ts
2.671875
3
import {resolve, join} from 'path'; import {IPackageJson} from './package.json'; import {readJSON, writeFile} from './promise-fs'; import {askDefault, close} from './promise-readline'; import {which, exec, rm} from 'shelljs'; const root = resolve(__dirname, '../../../'); if (!which('git')) { console.error('You nee...
73dbde75438f9eed7815966304f31c6c10952c4c
TypeScript
edgesite/ts-serialize
/index.ts
3.078125
3
import 'reflect-metadata'; interface SerializableAttrOptions { level?: string | symbol; transformer?: (value: any) => any; } interface SerializationOptions { // if strict mode is enable, only @SerializableAttr will be emit. strict?: boolean; } type ISerializeInfo = SerializationOptions & { fields: { [key: ...
ad696193941f25a80c7715b55587a1624a48dcdd
TypeScript
cordeirolucas42/device-manager-interface
/src/app/server-api.service.ts
2.53125
3
import { Injectable } from '@angular/core'; import { Category } from './category'; import { Device } from './device'; import { Observable, of } from 'rxjs'; import { MessageService } from './message.service'; import { HttpClient, HttpHeaders } from '@angular/common/http'; import { catchError, map, tap } from 'rxjs/oper...
8c97a14b0eb7e043425cc519beaac3971ba5bb2a
TypeScript
torqu4to/ITE002-2021
/src/modules/products/controllers/ProductController.ts
2.6875
3
import { Request, Response } from "express"; import CreateProductService from "../services/CreateProductService"; class ProductController { public async create(req: Request, res: Response): Promise<Response> { // recuperar dados para insercao let {name, price, quantity} = req.body; ...
97af1c93b80518a1184edea7e6a2a1830357efd4
TypeScript
phsarah/backend-project
/src/data/userDatabase.ts
2.734375
3
import { userOutputDTO } from "../business/entities/user"; import BaseDatabase from "./baseDatabase"; import { Model } from "./model/models"; export class UserDatabase extends BaseDatabase{ private static TABLE_NAME = "PIXALABON_USERS"; public async createUser(input: any, id: string): Promise<void>{ ...
40a9344ea181d94ec2bc8b096f2b205320543541
TypeScript
alelode/flightlog-dump
/db/database.ts
2.875
3
import { Pilot, Club, Flight, TakeOff } from "../types"; const sqlite3 = require("sqlite3").verbose(); class Database { db; initDb() { var filename = "flightlog"; this.db = new sqlite3.Database( "./" + filename + ".sqlite3", sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE, function(err) { ...
ef97b34819984d182d85b75d6e397551ede4520b
TypeScript
nginformatica/flipper-ui
/src/core/types.ts
2.53125
3
import type { CSSProperties } from 'react' export interface DefaultProps { /** * The children of the component. * @optional */ children?: React.ReactNode /** * The style of the component. * @optional */ style?: CSSProperties /** * The class name of the component. ...
83717f4a5700ee23f11c0a370d3c40e92a7110a8
TypeScript
jeroenmaas/advent-of-code
/2022/day9.ts
3.25
3
import {readFileSync} from "fs"; import {range} from "lodash"; const file: string = readFileSync('./day9', 'utf-8'); interface Action { direction: string; count: number } const actions = file.trim().split('\r\n').map(i => i.split(' ')).map(i => { return { direction: i[0], count: parseInt...
801778d602bda463513a8bce691f03d363f2ec4c
TypeScript
teemukaaria/useful-checklists
/client/src/store/modules/app/actions.ts
2.65625
3
import { ActionTree, ActionContext } from 'vuex'; import firebase from 'firebase'; import { createModuleActions } from '@/store/utils'; import { State, User } from './state'; import { CombinedState } from '@/store'; import { Mutations } from './mutations'; type AugmentedActionContext = { commit<K extends keyof Muta...
fa27c86b4de076f97698079a0afaf8cebf1d5240
TypeScript
zcmjs/TypeScript
/src/commonFunctionProblem.ts
3.1875
3
class CommonFunctionProblem { message: string = 'Hello Bitch'; printFunction() { return function () { console.log(this.message); } }; printFunction2() { return () => { console.log(this.message); } }; } let example = new CommonFunctionProblem...
875fa98432080fb3f4f6b9579dc8a86a29caa5b9
TypeScript
olli158/Samples
/TypeScript/AngularjsTypeScript/AngularjsTypeScript/Scripts/app/ParticleCtrl.ts
2.546875
3
/// <reference path="../typings/jquery/jquery.d.ts" /> /// <reference path="../typings/angularjs/angular.d.ts" /> module ParticleApp { // Model export class Particle { constructor(public name: string, public symbol: string, public massMeV: number, public subsymbol: string = "", public sup...
14d4a3e84f70b0f7dffd9b717057082e3f92b03b
TypeScript
rajatvijay/production-ts
/src/exhaustiveSwitch.ts
3.25
3
type FieldType = "single_select" | "checkbox"; class UnreachableError extends Error { constructor(val: never, message: string) { super(`Unreachable code reached!`); } } function getFieldCmpStr(fieldType: FieldType) { switch (fieldType) { case "single_select": return "Select"; case "checkbox": ...
c3a9a6e1efc6930daeab9ae5607d250be644abc7
TypeScript
sanity-io/sanity
/packages/@sanity/cli/src/util/parseArguments.ts
2.859375
3
import minimist from 'minimist' export interface ParsedArguments<F = Record<string, string>> { /** * Group or command name, eg `dataset` (`sanity dataset`) or `import` (`sanity dataset import`) */ groupOrCommand: string // Raw, forwarded arguments, for commands that want to be more explicit about parsing ...
e4907a78a0bc5fb972ffc53c582bab1c73d734b5
TypeScript
khanguslee/GTD
/src/models/todos.ts
2.8125
3
export interface Todo { id: string; created: Date; content: string; status: TodoStatus; } export enum TodoStatus { TODO = 'TODO', AWAITING = 'AWAITING', DONE = 'DONE', } export type TodoState = { allIds: string[]; byIds: { [key: string]: Todo }; };
a245372a137aa088e3a738f95c1d76bb91447de1
TypeScript
six-two/react_payload_builder
/src/app/hex/String.ts
3.34375
3
import ByteString from "./ByteString"; export interface Values { repeatCount: number, pattern: string, type: string, } export const TYPE = "String"; export const TYPE_REVERSED = "String (reversed)"; export class Utils { static defaultValues(): Values { return { pattern: "A", repeatCount: 1, ...
4416957ec15279cedcb48afff62ced28127d1166
TypeScript
Provinite/halloween-2018
/packages/constants/lib/constants.d.ts
3.421875
3
declare module "@clovercoin/constants" { /** * An object mapping named roles to string literals. */ export const ROLES: { admin: string; moderator: string; user: string; } export type Omit<T, K> = Pick<T, Exclude<keyof T, K>>; /** * The type T with all keys optional except those specified....
81b458fc2d1cd0cb3802e172dbc91fc8b7d872e7
TypeScript
patroza/fp-app-framework
/packages/framework/src/infrastructure/mediator/request.ts
2.640625
3
import { NamedHandlerWithDependencies, NamedRequestHandler, requestType } from "./registry" const request = (get: getRequestType): requestType => (requestHandler, input) => { const handler = get(requestHandler) return handler(input) } export default request type getRequestType = <TInput, TOutput, TError>( key:...
4113fba460924f4d508e238ac8c592fd3417efdb
TypeScript
ConnorUllmann/engine-ts
/tools/stack.ts
3.609375
4
export class Stack<T> { public readonly elements: T[] = []; constructor() {} public get length(): number { return this.elements.length; } public isEmpty(): boolean { return this.elements.length <= 0; } public pop(): T | null { return this.elements.pop() ?? null; } public push(item: T): vo...
55eb402421909560ff921811fdd5aa2b098c393f
TypeScript
morninng/redux_tutorial
/ts/OwnStore_Redux.ts
3.1875
3
/// <reference path="./../typings/globals/redux/index.d.ts" /> const counter = (state = 0, action) => { switch(action.type){ case 'INCREMENT': return state+1; case 'DECREMENT': return state-1; default: return state; } } class OwnStore{ construc...
9b683b91aedd07639a78d7fb32e111c223d1073f
TypeScript
tainguyenthe/antd-scss-theme-plugin
/src/loaderUtils.js
2.640625
3
import AntdScssThemePlugin from './index'; /** * Get path to SCSS theme file specified in loader options or through the plugin's constructor. * @param {Object} options - Loader options. * @return {string} Path to SCSS theme file. */ // eslint-disable-next-line import/prefer-default-export export const getScssThem...
33c61d71cbaebfc9312b4a57fd39eb00931d09b8
TypeScript
SpectralOne/bmstu-evm-web
/lab5/src/controller.ts
2.65625
3
import { Request, Response, NextFunction } from "express"; import { User } from './user'; import path from "path"; import fs from "fs"; const SECOND: string = path.join(__dirname, "..", "public", "second.html"); const HOME: string = path.join(__dirname, '..', "public", "index.html"); const DB: string = path.join(__di...
39ebd751058151d28b99c0f5b8fd5ba237533ed7
TypeScript
PandaCats/YuJudge
/src/common/programLanguage.ts
2.640625
3
/* * File: programLanguage.ts * Description: 编程语言相关配置内容 * Created: 2020-8-2 10:28 * Author: yuzhanglong * Email: yuzl1123@163.com */ import {LanguageTypeEnum} from './enumerations'; // C_PLUS_PLUS的昵称 export const C_PLUS_PLUS_NICK_NAME = 'C++'; // 展示给用户,支持的编程语言的执行脚本内容 export const PROGRAM_LANGUAGE_SCRIPT_CONTEN...
ef0cfd04de0c1d922a537d271f88013547f62368
TypeScript
Enhmunh-E/tsparticles
/engine/src/Interactions/External/Trail/TrailMaker.ts
2.6875
3
import type { Container } from "../../../Core/Container"; import { isInArray } from "../../../Utils"; import { ClickMode, HoverMode } from "../../../Enums"; import type { ICoordinates, IDelta } from "../../../Core/Interfaces"; import { ExternalInteractorBase } from "../../../Core/ExternalInteractorBase"; /** * @categ...
bd9581307adf48ac710f4f09318783916330da2c
TypeScript
betopinheiro1005/curso-typescript-sys4soft
/aula-11/code.ts
3.453125
3
function executar(){ // classe - modifiers class humano{ private nome: string; protected genero: string; constructor(n: string){ this.nome = n; } setNome(n:string){ this.nome = n; } getNome(){ return this.nome; ...
8f2c6708e7e25cf6b2d311eab801569efcf8643e
TypeScript
rickmugridge/mismatched
/src/examples/egMatchString.micro.ts
2.5625
3
import {assertThat} from "../assertThat"; import {match} from "../match"; describe("string:", () => { const actual = "abcdefghijkl"; it("string.match:", () => { assertThat(actual).is(match.string.match(actual)); assertThat(actual).is(actual); }); it("string.startsWith:", () => { ...
df6f1f1c9877f622f661cdc44a1f67f963c0a26f
TypeScript
xiaxzp/angular-workers-in-action
/src/ITodo.ts
2.59375
3
export interface ITodo { id: number; title: string; description: string; url: string; done: string; } export interface IList { list: ITodo[]; }
9b18e38d456d1d608498e25530dfb1cddbec2264
TypeScript
covidtop/covidtop
/packages/shared/src/metric/metric-format.ts
2.953125
3
import { format } from 'd3-format' import { mapValues } from '../utils' export type MetricFormatType = 'decimal' | 'percent' type NumberFormatter = (value?: number) => string | undefined export interface MetricFormat { readonly metricFormatType: MetricFormatType readonly apply: NumberFormatter } const createFo...
7e12077fac04bc9891684ec07092556814ed3ffd
TypeScript
etherik/eth-hooks
/src/useBalance.ts
2.765625
3
import { Provider } from '@ethersproject/providers'; import { BigNumber } from 'ethers'; import { useState, useCallback } from 'react'; import { useOnRepetition } from '~~/useOnRepetition'; const zero = BigNumber.from(0); /** * Gets your balance in ETH from given address and provider * * ~ Features ~ - Provi...
e953046981b7d09075514e41556576168a40f36a
TypeScript
SocialGouv/domifa
/packages/portail-admins/src/app/modules/shared/services/data/searchCore.spec.ts
2.6875
3
import { searchCore } from "./searchCore"; it("trim", () => { expect(searchCore.trim(" \ttwo words\n \t ")).toEqual("two words"); }); it("clean", () => { expect(searchCore.clean("à la C@mpagne éÂ!")).toEqual("a la c@mpagne ea!"); }); it("buildWords", () => { expect(searchCore.buildWords("a few words")).t...
993469a214920faecc3ba60cb0d183512163f966
TypeScript
aische/ts-typelevel-crap
/src/distribution.ts
3.171875
3
export type Pair1<A,B> = [A] extends any ? [B] extends any ? [A, B] : never : never export type Pair2<A,B> = A extends any ? [B] extends any ? [A, B] : never : never export type Pair3<A,B> = [A] extends any ? B extends any ? [A, B] : never : never export type Pair4<A,B> = A extends any ? B extends any ? [A, B] : ne...
476ca6fbf71af6b58cf31658289e97a7951cc410
TypeScript
silvioedu/Angular-Practice
/aula-2/declaracaoLet.ts
3.46875
3
let num1:number = 1 function varDeclaration() { let num2:number = 2 if (num2 > num1) { let num3:number = 3 num3++ } while (num1 < num2) { let num4:number = 4; num1++; } console.log("num1: " + num1) console.log("num2: " + num2) console.log("num3: " + nu...
c06d119a9fa477856339e39253e545f02e28b5fb
TypeScript
philipeachille/webapp-v2
/src/services/observables/customOperators.ts
2.828125
3
import { Observable } from 'rxjs'; import { switchMap, filter } from 'rxjs/operators'; export const switchMapIgnoreThrow = <T, Y>(switchMapProm: (data: T) => Promise<Y>) => (source: Observable<T>): Observable<Y> => source.pipe( switchMap((whatever) => switchMapProm(whatever).catch(() => 'DONT THR...
08a0e72ca502667ab0af5b1f8dc3752031b1ef68
TypeScript
kgroat/toodle
/src/types/Mutator.ts
2.796875
3
import { ReadonlyFlatMap } from './FlatMap' import { DeepReadonly } from './DeepReadonly' export interface Mutator<S, O> { mutate: (prev: DeepReadonly<S>, options: O) => DeepReadonly<S> defaultOptions?: O } export interface Mutators<S> extends ReadonlyFlatMap<Mutator<S, any>> {} export interface AsyncMutator<S,...
6221d9dbf567664a2c00846a5e1b5d70117b0a08
TypeScript
DimaGashko/security
/src/pages/hill/index.ts
2.609375
3
import chunk from 'lodash/chunk'; import 'normalize.scss/normalize.scss'; import './index.scss'; import { debounce } from 'throttle-debounce'; import { encode, decode } from './scripts/hill'; const $app: HTMLElement = document.querySelector('.app'); const $key: HTMLInputElement = $app.querySelector('.key'); const $ms...
ef6f5c251f3b0835b31eb82e1790084d9b7daaf1
TypeScript
takakoshimizu/wanikani-api
/src/typings/cache.d.ts
2.5625
3
export interface ICache<T> { lastUpdated: number; data: T; } export interface ILevelCache<T> { [key: number]: ICache<T>; }
10a7038aa2725f3aed2495c866de479f2bc76c2e
TypeScript
reidev275/marsrover
/src/filterDsl.ts
3.84375
4
export type Filter<A> = | { kind: "Equals"; field: keyof A; val: A[keyof A] } | { kind: "Greater"; field: keyof A; val: A[keyof A] } | { kind: "Less"; field: keyof A; val: A[keyof A] } | { kind: "And"; a: Filter<A>; b: Filter<A> } | { kind: "Or"; a: Filter<A>; b: Filter<A> }; //core export const equals = <A,...
87e35d3f6bef98fa8ff74d88b278d4547bf18027
TypeScript
CrackTheCode016/symbol-cli
/test/models/template.spec.ts
2.765625
3
import { expect } from 'chai' import { Template, TemplateConfig, TemplateDTO, NodeType } from '../../src/models/template' describe('Template Model', () => { it('should create a template from constructor', () => { const config = new TemplateConfig('friendlyNode123', 'bootKey', 'harvesterKey', 0, NodeType.A...
864848c73fa1a5cd46002d3085786de8022bcd45
TypeScript
xXD4rkC0d3rXx/freecom
/libs/peer/core/src/lib/peer-client.model.ts
2.75
3
import { ImmutableModel } from './immutable.model' export interface IPeerClient { id?: string label?: string stream: MediaStream } export class PeerClient extends ImmutableModel<IPeerClient, PeerClient> { constructor(data: IPeerClient) { super(PeerClient, data) } get id(): string { return this.da...
2a0036de70cb8c6b3da3df6f457d33301ff19213
TypeScript
Jumaniyozov/task-mngmnt
/src/auth/auth.service.ts
2.515625
3
import { Inject, Injectable, Logger, UnauthorizedException } from "@nestjs/common"; import { UserRepository } from "./user.repository"; import { AuthCredentialsDto } from "./dto/auth-credentials.dto"; import { JwtService } from "@nestjs/jwt"; @Injectable() export class AuthService { private logger = new Logger(); ...
0d69eaaec67a29320f70eb227fb54b4ab1d0849a
TypeScript
JetBrains/intellij-plugins
/AngularJS/testData/modelStructure/common/i18n/locale_data_api.ts
3
3
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import localeEn from './locale_en'; import {CurrencyIndex, ExtraLocaleDataIndex, LOCALE_DATA, LocaleDataIndex} from ...
906c9740cdf8a2ee420bcf0092dea7761d1a2115
TypeScript
hcigroupkonstanz/STREAM
/stream-server/src/server/modules/plots/plot-utils.ts
2.578125
3
import * as _ from 'lodash'; import { Manager } from '../database'; import { Plot } from './plot'; import { Link } from './link'; export class PlotUtils { public static getConnectedPlots(plots: Manager<Plot>, links: Manager<Link>, startPlotId: number): Plot[] { const startPlot = plots.findLoadedEntry({ id...
38ef24d330c32849a4ab94bc9f7489f1ba996dbf
TypeScript
ifakejs/page-visibility
/src/PubSub.ts
2.859375
3
export class PubSub { public listenEvent: Record<any, any> constructor() { this.listenEvent = {} } on(key: string, fn: Function): void { if (!this.listenEvent[key]) { this.listenEvent[key] = [] } this.listenEvent[key].push(fn) } trigger(...arg: any[]): void { const fnName = arg[0] ...
da77e2fbb7c68abdd1c689b1d8fc959fdb34026f
TypeScript
lampkraft/recept_angular
/src/app/models/recipe.ts
2.59375
3
export interface IRecipe { id: string, name: string, description: string, images: IRecipeImage[], base64Thumbnail: string, ingredients?: IIngredient[] } export interface IIngredient { id: string, name: string, amount: number, unit: string, order: number } export interface IRecipeForRequest { id?: string, ...
b386ccdc6ad93533b9f0d57560f63d23c19d5e8d
TypeScript
mbabaei0/nalino
/src/app/components/drop-down/drop-down.component.ts
2.65625
3
import { Component, OnInit, forwardRef, Input, Output } from "@angular/core"; import { ControlValueAccessor, NG_VALUE_ACCESSOR, NG_VALIDATORS, FormControl } from "@angular/forms"; @Component({ selector: "app-drop-down", templateUrl: "./drop-down.component.html", styleUrls: ["./drop-down.component.scss"], ...
48186a2260e4db5981b394ebcb8a19d89c101d81
TypeScript
yayhen/async-race
/src/components/car/index.ts
2.640625
3
import { carSvg } from "../../templates/car-svg"; import { flagSvg } from "../../templates/flag-svg"; import './style.css' class Car { private container: HTMLElement; carInfo: { name: string, color: string, id: number, }; velocity: number = 0; finished: boolean = false; private intervalId: Node...
235ba3bb4759ddc03057b4772a5b16498ce3594e
TypeScript
bigfu1993/fu-cli
/template/spa3/views/utils/bus.ts
2.78125
3
class Bus { list: any = {} constructor() { // 收集订阅信息,调度中心 this.list = {}; } // 订阅 $on(name: string, fn: any) { this.list[name] = this.list[name] || []; this.list[name].push(fn); } // 发布 $emit(name: string, data: any) { if (this.list[name]) { this.list[name].forEach((fn: any)...
f7f323fd60a2b4a3367e016885ad240d7fa5b96c
TypeScript
mGuv/Advent2018
/src/Collections/__tests__/HashSet.test.ts
3.578125
4
import HashSet from "../HashSet"; interface INestedValue { PropertyC: number; } interface ITestValue { PropertyA: string; PropertyB: INestedValue; } const testValue: ITestValue = {PropertyA: "Test One", PropertyB: {PropertyC: 123}}; const testValueSame: ITestValue = {PropertyA: "Test One", PropertyB: {Pro...
1f9bf326866dc95fcfee8a0e566586bfbbcfe1ec
TypeScript
tyrone-sudeium/aethebot
/src/brain/brain.d.ts
2.90625
3
import { EventEmitter } from "events" import StrictEventEmitter from "strict-event-emitter-types" /** * Abstract memory store for the bot. */ /* * AetheBot - A Discord Chatbot * * Created by Tyrone Trevorrow on 03/02/17. * Copyright (c) 2017 Tyrone Trevorrow. All rights reserved. * * This source code is licen...
8fc08bd8a706fd6bd938e507f10b1586c2026bb9
TypeScript
ChangJoo-Park/trimmer
/is_alpha.test.ts
3.0625
3
import { assertEquals } from "./deps.ts"; import { isAlpha } from "./is_alpha.ts"; Deno.test("Empty String is alpha", () => { assertEquals(isAlpha(""), true); }); Deno.test("HelloWorld is alpha", () => { assertEquals(isAlpha("HelloWorld"), true); }); Deno.test("12345 is not alpha", () => { assertEquals(isAlpha...
461225d548b9f2cde1822f7ea8bdb9b187cdba8a
TypeScript
game-OceanPlanet/OceanTribe
/src/com/breeze/game/battle/controller/HeroAttack2Controller.ts
2.828125
3
module qmr { /** * * @author coler * @description 英雄攻击2控制器,技能全部是自动释放 * */ export class HeroAttack2Controller extends BaseMoverActorController { private attackSpeed: number; private lastUseTime: number; public constructor(moverActor: BaseMoverActor) { super(...
2a4aadf979b708b0d36f6459f9949d1833be13f1
TypeScript
ranaDeepanshu/GoogleForm
/scripts/htmlElements/drop_down.ts
2.703125
3
import { dropDownElement } from "../interfaces"; export class dropDown implements dropDownElement { element: HTMLElement; optionList: HTMLSpanElement[]; constructor(list: HTMLSpanElement[]) { this.optionList = list; this.element = this.getBlock(); this.addEventListener(); } getBlock(): HTMLElem...
0f6e26575778f2cf6d3b9e1882a5bfb89d27f084
TypeScript
Amarillys/genshin-stats
/packages/genshin-api/src/index.ts
2.546875
3
import { APIClientType, WrapWithKey } from '@mihoyo-kit/api/typings'; import { request, RequestOptions } from '@mihoyo-kit/api/lib/request'; import { getServerRegionByUid } from '@mihoyo-kit/genshin-data'; import { GameStats, SpiralAbyssScheduleType, CharacterDetail, Character, SpiralAbyssData } from '../typings'; /**...
aeefde24a2286eeaffe155400ea181562867bb7b
TypeScript
mieshalannair/skuba
/src/cli/configure/processing/javascript.ts
2.671875
3
export const prependImport = (name: string, file?: string) => [`import '${name}';\n`, file] .filter((value) => value !== undefined) .join('\n'); export const stripImports = (names: readonly string[], inputFile: string) => { const searchStrings = names.flatMap((name) => [`'${name}'`, `"${name}"`]); const...
34049788f3f89d38f2abe2f11f208c0f0502618b
TypeScript
ringcentral/ringcentral-js-widgets
/packages/ringcentral-mock/src/platform/interfaces/ExtensionInfoGrants.ts
2.53125
3
// Extension information export interface ExtensionInfoGrants { /** * Internal identifier of an extension */ id: string; /** * Canonical URI of an extension */ uri: string; /** * Extension short number (usually 3 or 4 digits) */ extensionNumber: string; /** * Name of extension */ ...
217e2bfcd75b6d2bcaa433c43cd40c7440185a5e
TypeScript
maximebourdel/carPool-front-office
/src/app/feedback/feedback.ts
2.84375
3
import { Reservation } from '../reservation/reservation'; /** * Objet représentant un retour sur la réservation */ export class Feedback { /** * Constructeur initialisant un Objet Feedback * @param id Identifiant technique unique du Feedback * @param reservation Objet représentant une réserva...
8b8bc9961bfee81818416bcf4bd5f8ed64c20a3a
TypeScript
royhadad/caregivers-report-server
/src/controllers/reportController.ts
2.546875
3
import {Request, Response} from 'express'; import {QueryResult} from 'pg'; import * as dbUtil from './../utils/dbUtil'; interface Report { year: number, caregivers: { name: string, patients: string[] }[] } export const getReport = async (req: Request, res: Response) => { const {year} =...
84bbdac4a5e0eb1900b30abc9030c95b7de3d253
TypeScript
game7/sportified
/app/javascript/utils/use-form.ts
2.515625
3
import { FormDataConvertible } from "@inertiajs/inertia"; import { Form, FormItemProps } from "antd"; import _, { get, isPlainObject } from "lodash"; import { humanize } from "./inflector"; import { useErrors } from "./use-errors"; // hook to wrap antd useForm hook and include // model binding helper export function u...
29785b5ff5f4844edc6d77e3ff1a7409135173f5
TypeScript
rd-dev-ukraine/rd-url-utils
/src/api.ts
3.375
3
export interface ForceMatch<TParams, TQueryString> { /** Casts result to matched or throws error if URL didn't match. */ asMatched(): Match<TParams, TQueryString>; } export interface NoMatch { isMatched: false; } export interface Match<TParams, TQueryString> { isMatched: true; params: TParams; ...
f4a8b68cb9691b55ae54b128f94eaa37531dd568
TypeScript
hachimitu22/countdown
/test/ratio-record.test.ts
2.859375
3
import * as chai from 'chai'; import RatioRecord from '../src/frontend/ratio/ratio-record'; describe('RatioRecord', () => { it('stringを値に持つレコードが作成される', async () => { const record = new RatioRecord<string>('record', 100); chai.expect(record.value).to.equal('record'); chai.expect(record.ratio).to.eq...
c2ee9d976b94e97e1f20c9b8be289e749ae278be
TypeScript
CityOfZion/neon-js
/packages/neon-core/src/u/HexString.ts
3.71875
4
import { base642hex, hex2base64, ensureHex, reverseHex } from "./basic"; import { hexXor } from "./misc"; import { str2hexstring, hexstring2ab, ab2hexstring, hexstring2str, } from "./convert"; export class HexString { /** * Will store value in big endian */ #value: string; public get length(): num...
0c41a9ed53059c164ecab92238ffbf6756fd7e35
TypeScript
travetto/travetto
/module/model/src/internal/service/bulk.ts
2.625
3
import { Class } from '@travetto/base'; import { BulkOp } from '../../service/bulk'; import { ModelType } from '../../types/model'; import { ModelCrudProvider, ModelCrudUtil } from './crud'; export type BulkPreStore<T extends ModelType> = { insertedIds: Map<number, string>; upsertedIds: Map<number, string>; upd...
1995abc828c81a1c8c9edf3898fe34db81c48039
TypeScript
cHolzberger/pricey-typescript
/src/TaxDecorator.ts
2.75
3
import {PriceDecorator, Price} from "./Price"; import {Currency} from "./currency"; import {_internalToAmount,_amountToInternal} from "./helper"; //fixme move common code here export abstract class PriceWithTaxDecorator extends PriceDecorator { _price: Price; _tax: number; constructor(p: Price, c: { tax: ...
07a792c8bf3e813e10d296a6123b15aac3180c85
TypeScript
heartpoints/heartpoints.org
/src/restguru/restguru.test.ts
2.6875
3
import * as _ from "lodash"; import { then } from "../testing/then"; import { whenValues } from "../testing/whenValues"; import { theInternet } from "../restguru/theInternet"; import { expect } from "chai"; import { HttpMethod } from "../restguru/HttpMethod"; import { RestClient } from "./RestClient"; describe("restfu...
fba536b66b5dcfb510c4dce9e954808355fc1c69
TypeScript
training4developers/angular_01082018
/demos/app.component.7.ts
2.515625
3
import { Component, InjectionToken, Inject, Injectable } from '@angular/core'; import { HttpClient, HttpInterceptor, HttpRequest, HttpHandler, HTTP_INTERCEPTORS } from '@angular/common/http'; import { Observable } from 'rxjs/Observable'; import { WebSocketDemoService } from './services/web-socket-demo.service'; i...
03470121bbf70a5967f09c05787c3456788d5c47
TypeScript
bradrivenburgh/jotto-ts
/src/reducers/successReducer.test.ts
2.703125
3
import { actionTypes } from '../actions'; import successReducer from './successReducer'; test('when previous state is undefined, return false', () => { const newState = successReducer(undefined, { type: '' }); expect(newState).toBe(false); }); test('return previous state when unknown action type', () => { const...
558228aed881e0f7f8f27c444c7ab7aca3fd4e5e
TypeScript
AmandaVP23/nestjs-twitter-copy
/src/follow/follow.repository.ts
2.71875
3
import { EntityRepository, Repository } from 'typeorm'; import { Follow } from '../users/entities/follow.entity'; import { User } from '../users/entities/user.entity'; import { InternalServerErrorException } from '@nestjs/common'; import { IPaginationOptions, paginate } from 'nestjs-typeorm-paginate'; @EntityRepositor...
fccb55a6093825d945744745d524ada8189f963b
TypeScript
Nergal2/Shoping-Center-Front
/src/app/orders-list/cart.model.ts
2.546875
3
import {Recipe} from '../recipies/recipe.model'; export class Cart { public name: string; public email: string; public sex: string; public cart: {numb: number, rec: Recipe}[]; public price: number; public orderId: string; constructor(name: string, email: string, sex: string, cart: {numb: num...
c6b450f6268e2bb25fc60175058dabc064cad5f0
TypeScript
paullessing/home-comms-server
/entities/Channel.ts
2.6875
3
///<reference path='_all.ts' /> import * as Promise from 'bluebird'; import { Document, Schema, Model, model, Query } from 'mongoose'; var Types = Schema.Types; //#################// // Action // //#################// export interface Action { name: string, seqId?: number, timestamp: Date, da...
7892cd6677c2d089e2c7f9a587c18f73c5d0bc88
TypeScript
scottyboi30/Task-Management
/src/app/core/services/state.service.ts
2.515625
3
import { Injectable } from '@angular/core'; import { State } from '../../shared/enums/state'; @Injectable({ providedIn: 'root' }) export class StateService { getStateOptions() { let states: any[] = []; for (let value in State) { if (isNaN(Number(value))) { states.push({ name: value, value: ...
f70fe800931eb39968558326c274c8e65cae7d04
TypeScript
vinbustamante/pokemonquery
/test/common/services/ReflectionService.spec.ts
3.234375
3
import * as expect from "expect"; import { ReflectionService } from "../../../src/common/services/implementation/ReflectionService"; describe("ReflectionService", () => { let _reflectionService; beforeEach(() => { _reflectionService = new ReflectionService(); }); describe("isArray()", () => { it("sho...
1e5596f5d12599dff19b0572c2b7f7caa6cf872f
TypeScript
aduserviewer/aduserviewer
/user-viewer/src/model/sort-options.ts
3.25
3
/** * Represents sorting behavior to be applied to a dataset. 'attribute' * 'specifies' the attribute to sort on, and 'direction' specifies * whether to sort ascending or descending on the dataset. */ export interface SortOptions { attribute: string; direction: "asc" | "desc"; }
21cb1e76e81d3f04024cf0b2bc7343731018c087
TypeScript
vlad2497/tango
/src/store/modules/lessonAnnounces/reducer.ts
2.859375
3
import { SET_LESSON_ANNOUNCES_LIST, SET_LESSON_ANNOUNCES_LOADING, SET_LESSON_ANNOUNCES_ERROR, } from "./selectors"; import { ILessonAnnounce } from "./../../../interfaces/ILessonAnnounce"; export interface IState { list: ILessonAnnounce[] | null; loading: boolean; error: string | null; } type...
a1b8a5608dc9f9a1231f5f20f7d771006ffabe86
TypeScript
zachabney/atem-stream-deck
/src/auth/numeric-button.ts
2.921875
3
import { ImageSize, UIImage, UIScreen, Component } from 'tile-ui' import { RED, BLUE } from '../colors' export type NumericButtonListener = (button: NumericButton) => void type ButtonState = { isPressed: boolean hasError: boolean } export default class NumericButton extends Component<ButtonState> { readonly nu...
82e72e0c37626acc4d8ae323fed96c82716eae05
TypeScript
Prasannakumar124/Angular-Concepts
/Pipes/src/app/shorten.pipe.ts
2.515625
3
import { PipeTransform, Pipe } from "@angular/core"; @Pipe({ name:'short' }) export class ShortenPipes implements PipeTransform{ // transform(value:any){ // if(value.length>10){ // return value.substr(0,10) + '...'; // } // return value; // } transform(value:any,lim...
6dca9ed1e9fbaee9f7c4de16fb9681d1ae0c4723
TypeScript
choyg/wwwwwwwww
/functions/service/extractor.ts
2.65625
3
import * as ytdl from 'ytdl-core'; import { AudioQuality, ContentDownloadable, ContentFormat, ContentInfo } from '../util/types'; // TODO ytdl.videoInfo typings are incorrect // Using any for now cuz too lazy to fix export function getBestM4a(info: any): ContentFormat | null { const streamingData = info.player_respo...
7ff96c8cdcfe5d970571f6868fd040812d3b622b
TypeScript
fabasoad/algorithm-tasks
/typescript/leetcode/easy/Solution_MostCommonWord.ts
3.421875
3
{ // https://leetcode.com/problems/most-common-word/ function mostCommonWord(paragraph: string, banned: string[]): string { const map: Map<string, number> = new Map<string, number>(); const words: string[] = paragraph.match(/[a-zA-Z0-9]+/g) as Array<string>; let max: number = 0; let maxWord: string = ...
f7026bac4b906e503412c8c0402b1c2667caf4aa
TypeScript
darlanhms/new-world-guild-discord-bot
/src/handlers/invite/subcommands/deny.ts
2.625
3
import { Message } from 'discord.js'; import BaseHandler from '../../../shared/logic/BaseHandler'; import Handler from '../../../shared/logic/Handler'; import DenyGuildInviteUseCase from '../../../useCases/invites/denyGuildInvite/denyGuildInviteUseCase'; export default class DenyInviteHandler extends BaseHandler imple...
354005f4ece39b2608b0af13493c99fbc218cbe5
TypeScript
MaxKim-J/tweet-bot-client
/src/utils/flattenHelper.ts
2.78125
3
export const flattenPrevTweetList = (tweetList:any) => tweetList.map((tweet:any) => { const { id, uploadedAt, precedent: { name } } = tweet return { id, name, uploadedAt: uploadedAt.slice(0, 10) } }) export type TweetListType = ReturnType<typeof flattenPrevTweetList> export const flattenPrecedentDetail = (precede...
52c0507de32808cf657872981a73f8171f9c2eb5
TypeScript
BarkSanson/sort-algorithms-animation
/ts/Node.ts
3.09375
3
import * as Animator from "./animator.js"; import * as Sort from "./sortAlgorithms.js"; import Err from "./errors.js"; const addInput = document.querySelector(".add-input") as HTMLInputElement; const removeInput = document.querySelector(".remove-input") as HTMLInputElement; const elements = document.querySelector(".el...
81fe7c64b272da2845f928147daa2f0c4320173a
TypeScript
dljsbook/data
/src/Stripes/generator.ts
2.9375
3
import getAtStep from '../utils/getAtStep'; import squish from '../utils/squish'; import { IRange, IGeneratorFn, IPoint, IGetX, } from '../NonLinear'; const getDividedDistribution = (num: number) => { const n = num; if (n <= 3) { return [n]; } else if (n === 4) { return [2, 2]; } const div ...
2d6dfa3179dddc585d5698cb2014d2769adff33c
TypeScript
next-cd/nest-learn
/src/dog/dog.controller.ts
2.84375
3
import { Controller, Get, HttpException, HttpStatus, UseFilters } from '@nestjs/common'; import { AppService } from './dog.service'; import { HttpExceptionFilter } from '../common/filters/http-exception.filter'; // import { CatsService } from '../cats/cats.service'; @Controller('dog') @UseFilters(HttpExceptionFilter)...
69744043af18a2e692fc09ba71fba4e5373f932a
TypeScript
helenmenge/cs445-lab-3
/lab3b/q1/q1.ts
3.1875
3
class University { name: string; dept: string; constructor(name: string, dept: string) { this.name = name; this.dept = dept; } graduation(year: number) { console.log(`Graduating ${this.dept} ${year} students`); } } let miu = new University("MIU", "MSD"); miu.graduation(2...
1b1a97b2032f53f79b4cf7e6263b055fd51b99c6
TypeScript
junkerm/specmate
/web/src/app/modules/views/side/modules/log-list/services/logging.service.ts
2.625
3
import { Injectable } from '@angular/core'; import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import { Observable } from 'rxjs/Observable'; import { Config } from '../../../../../../config/config'; import { ELogSeverity } from './e-log-severity'; import { LogElement } from './log-element'; @Injectable() export c...
47c04c9960272dc95466e0bf61385430dafb2302
TypeScript
1kriva1/sfc-components
/projects/sfc-components/src/lib/common/interfaces/sfc-toggle/IToggleConfig.ts
2.59375
3
export interface IToggleConfigItem { label: string; icon?: string; } export interface IToggleConfig { checkedItem: IToggleConfigItem; uncheckedItem: IToggleConfigItem; }
5e828b72ae0c394a5ec33bac9def088d373b132f
TypeScript
Reamd7/react-recontext
/src/types.ts
3.015625
3
export interface ObjectWithKey { [key: string]: any; } export interface StoreState { [key: string]: any; } export interface Actions { [actionType: string]: (state: StoreState, params?: any) => StoreState; } export type VoidFunction = () => void; export type ListenerFunction = (newStoreState: StoreState) => vo...