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
84cf68c5493d1a1314687a5839df9334d9ee3f27
TypeScript
lpaladin/json-inline-doc
/src/test/mixedComment.test.ts
2.8125
3
import { strictEqual } from 'assert'; import { CustomCommentWriter } from '..'; import { LONG_STRING } from './assets'; describe('mixed comments', () => { it('should properly escape */', () => { const w: CustomCommentWriter = new CustomCommentWriter(); w.addComments([], [{ type: 'block', content: ...
b5ec0e23f9f645b54c0c63c289a93977a12462f3
TypeScript
rpghq/game
/libs/core/src/builder/resource/constant.ts
3.0625
3
import { Constant, ConstantTypes } from '../../types'; export function constant<T extends ConstantTypes>(constant: T): Constant<T> { if (!['number', 'string', 'boolean'].includes(typeof constant)) { throw new Error('unexpected value for constant'); } return new Constant(constant); } export type ResolvedCons...
1fcf4e5a4d3c53ac8301a80d01846da2b5d67d45
TypeScript
jpmtrabbold/react-hooks-mobx-typescript-todo-list
/src/hooks/useButtonWithKeyDownListener.ts
2.671875
3
import { useMemo } from "react" import useKeyDownListener from "./useKeyDownListener" interface useButtonWithKeyDownListenerProps { action: () => any, keyboardCondition: (e: KeyboardEvent) => boolean | undefined, conditionToApplyListener: () => boolean | undefined, button: React.ReactNode } const use...
51fa36d287ecf2cb102a89409b0433587794f538
TypeScript
RafalPijet/execute-project-task
/src/redux/actions/requestActions.ts
2.59375
3
import { Action } from 'redux'; import { RootState } from '../store'; import { errorContent } from '../reducers/requestReducer'; //ACTIONS NAMES export const START_REQUEST = 'request/start_request'; export const STOP_REQUEST = 'request/stop_request'; export const ERROR_REQUEST = 'request/error_request'; export const R...
1023fb79171b9a4951e0c41cf6e98b3585baaad0
TypeScript
mmondani/MIoT_DAIoT_Frontend
/src/app/pipes/timestamp.pipe.ts
2.90625
3
import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'timestamp' }) //transforma timestamp a fecha y hora de Argentina export class TimestampPipe implements PipeTransform { transform(value: Number): string { if (value === 0) { return "--" } let date = new Date(<number>value *...
5d6ecbabf7365eccb6675085ea96815f73cbbed2
TypeScript
jintolPark/git2021-working
/4-react/myworkspace/src/common/lib/string.ts
2.609375
3
const getTimeString = (unixtime: number) => { // Locale: timezone, currency 등 // js에서는 브라우저의 정보를 이용함 const dateTime = new Date(unixtime); return `${dateTime.toLocaleDateString()} ${dateTime.toLocaleTimeString()}`; }; export { getTimeString };
b802feea7d00ae01b23c02610a3f073931f671a8
TypeScript
BAOTD789/BAOTD789.github.io
/toolkit.ts
3.09375
3
interface IWidgetEvent{ _height: number; _width: number; _xPos: number; _yPos: number; } abstract class Widget implements IWidgetEvent{ _height: number; _width: number; _xPos: number; _yPos: number; private _backcolor: string; Widget(height:any, width: any){ this._height...
df0f8975715e82223a6b551bbb522e391ee1e97b
TypeScript
jboz/living-documentation
/livingdoc-typescript-plugin/src/factories/class.factory.ts
2.90625
3
import { ClassDeclaration, ClassLikeDeclarationBase, ConstructorDeclaration, HeritageClause, NodeArray, SyntaxKind, TypeChecker } from 'typescript'; import { Class } from '../models/class'; import { Statement } from '../models/statement'; import { Type } from '../models/type'; import { extract...
5e42534dc9819eab4e87a23c011b311d1c3b397f
TypeScript
libero/reviewer-submission
/src/domain/submission/services/models/files-schema.test.ts
2.84375
3
import { filesSchema } from './files-schema'; import { TestFile } from './file-schema.test'; describe('file schema', () => { let files: { coverLetter?: string; manuscriptFile: TestFile | null; supportingFiles: TestFile[]; }; let file: TestFile; beforeEach(() => { file = ...
5e3092d9ac51b9cc3da27c2e56580b31262d2564
TypeScript
webdevproformation/angular-ifocop-dec2020
/app-blog/src/app/jour1/premier.component.ts
3
3
// transformer la class en un vrai composant Angular // décorer notre class avec un décoration Component // fin de la création de notre premier composant import { Component } from '@angular/core'; import { DataService } from "./services/data.service"; @Component({ selector : "premier", template : ` <...
8198dbb414b0d2ab9278ac1d48c058101ae9427f
TypeScript
wahello/wigfrid
/src/clarity-angular/wigfrid/core/src/util/lang/is-boolean.ts
2.640625
3
export function isBoolean(value: any): boolean { return typeof (value) == 'boolean'; }
0e04d9eaade278b7431f0f1f1c7a20fb16a25f80
TypeScript
jfrog/jfrog-vscode-extension
/src/main/cache/buildsScanCache.ts
2.546875
3
import * as fs from 'fs'; import { IDetailsResponse } from 'jfrog-client-js'; import * as path from 'path'; import { LogManager } from '../log/logManager'; import { ScanUtils } from '../utils/scanUtils'; import { Utils } from '../utils/utils'; export enum Type { BUILD_INFO, BUILD_SCAN_RESULTS } export class B...
8f186c9c76ae02231855e28b6a32fd40a1728fec
TypeScript
nagatapote/nextjs-nestjs-docker-aws-test
/nest-sample-app/src/books/book.ts
2.640625
3
import { Field, ID, ObjectType, Int } from "@nestjs/graphql" import { Entity, Column, PrimaryGeneratedColumn,CreateDateColumn } from "typeorm" @Entity() @ObjectType() export class Book { @PrimaryGeneratedColumn() @Field((type) => ID) id: number; @Column({ length: "30"}) @Field() title: string;...
3306bee7ee425d275d1fa25ec193aabd9cebe72c
TypeScript
node-ts/ddd
/packages/ddd/src/domain/aggregate-root.ts
3.078125
3
import { Entity } from './entity' import { Event } from '@node-ts/bus-messages' import { FunctionNotFound } from './error/function-not-found' import { pascalCase } from 'change-case' import { Uuid, AggregateRootProperties } from '@node-ts/ddd-types' type IndexedWith<TTarget> = TTarget & { [key: string]: (event: Event)...
b806c27ac7fddc8ab52203dc521ed868e1ac014f
TypeScript
jlaramie/alexa-picobrew
/src/intents/last-brew-intent.ts
2.5625
3
import { Handler } from 'alexa-sdk'; import * as moment from 'moment'; import { PicoBrewServiceFactory } from '../picobrew-service'; import { ISession } from '../picobrew/index'; import { intentHelpers } from './intent-helpers'; import { config } from '../config'; import { log } from '../common/log'; /** * Looks thr...
b72278840d64a18a9340de66f052a6077939455e
TypeScript
Azure/Azurite
/src/common/persistence/IExtentStore.ts
3.046875
3
import ICleaner from "../ICleaner"; import IDataStore from "../IDataStore"; import IExtentMetadataStore from "./IExtentMetadataStore"; /** * This model describes a chunk inside a persistency extent for a given extent ID. * A chunk points to a sub-range of an extent. * * @export * @interface IExtentChunk */ expor...
8619aac5faa9916249d0b42ceb44523faf610485
TypeScript
lenaWitterauf/Tweam
/reactclient/src/ErrorService.ts
3.109375
3
type Listener = (error: string) => void; class ErrorService { private readonly listeners: Listener[] = []; error(message: string): void { this.listeners.forEach(listener => listener(message)); } registerListener(listener: Listener) { this.listeners.push(listener); } unregisterLstener(listener: Listener) {...
265f5bc475272a1754f3749d64186e2e0a0bb125
TypeScript
Anwesh43/ball-in-square-path-ts
/BallInSquarePathStage.ts
2.890625
3
const w : number = window.innerWidth, h : number = window.innerHeight const nodes : number = 5 const paths : number = 4 const sizeFactor : number = 3 const rFactor : number = 5 const strokeFactor : number = 90 const scGap : number = 0.05 const scDiv : number = 0.51 const foreColor : string = "#673AB7" const backColor :...
8a15cdad4fb205e65d2e7a5907c007db6d4f5ab1
TypeScript
dwfe/tools
/packages/common/src/async.ts
2.796875
3
export const delay = (ms: number) => new Promise((resolve) => { setTimeout(resolve, ms) }); export const timeout = (ms, promise): Promise<any> => new Promise((resolve, reject) => { const timer = setTimeout(() => { reject(new Error('TIMEOUT')); }, ms); promise.then(value => { clearTimeout(timer); re...
637fad3ae4d60e464daa5ae648cf41b4b8acbfcd
TypeScript
dmitrymorozoff/christmas-is-coming
/source/utils/index.ts
3.046875
3
import * as THREE from "three"; export function getRandomInt(min: number, max: number) { return Math.floor(Math.random() * (max - min)) + min; } export function makeCube( width: number, height: number, depth: number, color: number, ) { const geometry = new THREE.BoxGeometry(width, height, dept...
82328dbcdc4e227ada28935cba91ca7433e82ac1
TypeScript
rafasnarf/Game_Cars_Typescript
/phaser.d.ts
3.25
3
/// <reference types="./matter" /> declare type CameraRotateCallback = (camera: Phaser.Cameras.Scene2D.Camera, progress: number, angle: number)=>void; declare type DataEachCallback = (parent: any, key: string, value: any, ...args: any[])=>void; declare type ContentLoadedCallback = ()=>void; declare type CreateCallb...
3aee8688e8145ab2aabe69afb654022770661761
TypeScript
dang1412/ccex-api
/src/exchanges/bitmex/candlestick/internal/functions.ts
2.6875
3
import { CandleStick } from '../../../exchange-types'; import { getSymbol, apiEndPoint } from '../../bitmex-common'; import { BitmexRestCandlestick } from './types'; // https://www.bitmex.com/api/udf/history?symbol=EOSZ18&resolution=60&from=1544974016&to=1545578876 // resolution = 1, 5, 60, D export function getCandle...
d170a7cfd16ffaa49fe564e620cb67c94fcea9bf
TypeScript
frederikschubert/ts-simple-ast
/src/DefaultFileSystemHost.ts
2.75
3
import * as fs from "fs"; import * as globby from "globby"; import {FileSystemHost} from "./FileSystemHost"; import {FileUtils} from "./utils"; /** * @internal */ export class DefaultFileSystemHost implements FileSystemHost { readFile(filePath: string, encoding = "utf-8") { return fs.readFileSync(filePa...
0b9c5b2a2290563a7b4e0c0e03c17136a1405928
TypeScript
crackerland/crackerland.github.io
/scripts/app.ts
2.546875
3
import { FileLoaderFactory } from "/web_modules/ts-libs.js" import { InstallChoice } from "./InstallChoice.js" import { InstallPrompt } from "./InstallPrompt.js" import { PwaInstaller } from "./PwaInstaller.js" import { RootPageController } from "./Controllers/RootPageController.js" import { RootViewModel } from ...
3d838ec2ebf0776f0fe1f5dab9c85e0bf745761d
TypeScript
jameelopix/precast_UI
/src/app/model/bank-account-search-dto.ts
2.53125
3
import { ColiseumSearchDTO } from "./coliseum-search-dto"; export class BankAccountSearchDTO extends ColiseumSearchDTO { private _accountNos: string[]; private _defaultAccounts: boolean[]; private _disableds: boolean[]; private _companyIds: number[]; /** * Getter accountNos * @return {...
04a38e63ed80c22b34ebe215d02098fedae48bfc
TypeScript
huuthangdut/svdanang
/src/app/core/models/user-profile.model.ts
2.5625
3
// for GET class UserProfile { id: string; firstName: string; lastName: string; userName: string; department: string; email: string; phoneNumber: string; birthDate: number; gender: boolean; address: string; city: string; facebookLink: string; avatar: string; } // for POST, PUT class UserProf...
dfbd8af3815831512d0d2310a1a71ea13f8d49bb
TypeScript
RadarTech/lnrpc
/src/default-empty-arg.ts
3.78125
4
/** * Add an empty object as the first argument if no argument was passed * @param {Function} func The function being called * @param {boolean} hasCallback Whether or not the passed function has a callback * @return {any} */ export function defaultEmptyArg(func: (...args: any[]) => any, hasCallback: boolean = tr...
e28cc20cbbe1802edafbd197c66aac0aa363c23c
TypeScript
MS7700/ra-data-odata-server
/src/index.ts
2.578125
3
import { CreateParams, DataProvider, GetListParams, HttpError, Identifier, } from "ra-core"; import odata from "odata-client"; import { resource_id_mapper } from "./ra-data-id-mapper"; import { parse_metadata } from "./metadata_parser"; import { Response } from "request"; interface GetRelatedParams extends G...
870ff8bf03fde10f2d06aa4f8bdf6dce47704485
TypeScript
revam/koa-match
/src/helpers.ts
3.609375
4
/** * src/helpers.ts * * Copyright (c) 2017 Mikal Stordal <mikalstordal@gmail.com> * MIT Licensed */ /** * Test `fn` on every value of `iterable`. * * @param iterable iterable * @param fn result tested as a truthy value. * @param thisArg `this` for `fn`. */ export function iterableEvery<T, U = any>(iterable...
59a58f7e379963397570d632097a3a19fc919fab
TypeScript
jsdelivrbot/WebAudioKeyboard
/src/scripts/main.ts
2.65625
3
import { Keyboard } from "./Keyboard"; let keys_down_node: HTMLElement; let chord_pressed_node: HTMLElement; let chord_callback: EventListener; let keyboard: Keyboard; let audioContext: AudioContext; keys_down_node = document.getElementById("keys_down"); chord_pressed_node = document.getElementById("chord_pressed")...
e1fa7e926fb39a1671a9beebe3340e494d4489c0
TypeScript
meiling413code/hulian_reader
/core/signatures/sig/Provider.ts
2.71875
3
package org.ofdrw.core.signatures.sig; import org.dom4j.Element; import org.ofdrw.core.OFDElement; /** * 创建签名时所用的签章组件提供者信息 * <p> * 18.2.1 文件摘要 图 86 表 67 * * @author 泰山信息科技 * @since 2019-11-20 19:26:15 */ public class Provider extends OFDElement { public Provider(Element proxy) { super(proxy); }...
e05c08da0c1c56cda0d575eb1d8f8d4aa9f6fb5e
TypeScript
danilosampaio/vscode_deno
/core/permcache.test.ts
2.65625
3
import { PermCache, TRANSACTION_STATE } from "./permcache"; import { sleep } from "./util"; test("core / permcache", async () => { const data = [1, 2]; const cache = await PermCache.create("permcache-test", 1); // test expired await sleep(500); expect(cache.expired()).toBeFalsy(); await sleep(600); expe...
7c01850faffc9096814ff752ffe9db16ce5fea5e
TypeScript
martinseanhunt/microservices-voting
/allocations/src/models/User.ts
3.046875
3
import mongoose from 'mongoose' // properties required for user creation interface UserAttrs { id: string points: number } // properties of the returned user document export interface UserDoc extends mongoose.Document { // NOTE: Id is automatically provided by the Document interface we're extending points: nu...
4e8b5ddc95bc8ecbe16646d656ed698ba2194769
TypeScript
Faktura179/kulki
/src/square.ts
3.09375
3
import {ballWrapper, squareWrapper, Color, highlightPath} from "./main" export class Square { element:HTMLElement; private occupied:boolean; private ball:Ball; pos:Position; path:Position[]; constructor(element:Element,pos:Position){ this.element = <HTMLElement>element; this.el...
9145ac5f2d24f6cf7e2bd8da9181d1189288526d
TypeScript
smeli-lang/smeli
/packages/smeli-core/src/stringify.ts
3.171875
3
import { BinaryOperator, BindingDefinition, Comment, Expression, FunctionCall, Identifier, LambdaExpression, Literal, ScopeExpression, Statement, traverse, Visitor, } from "./ast"; import { AddTrait, DivTrait, MulTrait, StrTrait, SubTrait } from "./traits"; import { ExpressionValu...
23065c87452f1ae7156e830da3b50ad3718a6f21
TypeScript
karatsuba/currency-exchange-widget
/src/screens/Exchange/hooks/useExchangeState/reducer/index.ts
2.640625
3
import { ExchangeState } from '../types'; import { ExchangeStateActions, TYPES } from '../actions'; import { ExchangeFlow } from '../../../services/exchangeFlow'; import { convertValue } from './helpers/convertValue'; import { convertWithFlow } from './helpers/convertWithFlow'; import { areRatesEqual } from './helpers/...
8a0abcf5e10687d9fa9774c2aa7d3a4c38af83a3
TypeScript
WWWMARIO/ngMeteo
/src/app/modules/shared/pipes/filter-readings-for-sensor.pipe.ts
2.53125
3
import { Pipe, PipeTransform } from '@angular/core'; import { Reading } from "../../readings/components/edit-readings/edit-readings.component"; @Pipe({ name: 'filterReadingsForSensor' }) export class FilterReadingsForSensorPipe implements PipeTransform { transform(readings: Reading [], sensorId: string) : any{ ...
820179e1ab5c4bd4901946b51003e1c0d4aa3083
TypeScript
sekwiatkowski/js-fp
/test/result/Failure.test.ts
3.25
3
import {createResultEquality, failure, success} from '../../src' const expect = require('chai').expect describe('Failure', () => { const unsafeGet = () => { throw 'Unexpected failure to get the value!' } const error = 'error' const createFailureOfString = () => failure<string, string>(error) const noS...
0ec488a8ca580f762b1491a5bea4d70679ade1b5
TypeScript
taystack/get-date
/__tests__/range.spec.ts
2.734375
3
import { Step } from '../source/types' import { range, RangeConfig } from '../source/timeDelta/range' describe('timeDelta range', () => { it('should return without failures', () => { expect(range(0, { from: 0 })).toEqual([]) }) it('should return an exclusive range of dates', () => { const config: Range...
5b52d4df4c3f539cd0f5ae8e2e68c39939fbfa90
TypeScript
luoweihoo/NamorvTech
/src/Engine/Core/Components/BitmapTextComponent.ts
3.1875
3
namespace NT { export class BitmapTextComponentData implements IComponentData { public name: string; public fontName: string; public origin: Vector3 = Vector3.zero; public text: string; public setFromJson( json: any ): void { if ( json.name !== undefined ) { ...
d9b9d9940d4018f9a31a48ed836d824efcf52a39
TypeScript
linyows/junkie
/src/slack.ts
2.6875
3
/** * Junkie * * Copyright (c) 2019 Tomohisa Oda */ interface SlackField { title: string value: string } interface SlackAttachment { title: string title_link: string color: string text: string fields?: SlackField[] } interface SlackPostMessageOpts { username: string icon_emoji: string link_na...
0a7362ae5aab53f480371228b127b12d1bc2d97c
TypeScript
joshclyde/allthethings
/react/src/components/Music/reducers.ts
3.453125
3
// actions and action creators const YOUR_ACTION_NAME = "YOUR_ACTION_NAME"; export const setYourActionName = (actionVar: string) => ({ type: YOUR_ACTION_NAME, actionVar }); // types of state and actions interface IState { stateVar: string; } interface IActions { type: string; actionVar: string; } // initial st...
80a477ddbb0b7449f534581d288f2b12c5af9568
TypeScript
konstantin-retunsky/learn-redux
/src/sotre/action-creators/user.ts
2.578125
3
import axios from "axios" import { Dispatch } from "react" import { UserActions, UserActionTypes } from "../../types/user" export const fetchUsers = () => { return async (dispatch: Dispatch<UserActions>) => { try { dispatch({ type: UserActionTypes.FETCH_USERS }) const response = await axios.get('https://jso...
e05179a7549d863b7440b2fb95d5344dad57f037
TypeScript
livemelkild/Movie-Explorer-Webpage
/my-app/src/Reducer/FetchDataReducer.ts
2.9375
3
import { FETCH_PENDING, FETCH_SUCCESS, FETCH_ERROR } from "../Action/Actions"; const initialState = { pending: false, fetch: [], error: null } interface FetchState { pending: boolean, fetch: string[], error: any } export function fetchDataReducer(state: FetchState = initialState, action: { typ...
e352ff42a9002fa7fb6ffd2513f1562356d1ecea
TypeScript
lkettavong/creatures-and-coworkers
/src/effector/index.ts
2.546875
3
import * as R from 'ramda'; import { roomBlocks } from "./slackResponse"; import { match, makeFactory } from "../stateReconstructor/unionHelpers"; import { Direction, DungeonState, Room, Player } from "../stateReconstructor/dungeonState"; import { DungeonEvent, Move } from '../stateReconstructor/events'; import { lens...
adc5e4d1aab517e0fafe789d025afe17ce55741e
TypeScript
michaelcw02/Sudoku
/client/app/services/sudoku.service.ts
2.671875
3
/* Authors: Andrey Arguedas Espinoza Daniela Armas Sánchez Michael Chen Wang Kimberly Olivas Delgado */ import { Injectable } from '@angular/core' import { Http } from '@angular/http' import { Observable, Subscription } from 'rxjs/Rx' import 'rxjs/add/operator/map' @Injectable() export class SudokuService { ...
3343b31bf8be44af03f2ffdd1f03457013ac988b
TypeScript
VOdu64/todos-filter
/src/app/store/todos.actions.ts
2.609375
3
import { Action } from '@ngrx/store'; import { Todo, TodoFilter } from '../todo.model'; import { TodoState } from './todos.reducer'; export const TODO_CREATE = '[todo] create'; export const TODO_DELETE = '[todo] delete'; export const TODO_TOGGLE = '[todo] toggle'; export const FETCH_TODO = '[todo] fetch'; export const...
fcbe75e6b584bb1d086f4d2d0580a4fcdbfcdc19
TypeScript
thedrumz/pmcm-api
/src/Group/domain/Group.ts
2.96875
3
import GroupId from './value-object/GroupId' import GroupImage from './value-object/GroupImage' import GroupName from './value-object/GroupName' import GroupStyle from './value-object/GroupStyle' export interface GroupPrimitives { groupId?: string groupName: string style: string image: string } class Group { ...
7a15034631b39574b0d0643bb3bbf4ef7ef6b620
TypeScript
anonopsbuilds/utils
/src/array/chunk.ts
3.5625
4
/** * 将数组分成指定大小的较小数组 * @param array * @param size default 1 * @category Array */ function chunk<T>(array: Array<T>, size: number = 1): T[][] { return Array.from({ length: Math.ceil(array.length / size) }, (_, i) => array.slice(i * size, i * size + size), ); } export default chunk;
72e34f01e8d04da4e7cd6864c3e535bce63750cf
TypeScript
tommaye/nuzlocke-generator
/src/utils/getPokemonImage.ts
2.578125
3
import { addForme, getSpriteIcon, speciesToNumber, getForme } from 'utils'; const sugiFormeNotation = forme => { if (typeof forme === 'undefined') return ''; // If the forme exists, we default to '_f2' if (forme != null || forme !== 'Normal' || forme === 'Alolan' || forme === 'Mega') return '_f2'; ...
239a9f2c503663208b8df39f40d8871165978973
TypeScript
varun431/AngularTraining
/src/app/directives/img-fallback.directive.ts
2.609375
3
import { Directive, ElementRef, HostListener, Input } from '@angular/core'; @Directive({ selector: 'img[appImgFallback]' // img is used to tell that this directive should be used with img tag in html. }) export class ImgFallbackDirective { // <img appImgFallback /> // <img appImgFallback="some image url he...
b645b942a93cec904f6570325010b161f2165ef2
TypeScript
swashapp/network-monorepo
/packages/client/src/MessageChain.ts
2.6875
3
/** * MessageChains */ import { MessageRef, MessageID, MessageIDStrict, SPID } from 'streamr-client-protocol' import { CacheConfig } from './Config' import { randomString, CacheFn } from './utils' export type MessageChainOptions = { publisherId: string msgChainId?: string } export function getCachedMesssage...
cb00eab95b89db8be66c038f825a3f0c8a77bd8f
TypeScript
giangr21/ProjetoTaTudoBem
/backend/src/services/AutenticarUsuarioService.ts
2.59375
3
import { sign } from 'jsonwebtoken'; import authConfig from '../config/auth'; import AppError from '../errors/AppError'; import Usuario from '../models/Usuario'; import UsuarioService from './UsuarioService'; import VoluntarioService from './VoluntarioService'; interface IRequest { email: string; senha: string; } ...
b61bfd4a349f9318ceace1d27923d4609157bd80
TypeScript
kometh0616/fmcord
/src/snippets.ts
2.609375
3
/* eslint-disable */ import config from "./config"; import { Message } from "eris"; export default { noLogin: `you haven't registered your Last.fm ` + `user account to this bot! Please do so with \`${config.prefix}` + `setnick <lastfm username>\` to be able to use this command!`, error: `There was a...
e7af25727efce144c8ff503bc2db5bcaeb9b9d04
TypeScript
BellumGens/bellum-gens
/projects/ebleague/src/app/pipes/starts-with.pipe.ts
2.625
3
import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'startsWith', standalone: true }) export class StartsWithPipe implements PipeTransform { public transform(collection: string[], term = ''): string[] { if (collection) { return collection.filter((item) => item.toLowerCase().startsWi...
e856fcba590872b4693654d35be32a248d6db284
TypeScript
buosseph/kuspe
/src/extensions.ts
3.3125
3
/** * @module * Extension architecture */ import plugins, { Plugin, PluginManager } from "./plugins"; import { robustTopologicalSort } from "./sort"; export type ExtensionTag = string; export type Extension = Plugin & { /** Extensions with the following tags may be accessible */ uses: ExtensionTag[], /** Extens...
377903e833684c0a78fcec361ff2bb6c46b2a97c
TypeScript
edw013/multiplayer-game
/src/QuadTree.ts
3.171875
3
import GameObject from "./GameObject"; import { Bounds } from "./common/Utilities"; // used for better collision checking class QuadTree { private root: Node; public constructor(bounds: Bounds, maxObjects: number, maxLevels: number) { let node: Node = new Node(bounds, 0, maxObjects, maxLevels); ...
302d3b2f58e48e326a33e97da0a89abd2a3b885b
TypeScript
ecmal/sip
/src/parser.ts
2.53125
3
import {Grammar} from "./grammar"; import {Model} from "./models/model"; import * as Models from "./models"; export class Parser { public static normalize(text:string):string{ if(text.match(/\r?\n/) && text.trim().split(/\r?\n/)[0].match(/SIP\/2\.0/)){ return text.replace(/\r?\n/g,'\r\n').trim(...
3722d9d649cb5d97ee32644ecbe9b1d931b7967b
TypeScript
zinderud/Angtbn
/src/libs/component/tbn-item-count.component.ts
2.703125
3
import { Component, Input } from '@angular/core'; /** * A component that will take care of item count statistics of a pagination. */ @Component({ // tslint:disable-next-line:component-selector selector: 'tbn-item-count', template: ` <div class="info item-count"> Showing {{((page - 1)...
8871ac4e035043c3fe61f212416be0e115d6f959
TypeScript
AndriiSiuta/routeshub
/package/src/utils/name.ts
3.15625
3
import { DefaultRouteName } from '../interfaces'; function fixPathName(path: string): string { let newPath = ''; let i = path.length - 1; if (path[i] === '/') { i -= 1; } while (i > -1) { const char = path[i]; const nextChar = path[i - 1]; if (nextChar === '/' || nextChar === ':') { n...
7a7fffd70845d1c0f9df6d9fcec6c781b08b2e18
TypeScript
gojob-1337/nest-cloud-datastore
/src/cloud-datastore.service.ts
2.828125
3
import { Datastore } from '@google-cloud/datastore'; import { Inject, Optional } from '@nestjs/common'; import { DatastoreModuleOptions } from './cloud-datastore.module'; export const DATASTORE_CONFIG_TOKEN = 'DATASTORE_CONFIG_TOKEN'; export class CloudDatastoreService { private readonly datastore: Datastore; c...
a9ec5d8deb9173970a6a9d951c41ba0c084d593a
TypeScript
yinhunfeixue/projectComponent
/v0.0.1/src/utils/HtmlUtil.ts
3.046875
3
class HtmlUtil { /** * 富文本转换为纯文件 * @param htmlStr 富文本 */ static plainHtml(htmlStr?: string) { if (!htmlStr) { return ''; } const span = document.createElement('span'); span.innerHTML = htmlStr; return span.innerText; } /** * 从blob中导出文件 * @param blob blob实例 * @param f...
4d928972fc067f0ae4b146d07bce9b91a6c03cd4
TypeScript
Unoqwy/blockbench-types
/types/settings.d.ts
2.65625
3
declare const settings: { [id: string]: Setting; }; interface SettingOptions { name: string; type?: "number" | "string" | "boolean" | "password" | "select" | "click"; value: boolean | number | string; condition?: any; category: string; description?: string; //launch_setting?: boolean ...
c2645e5e5ecf05f3433c6b6e8188c4905674407f
TypeScript
KESA24/JavaScript_OOP
/acm.ts
3.5625
4
/* Access control Modifiers Types - Private => It's scope is limited to the class where the variable is declared from. - Protected => the scope is limited to the class and (its child/subclasses) where the variable is declared from. - Public => the scope is limited to the module/package where...
ffc73cd8c3475df269fae5b4bbcd5fa50c2a1d82
TypeScript
Novik-A/social-network
/src/redux/app-reducer.ts
2.765625
3
import {ActionsTypes} from "./redux-store"; import {ThunkType} from "./users-reducer"; import {getAuthUserData} from "./auth-reducer"; const INITIALIZED_SUCCESS = 'app/INITIALIZED_SUCCESS' const initialState = { initialized: false } export const appReducer = (state: InitialStateAppType = initialState, action: Ac...
0716a50f07ed6454cfaf24d5e17007684b0ee6e1
TypeScript
martin-trajanovski/node-express-ts-boilerplate
/src/tests/authentication/authMiddleware.test.ts
2.71875
3
import httpMocks from 'node-mocks-http'; import { AuthenticationTokenMissingException, WrongAuthenticationTokenException, } from '@src/exceptions'; import { RequestWithUser } from '@src/interfaces'; import authMiddleware from '@src/middlewares/auth.middleware'; describe('auth.middleware.ts', () => { test('A req...
53ac9992e127e22dc3a5487eb298766668c607e3
TypeScript
nfwyst/react-flow-smart-edge
/src/PathFindingEdge/pointConversion.ts
3.453125
3
import type { XYPosition } from 'react-flow-renderer'; const gridRatio = 10; /** * Each bounding box is a collection of X/Y points in a graph, and we * need to convert them to "occupied" cells in a 2D grid representation. * * The top most position of the grid (grid[0][0]) needs to be equivalent * to the top most...
cb3c73f523c73242c2e252fb9d37d0690e46e33d
TypeScript
rickychilcott/mrujs
/src/utils/url.ts
2.8125
3
import { Locateable } from '../../types' export function expandUrl (locateable: Locateable): URL { if (urlExpanded(locateable)) { return new URL(locateable.toString()) } return new URL(locateable.toString(), document.baseURI) } function urlExpanded (locateable: Locateable): boolean { return /^http/.test(...
6d1c5da62d3e3054cb82b450634343313f19f09c
TypeScript
verzac/about-react
/src/utils/Mocks.ts
2.625
3
export async function mockAsync<T>(resolvedValue: T, timeoutMs: number): Promise<T> { return new Promise((res) => { setTimeout(() => res(resolvedValue), timeoutMs); }); }
d220294161f297f7933cf4ce091f6fa49f50a5fc
TypeScript
chongji2000/Code-Builder
/src/renderer/model/data/GenericManager.ts
2.875
3
import * as ts from 'typescript' import Generic from './Generic' import NameManager from './NameManager' export default class GenericManager extends NameManager<Generic> { get text(): string { let list = Array<string>() this.list.forEach(item => { list.push(item.text) }) ...
7acf656adb39680859fda4a2e2d59879579b4633
TypeScript
Langion/introspector
/src/core/Comparator.ts
2.984375
3
import * as _ from "lodash"; import * as types from "../typings"; interface Proceeded<O extends string> { a: types.Source<O>; b: types.Source<O>; isEqual: boolean; } export class Comparator<O extends string> { private processed: Array<Proceeded<O>> = []; public isEqual(a: types.Source<O>, b: type...
65eca991710f3134b6abbb9a50ab70954439b569
TypeScript
ctymcom/store-ban-thuoc
/src/helpers/report/charts/columnLine.chart.ts
2.78125
3
import { IChartConfig, Chart, ChartType } from "../chart"; export type ColumnLineChartConfig = IChartConfig & { colLabels: string[]; colColors: string[]; lineLabels: string[]; lineColors: string[]; data: ColumnLineChartItem[]; zoom: number; lineUnit: string; }; export type ColumnLineChartItem ...
c855ecd3cd5d3b73d2d7ce181e2806b6a575eb79
TypeScript
yjl9903/XLang
/src/xlang/tac.ts
3.171875
3
import { ValueType, VoidType, CmpOpType } from './type'; export interface GlobalVariableCode { globalAddress: number; type: ValueType; } export interface LocalVariableCode { address: number; type: ValueType; } export type VariableCode = GlobalVariableCode | LocalVariableCode; export enum ThreeAddressCodeTyp...
a4361e2224b6c0e4e34ca32a4f048d57fae9a301
TypeScript
WaywardGame/types
/definitions/game/game/inspection/IInspection.d.ts
2.5625
3
/*! * Copyright 2011-2023 Unlok * https://www.unlok.ca * * Credits & Thanks: * https://www.unlok.ca/credits-thanks/ * * Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide: * ...
3c680f646b175db73b07e502ebd048853521f32e
TypeScript
tathagat2006/serenity-js
/packages/protractor/src/screenplay/questions/targets/TargetElements.ts
2.65625
3
import { AnswersQuestions, Question, UsesAbilities } from '@serenity-js/core'; import { ElementArrayFinder, ElementFinder, Locator } from 'protractor'; import { BrowseTheWeb } from '../../abilities'; import { RelativeQuestion } from '../RelativeQuestion'; import { override } from './override'; import { TargetNestedElem...
d0597c10d4e41e8f9024e85b3058af42c98304bf
TypeScript
xiaoquanquanxin/medical
/src/store/modules/intervention.ts
2.875
3
// 营养干预,intervention import {COMMIT_INTERFACE} from "@/store"; interface STATE { // 被选中的营养干预方案 chooseInterventionData: any // 新增处方、编辑处方选择的头部数据 basicInfoEditData: any; kqcnData: any, // 肠内营养支持数据 cnyyzcData: any; // 膳食营养计划 mealData: any; prescriptionType: number, // 总的能量表格数据 totalEnergyData: any, // 根据t...
8b9c9ba9446da0551d578f484e2998595a683602
TypeScript
markuskraemer/tf-examples
/src/app/handwrittenRecognition/draw-image/draw-image.component.ts
2.578125
3
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'; import * as tf from '@tensorflow/tfjs'; class Point { public x:number; public y:number; } @Component({ selector: 'draw-image', templateUrl: './draw-image.component.html', styleUrls: ['./draw-image.component.scss'] }) export class ...
e1f9b00b8ad5408e0123bcdeab005750da1b55af
TypeScript
t4d-classes/bootcamp_09142020
/demo-app/src/models/Item.ts
2.5625
3
export type ItemId = number; // | string; export interface Item { id: ItemId; }
5a15cb5c711f9ee76265d4cd54b12ab8cf342c12
TypeScript
intellabytes01/Ionic
/src/app/pages/auth/register/store/register.actions.ts
2.515625
3
import { Action } from '@ngrx/store'; export enum RegisterActionTypes { BUSINESSTYPES = '[Register] Business Types', BUSINESSTYPES_SUCCESS = '[Register] Business Types Success', BUSINESSTYPES_FAILURE = '[Register] Business Types Failure', REGIONS = '[Register] Region Types', REGIONS_SUCCESS = '[Register] Re...
b0ff83a805bffadc8a045fb714297e7da6365099
TypeScript
MaikelChan/ts-game-engine
/src/Math/Frustum.ts
2.9375
3
import { Plane } from "./Plane"; import { BoundingBox } from "./BoundingBox"; import { vec3 } from "gl-matrix"; export const enum IntersectionResults { Inside, Outside, Intersect }; export class Frustum { private planes: Plane[]; get Planes(): Plane[] { return this.planes; } constructor() { this...
4df9666863217b1d49abba3d798eb6d79e9b746c
TypeScript
mm2367/pigdice
/src/PigDiceTypes.ts
2.53125
3
export interface Player { id: number; score: number; isActive: boolean; } export interface Winner{ id:number; totalScore:number }
b2153bd2b0a0f5a6d4d55940dcfb702db423bc1e
TypeScript
hrlr1230/cccPeekCard
/assets/Script/Helloworld.ts
2.734375
3
import PeekCardNode from "./PeekCardNode"; import PeekCard from "../Prefab/PeekCard/PeekCard"; import PeekCardHorizontal from "./PeekCardHorizontal"; export enum DirType { horizontal = 0, vertical = 1 } const { ccclass, property } = cc._decorator; @ccclass export default class Helloworld extends cc.Componen...
b7e5fe8581101c1c7fdeb07cfa18ec1534215f4b
TypeScript
lorenzowind/UBEMath
/backend/src/modules/conquests/services/UpdateConquestService.ts
2.515625
3
import { injectable, inject } from 'tsyringe'; import AppError from '@shared/errors/AppError'; import ICacheProvider from '@shared/container/providers/CacheProvider/models/ICacheProvider'; import IConquestsRepository from '../repositories/IConquestsRepository'; import Conquest from '../infra/typeorm/entities/Conque...
c081ae170d948debb2e2c54440bcebef69e14877
TypeScript
eccentricnode/level-up
/libs/core-data/src/lib/store/coins/coins.reducer.ts
2.625
3
import { EntityState, EntityAdapter, createEntityAdapter } from '@ngrx/entity'; import { Coin } from '../../crypto/crypto.model'; import { CoinsAction, CoinsActionTypes } from './coins.actions'; export interface CoinsState extends EntityState<Coin>{ selectedCoinId: string | null; } export const adapter: EntityAdap...
8c69faf78ce3f303464ac148fc528133733e2da4
TypeScript
anovote/frontend
/src/core/service/storage/LocalStorageService.test.ts
3.25
3
import { LocalStorageService } from './LocalStorageService' export type testTypes = 'A' | 'B' | 'C' | 'D' const storageService: LocalStorageService<testTypes> = new LocalStorageService() beforeEach(() => { storageService.clear() }) it('should return same value after getting inserted item with key', () => { c...
356147d0736d94ce85ade17fa6a605ff2629a74f
TypeScript
Nadno/e-commerce-web
/src/types/hooks.d.ts
2.765625
3
import React, { SetStateAction, Dispatch } from 'react'; export interface Account { id: number | null; name: string; avatar: string; } interface Token { token: string; refreshToken: string; } export interface StoreProvider { token: string; account: Account; cart: string[]; setAccount: Dispatch<SetS...
37134123cf121fe16249aed203ad1930525d930d
TypeScript
regexp-lin/GraphQL-Explorer-Server
/server/directives/dateFormat.ts
2.734375
3
import { GraphQLField, defaultFieldResolver, GraphQLString } from "graphql"; import { SchemaDirectiveVisitor } from "graphql-tools"; import DateFormatter from "dateformat"; const defaultFormat = "mmmm d, yyyy"; export class DateFormatDirective extends SchemaDirectiveVisitor { visitFieldDefinition(field: GraphQLField...
dbe7bf18b20b733ec5dc569038271af846620db4
TypeScript
medunigraz/MedUniGraz-API
/medunimaps/src/app/base/edgeweight.ts
3.0625
3
export class EdgeWeight { id: number; name: string; weight: number; color: string; constructor(obj: any) { this.id = obj["id"]; this.name = obj["name"]; this.weight = obj["weight"]; if (this.id == 1) { this.color = "#000000"; } else if (this.id == 2) { th...
54a8c2c05b0cd0ef09bb7baed85633a053301d06
TypeScript
kgolezardi/Performance-Review-Web
/src/shared/forminator/core/subscribable/MapSubscribable.ts
2.984375
3
import { Emitter } from 'mitt'; import { Subscribable } from './types'; export class MapSubscribable<V> implements Subscribable<V> { constructor( private readonly values: Map<string, any>, private readonly emitter: Emitter, private readonly key: string, ) {} getValue(): V | undefined; getValue(de...
efaa1e8ee348bdb9c6f0ce88579490628fa2fa78
TypeScript
Ishadijcks/unknown-rpg
/src/game/items/EquipableInventory.ts
2.53125
3
import {Item} from "@/game/items/Item"; import {Inventory} from "@/game/features/inventory/Inventory"; import {ItemType} from "@/game/items/ItemType"; import {ItemId} from "@/game/items/ItemId"; import {Consumable} from "@/game/items/Consumable"; import {App} from "@/App"; export class EquipableInventory extends Item ...
e80f950ccc006aaed715f5d81924028ff81688b9
TypeScript
kristianmandrup/zebkit
/src/ui/ExtendablePan.ts
2.859375
3
/** * Extendable UI panel class. Implement collapsible panel where * a user can hide of show content by pressing special control * element: // create extendable panel that contains list as its content var ext = zebkit.ui.ExtendablePan("Title", new zebkit.ui.List([ "Item 1", ...
f7702b13376b7c2d281393aba95314f66978c654
TypeScript
sergromanov4/tesler-ui
/src/utils/filters.ts
2.75
3
import {BcFilter, BcSorter} from '../interfaces/filters' import {DataValue} from '../interfaces/data' export function getFilters(filters: BcFilter[]) { if (!filters || !filters.length) { return null } const result: Record<string, string> = {} filters.forEach(item => { let value = String...
91370f4c88818b204128e6f2449c52da54e7b3de
TypeScript
arturober/JavaScript-2020
/Parte 8/products-typescript/src/interfaces.ts
2.515625
3
export interface IProduct { id?: number; name: string; description: string; photo: string; } export interface ResponseProducts { products: IProduct[] } export interface ResponseProduct { product: IProduct }
6a6471ff805168f0ed5c7d4ffc47d219e5fb5c99
TypeScript
zkan/ts-oop
/src/abstraction-polymorph/shared.ts
2.75
3
export enum Role { Manager, Employee, CLevel, } export class Employee { Role: Role public isRoleHigherThan(role: Role): boolean { return true } }
8162a0d0568425e4e159bca309fec5f3e6c6bafb
TypeScript
jackyanjiaqi/nojson-base
/src/sys/basic/Router.ts
2.796875
3
/** * Created by jackyanjiaqi on 16/10/26. */ import { IPlugin, Context } from '../Plugin'; import { Value } from './Value'; import { Utils } from "../../Utils"; var PATH = require('path'); /** * 以.或@cd开头用于定位 * .定位到当前层级,并约束只在当前层级查找 * 例: .a 仅在当前层查找a,不向上查找 * ..向上一层 * 例: * @have-it(value)[value...
47cfb93c770cd25dcc7c24dfbbe16116d1df1135
TypeScript
yatin80/Weather
/src/app/components/weather/weather.component.ts
2.625
3
import { Component, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; import { WeatherService } from './../../api/weather.service' @Component({ selector: 'app-weather', templateUrl: './weather.component.html', styleUrls: ['./weather.component.css'] }) export class WeatherComponent implements OnIni...
658883aedbcffa2066ad517810637dcb27a027f7
TypeScript
luoyu-java/X6
/packages/x6-vector/src/struct/path-array.ts
2.96875
3
import type { Path } from '../vector/path/path' import { withPathContext } from '../util/context' import { parse, toString } from '../vector/path/util' import { Box } from './box' import { TypeArray } from './type-array' import { UnitNumber } from './unit-number' export class PathArray extends TypeArray<Path.Segment> ...
6ca2964b55ce2632f5018149257beaee086683e6
TypeScript
DefinitelyTyped/DefinitelyTyped
/types/world-currencies/test/world-currencies-tests.ts
2.765625
3
import worldCurrencies = require("world-currencies"); // test interface exports type Currency = worldCurrencies.Currency; type IsoData = worldCurrencies.IsoData; type Unit = worldCurrencies.Unit; type MinorUnit = worldCurrencies.MinorUnit; type CashValues = worldCurrencies.CashValues; worldCurrencies; // $ExpectType ...
2be689eb4088f763fc74814c55777e39119e5eb7
TypeScript
americademy/pixi-essentials
/packages/cull/index.d.ts
3.109375
3
import { DisplayObject } from '@pixi/display'; import { Rectangle } from '@pixi/math'; /** * Provides a simple, configurable mechanism for culling a subtree of your scene graph. * * If your scene graph is not static, culling needs to be done before rendering. You * can run it on the `prerender` event fired ...
65d5f84e03222e1d22d8f7775b4adf616ae28ed4
TypeScript
MielPoPSCrew/ParisCultureAnalyze
/src/app/services/event.service.ts
2.515625
3
import { Injectable } from '@angular/core'; import { Observable } from 'rxjs/Observable'; import { ReplaySubject } from 'rxjs/ReplaySubject'; import { flatMap, tap, map, toArray, shareReplay, filter } from 'rxjs/operators'; import { of } from 'rxjs/observable/of'; import { HttpClient } from '@angular/common/http'; impo...