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
d4ac1e7d7256669449d2ace299cb370d1a748c26
TypeScript
burin-sapsiri/HDLC
/index.ts
2.765625
3
const crc = require("crc"); const EventEmitter = require("events").EventEmitter; const FRAME_BOUNDARY_OCTET = 0x7E; const CONTROL_ESCAPE_OCTET = 0x7D; const INVERT_OCTET = 0x20; const MINIHDLC_MAX_FRAME_LENGTH = 4096; class HDLC { public pendingFrame: any = {}; public eventEmitter = new EventEmitter(); pub...
66f7f331e304deed5938a29724861cd68b744516
TypeScript
Woohaik/EventosDeportivos-Frontend
/src/store/reducers/customerReducer.ts
2.78125
3
import { CustomerState, CustomerAction, EDIT_CUSTOMER, LOGIN_CUSTOMER, DELETE_CUSTOMER, LOGOUT_CUSTOMER } from "../types"; import { isJwtExpired } from "../../utils" const initialState: CustomerState = { customer: { dni: "", email: "", lastname: "", name: "", id: 0 }, ...
0a627fec7dff5b5ac795b4d425d8653a5a7ffecf
TypeScript
knraulmendoza/practics-api
/src/modules/login/user.controller.ts
2.65625
3
/* https://docs.nestjs.com/controllers#controllers */ import { Body, Controller, Get, HttpException, HttpStatus, Post, Res, } from '@nestjs/common'; import { UserDto } from './dto/user.dto'; import { User } from './user.entity'; import { UserService } from './user.service'; @Controller('user') export cl...
98ce73044976add536c36be902da435a419cf7ee
TypeScript
hshine1226/bee-js
/test/utils/eth.spec.ts
2.859375
3
/* eslint @typescript-eslint/no-empty-function: 0 */ import { ethToSwarmAddress, fromLittleEndian, isEthAddress, toLittleEndian } from '../../src/utils/eth' describe('eth', () => { describe('isEthAddress', () => { const testValues = [ { value: () => {}, result: false }, { value: new Function(), resul...
42cc56e53158c61b038c7e62d2a20ac86d13c67d
TypeScript
JowieXiang/backend
/application/micado-backend/src/models/settings.model.ts
2.578125
3
import { Entity, model, property } from '@loopback/repository'; @model({ settings: { idInjection: false, postgresql: { schema: 'micadoapp', table: 'settings' } } }) export class Settings extends Entity { @property({ type: 'string', required: true, id: 1, postgresql: { columnName: 'key', dataType: '...
92e74b87111efea995431b38928db76096d91be4
TypeScript
hugojosefson/highland-deno
/src/stream-redirect.ts
2.609375
3
import { Stream } from "./stream.ts"; /** * Used as a Redirect marker when writing to a Stream's incoming buffer */ export class StreamRedirect<R> { __HighlandStreamRedirect__ = true; to: Stream<R>; constructor(to: Stream<R>) { this.to = to; } }
da701e76b65b15ca0593df9e2044818802d2a53a
TypeScript
johney-suk/WantoDo
/back/src/exceptions/MongoException.ts
2.5625
3
import { Error as MongooseError } from 'mongoose'; class MongoException extends Error { public status: number = 0; public type: string = 'MongoDBException'; public name: string = ''; public errorCode: number = 0; constructor(mongoError: MongooseError, msg?: string) { super(msg || mongoError.message); if ...
3e744659ed072a51ec0b578ffaed84bb60dcc7f4
TypeScript
nghiattran/transpiler
/src/language/pascal/intermediate/RoutineCodeImpl.ts
2.671875
3
import {RoutineCode} from '../../../intermediate/RoutineCode'; export class RoutineCodeImpl implements RoutineCode { private text : string; public static DECLARED : RoutineCodeImpl = new RoutineCodeImpl('DECLARED'); public static FORWARD : RoutineCodeImpl = new RoutineCodeImpl('FORWARD'); public stat...
45049c7515133f1645ed0a939d781198542e25a7
TypeScript
devhedges/parse
/packages/parse/src/lib/tokenizer/tokenizer.spec.ts
3.234375
3
import { tokenizeSingleChar, tokenizeMultipleChars, skipWhiteSpace, tokenizer, TokenType, } from './tokenizer'; describe('tokenizer', () => { it('should tokenize single character tokens', () => { const results = tokenizeSingleChar(TokenType.BRACKET, '[', '[', 0); const [length, token] = results; ...
163bf66346eff5260dad542cf3abe9ca8d2d7cf9
TypeScript
ericchingalo/comment-app
/src/app/store/reducers/comment.reducers.ts
2.84375
3
import * as fromAction from '../actions/comment.actions' import { Comment } from '../../comment-module/modules/comment.module'; export interface CurrentState{ comments: Comment[], loading: boolean, loaded: boolean } export const initialState: CurrentState = { loaded: false, loading: false, com...
bb48206b6f50ea8c5412e2fab2d7e70605f9440b
TypeScript
marcoshuck/utn.web.dev
/TypeScript/2_Datos/2_2_tipos.ts
2.609375
3
const unNumero: number = 22; const unaPalabra: string = "Hola, mundo!" const unLogico: boolean = true; const unNada: void = void; const unaVariableSinValor: null = null; const unVariableSinDefinir: undefined = undefined; const unCualquiera: any = 22;
d76ca4a700718b4d6d87e1e080d957118a071cbe
TypeScript
Rabindra-pandey/pokemon-assi
/src/app/models/pokemon.ts
2.546875
3
export interface PokemonDetails { name: string; height: number; wight: number; abilities: string; } export interface PokemonAPI { count: number; next: string; previous: string; results: []; }
55583953d598d6cf8823ec84b12db849e045a6a5
TypeScript
mathdeziel/vscode
/src/vs/base/common/resources.ts
2.578125
3
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
167c89611b8e2b050c0a7af2a1f972fb20550b7a
TypeScript
suyash/char-rnn
/web/src/index.ts
2.75
3
import * as tf from "@tensorflow/tfjs"; import debug from "debug"; import { decode, encode, sample, sleep } from "./utils"; debug.enable("*"); const INITIAL_TEXT: string = "Immortal longings in me: now no more"; let speed: number = 38; let playing: boolean = false; let text: string = INITIAL_TEXT; let predictionCo...
1818bd0a25feba9a20cb5217d9dd3dea92628b7c
TypeScript
Exormeter/Moveit-Backend
/src/routes/allUsersRoute.ts
2.5625
3
import * as User from '../models/user'; // import User import { BaseRoute } from './baseRoute'; export class AllUsersRoute extends BaseRoute { public static create(router) { console.log("Create all users route"); /** @api {get} /allUsers Alle Benutzernamen und pushToken @api...
3ffb08b3ebfc611076eded0601a97ff7cd891b2e
TypeScript
pushrocks/lik
/test/test.objectmap.ts
2.875
3
// import test framework import { expect, tap } from '@pushrocks/tapbundle'; import * as events from 'events'; import * as smartpromise from '@pushrocks/smartpromise'; // import the module import * as lik from '../ts/index'; // Objectmap interface ITestObject { propOne: string; propTwo: string; } let testObjectma...
c2707be52f7c64685b85eb950d867824e81054c7
TypeScript
bevkwok/react-capstone
/server/src/controllers/productController.ts
2.71875
3
import { Response, Request } from 'express' import { ProductDoc } from '../interfaces/product' import { Product } from '../models/productModel' const getAllProducts = async(req: Request, res: Response): Promise<void> => { try { const products: ProductDoc[] = await Product.find() if (products.length...
f9de6e0a4148ee32086308cc46699bc369333997
TypeScript
cnscorpions/data-story
/tests/unit/core/Feature.test.ts
3.125
3
import Feature from '../../../src/core/Feature' test('a Feature can be instantiate from various types', () => { [ 'str', 123, [], {}, {foo: 'bar'}, ].forEach(value => { expect(new Feature(value)).toBeInstanceOf(Feature) }) }); test('a Feature can hold attributes', () => { let feature =...
38aa9bdc48f6745be153253facf084dfad1e82a9
TypeScript
thrashplay/devops-tools
/packages/modular-cli/src/cli-builder.ts
2.6875
3
import { Arguments, Argv, CommandBuilder, CommandModule } from 'yargs' import yargs from 'yargs' import { each, identity, isNil, map, merge, reduce } from 'lodash' import { createCli } from '@thrashplay/logging' import { ConfigurationOptions, CommandSet, Task, Result } from '.' const log = createCli() const getConfi...
624e4bce66ac6d5737bbf64a4207907b387b8ad6
TypeScript
adroaldofilho/api-thedica
/src/modules/profissao/profissao.model.ts
2.734375
3
// import { IPost } from "../Post/interface"; export interface IProfissao { readonly id: number, nome: string, conselho: string // Posts?: IPost[]; } export function createProfissao({id, nome, conselho}: any): IProfissao { return { id, nome, conselho // , Posts } } export func...
5fc0710b10294b43f11686ce6dea307218c8c7ef
TypeScript
GeekChanaa/SchoolV2
/SchoolSpa/src/app/_services/room.service.ts
2.625
3
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators' import { Room } from '../_models/room'; import { PaginatedResult } from '../_models/pagination'; @Injectable({ providedIn: 'r...
004e4e86907b2b78c083143a7b6c44f6f10d9e39
TypeScript
future4code/Patricia-Matiesque
/semana15/aula2/Restaurant/src/dessert.ts
3.390625
3
import { Dish } from "./dish"; export class Dessert extends Dish { public slicesNumber: number; constructor( price: number, cost: number, ingredients: string[], timeToCook: number, slicesNumber: number ) { super(price, cost, ingredients, timeToCook); this.slicesNumber = slicesNumber; ...
ce359d71ee9bd887f70be71029c93e73a49cbe2e
TypeScript
hangcs/doppelgunner-blog
/src/app/models/post.ts
2.921875
3
export class Post { constructor(public title: string, public content: string, public createdAt: any, public lastUpdate: any) {} clone(): Post { let newPost = new Post(this.title,this.content, this.createdAt, this.lastUpdate); return newPost; } }
30a72a37d962d33ebb3c811126962e4457b4b34b
TypeScript
CalionVarduk/ts-utils
/tests/logging/logger.spec.ts
3
3
import { Logger, createConsoleLogger } from '../../src/logging/logger'; import { LogType } from '../../src/logging/log-type.enum'; import { LogMessage } from '../../src/logging/log-message'; import { Nullable } from '../../src/types/nullable'; import { ILogger, LoggerDelegate } from '../../src/logging/logger.interface'...
19f3891b552797f59668d9788f4b98fc3935c3c6
TypeScript
ICT37108G1-LB-spring-2019/lab4-anianichka
/src/app/student.service.ts
2.546875
3
import { Injectable } from '@angular/core'; import { IStudent } from './StudentInterface' @Injectable({ providedIn: 'root' }) export class StudentService { constructor() { } student: IStudent[] = [ { name: 'Zura', lastName: 'MgalobliShvili', id: 350505050 }, { name: 'Lasha', ...
510b9692253da69aef9075eff11c12c60406e3ad
TypeScript
MatheusBVieira/evento-dot-com-frontend
/utils/toCurrency.ts
2.75
3
export const toCurrency = (number: number) => number?.toLocaleString('pt-BR', { style: 'currency', currency: 'BRL', minimumFractionDigits: 2, }); export const currencyToFloat = (number: string) => { let value = Number(String(number).replace(/\D/g, '')); return parseFloat((value / 100).toFixed(2)); ...
c2e1d91c7c20d0bd434d36e98fcc6bb8c6a31a41
TypeScript
jcmagsay/data-structures
/problems/knapsack.ts
3.28125
3
function max(a, b) { return Math.max(a, b); } function knapsack(iterator, capacity, weights, scores) { const nextIteration = iterator - 1; const currentWeight = weights[nextIteration]; const currentScore = scores[nextIteration]; console.log({ iter: iterator, cap: capacity, currentScore, curr...
5c1cf10d2a069da8d8eb0578fade7fd8c28b8f19
TypeScript
prafulrana/blender-node
/src/blender/bpy/types/MeshLoopColorLayer.ts
2.625
3
import * as util from 'util' import { BlenderCollection, Indexable } from '../../collection' import { BlenderInterop } from '../../../worker/interop' import { PythonInterop } from '../../../python/interop' import { MeshLoopColor } from './MeshLoopColor' /** * MeshLoopColorLayer * * https://docs.blender.org/api/cur...
7c49afa8322151b19dbc2237feaa0b485f36b6ef
TypeScript
mrsaleh/usdz-ts
/src/Utils/PixarIntegerEncoderBits.test.ts
2.796875
3
import {IntegerEncoder} from 'Utils/PixarIntegerEncoder' import { Utils } from 'Utils/Utils'; const input = [123, 1, 1, 100000, 0, 1, 0]; const mostCommonOccurance = 1; const output = IntegerEncoder.CalculateBits(input,mostCommonOccurance); //01 00 00 11 01 00 01 XX const expectedOuput = [0,1 ,0,0 ,0,0 ,1...
adcc4c4edbef9b47d6d4c3cbf34b254983fa5c5e
TypeScript
wbjqiqi/design-patterns-ts
/design-pattern/16-command/receiver-models/rabbit-receiver.ts
3
3
/* rabbit-receiver.ts */ // 兔子 import { ILeftReceiver, IRightReceiver } from './receiver-interface'; import { ITarget } from './target-interface'; export class RabbitReceiver implements IRightReceiver, ILeftReceiver { public rabbit: ITarget; private rightLogs: number[] = []; private leftLogs: number[] = []...
9e1f13252022625f56501884425339f8b181fc55
TypeScript
studiometa/js-toolkit
/packages/js-toolkit/services/raf.ts
2.53125
3
/* eslint-disable no-use-before-define, @typescript-eslint/no-use-before-define */ import { useService } from './service.js'; import { getRaf as getRequestAnimationFrame } from '../utils/nextFrame.js'; import { useScheduler } from '../utils/scheduler.js'; import { isFunction } from '../utils/is.js'; import type { Servi...
c4b273c0c6008d54f0c7edc80f8989fc2ca6b465
TypeScript
JohnApache/hasaki-cli
/src/command/template/action.ts
2.53125
3
import { Command } from 'commander'; import { GetTemplates, UpdateTemplates, ResetTemplates, } from '../../config/template'; import { Exit } from '../../common'; import { ErrorLog, SuccessLog } from '../../common/log'; import { CheckTemplate } from '../../common/template'; import { AddTemplatePrompt, ...
36b569ea7cac3dae9d8ab310ac2e4b9861828c02
TypeScript
Megatone/Angular5-Ethereum-Wallet-Platform
/Ethereum-Wallet-Platform-Frontend/src/app/models/alert.model.ts
2.640625
3
import { Router } from '@angular/router'; export class Alert { public message: String; public type: String; public status: boolean; public redirect: boolean; public url: String; constructor(alert: any = {}) { this.load(alert); } public load(alert: any = {}) { const _this = <Alert>alert; t...
7311f332e6a30bde4c0a8e3d2b56b751238714f6
TypeScript
AndreiDC/test-jest
/integer/23.ts
3.296875
3
/* From the beginning of the day N seconds have passed (N is integer). Find an amount of full minutes passed from the beginning of the last hour.*/ export function lastHaurs(n) { let lh, int, aju: number; aju = Math.floor(n / 3600); int = aju * 3600; lh = n - int; return Math.floor(lh / 60); }
613e1a30b0dbce387332528a2eb29429646ca491
TypeScript
swimos/swim
/swim-js/swim-runtime/swim-core/swim-util/src/main/assert/Assert.ts
2.984375
3
// Copyright 2015-2023 Swim.inc // // 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 i...
48bfe9fb51fe3ed491fee6c6ef3b595a950ee2fe
TypeScript
Tanvir-Kang/Portfolio
/src/pages/AboutMe.tsx/personalInfo.ts
2.609375
3
import { ImageCardProps } from "../../components/ImageCard/cardTypes"; import { TextCardProps } from "../../components/TextCard/cardTypes"; import PROFILE_PICTURE from "../../Static/Images/IMG_2662.jpg" import { icons } from "../../Static/Images/LanguageIcons"; import { LanguageCardType } from "../../components/Languag...
4ae2884eabdaa42c54e2ed9d429051fade3ebfe4
TypeScript
typvp/typvp-api
/src/resolvers/typingTest/test.type.ts
2.609375
3
import {ObjectType, Field, ID, Int, registerEnumType} from 'type-graphql' import {Account} from '../account/account.type' export enum ResultType { SINGLEPLAYER = 'SINGLEPLAYER', RACE = 'RACE', TRIAL = 'TRIAL', } registerEnumType(ResultType, { name: 'ResultType', }) @ObjectType() export class Test { @Field(...
fbbdf20e9f280729539a2223154b16f75ce85720
TypeScript
mikearnaldi/effect-ts
/packages/system/src/Effect/validate.ts
3.125
3
import * as A from "../Array" import type * as NA from "../NonEmptyArray" import type { Effect } from "./effect" import type { ExecutionStrategy } from "./ExecutionStrategy" import { validate_, validateExec_, validatePar_, validateParN_ } from "./validate_" /** * Feeds elements of type `A` to `f` and accumulates all ...
e7806254025aff395481f5517d26a892f0c3164e
TypeScript
kluntje/kluntje
/packages/js-utils/src/dom-helpers/lib/getInnerText.ts
3.390625
3
/** * returns innerText of given Element * @param {HTMLElement} el * @returns {string} * @example * const myArticle = document.querySelector('article'); * const articleText = getInnerText(myArticle); */ export const getInnerText = (el: HTMLElement): string => { return el.innerText || el.textContent || ''; };
3283343f22d4d009ba7382b22eff8aa3013ae4a6
TypeScript
uk-gov-mirror/hmcts.rpa-jui-webapp
/src/app/shared/components/hmcts-em-viewer-ui/data/js-wrapper/pdf-annotate-wrapper.spec.ts
2.53125
3
import {PdfAnnotateWrapper} from './pdf-annotate-wrapper'; import { RenderOptions } from './renderOptions.model'; declare global { interface Window { PDFAnnotate: any; } } describe('pdfAnnotateWrapper', () => { const pdfAnnotateWrapper = new PdfAnnotateWrapper(); const mockUI = { createPage(pageNumbe...
107980174a0335ba5479ad1c7e0df04f6a6b3d5a
TypeScript
jgudo/movx
/src/redux/reducers/miscReducer.ts
2.84375
3
import { IS_LOADING, SET_DARK_MODE, } from '@app/constants/actionType'; import { IMiscState } from '@app/types/types'; import { TMiscActionType } from '../actions/miscActions'; const defaultState: IMiscState = { isLoading: false, darkMode: true, } export default (state = defaultState, action: TMiscActionType)...
22e8665af61662261254ab327daa25646d960538
TypeScript
nitrogenlabs/starfire
/src/main/Comments.ts
2.8125
3
import assert from 'assert'; import {Util} from '../common/Util'; import {DocBuilders} from '../doc/DocBuilders'; const childNodesCacheKey = Symbol('child-nodes'); export class Comments { static getSortedChildNodes(node, text, options, resultArray?) { if(!node) { return; } const {locEnd, locStart...
8d867f3f8b6ecc67fb8a9d8b2ef23a1f8248f3c0
TypeScript
Tomella/cossap-3d
/source/label/css2drenderer.ts
2.5625
3
import { CSS2DObject } from "./css2dobject"; /** * Refactored THREE.CSS2DRenderer * @author mrdoob / http://mrdoob.com/ */ export class CSS2DRenderer { domElement: HTMLElement; private viewMatrix; private vector; private viewProjectionMatrix; private width: number; private height: number; pri...
8b65dac53106978d66ea23252efceebba3c7373a
TypeScript
shivam-kantival-mt/test-react-app
/src/hooks/useScrollRatio/index.ts
2.828125
3
import { RefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import debounce from 'lodash/debounce'; //typeDefs import { ScrollRatioComputeParams } from './interfaces'; //helpers import { computeScrollRatio } from './helpers'; export default function useScrollRatio<S extends HTMLElement>({ ...
1a90e4128ac3188a825e4ec88d887fc064c805dc
TypeScript
tensorflow/tfjs
/tfjs-layers/src/engine/training_tensors.ts
2.71875
3
/** * @license * Copyright 2018 Google LLC * * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. * ============================================================================= */ /** * Interfaces and methods for tr...
82d179f599603551e6efa337a7bf29d3e58b021d
TypeScript
kabbash/EFS
/Trainer-FrontEnd/src/app/your-tools/Models/calories-dto.ts
2.71875
3
export class Calculator { age: number; height: number; weight: number; neck: number; waist: number; hip: number; fats: number; carbPercentage: number; gender: string = "0"; equation: string = "0"; activityRange: string = "1"; showResult: boolean = false; caloriesResu...
e6e05d5366fea71cc0071f6cdbe6a7e09d092cfc
TypeScript
yiqu/recursion-ng-forms
/src/app/pipes.pipe.ts
2.5625
3
import {Pipe, PipeTransform} from '@angular/core'; @Pipe ({ name : 'labelName' }) export class AnimalPipeDisplay implements PipeTransform { transform(val : string) : string { if (val === 'petName') { return 'Pet Name'; } return val; } }
18e86d2dcddd2f948daefea8a51fd29666912e4c
TypeScript
halloverden/norwegian-data-validators-ts
/src/validators/ssn-validator.ts
2.859375
3
import { getMod11ControlDigit } from '../utilities/mod11-utilities'; import { ssnFactors } from '../utilities/ssn-utilities'; export function validateSsn( ssn: string ): boolean { if ( !ssn || ssn.length !== 11 ) { return false; } let factorSum = 0; for ( let i = 0; i < ssnFactors.length; i++ ) { fac...
659a5406a2784bfb311162b620b937785ab467a0
TypeScript
Codaisseur/50-typescript-demo
/index.ts
4.03125
4
// function sum(a: number, b: number) { // return a + b; // } // const c = sum(3, 4); //7 // console.log(c); // function multiplyArrayByTen(array: number[]) { // return array.map(element => (element *= 10)); // } // const numbers = [1, 2, 3]; // const numbersMultipliedByTen = multiplyArrayByTen([]); // console...
333c70e3be47d2b5dfe9a2e6d194ca8fa53cdefc
TypeScript
willneedit/mixed-reality-extension-sdk
/packages/sdk/src/asset/material.ts
2.65625
3
/*! * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { Actor, Animation, AssetContainer, AssetLike, AssetUserType, Color3, Color3Like, Color4, Color4Like, Guid, Vector2, Vector2Like, ZeroGuid } from '..'; import { observe, Patchable, readPath } ...
638eaf8354f16552549e68b4432460c6f4162394
TypeScript
RobertoWeegeJr/RubiksCube
/scr/Face.ts
3.0625
3
import { Color, Position } from "./Enumerations"; export class Face3x3 { private _dimension: number; public get dimension(): number { return this._dimension; } public set dimension(value: number) { this._dimension = value; } private _face: Color[][]; public get face(): Col...
ef5949d297cbbb01f975e3f2768d308ad46cab67
TypeScript
salieri/tartarus-data
/src/task/spider/navigator/navigator.ts
2.6875
3
import _ from 'lodash'; import { promisify } from 'util'; import { SpiderHandle } from '../handle'; import { LogLevel } from '../../task'; const wait = promisify(setTimeout); export type SpiderNavigatorUrlCallback = (h: SpiderHandle) => string | null; export type SpiderNavigatorIsDoneCallback = (h: SpiderHandle) => ...
f7154db3d22d1b4c9c75f3e97fbce9deda1f2b17
TypeScript
wcc17/apple-music-share-server
/src/service/room-service.ts
2.765625
3
import { JSDictionary } from '../util/dictionary'; import { Song } from '../model/song'; import { User } from '../model/user'; export class RoomService { private roomQueues: JSDictionary<string, Song[]>; private roomUsers: JSDictionary<string, User[]>; private roomVotesToSkipDict: JSDictionary<string, numb...
364e8569bf79f71e64c538c898618e037e66e701
TypeScript
ess-dmsc/user-office-frontend
/src/hooks/call/useCallsData.ts
2.5625
3
import { useEffect, useState } from 'react'; import { Call, CallsFilter } from 'generated/sdk'; import { useDataApi } from 'hooks/common/useDataApi'; export function useCallsData(filter?: CallsFilter) { const [callsFilter, setCallsFilter] = useState(filter); const [callsData, setCallsData] = useState<Call[]>([]);...
9cb867f407eb21c113aa0b5a2cfdbf5837f56a98
TypeScript
Yurii19/rtsbt-raw
/src/reducers/articlesReducer.ts
2.984375
3
const GET_ARTICLES = "GET_ARTICLES"; export const UPDATE_ARTICLES = "UPDATE_ARTICLES"; export const SELECT_ARTICLE = "SELECT_ARTICLE"; export interface IAction { type: string; payload: object; } const initialState = { articles: [], articlesSelected: null }; function articlesReducer(state = initialState, acti...
cd94ddad5300198d5e266897d227465f8e8b1e87
TypeScript
Sasuke1374/ghostybot
/src/commands/util/uptime.ts
2.84375
3
import { Message } from "discord.js"; import dayJs from "dayjs"; import duration from "dayjs/plugin/duration"; import Command from "structures/Command"; import Bot from "structures/Bot"; dayJs.extend(duration); export default class UptimeCommand extends Command { constructor(bot: Bot) { super(bot, { name: ...
984338fe08eb16de6309bd42a4b6a3d0660c8047
TypeScript
kreo/parsers
/types/tokens/Border.ts
2.6875
3
import Token, { TokenInterface } from './Token'; import { ColorToken, ColorValue } from './Color'; import { MeasurementToken, MeasurementValue } from './Measurement'; import { TokensType } from './index'; export interface BorderValue { color: | ColorToken | { value: ColorValue; }; type: |...
50ee826a39ab1656da7925148da6f771b092e322
TypeScript
turkaytunc/pelp
/frontend/src/context/reducers/userReducer.ts
2.71875
3
import { User } from '../../interfaces'; import { UserAction } from '../actions/UserAction'; export const userReducer = (state: User, action: UserAction): User => { switch (action.type) { case 'ADD_USER': { return action.payload as User; } default: return state; } };
d92e1171afc558d3e85e276538d49ca07c8ba90a
TypeScript
nbelleme/hvsz-web
/src/app/foodsupply/food-supply.ts
2.515625
3
/** * Created by nicolas on 05/05/2017. */ export class FoodSupply { private _id: number; public _level: number; private _capacity: number; private _name: string; get id(): number { return this._id; } set id(value: number) { this._id = value; } get level(): number { return this._lev...
3169d7ebbd7a08722f88ab9de1482c9720c708d0
TypeScript
ElBureeto/Capstone2
/capstone2/src/app/balance/balance.component.ts
2.609375
3
import { Component, OnInit } from '@angular/core'; import { ApiService } from '../services/api/api.service'; import { NgxSpinnerService } from "ngx-spinner"; export class CircuitData { circuit1: number[][] = []; circuit2: number[][] = []; circuitUsage: number[] = [0.0, 0.0]; } @Component({ selector: 'app-bal...
beb9df0610223fc98adc99a9b248f6470b3a59a6
TypeScript
tabb-global/js-service-common
/src/exceptions/LoggableExceptionFilter.ts
2.703125
3
import { Request } from 'express'; import { LoggerService } from '../logging/LoggerService'; export class LoggableExceptionFilter { public constructor( protected readonly logger: LoggerService, ) { } protected log(e: any, r: Request, defaultLevel?: string) { let message; let l...
9a7e6beb63f5e847149a81503da6e9c2d004ed31
TypeScript
sondregj/hitori
/src/utils.ts
2.71875
3
import { IHitoriColumn, IHitoriRow } from './types' export function transposeBoard( board: IHitoriRow[] | IHitoriColumn[], ): IHitoriRow[] | IHitoriColumn[] { return board[0].cells.map((col, i) => ({ cells: board.map(row => row.cells[i]), })) }
743caca553846c1098be506559c1384b8c24532d
TypeScript
majidakhter/AngularMVCMicroservices
/AromaCareGlow.Commerce.Web.AngularMVC1.1/wwwroot/app/legacy_V1/src/app/shared/date-formats/date-formats.ts
3.359375
3
import * as moment from 'moment'; export class DateFormats { constructor() { this.DATE_MONTH_DAY = DateFormats.determineMonthDayFormat(moment.localeData().longDateFormat('ll')); } /** * Date format that moment.js uses by Default, which happens to be a date time offset value. * Example: 02/03/2018 08:...
a3bc3409707eab28670b155ae6eee2452a0d4f16
TypeScript
kevin-litthub/vax-dist-app
/notaryAPI/src/routers/notary.router.ts
2.625
3
import { Request, Response, Router } from 'express'; import { connection } from '..'; import Event from '../entities/event.entity'; import { v4 as uuid } from 'uuid'; import createEvent from '../utils/helperFunctions'; import { isNil } from 'ramda'; const router = Router(); router.post('/event', async (req: Request, ...
19726c49592183eab7c286a71a94ad4311667b36
TypeScript
VincentVen/Framing
/src2/modules/games/public/CardLogic.ts
3.296875
3
/** * 全局模块-牌型判断逻辑 * @author none * */ class CardLogic { public constructor() { } /** 花色掩码 **/ public MASK_COLOR: number = 0xF0; /** 数值掩码 **/ public MASK_VALUE: number = 0x0F; /** 扑克数据 **/ public cardDataArray: number[] = [ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0...
164967598a636da12d270002eebd036035055426
TypeScript
ngjunxiang/Node-TypeScript-Template
/src/controllers/AuthController.ts
2.578125
3
import {Request, Response} from "express"; import * as jwt from "jsonwebtoken"; import {getRepository} from "typeorm"; import {validate} from "class-validator"; import {generate} from "generate-password"; import {User} from "../entity/User"; import config from "../config/config"; import EmailController from "./EmailCo...
21a66ce28940161ae536dc6eac6bc36be761bd8d
TypeScript
FlorentinMonteil/nanogl-pbr
/PbrSurface.d.ts
2.53125
3
import Chunk from "./Chunk"; import Input from "./Input"; import Enum from "./Enum"; import ChunksSlots from "./ChunksSlots"; export declare enum PbrWorkflowType { NONE = "NONE", METALNESS = "METALNESS", SPECULAR = "SPECULAR" } export declare type PbrSurface = MetalnessSurface | SpecularSurface; export decl...
1ba131496ff539969a384d5e1e5836335f0d5229
TypeScript
caiomamprin/microSaaS-node-react
/backend/src/models/linksRepository.ts
2.6875
3
import linkModel, {ILinkModel} from './linkModel'; import {Link} from './link'; import LinkModel from './linkModel'; //No BANCODE DADOS - Encontrar um link para o codigo. function findByCode(code: string){ return linkModel.findOne<ILinkModel>({ where: { code } }); } //No BANCODE DADOS - Adicionar um novo link. fu...
c30d8909f804bc19b616d9aa9ec9cb444fe16399
TypeScript
hmcts/cmc-legal-rep-frontend
/src/test/app/forms/models/feeAccount.ts
2.875
3
/* Allow chai assertions which don't end in a function call, e.g. expect(thing).to.be.undefined */ /* tslint:disable:no-unused-expression */ import { expect } from 'chai' import { Validator } from '@hmcts/class-validator' import { expectValidationError } from 'test/app/forms/models/validationUtils' import { FeeAccount...
ee74b55e0231d94b806c643541051328791fd7ae
TypeScript
brunodantascg/estudo-typescript
/curso-2021/Curso-TypeScript/exericio-lista/2-estrutura-decisao/estrutura-decisao.ts
4.09375
4
console.log("--- Questões da Lista de Estrutura de Decisão ---") // 1 - Faça um Programa que peça dois números e imprima o maior deles. function maiorNumero(numero1: number, numero2: number): number { if (numero1 > numero2) { return numero1 } return numero2 } console.log("1: O maior número é: " +...
958b1fc809239622694cf51bbfcf0453df9e302d
TypeScript
gudwnsdl88/corona_clone_server
/src/utils/webCrawler.ts
2.578125
3
import axios from 'axios'; import cheerio from 'cheerio'; import { statusType } from '../types/myType'; //보건부에서 감염정보 가져오기 //확진환자, 격리해제 ,사망자 ,검사진행 export const getStatusCrawler = async () => { const statusData: statusType = { confirmation: 0, release: 0, dead: 0, inspection: 0, date: '' }; tr...
e3fafb99a3789fdd5b1469cbfe92b528e162094c
TypeScript
FabienBrisset/genese-complexity
/src/languages-to-json-ast/java/cstToAstCases/integral-type.ts
2.578125
3
import { cstToAst } from '../cst-to-ast'; import { IntegralType } from '../models/integral-type.model'; import { IntegralTypeChildren } from '../models/integral-type-children.model'; // @ts-ignore export function run(cstNode: IntegralType, children: IntegralTypeChildren): any { const int = children.Int; const ...
b5a832c6fa4998f61f68d3a0df30779b73df4861
TypeScript
benjamin-t-brown/orbital-golfing
/src/server/lobby.ts
3.078125
3
interface Lobby { id: string; name: string; playerIds: string[]; } const lobbyStorage: Lobby[] = []; const broadcastLobbies = () => { sendIoMessageAll(getShared().G_S_LOBBIES_UPDATED, { lobbies: lobbyStorage.map(lobby => { return { ...lobby, playerIds: undefined, players: lob...
52f6efa15f4b99bc24a038aa3f8991cde3fe1ec9
TypeScript
plee42/RockPaperScissors
/src/app/game/game.component.spec.ts
2.5625
3
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { Router } from '@angular/router'; import { provideMockStore } from '@ngrx/store/testing'; import { DebugElement } from '@angular/core'; import { By } from '@angular/platform-browser'; import { of } from 'rxjs'; import { GameComponent } fr...
13fcc739b2a694723f3d78f265f74dc52686cd5b
TypeScript
saracelik/LiterarnoUdruzenje-1
/luservice-fe/src/app/shared/models/cart-item.ts
2.796875
3
import { Book } from "./book"; export class CartItem { id; price: number; quantity: number; book: Book; constructor(id: any, price: number, quantity: number, book: Book) { this.id = id; this.price = price; this.quantity = quantity; this.book = book; } isTh...
8ffb988fa86c19004d840864e29140613a97bff1
TypeScript
Happy-Ferret/pixi-swf
/src/shumway/tools/profiler/flameChartBase.ts
2.53125
3
/** * Copyright 2014 Mozilla Foundation * * 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...
d5a08660fcbaa5a58f6053ad6eff040e86c4b263
TypeScript
jet2jet/js-sequencer
/src/main/functions/index.ts
3.046875
3
export function getItemFromArray<T>(arr: T[], item: T): number { return arr.indexOf(item); } export function removeItemFromArray<T>(arr: T[], item: T): boolean { const n = arr.indexOf(item); return n >= 0 ? (arr.splice(n, 1), true) : false; } export function gcd(m: number, n: number) { if (m < n) { const x = m;...
10be2967e64e78084a786255f034548f5bc4a762
TypeScript
kyiimn/actapublisher
/src/js/pageobject/textstyle/textattribute-absolute.ts
2.90625
3
import ActaFont from '../font/font'; import IActaTextAttribute from '../interface/textattribute'; import ActaTextAttribute from './textattribute'; export enum TextAlign { JUSTIFY = 0, LEFT, RIGHT, CENTER } export default class ActaTextAttributeAbsolute extends IActaTextAttribute { private _name?: string; ...
f63f45b2d4a321ace3054d5b9a0a76b1c9eddfdb
TypeScript
patrickedqvist/soundwave
/utils/cookies.ts
2.828125
3
import { serialize, CookieSerializeOptions, parse } from 'cookie'; import { NextApiRequest, NextApiResponse } from 'next'; /** * This sets `cookie` using the `res` object */ export function setCookie( res: NextApiResponse, tokenName: string, value: unknown, options: CookieSerializeOptions = {} ) { const s...
9737627c51b31c63af2f969bf9d53104220cd39b
TypeScript
denwilliams/mqtt-state
/src/throttle.test.ts
2.71875
3
import test from "ava"; import { createTestService } from "./_test-helper"; test.serial("throttle requests to the defined ms value", async (t) => { const service = createTestService({ rules: [ { key: "output", source: "set(event.value);", subscribe: "input", throttle: 30, ...
2a5640fc8669b6db1765330f70309cd411a45edc
TypeScript
keklol-123/myProject
/src/interfaces/clickEvent.ts
2.5625
3
interface OnClickEventTarget extends EventTarget { value: string | null | undefined; } export default interface OnClickEvent extends React.MouseEvent<HTMLElement> { target: OnClickEventTarget }
f5c91e2c47f0c2feadeb94f47e09e948f2404448
TypeScript
scott-census/cedr2
/src/app/core/dispatch.service.ts
2.53125
3
import { Injectable } from '@angular/core'; import * as _ from 'lodash'; import { WhenService } from '../shared/when.service'; interface Subscription { msg: string; // message id - should be changed to enum when: any; // optional condition - must be valid when clause func: any; // callee function t...
7f943d4695a551bdb5a714207f1fa282894f2ca4
TypeScript
vicente-valls/pingpongfy-firebase
/functions/src/errors/InvalidDtoError.ts
2.59375
3
import {ValidationErrorItem} from "./ValidationErrorItem"; export class InvalidDtoError extends Error { public readonly errors: ValidationErrorItem[]; constructor(errors: ValidationErrorItem[], message: string) { super(message); Object.setPrototypeOf(this, InvalidDtoError.prototype); t...
1404ac792f267593e074a9c0a973d1a74d91db02
TypeScript
thesayyn/ng-ally
/packages/schematics/application/schema.ts
2.5625
3
export interface Schema { /** * The root directory of the new application. */ projectRoot?: string; /** * The name of the application. */ name: string; }
19381d6047b1c3b0342c0794239dba30f1086ab2
TypeScript
doroginalexanderqt/process-manager
/server/src/routers/services/db.ts
2.796875
3
import fs from 'fs/promises' import faker from 'faker' import { sortBy } from 'lodash' import { Job, JobStatus, Process } from '../../../types' import { getRandomInt } from './utils' import moment from "moment" type ReadDBShape = { jobs: Job[] processes: Process[] } const readDB = (): Promise<ReadDBShape> =>...
2503d723143a5fd188ba9907f40120bb6f388276
TypeScript
joonhocho/ts-jutil
/src/promise/allValues.test.ts
2.59375
3
import { allValues, promiseAll } from './allValues'; test('allValues', async () => { expect( await allValues({ a: undefined, b: null, c: 1, d: Promise.resolve(4), e: Promise.resolve(Promise.resolve({ f: 'g' })).then((x) => Promise.resolve(Promise.resolve(x)) ), }) ...
f89f869573bba52bb86279e014e7f5aa30397e01
TypeScript
khirshah/react-component-library
/src/components/DatePicker/reducers/stateMachine.ts
2.84375
3
import { Action, ActionType, State, StateType, } from '../types/stateMachineTypes'; const stateMachine = ( state: State, action: Action, ): State => { switch (action.type) { case ActionType.UserClickedInputField: return state; case ActionType.UserClickedCalendarButton: if (state.curre...
3c9d2fa21a918b252e2d156792f282b188f645af
TypeScript
JerlyJr/POO-Carro
/Principal.ts
3.15625
3
declare function require(msg : string) : any; var readline = require('readline-sync'); import {Carro} from "./Carro";{ let car : Carro = new Carro(); while(true){ let statusCar : string = "\n" + "mostrar - Informações sobre o carro \n" + "in - adiciona um passageiro ao carro\n...
5851615a7e8eb8fb19dbf63cbc7504595fbeee8f
TypeScript
delta94/ServiceHero
/servicehero-app/src/types/index.ts
2.515625
3
import { RootState } from './RootState'; export interface JwtPayload { name: string; sub: string; type: string; email: string; iat: number; exp: number; } export enum UserType { Client = 'Client', Specialist = 'Specialist', Unknown = 'Unknown', } export enum ListingType { CarRepair = 'CarRepair',...
e4fce4f989eb931d9c84e7ffd9bd2a6910d85c1d
TypeScript
rafaeljfec2/desafio-backend-framework
/src/infraestructure/repositories/orm/postgres/repository/Account/PostgresAccountRepository.ts
2.546875
3
import { IAccount } from '@entities/Account/IAccount'; import { IAccountRepository } from '@entities/Account/IAccountRepository'; import { ICreateAccountDTO } from '@entities/Account/ICreateAccountDTO'; import { getRepository, Repository } from 'typeorm'; import Account from '../../entities/Account/Account'; export de...
0dc6dfaff9e243f4c3c1b9540d1c0469fdb87b75
TypeScript
IlyaSemenov/vue-observable-persist
/src/index.ts
3.015625
3
import { merge, pick } from "lodash" import Vue from "vue" interface Options { storage?: Pick<Storage, "getItem" | "setItem"> key: string fields?: string[] serialize: (data: any) => any deserialize: (data: any) => any } const defaults: Options = { key: "store", serialize: JSON.stringify, deserialize: JSON.par...
0532a9cc5f31098902d43e91a3cbfaaafe31c434
TypeScript
artalar/bacon.js
/test/startwith.ts
3.015625
3
import * as Bacon from ".."; import { expect } from "chai"; import { expectStreamEvents, expectPropertyEvents, series, semiunstable, unstable, fromArray } from "./util/SpecHelper"; describe("EventStream.startWith", function() { describe("provides seed value, then the rest", () => expectStreamEvents( funct...
0d1eed731a4bb0ec807bbef51fc4529393413e9e
TypeScript
sH4rk0/fornovo-presentation
/src/slides/slide49.ts
2.703125
3
export default class Slide49 extends Phaser.Scene { private _text: Phaser.GameObjects.Text; private _image: Phaser.GameObjects.Image; private _ground: Phaser.GameObjects.Image; private _isCollide: boolean; constructor() { super({ key: "Slide49" }); //console.log(this.scene.key + ":construct...
f928e0b8696b7d5d776db4544e3249fcdfb22aa8
TypeScript
iharabukhouski/mango
/server/src/products/dal/data.ts
2.71875
3
import { getRepository } from 'typeorm'; import * as R from 'ramda'; import { Product } from './entity'; import { Review } from '../../reviews/dal/entity'; /** * List Products */ export const listProducts = async (): Promise<Product[]> => { const repository = getRepository(Product); return await reposito...
3d0dd5ae31aa6fb987cb554389d7c52a47bdec1b
TypeScript
sridharmallela/karma-typescript
/tests/integration-latest/src/ambient/ambient-module-tester.ts
2.515625
3
import * as module from "ambient"; export class AmbientModuleTester implements module.AmbientModule { public doSomething(): string { return "ambient"; } public testAmbientModule() { return this.doSomething(); } }
c54caab8ede1822e5a382eb31c5ab83a85372156
TypeScript
MartijnHols/fullstack-typescript
/backend/src/modules/account/actions/_authenticateAccount.ts
2.984375
3
import Account from '../models/Account' export class InvalidUsernameError extends Error {} export class AccountUnavailableError extends Error {} export class InvalidPasswordError extends Error {} const authenticateAccount = async ( username: string, password: string, ): Promise<Account> => { const account = awa...
09bb8f576ca26ae39f5c57540b3ce4644f0d43be
TypeScript
dhianpratama/koa-router-rx6
/src/lib/koa-router-rx.ts
2.6875
3
import { Context } from "koa"; import * as Router from "koa-router"; import { Observable, of } from "rxjs"; type Epic<A, B> = (observable: Observable<A>) => Observable<B>; enum HttpMethod { GET, POST, PUT, PATCH, DELETE, OPTIONS, } class KoaRouterRx extends Router { constructor (...args: any[]) { super(...a...
0ff74ec5c91ded7350344c015c062d72b7d432bc
TypeScript
GreatLaboratory/typescript-practice
/advanced/2-index_type.ts
3
3
{ type Person = { name: string; age: number; gender: 'male' | 'female'; }; const p: Person = { name: 'mg', age: 24, gender: 'male', }; console.log(p.name); console.log(p['name']); type Name = Person['name']; // const name: Name = 123; // e...
2924f369f1d879853c50c3bc44f05e6ab3d3ceb7
TypeScript
varubi/nearley
/src/parser.ts
2.90625
3
import { Column } from "./column"; import { Grammar } from "./grammar"; import { StreamLexer } from "./streamlexer"; export class Parser { static fail = {}; grammar; lexer; lexerState; table; current; results; constructor(private rules, private start?, private options?) { if (r...
8288b89d7d56e9268fc6b751e8be2b92ff055a69
TypeScript
tiagocorreiaalmeida/design-patterns
/src/behaviour/observer/observer.test.ts
2.984375
3
import { Observer } from "./observer"; interface Changes { value: string; } const makeObserver = () => { const listener = { update: jest.fn() }; const changes: Changes = { value: "system updated" }; const observer = new Observer<Changes>(); return { changes, observer, listener };...