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
1c49861038271d218aef0e9c258c176bf0eabf66
TypeScript
krt23/calvados
/src/app/core/store/actions/employee.actions.ts
2.5625
3
import {Action} from '@ngrx/store'; import {Employee} from '../../models/employees.model'; export const GET_EMPLOYEE = '[Employee] Get Employee'; export const GET_EMPLOYEES = '[Employee] Get Employees'; export const ADD_EMPLOYEE = '[Employee] Add Employee'; export const UPDATE_EMPLOYEE = '[Employee] Update Employee'; ...
8ea1d17df2591fef51a0e279919745b0ac16c58c
TypeScript
seniorteck/Visual-Scripting-React
/src/types/appState.ts
2.765625
3
export declare interface AppState { appState?: "EDITING_VARIABLE" | "EDITING_FUNCTION"; variableState: VariableState; } export declare interface VariableState { id: string | number; type?: "var" | "let" | "const"; name?: string; value?: string; } //TODO: change name to more meaningful name e...
7d539a813aa68573e6a8d113774e7da8cb8d25ac
TypeScript
badi3a/discoveryFood
/src/app/shared/food.service.ts
2.6875
3
import { Injectable } from '@angular/core'; import { Subject } from 'rxjs'; import { Food } from '../model/Food'; import { DatacommunicationService } from './datacommunication.service'; @Injectable({ providedIn: 'root' }) export class FoodService { //there is an abstraction beteween the service and the components, w...
9ae8d3d5a0bf53f389161d0edcad0579c39941a6
TypeScript
KiaraGrouwstra/ng2ls
/src/models/models.ts
2.828125
3
import { Observable } from 'rxjs'; import { Type } from '@angular/core'; export { Type } from '@angular/core'; export { Action } from '@ngrx/store'; import { State } from '../reducers'; import { Reducer } from '../reducers/reducers'; export interface Obj<T> { [k: string]: T; } export type AppState = State; export ...
15202e80f8c9f879f75e804aa8f622dc64715764
TypeScript
preconstruct/preconstruct
/packages/cli/src/logger.ts
3.125
3
import chalk from "chalk"; export function format( message: string, messageType: "error" | "success" | "info" | "none", scope?: string ) { let prefix = { error: " " + chalk.red("error"), success: " " + chalk.green("success"), info: " " + chalk.cyan("info"), none: "", }[messageType]; let ful...
8151e1112d9d6c690eb6fdc88124d5b8ffff504b
TypeScript
nathansomething/Smarta
/techvalley/src/app/map/marker.ts
2.765625
3
export class Marker { id:Number; lat:Number; lng:Number; constructor(id,lat,lng) { this.id = id; this.lat = lat; this.lng = lng; } }
80a5fece835296b6c6710493c8cc248c8fb1d891
TypeScript
TylerGarlick/joiful
/test/unit/decorators/boolean.test.ts
2.609375
3
import { testConstraint } from '../testUtil'; import { boolean } from '../../../src'; describe('boolean', () => { testConstraint( () => { class MarketingOptIn { @boolean() joinMailingList?: boolean; } return MarketingOptIn; }, ...
790729b723f83b97ba9e999f63651a1567dd5e7a
TypeScript
nognzlz/ejercicio-angular-6
/src/app/models/producto.ts
2.625
3
export class Producto { public nombre: string; public detalle: string; public cantidad: string; constructor(nombre: string = "", detalle: string = "", cantidad: string = "" ) { this.nombre = nombre; this.detalle = detalle; this.cantidad = cantidad; } //constructor(){}; ...
2828a52fb0a1a105553e08cade091e903fb82264
TypeScript
vakolesnikov/guest_book_frontend
/src/utils/index.ts
2.8125
3
import moment from 'moment'; import { IPostsFilters } from 'types/index'; export const stringToColor = (str: string) => { let hash = 0; let i; /* eslint-disable no-bitwise */ for (i = 0; i < str.length; i += 1) { hash = str.charCodeAt(i) + ((hash << 5) - hash); } let color = '#'; for (i = 0; i < 3...
baf21c40bdf2f45da500b9c39007808a39e3c0c5
TypeScript
TiPunch69/homebridge-awtrix-plugin
/src/matrix-accessory.ts
2.703125
3
import { AccessoryPlugin, Logging, HAP, Service, } from 'homebridge'; import axios from 'axios'; /** * This class represents the services to control the matrix. */ export class MatrixAccessory implements AccessoryPlugin { /** * the URL path */ private readonly url: string; /** * the display n...
e069fa3cdb0432e756a261498eb9612c82e253eb
TypeScript
below-1/bram-2014-server
/src/services/foo.ts
3.078125
3
import { zip, range } from "lodash"; import { readFileSync, writeFileSync } from "fs"; type Row = number[]; type Matrix = Row[]; type ClassificationResult = { _class: number; prob: number; } type KFoldPart = { Xs: Matrix; Ys: Row; }; export class GaussNB { d: number = undefined; n: number = undefined; ...
9eec6558a866fb4051b9573ff367b06dc2cbca98
TypeScript
makito/angular-base
/src/app/common/interfaces/plural-case.interface.ts
2.9375
3
/** * интерфейс для описания вариантов произношения */ export interface IPluralCase { /** * для одного */ one: string; /** * от двух до четырёх */ fromTwoToFour: string; /** * от пяти */ fromFive: string; }
41aa53a97efc1e000dc7f0c804912869094d2654
TypeScript
BaconSoap/leaflet-bike-gpx
/src/domTools.ts
3.0625
3
module util { /** * Get an element by its ID */ export var getById = function(id) { return document.getElementById(id); }; /** * Add an event listener to an element located by its ID */ export var onById = function(id, eventName, cb) { util.getById(id).addEventListener(eventName, cb); }...
9a0670268766ea86655be400522e4b7ed741c5e4
TypeScript
boostcamp-2020/IssueTracker-15
/web/server/src/entity/issue.entity.ts
2.625
3
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn, } from "typeorm"; import CommentEntity from "./comment.entity"; import MilestoneEntity from "./milestone.entity"; import UserEntity from "./user.entity"; import IssueHasLabelEntity from...
191fcae2a1aa75a21ce37d41bed5680b987d114c
TypeScript
erospv/repositorio-curso-Labenu
/semana19/testes-no-backend/tests/UserBusiness/getAllUsers.test.ts
3.078125
3
import { UserBusiness } from "../../src/business/UserBusiness" import { User, stringToUserRole, UserRole } from "../../src/model/User" describe("Testing UserBusiness.getAllUsers", () => { let userDatabase = {} let hashGenerator = {} let tokenGenerator = {} let idGenerator = {} it("Should return an...
6ff51dd9f29c7062fe21e515646706d093d17db3
TypeScript
hoanglt1223/Capstone_Project_BE
/src/projects/dto/update-project.dto.ts
2.515625
3
import { IsBoolean, IsNotEmpty, IsOptional, Length, Validate, } from 'class-validator' import { PasswordConfirmValidator } from '@validators/password-confirm.validator' export class UpdateProjectDto { @IsOptional() name: string @IsOptional() @IsNotEmpty() @Length(8, 24) password: string @IsOp...
f7078c735aec3f2b9f4eb44abf2ceb20346f5fe7
TypeScript
romulobordezani/formoose
/src/tools/updateFormDataValues/updateFormDataValues.ts
2.921875
3
import { IFormData, IModel } from "../../interfaces"; /** * Updates all form data based on an User * @category Utils * @alias validate/updateFormDataValues * @param formData All fields state from component * @param {IModel} model User Model Abstraction * @returns {void} */ function updateFormDataValues( formD...
878a361cdc53b3859cadb1b028ff36515f226752
TypeScript
michaelcheers/SVG.JS
/ShapeCirclerf/app.ts
2.546875
3
var colorsL = 0; declare var inner: HTMLInputElement; declare var outer: HTMLInputElement; function getColors() { var result = []; for (var n = 0; n < colors.childNodes.length; n++) { var item = colors.childNodes.item(n); result.push((item as HTMLInputElement).value); } return resu...
31478cd49c04445f7a67aca5627ba5dd8d13cfc4
TypeScript
bouquen124/app_convocatoria
/src/app/servicios/boletines.service.ts
2.5625
3
import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; export interface Boletin { id?: string; c_profesional_id: string; titulo: string; subtitulo: string; contenido: string; autor: string } @Injectable({ providedIn: 'root' }) export class BoletinesService { ...
3763a3ace81e0a6f95ab2932c261832c6209c770
TypeScript
john-piedrahita/plugin-scaffold
/lib/commands/CommandCreateEntity.ts
2.78125
3
import chalk from 'chalk' import * as yargs from 'yargs' import {CommandUtils} from './CommandUtils' import {banner, errorMessage} from "../utils/helpers"; import {MESSAGES} from "../utils/messages"; import ora from "ora"; import {EMOJIS} from "../utils/emojis"; export class EntityCreateCommand implements yargs.Comma...
7194d55da95cf24680660646863c1fca6d15f55c
TypeScript
mdumandag/hazelcast-nodejs-client
/src/config/NearCacheConfig.ts
2.53125
3
/* * Copyright (c) 2008-2020, Hazelcast, Inc. All Rights Reserved. * * 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 ...
6ab3567f5fb724c799d00c6e588846a6ba2fd551
TypeScript
relaxvinodh/react-live-ticker
/src/components/reducer/utils.spec.ts
3.265625
3
import * as R from 'ramda'; import { mapRec, accumalateTotal } from './utils'; export const isLastPositive = R.pipe( R.last, R.flip(R.gt)(0), ); export const filterPositive = R.filter(isLastPositive); export const filterNegative = R.reject(isLastPositive); export const mapHead = R.map(R.head); export const conver...
453b0f6b787ac76ea9d5c0c07823878f34f1106c
TypeScript
vicbitly/dynamic-forms-ts
/src/services/form-service.ts
2.546875
3
import * as React from 'react'; import { FieldType, DynamicFieldProps } from '../types'; import { ContentHeadlineComponent } from '../components/content-headline'; import { ContentNormalComponent } from '../components/content-normal'; import { TextAreaComponent } from '../components/text-area'; import { TextInputCompon...
5cd1b6a9f7e9dd1f1fe83e08c463fcdd34a59336
TypeScript
Wattle-bird/cave-dungeon
/src/game/effect.ts
2.828125
3
export class Effect { damage = 0; withDamage(damage: number) { this.damage = damage; return this; } }
a692ea4a9c1442f1c7c9abc28a5b3f330f33f001
TypeScript
fivetran/typescript-closure-tools
/index/closure-library/closure/goog/ui/toolbarselect.d.ts
2.8125
3
/// <reference path="../../../globals.d.ts" /> /// <reference path="./select.d.ts" /> /// <reference path="./controlcontent.d.ts" /> /// <reference path="./menu.d.ts" /> /// <reference path="./menubuttonrenderer.d.ts" /> /// <reference path="../dom/dom.d.ts" /> declare module goog.ui { class ToolbarSelect extends...
515acc48fcc2996e974d7c93cd7630290acba1f2
TypeScript
huangyingqi/huarongdao
/src/huarongdao/myui.ts
2.609375
3
import * as PIXI from "pixi.js" export class Button extends PIXI.Sprite{ constructor(texture: PIXI.Texture, title?: string) { super(texture); this.interactive = true; this.buttonMode = true; this.width = this.width; this.height = this.height; if (title) { let style = new PIXI.TextStyle(...
e97a52e96ecc30096cc4cd3ace859f692a777e89
TypeScript
lq1990/myFrontEnd
/TypeScript/设计模式/practices/责任链模式/责任链模式01/client.ts
2.609375
3
import { ProjectManager } from './ProjectManager'; import { DeptManager } from './DeptManager'; import { GeneralManager } from './GeneralManager'; /** * 责任链模式: * */ let pm = new ProjectManager(); let dm = new DeptManager(); let gm = new GeneralManager(); pm.setSuccessor(dm); dm.setSuccessor(gm); let t1: string = ...
745c7406328222e8178a0a38f4accad64465f591
TypeScript
taylordeatri/openmrs-esm-user-dashboard-widgets
/src/refapp-grid/formatters.ts
2.984375
3
import cloneDeep from "lodash.clonedeep"; const formatters = { convertToTime: (dateTimevalue): string => { const hour = new Date(dateTimevalue).getHours(); const minutes = new Date(dateTimevalue).getMinutes(); const type = hour >= 12 ? "PM" : "AM"; return `${String(hour % 12).padStart(2, "0")}:${Stri...
9f6ec73c1f3120d28e6a938a6f50b9a7bc2d8191
TypeScript
hoffination/TDD-CHESS
/src/logic/Turn.ts
2.875
3
import { Player } from '../enums/Player' const Turn = { options: [Player.WHITE, Player.BLACK], get(index: number) { return this.options[index] }, lookup(name: Player) { return this.options.indexOf(name) }, next(index: number) { return (index + 1) % 2 } } export default Turn
b5b8a748498c5235dfcfb40888b34179f0588976
TypeScript
LakshanSS/PlaySlotMachine
/public/javascripts/game.ts
3.484375
3
//Interface ISymbol interface ISymbol{ setImage:(string)=>void, setValue:(number)=>void, getImage:()=>string, getValue:()=>number } //Class Symbol class Symbol implements ISymbol{ private imgURL:string; private value:number; constructor(imgName:string,value:number){ this.imgURL = "/assets/images/"+im...
0f17f5b1e564e57cac987777b44fc091c1713cca
TypeScript
xrei/kr
/frontend/src/lib/index.ts
2.765625
3
export function omit(o: any) { let clone = {...o} Object.keys(clone).forEach((key) => clone[key] === undefined && delete clone[key]) return clone } export const sleep = (t: number = 1000) => new Promise((resolve) => setTimeout(resolve, t))
f27b89d2dad184fbc4e3f57fe6f0740ce0489d22
TypeScript
borabaloglu/blog-app
/src/modules/posts/dto/posts.lookup.dto.ts
2.65625
3
import { Transform } from 'class-transformer'; import { ArrayMaxSize, ArrayMinSize, ArrayUnique, IsDate, IsEnum, IsInt, IsOptional, IsString, Length, Matches, Min, } from 'class-validator'; import lookupHelper from 'src/shared/helpers/lookup.helper'; import { PostType } from '../entities/post.ent...
d985fe6be6d8cd93c0704731bdd958dfe2cef5f2
TypeScript
eyalmendel/logga-ts
/src/config/BaseConfig.ts
2.796875
3
"use strict"; import { PersistableFactory } from "./../storage/PersistableFactory"; import { FormatterFactory } from "./../formats/FormatterFactory"; import { Levels } from "../levels/Levels"; import Persistable from "../storage/Persistable"; import { Formatter } from "../formats/Formatter"; export class BaseConfig {...
8af138f1815de67abc2b33cf0f554a2e123c0294
TypeScript
juriousts/jurious
/packages/templates/src/models/DecoratorTemplate.ts
2.703125
3
import { ITemplate } from "../interfaces/ITemplate"; export class DecoratorTemplate implements ITemplate { protected params: object; constructor(private name: string) {} private get Params(): string { return JSON.stringify(this.params, null, "\t").replace('"', ""); } private get Name(): string { return thi...
788506429dbc5e5c47d5443226d60d9e04eb0e67
TypeScript
fanhualei/wukong-antdpro
/doc/test-temp/src/pages/store/storeHelp/list/_mock.ts
2.515625
3
import { Request, Response } from 'express'; import { parse } from 'url'; import { HelpItem, HelpListParams } from './data.d'; import { getRandomNumber, isInNumberArray } from '../../../../utils/Wk/tools' let helpListDataSource: HelpItem[] = []; for (let i = 1; i < 30; i += 1) { let helpTitle:string = `帮助文章-${i}`; ...
b4d537673c68149c321d09bb7fa748028409d625
TypeScript
SundareshanB/Acumen
/src/models/uom.model.ts
2.640625
3
import {Entity, model, property} from '@loopback/repository'; @model() export class Uom extends Entity { @property({ type: 'string', id: true, generated: true, }) id?: string; @property({ type: 'string', required: true, unique:true }) uom: string; constructor(data?: Partial<Uom...
fa96e91685c4bc4b2197378cad2c78ebb2bd359a
TypeScript
celsobonutti/bank
/assets/ts/src/utils/__test__/parseMoney.test.ts
2.9375
3
import { parseMoney } from '../parseMoney'; describe('parseMoney(money: string)', () => { test('parses 0 reais correctly', () => { const money = parseMoney('R$ 0,00'); expect(money).toBe(0); }); test('parses numbers with thousands', () => { const money = parseMoney('R$ 1.450,00'); expect(money)....
22669fcc95472ac0da6470bf90f37717e94e9806
TypeScript
scw1021/bacb-angularj
/src/app/_models/registration.ts
2.78125
3
import { IRegistration } from "../_interfaces/i-registration"; import { IUser } from '../_interfaces/i-user'; import { ListObject } from "./list-object"; import { Phone } from "./phone"; import { User } from "./user"; export class Registration extends User { public Prefix: ListObject = new ListObject(); public Suf...
327387be3218234831b0d75d735e4a3c97819801
TypeScript
moexplore/TypeScript-Dicey-Business
/dice.ts
3.375
3
let button: HTMLButtonElement = document.getElementById("generatedie") as HTMLButtonElement; let dieContainer: HTMLDivElement = document.getElementById("dieContainer") as HTMLDivElement; let rollButton: HTMLButtonElement = document.getElementById("rolldie") as HTMLButtonElement; let sumButton: HTMLButtonElement = docum...
1146781ce6bcddf7e7397775df34240f0d8a8714
TypeScript
eric-acosta/typescript
/app.ts
3.03125
3
(()=>{ const sumar = (a:number, b:number):number=> { return a +b; } const nombre= ():string => ' hola eric'; const obtenerSalario = ():Promise<string> => { return new Promise ((resolve,reject)=>{ resolve('Eric'); }); } obtenerSalario().then(a => console...
f2299b7f07f926f0adc15ae507db4d28a5dfc4e9
TypeScript
skstef/testToDo
/utils/tasks/deleteTask.ts
2.65625
3
import { IProject } from "../../models/IProject"; export const deleteTask = ( projectId: string, taskId: string, parentTaskId?: string ): void => { const projects: IProject[] = JSON.parse( (typeof window !== "undefined" && window.localStorage.getItem("projects")) || "[]" ); const project = ...
ed46b5f90856873dfbb71a5dc18e9b8bf01053b2
TypeScript
micahtessler/causal-diagram
/src/app/pattern.service.spec.ts
2.59375
3
import { PatternService } from './pattern.service'; import deathFromAbove from './patterns/deathFromAbove.json'; import earlyDouble from './patterns/earlyDouble.json'; import feed from './patterns/feed.json'; import fourCount from './patterns/fourCount.json'; import lateDouble from './patterns/lateDouble.json'; impor...
498bdbc9a3bb987e8833296a7e0f44ea6dfcf74e
TypeScript
KrishnaK-Z/Samosa
/src/app/Services/Authentication/authenticate.service.ts
2.578125
3
import { Injectable } from '@angular/core'; import { WebRequestService } from 'src/app/Services/WebRequest/web-request.service'; import { HttpResponse } from '@angular/common/http'; import { Router } from '@angular/router'; import { shareReplay, tap } from 'rxjs/operators'; @Injectable({ providedIn: 'root' }) export...
27fdc454d20f769b71ebeb7e6ffc7c1fab980d15
TypeScript
andresgutgon/react-playground
/src/hooks/useTodos.test.ts
2.640625
3
import { renderHook, act } from '@testing-library/react-hooks' import useTodos from './useTodos' const locale = 'en' const initialTodos = [ { text: 'C Third todo', resolved: false }, { text: 'A second resolved todo', resolved: true }, { text: 'A first resolved todo', resolved: true }, { text: 'B second todo', ...
89ced8220a4c3429c138948e8962a66b778e4124
TypeScript
che-ri/TS-Pratice
/Typescript/src/practice.ts
4.375
4
//1. 변수에서 타입 정의하기 let count = 0; count += 1; // count = "갑자기 분위기 문자열"; //숫자로 선언되었던 count를 문자열로 업데이트하면 에러난다! const message: string = "hello world"; //문자열 const done: boolean = true; //불리언 값 const numbers: number[] = [1, 2, 3]; //숫자 배열 const messages: string[] = ["hello", "world"]; //문자열 배열 // messages.push(1); //숫자를 넣으려...
c16976f5de6d13161e9480e20bf11f17d58f339c
TypeScript
star47raven/model
/packages/shell/helpers/ThemeHelper.ts
2.546875
3
import { css, unsafeCSS } from '../../library' import { DocumentHelper, LocalStorageEntry, Color } from '../../utilities' import { Background } from '.' export class ThemeHelper { static readonly background = new class extends LocalStorageEntry<Background> { constructor() { super('MoDeL.Theme.Theme', Background....
4ccfeb9e60a503ac2309a538a885d02a1a6ac1f0
TypeScript
domenester/nest-initializer
/src/list/list.service.ts
2.59375
3
import { Injectable } from '@nestjs/common' import { ListFilter } from '../dtos' import { ObjectLiteral, Like, Between } from 'typeorm' export interface BuildListFilter extends ListFilter { fields: string [] } @Injectable() export class ListService { buildFilter(filter: BuildListFilter): ObjectLiteral { if (...
f8c65cce373783045a77a4dbad47f09b1a45d491
TypeScript
LesterWeng/tiny-libs
/tiny-html-parser/index.ts
3.703125
4
enum TokenType { START_TAG, END_TAG, TEXT, GLOBAL, } type Token = { value: string type: number children?: Token[] } const HTML_REG = { startTag: /^<[a-z]+>/, endTag: /^<\/[a-z]+>/, } // tokenizer const htmlToToken: (html: string) => Token[] = ( html, ) => { const tokens = [] while (html) { ...
1e2c65b82f0b4cab6caa442b4653f8e4c589951e
TypeScript
jameswilddev/trash-kit
/src/pipeline/stores/key-value-store.ts
3.1875
3
import StoreBase from './store-base' export default class KeyValueStore<TValue> extends StoreBase { private readonly keysAndValues = new Map<string, TValue>() hasKey ( key: string ): boolean { return this.keysAndValues.has(key) } get ( key: string ): TValue { if (this.hasKey(key)) { ...
b1b2a79a261888a82f4d4f1f19c9d25a873fc796
TypeScript
humpback-app/humpback-server
/src/routes/auth.ts
2.5625
3
import bcrypt from 'bcrypt'; import {usersAccounts} from '../database.js'; import {setUserInfo} from '../common/setUserInfo.js'; import * as Schema from '../schema/index.js'; import type {FastifyInstance} from 'fastify'; /** * A cryptographic salt is made up of random bits added * to each password instance before it...
837d52d54ada39d338a3e1f23f1f50a111a654c7
TypeScript
JustusPu/bachelor-thesis
/visualization/app/src/app/api/cloud.ts
2.578125
3
import { Anchor } from "./anchor"; import { functions } from './functions'; import { MessageService } from 'primeng/components/common/messageservice'; export class Cloud { anchors: Anchor[]; determinedAnchors: Anchor[]; constructor(private messageService: MessageService) { this.anchors = []; ...
0e9bc1e6c6cb07936bf4aee138a6270de60786b3
TypeScript
tictools/javascript-design-patterns
/src/behavioral_patterns/Observer/WeatherData/index.ts
3.109375
3
export default class WeatherData { private temperature: number[]; private humidity: number[]; constructor() { this.temperature = []; this.humidity = []; } public getTemperatureHistory() { return this.temperature; } public getHumidityHistory() { return this.humidity; } public updateT...
bc1c46cdae3ec0415b906be5b4ed156dfdbd06da
TypeScript
dungvo0111/library-backend
/test/services/user.test.ts
2.71875
3
import jwt from 'jsonwebtoken' import User from '../../src/models/User' import UserService from '../../src/services/user' import * as dbHelper from '../db-helper' const unregisteredEmail = "unregistered@gmail.com" const unmatchedPassword = "password123" async function signUp() { const user = new User({ e...
fe8e9846b402529b6835667c4ab62407df09bfa7
TypeScript
efraim-andrade/semana_omnistack_10
/backend/src/websocket.ts
2.78125
3
import socketio from 'socket.io' import { Application } from 'express' import { parseStringAsArray, getDistanceFromLatLonInKm } from './functions' type CoordinatesTypes = { latitude: number, longitude: number } interface ConnectionsType { id: string; coordinates: CoordinatesTypes; techs: string[] } const ...
edc38cc2137abe4fc3a458a66b81218c3c6f5d65
TypeScript
ottomated/DefinitelyTyped
/types/tizen-common-web/filesystem.d.ts
3.1875
3
declare module 'filesystem' { import { ErrorCallback, SuccessCallback } from 'tizen'; /** * String, which points to file or directory. * In methods available since Tizen 5.0, checking or accessing files or directories may be granted only through a valid path. * Paths may contain one of the suppor...
a90035860290e26e1697ace5793becb7ee15b14b
TypeScript
TatsuyaYamamoto/school-idol-game-project
/packages/oimo-no-mikiri/src/js/texture/containers/GameResultPaper/TopTime.ts
2.71875
3
import { Container } from "pixi.js"; import { t } from "@sokontokoro/mikan"; import Text from "../../internal/Text"; import { Ids as StringIds } from "../../../resources/string"; /** * Container that has top time' label and value text. * It's set right end as a container's anchor. * Then, you should consider it ...
3d86d222d39b643f8281ff8d1174e39262eb046c
TypeScript
rajmohan6268/nodejs-db-orm-world
/with Knex/nestjs-knex-postgres/src/app/module/dto/user.dto.ts
2.5625
3
import { PartialType } from "@nestjs/swagger"; import { IsEmail, IsNotEmpty, IsString } from "class-validator"; export class CreateUserDto { @IsString() firstName!: string; @IsString() lastName!: string; @IsString() @IsEmail() email!: string; } export class UpdateUserDto extends PartialType(CreateUser...
0b952f92cf69bdb36c9ba0e40b8b5b78a0e38811
TypeScript
gagiD/chartjs-plugin-centerlabel
/src/plugin.ts
2.796875
3
import { Plugin, ChartType, DoughnutController } from 'chart.js' import CenterLabelOptions from './CenterLabelOptions' declare type CenterPlugin<TType extends ChartType = ChartType> = Plugin< TType, CenterLabelOptions > export default { id: 'centerlabel', afterDraw: function (chart, _, options) { ...
daa5aba1dbdc0b7dcfc9e0f943dc446de4ff1462
TypeScript
vicodersvn/nestjs-casbin
/src/components/auth/entities/password-reset.entity.ts
2.609375
3
import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm'; @Entity({ name: 'password_resets' }) export class PasswordReset { @PrimaryGeneratedColumn() id: number; @Column({ type: 'varchar', }) email: string; @Column({ type: 'varchar', }) token: strin...
3c6674ac0ff3f9250895a2ab5495fc727502ff21
TypeScript
antunesbe/taskboard_desafio
/src/app/shared/task.model.ts
2.65625
3
export class Task { _id: string; title: string; description: string; attachments: any[]; status: string = 'todo'; developed_by: string; priority: Number; owner: string; created_at: Date = new Date(); updated_at: Date = new Date(); constructor(data?: Task){ if(data){...
943b95ddaa124533268272b4f659c467e79125d7
TypeScript
thanhtung030400/ThanhtungA1020I1
/Module_5/bai_6/register_and_login/src/app/register-form/register-form.component.ts
2.6875
3
import { Component, OnInit } from '@angular/core'; import {AbstractControl, FormControl, FormGroup, ValidationErrors, ValidatorFn, Validators} from '@angular/forms'; function comparePassword(c: AbstractControl) { const v = c.value; return (v.password === v.confirmPassword) ? null : { passwordnotmatch: true }...
d5012b197f1aa6efc8c82265e3112985decfa1d4
TypeScript
fuunnx/portals-poc
/src/lang/stringify/index.test.ts
2.640625
3
import { parse } from '../parse' import { stringify } from './index' import { comment, portalStart, portalEnd, warp } from '../helpers' test('empty text', () => { const source = '' expect(stringify(parse(source))).toEqual(source) }) test('simple text', () => { const source = `1 2 3` expect(stringify(parse(sou...
c93fa6fd6455f93830aa286babb92c012be3c5e6
TypeScript
Ana-MM/Practica-Typescript
/persona.ts
2.59375
3
import { Direccion } from "./direccion"; import { Mail } from './mail'; import { Telefono } from './telefono'; export class Persona { private _nombre: string; private _apellidos: string; private _edad: number; private _dni: string; private _cumpleaños: Date; private _color: string; ...
ff0f07ffda8acd5bb4d09e76ec8036e987ec61ad
TypeScript
Sebasmn/angular007
/src/app/agregar/agregar.component.ts
2.84375
3
import { Component, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; interface Usuario{ nombre: string; apellido: string; edad: number; correo: string; clave: string; } @Component({ selector: 'app-agregar', templateUrl: './agregar.component.html', sty...
b1686d348f0f96db4eebc493b3e49a16609ef5ce
TypeScript
superclassiceth/airgap-vault
/src/app/pipes/amount-converter/amount-converter.pipe.spec.ts
2.6875
3
import { BigNumber } from 'bignumber.js' import { AmountConverterPipe } from './amount-converter.pipe' import { MainProtocolSymbols } from 'airgap-coin-lib/dist/utils/ProtocolSymbols' const BN: typeof BigNumber = BigNumber.clone({ FORMAT: { decimalSeparator: `.`, groupSeparator: `'`, groupSize: 3 } })...
65619b1b56295181568b1a65baf6bd184b34e558
TypeScript
GEBittencourt/sdk-jsddd
/src/lib/query/type/get-all-response.ts
2.84375
3
/** * Definition of get all response */ export type GetAllResponse<DTO> = { /** * List of DTO (Data transfer object) */ items: DTO[]; /** * Show if next page exists */ hasNext: boolean; /** * Number of page returned */ page: number; /** * Quantity of page records requested */ ...
92e57fe2859f0e5679482e510135f8ac21b8e637
TypeScript
react-widget/tree-basic
/src/Node.ts
2.90625
3
let idx = 1; interface NodeOptions { rootId?: null | string | number; idField?: string; pidField?: string; leafField?: string; } interface NodeState { expandedMap?: Record<string, boolean>; } export default class Node<T = Record<string, any>> { id: string | number; pid: string | number; leaf: boolean; data:...
6a855bfc92c91fb8a0c306432338975641ca3470
TypeScript
tajpouria/GOF-design-pattenrs
/SOLID_Principles/single_responsibility_principle/Jounral.ts
3.484375
3
// bad way class BadJournal { public entries: string[] = []; public saveJournal: Record<string, string> = {}; constructor(public title: string) {} public addEntry(entry: string) { this.entries.push(entry); } public save() { this.entries.map((entry, index) => { this.saveJournal[index] = en...
b13fef830162ad08a68d9442977ff1442fa83f32
TypeScript
greghart/climbing-app
/src/typescript/redux/store/thunkBundler.ts
2.90625
3
function isPromise(val) { return val && typeof val.then === 'function'; } /** * A replacement for redux-thunk that will intercept and callback promises */ function thunkBundler(onPromise?: (promise: Promise<unknown>) => unknown) { return (ref: any) => { return (next) => { return (action) => { ...
730757d3c3940b2fa115e832b88b2e47e448ca31
TypeScript
snhardin/you-owe-me-money
/api/src/util/authentication.ts
2.59375
3
/** * Name of the cookie to store the JWT in */ export const JWT_COOKIE_NAME = 'youOwe-token'; /** * Information encrypted and stored in the JWT */ export interface JwtInfo { /** * The email of the user */ email: string; }
15857a9555475d3c5e677d6755101a98d8cf7f2a
TypeScript
visgl/deck.gl
/modules/geo-layers/src/wms-layer/utils.ts
2.671875
3
import {lngLatToWorld} from '@math.gl/web-mercator'; // https://epsg.io/3857 // +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs const HALF_EARTH_CIRCUMFERENCE = 6378137 * Math.PI; /** Projects EPSG:4326 to EPSG:3857 * This is a lightweight re...
ded58b51d022c6742b6e0cc5e67cc765013815a4
TypeScript
xesxfs/mjgo
/recsmj2/csmj/src/gdmj/view/game/ui/SelectActUI.ts
2.53125
3
/** * 操作面板,吃碰杠胡 * @author chenkai * @date 2016/7/11 * * @author huanglong * @data 2017/04/12 chongxie */ class SelectActUI extends eui.Component{ private eatBtn:SelectActBtn; private pengBtn:SelectActBtn; private gangBtn:SelectActBtn; private huBtn:SelectActBtn; private passBtn:SelectActBtn;...
62b2a31d3e7cb68b9bb7fcdbb1a741527471dac1
TypeScript
HenrikThoroe/swc-common-client
/performance_tests/src/base64.ts
3.328125
3
const base64Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("") function encodeBase64(x: number): string { let result = "" const blockLength = 6 const bitsToShift = 32 - blockLength while (x > 0) { const y = x << bitsToShift >>> bitsToShift // Read block ...
78f5bfc73d991a95dc28cfffca76b675a5dca5a8
TypeScript
bsdelf/barebone-js
/src/migrations/templates/model.ts
2.53125
3
import { Sequelize, Table, Index, Column, Model, DataType } from 'sequelize-typescript'; @Table({ freezeTableName: true, underscored: false, timestamps: false, tableName: 'template_model', }) export class TemplateModel extends Model<TemplateModel> { @Column({ type: DataType.BIGINT, autoIncrement: tru...
fb3fd0f3c5cfebe5e41a17a9236b9a9a8eab3c95
TypeScript
davehenton/beefindr
/src/app/common/models/beekeeper.model.ts
2.953125
3
import {LocationBasedModel, SerializedLocationBaseModel} from './location-based.model'; export interface SerializedBeeKeeper extends SerializedLocationBaseModel { email?: string; messagingID?: string; firstname?: string; } export class BeeKeeper extends LocationBasedModel { private messagingID = ''; public...
0a749fdceb88e4333fffaa07858eaac1c5f25106
TypeScript
peterm94/lagom
/src/Common/Camera.ts
3.171875
3
import * as PIXI from "pixi.js"; import {Scene} from "../ECS/Scene"; import {MathUtil} from "./Util"; /** * Camera class for interacting with the viewport. */ export class Camera { angle = 0; readonly scene: Scene; readonly width: number; readonly height: number; readonly halfWidth: number; r...
aad0e7b3dbb06457e94512cbec480ce92a53b49d
TypeScript
k3ntako/split-it
/test/tables/UserTable.spec.ts
2.671875
3
import { expect } from 'chai'; import { userTable } from '../../src/tables'; import PG_Interface from '../../src/PG_Interface'; describe('UserTable model', () => { const pgInterface = new PG_Interface(); before(async () => { await pgInterface.query('DELETE FROM transaction_users;'); await pgInterface.quer...
72803741bd39cbe337bf1f6c17a05480bd472010
TypeScript
ypanshin/financial-independence
/assets/components/investment-guide/dist/types/components/calculators/investment-guide/mortgage-form/model/mortgage-form-value.d.ts
2.546875
3
import { IMortgageValue } from "../../model/mortgage-value"; export interface IMortgageFormValue extends IMortgageValue { /** * The mortgage rate. */ mortgageRate?: number; /** * The mortgage rate. */ mortgageBalance?: number; /** * The mortgage amortization in years. *...
14eaaea2677360c4419a55259ee5a49b837e63a9
TypeScript
tomvin/blade
/src/app/modules/core/services/menu-item/menu-item.model.ts
2.65625
3
export interface MenuItemCategoryVM { id: number; categoryLabel: string; // The category of the menu items inside this menu fontAwesomeIconName: string; // The font awesome icon name to use for the menu item menuItems: MenuItemVM[]; // Child menu items (if there are any) defaultMenuItemIdToNavigateTo: numbe...
3b4020544ccd8370304431e77bfbf6b2a606db73
TypeScript
barthap/TheDiary
/Frontend/client/src/actions/photo.actions.ts
2.734375
3
import {ActionCreator, Action} from "redux"; import {IPhoto} from "../helpers/types"; import { ADD_PHOTO, ADD_PHOTO_STATUS, DELETE_PHOTO, DELETE_PHOTO_STATUS, FETCH_PHOTOS, FETCH_PHOTOS_STATUS, photoConstants, UPDATE_PHOTO, UPDATE_PHOTO_STATUS } from "../consts/photo.constants"; import {IPageConfig}...
6550c41ef89dddee30897d3e75ad4008a621dea4
TypeScript
nicholasking900816/javascript-ast-walk
/src/lib/javascript-ast-parser/statements/ClassDeclarationStatement.ts
2.59375
3
import { FunDeclarationStatement } from "./FunDeclarationStatement"; import { IdentifierLiteratureStatement } from "./IdentifierLiteratureStatement"; import { Statement } from "./Statement" export class ClassDeclarationStatement extends Statement { type = 'ClassDeclarationStatement'; extend: IdentifierLiteratu...
6128f9dd4082693c10523ce053219899250fae2e
TypeScript
NateRobinson/AndroidUI4Web
/src/androidui/image/NetImage.ts
2.765625
3
/** * Created by linfaxin on 15/12/11. */ module androidui.image{ export class NetImage { private platformImage; private mSrc:string; private mImageWidth=0; private mImageHeight=0; private mOnLoads = new Set<()=>void>(); private mOnErrors = new Set<()=>void>(); ...
b93c78f053915ce8ca829e5522d277494982e57c
TypeScript
corets/schema
/src/assertions/mixed.ts
3.03125
3
import includes from "lodash/includes" import { LazyValue, ValidationFunctionResult } from "../types" import { lazyValue } from "../lazyValue" export const isDefined = (value: any) => value !== null && value !== undefined export const mixedRequired = ( value: any, required?: LazyValue<boolean> ): ValidationFuncti...
9a009a370ecf6b291d737c7f68967b941daa1313
TypeScript
paleite/serverless-next.js
/packages/libs/core/src/route/locale.ts
2.734375
3
import { Manifest, RoutesManifest } from "../types"; export function addDefaultLocaleToPath( path: string, routesManifest: RoutesManifest ): string { if (routesManifest.i18n) { const defaultLocale = routesManifest.i18n.defaultLocale; const locales = routesManifest.i18n.locales; const basePath = path....
b1ee15f86bbb5fc8e38085015b3d54d86f7c4b4e
TypeScript
matthew-dean/less.js
/packages/core/src/functions/list.ts
2.796875
3
import { Comment, Dimension, Declaration, Expression, Rules, Node, Num, Selector, // Element, // Mixin, Quoted, WS } from '../tree/nodes' import { define } from './helpers' export const _SELF = define(function (n: Node) { return n }, [Node]) export const extract = define(function (value: Nod...
aafcfdbfdf227f7e4c74adbd5ed1ea641482e819
TypeScript
HediAbed/codecharta
/visualization/app/codeCharta/state/store/dynamicSettings/searchedNodePaths/searchedNodePaths.reducer.spec.ts
2.59375
3
import { searchedNodePaths } from "./searchedNodePaths.reducer" import { SearchedNodePathsAction, setSearchedNodePaths } from "./searchedNodePaths.actions" describe("searchedNodePaths", () => { describe("Default State", () => { it("should initialize the default state", () => { const result = searchedNodePaths(un...
f62221921f04b8ebe35c4147a68c0c7d84fa6b68
TypeScript
cpannwitz/chout-web
/src/services/localStorage.service.ts
2.53125
3
import { ImmortalStorage, LocalStorageStore, IndexedDbStore } from 'immortal-db' const stores = [IndexedDbStore, LocalStorageStore] const db = new ImmortalStorage(stores) export const localStorageService = { // single ops set: (key: string, value: string) => db.set(key, value), get: (key: string, fallback: stri...
2d30b419b15de4e03e68b7ccc9b9097fbe86f213
TypeScript
semakov-andrey/sa-time-tracker
/src/utils/di.ts
2.671875
3
import { PureComponent } from 'react'; import { isset } from './guards'; class IoCContainer { private instances: Map<symbol, unknown> = new Map(); public get = <T>(token: symbol): T => { const constructor = this.instances.get(token); if (!isset(constructor)) throw new Error('di failed'); return cons...
bf75ea7b7280f432faf81364ff22244a236ba41e
TypeScript
redplane/v-personal-cv
/src/models/user-description.ts
2.734375
3
export class UserDescription { //#region Properties /* * Id of description. * */ public id: number = 0; /* * User id that description belongs to. * */ public userId: number = 0; /* * User description. * */ public description: string = ''; //#endregion }
7a91561a010041d8048ed8305231aa395c3e6f96
TypeScript
jberglinds/spotify-tunein-backend
/src/socket-app.ts
2.6875
3
import http from 'http' import socketIO from 'socket.io' import { default as RadioController, PlayerState, APIRadioStation } from './controllers/radio-controller' enum IncomingEvent { startBroadcast = 'start-broadcast', endBroadcast = 'end-broadcast', updatePlayerState = 'update-player-state', ...
09e4e33ab815128b0d247ab5053fdcdca8435d2d
TypeScript
TeemuHe/myproject
/src/app/classes/feedback-item.ts
2.65625
3
export class FeedbackItem { question: string; answer: string; answerList: string[]; constructor(question: string) { this.question = question; this.answer = ''; this.answerList = ['Ei arvosteltu', 'Huono', 'Kohtalainen', 'Hyvä', 'Täydellinen']; } }
3d94a06ddf9a7eb3654913449f453db94a2ab8d3
TypeScript
zbream/project-euler-node
/src/052/index.ts
3.546875
4
export function main052() { return findSmallestPermutedMultiple(); } function findSmallestPermutedMultiple(): number { for (let i = 1;; i++) { if (isPermutedMultiple(i)) { return i; } } } function isPermutedMultiple(num: number): boolean { const digits = getDigits(num); for (let multiplier = 2...
221815c3f7160a684c94b8baf3bec53a387ca0aa
TypeScript
vino337/Angular-MyApp
/src/app/services/customer.service.ts
2.59375
3
import { Injectable } from '@angular/core'; import { HttpClient, HttpHeaders, HttpErrorResponse } from '@angular/common/http'; import { Observable, of, throwError } from 'rxjs'; import { catchError, map, tap } from 'rxjs/operators'; @Injectable({ providedIn: 'root' }) export class CustomerService { private custom...
14d8041a9b079a5f3fb12ef1a26009b2bca1a6b9
TypeScript
terra10/codefest_serverless-awslambda
/Lab003/reference/postBeerAdvanced.ts
2.703125
3
import { APIGatewayProxyEvent, Callback, Context } from 'aws-lambda'; import * as AWS from 'aws-sdk'; import * as https from 'https'; const documentClient = new AWS.DynamoDB.DocumentClient({ httpOptions: { agent: new https.Agent({ keepAlive: true }) } }); // Handler for AWS Lambda ...
008d54abbeb0592019c395f0d1d0ed7594016dcf
TypeScript
wbalaniucCentennialCollege/COMP397_Mario
/Scripts/Core/game.ts
2.625
3
/// <reference path = "_reference.ts" /> // Global Variables var assets: createjs.LoadQueue; var canvas: HTMLElement; var stage: createjs.Stage; var spriteSheetLoader : createjs.SpriteSheetLoader; var atlas : createjs.SpriteSheet; var currentScene : objects.Scene; var scene: number; // Preload Assets required var a...
c2e89b6b82b239e06c28bde68f31a33be00e369b
TypeScript
bostalowski/poc-game
/src/controller.ts
3.09375
3
const ButtonInput = function () { let isButtonInputActive = false let isButtonInputDown = false return { setInput: (isDown: boolean) => { if (isButtonInputDown !== isDown) { isButtonInputActive = isDown } isButtonInputDown = isDown }, isActive: () => isButtonInputActive }...
e6d6c3b121f8bdc13f9e33b5b84ad8759fa1c9d3
TypeScript
milton-reyes/dwelling-kitchen-Inventory
/src/model/FoodStorage.ts
2.8125
3
export class FoodStorage { storagesId: number; upcFood: string; quantity: number; datePurchased: Date; shelfLife: string; constructor( storagesId: number, upcFood: string, quantity: number, datePurchased: Date, shelfLife: string) { this.storagesId = st...
68bd9d1f917014c914052ce05ffcbbf265b5480a
TypeScript
multitoken/calculator
/src/manager/analytics/AnalyticsManagerImpl.ts
2.625
3
import * as Sentry from '@sentry/browser'; import { AnalyticsManager } from './AnalyticsManager'; import { BasicAnalytics } from './BasicAnalytics'; export class AnalyticsManagerImpl implements AnalyticsManager { private analytics: BasicAnalytics[] = []; constructor(analytics: BasicAnalytics[]) { this.analyt...
71c499db232abf44da451268eff697737249d1a1
TypeScript
jvanmelckebeke/pacman-electron
/scripts/tools.ts
3.46875
3
export class XY { constructor(x: number, y: number) { this._x = x; this._y = y; } private _x: number; get x(): number { return this._x; } set x(value: number) { this._x = value; } private _y: number; get y(): number { return this._y; }...
b4e16c6fb9ba4e6df57c870a4c6e19dfcd83f205
TypeScript
makoscafee/map-api
/src/lib/layers/thematic.ts
2.546875
3
import { LayerOptions } from '../models/layer-options.model'; import { getLabelsLayer, getLablesSource } from '../utils/labels.util'; import Layer from './index'; const borderColor = '#333'; const borderWeight = 1; const hoverBorderWeight = 3; class Thematic extends Layer { constructor(options: LayerOptions) { ...