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
6a01eda2f26ea3d2ca6e6c9963ce484e7c9ef883
TypeScript
catflinger/heating-controller
/test/program/program-spec.ts
2.78125
3
import { IControllerSettings, IProgram, INJECTABLES, ProgramSnapshot } from "../../src/controller/types"; import { Program } from "../../src/controller/program"; import { container } from "./inversify.config.test"; import * as fs from "fs"; import * as chai from "chai"; import "mocha"; const expect = chai.expect; le...
f2f19e40555cbd56413ded3a44b7e8d8cb1d1bfb
TypeScript
Sergey-lang/Notes-react-app
/src/n-1-Api/api.ts
2.5625
3
import axios from 'axios' import {NoteType} from '../n-2-Redux/notes-reducer'; import {TagType} from '../n-2-Redux/tags-reducer'; const defaultOptions = { withCredentials: true, headers: { Accept: 'application/json', } } const axiosInstance = axios.create(defaultOptions); export const notesAPI = ...
3aeae887e5464816aaddee9640004c026eabc43f
TypeScript
js/apollo-tooling
/packages/apollo/src/commands/client/push.ts
2.546875
3
import { createHash } from "crypto"; import { printWithReducedWhitespace, sortAST, defaultSignature as engineDefaultSignature } from "apollo-engine-reporting"; import { visit, DocumentNode, IntValueNode, FloatValueNode, StringValueNode } from "graphql"; import { ClientCommand } from "../../Command"; ...
0a2198e1395484be66c3aa8c0c3cc970cebd7b97
TypeScript
dwchiang/aws-cdk
/packages/@aws-cdk/aws-lambda-nodejs/lib/bundling.ts
2.53125
3
import * as fs from 'fs'; import * as path from 'path'; import * as lambda from '@aws-cdk/aws-lambda'; import * as cdk from '@aws-cdk/core'; import { PackageJsonManager } from './package-json-manager'; import { findUp } from './util'; /** * Base options for Parcel bundling */ export interface ParcelBaseOptions { /...
464f3f7a5ab442f8015c44ab1581df2363ea8cda
TypeScript
gaohejin/ynm3000
/src/intersectionWith.ts
3.015625
3
import last from './last' import map from './map' import castArrayLikeObject from './internal/castArrayLikeObject' import baseIntersection from './internal/baseIntersection' /** * 比较数组取相似结果 * @param arrays */ function intersectionWith(...arrays) { let comparator = last(arrays) const mapped = map(arrays, castArr...
fa93dae553537e1d24ec2e5f48b413344845dc93
TypeScript
TextC0de/formify
/server/model/user/user.model.ts
2.71875
3
import bcrypt from 'bcrypt'; import { Document, Schema, model } from 'mongoose'; export const UserSchemaName = 'User'; export interface User extends Document { readonly username: string; readonly password: string; readonly forms: [string]; readonly token?: string; readonly created: Date; reado...
27921a0d00cbd7e669fdd9cf7c79be70238771f6
TypeScript
corbanbrook/datapack
/tests/unit/Schema.test.ts
2.921875
3
import { Schema, Component, Type } from '../../src' test('Create schema with diffing', () => { const schema = new Schema( 1, 'thing', [ new Component('loc', Type.Array(Type.Float32, 2)), new Component('vel', Type.Array(Type.Float32, 2)), new Component('rot', Type.Float32) ], { d...
aa443a08f5097acd420df5227eaebacb6aaa4f66
TypeScript
b54690/Final-Assessment
/server/src/students/controller.ts
2.640625
3
import { Authorized, Post, Param, HttpCode, Get, Body, JsonController, Put, NotFoundError, Delete} from 'routing-controllers' import Student from './entity'; import * as request from 'superagent' @JsonController() export default class StudentController { @Get('/students') async all() { const students = a...
4ba5aea03ed2c21ffb4b1b9b2ef91b3f8c0ba66c
TypeScript
dillonjason/resume-service
/src/data/schema/experience.ts
2.734375
3
import { Schema, Document, Model, model } from "mongoose"; import { SkillDocument, SkillModel } from "./skill"; interface Experience { company: string; position: string; start: Date; end?: Date; skills: SkillDocument[]; responsibilities: string[]; } export interface ExperienceDocument extends Experience, ...
5562f2aafadd8e83b41e31677add94dd950b72e1
TypeScript
Ruddickmg/js-wars
/front/javascript/tests/tools/calculations/dotProduct.spec.ts
3.09375
3
import {expect} from "chai"; import dotProduct from "../../../src/tools/calculations/dotProduct"; describe("dotProduct", () => { it("Returns an array containing the product of values found at each index of two arrays", () => { const array: number[] = [1, 2, 3, 4, 5, 6, 7, 8]; expect(dotProduct(array, array))...
6f22489fc08720f892e160daecf349f3f086aed3
TypeScript
AugurProject/Augur-Node-Experiment
/src/AccountManager.ts
2.609375
3
import BN = require('bn.js'); import { Account, generate, privateToAccount } from 'ethjs-account'; import { sign } from 'ethjs-signer'; import { Connector } from './Connector'; export interface Transaction { from?: string; to?: string; gas?: number | BN; gasPrice?: number | BN; value?: BN; data...
6c5b306a458a04449212bd473dc6f3e5c4e95b88
TypeScript
chase-moskal/turtleblog
/source/files/interfaces.ts
2.546875
3
export interface DirectoryItem { name: string path: string isDirectory: boolean }
df42a267a9072e33c30a90ab5744e38d11cf1cbd
TypeScript
humanchimp/tack
/src/findLast.ts
3.296875
3
export function findLast<T>( predicate: (it: T, index: number) => boolean, array: any[], ): T { for (let index = array.length - 1; index >= 0; index--) { const item = array[index]; if (predicate(item, index)) { return item; } } }
41b5604bbc5366b1e8fda5be1cebfc968c9fea9e
TypeScript
heiwais25/mymask-worker
/src/maps.ts
2.578125
3
import axios from "axios"; import configs from "./configs"; import { IPoint, FieldType } from "influx"; import { getMeasurementName } from "./loaders/influxdb"; import { ManualMappingLocation } from "./data"; import _ from "lodash"; export type IRemainStat = "few" | "empty" | "some" | "plenty"; export type IRawStore ...
a7e672ae452c3056b6c41da7247937315371e51c
TypeScript
yoollii/kindness
/app/validator.service.ts
2.84375
3
import { Injectable } from '@angular/core'; import { FormControl } from '@angular/forms'; @Injectable({ providedIn: 'root' }) export class ValidatorService { constructor() { } positiveNumberValidator(control: FormControl): any { if (!control.value) { // 如果输入为空则返回空 return null; } const val = con...
970981b9d98d25384589295d68d2265f732c1644
TypeScript
david2tdw/typescript
/classThis2.ts
3.78125
4
interface Card { suit : string, card: number } interface Deck { suits: string [], cards: number[], createCardPicker(this: Deck): () => Card } let deck : Deck = { suits: ["hearts", "spades", "clubs", "diamonds"], cards: Array(35), createCardPicker: function (this: Deck) { return () => { let ...
a2a5951be2abcead57e08e541ece47f6f8fd8a5a
TypeScript
Miguel319/booking-spot
/server/seeder/dummy-db.ts
2.859375
3
const Rental = require("../models/rental"); const User = require("../models/user"); class DummyDb { rentals; users; constructor() { this.createRentals(); this.createUsers(); } private createRentals() { this.rentals = [ { title: "Nice view on ocean", city: "San Francisco", ...
2de17cda3703931d43099d382a972a4d3dad0477
TypeScript
MichalPiaskowski/oop-typescript
/script.ts
4.1875
4
//Abstraction and encapsulation interface HeroI { name: string; attackPower: number; defence?: number; showWeakness(): string; normalAttack(): number; ultimateAttack(multiplayer: number): number; defend?(): number; } class TypicalHero implements HeroI { name: string; attackPower: number; defenc...
ab566bdacd13d19e19bdcfd66efd19846416e805
TypeScript
hylickipiotr/covid19
/src/components/CardChart/prepareChartData.ts
2.640625
3
import { Moment } from "moment"; import { CachedCoutry } from "../../contexts/Search/search.type"; import { DailyRawData } from "../../types/Data"; import { isToday } from "../../utils/isToday"; import { TCardType } from "../Card/Card"; const getHistoricalSpecificTypeData = ( historical: DailyRawData[], type: TCar...
6a4b38bc0bb530d733af0676ec39b3b89ca29dee
TypeScript
kalyan0055/nvipani_UI
/src/app/common/password-validator.ts
2.859375
3
import { FormGroup } from '@angular/forms'; export class RegistrationValidator { static validate(registrationFormGroup: FormGroup) { let password = registrationFormGroup.controls.password.value; let repeatPassword = registrationFormGroup.controls.repeatPassword.value; var re = /(?=.*...
bc1f0f4447e0a15fd3ef02c4e4d0b2f468a2b7d3
TypeScript
parthavtarfe/CRUD-nodejs-docker
/functions/src/models/product.ts
2.53125
3
import { urlpath } from '../config/environment' var mongo_instance = require('../connection'); let prod = require('../mongo_schemas/product'); export class productModel { public req; public res; public next; constructor(req, res, next){ this.req = req; this.res = res; this.next...
a51b84c56530c6c218162e7916995692d5b81dec
TypeScript
billyprice1old/base65536
/src/test/parse.spec.ts
2.640625
3
/** Tests for the command line parser, which was a bit annoying */ 'use strict' import Action from './../bin/action' import parse from './../bin/parse' describe('parse', function () { it('helps', function () { expect(parse(['--help'])).toEqual({action: Action.help, ignoreGarbage: false, fileName: undefined}) ...
df3cf7480d93279912900994fb3e3a0eca702d08
TypeScript
vibollmc/4c58c0cf20d4dbb8945ae95b2b664fd6
/app/hotel/models/room.ts
2.53125
3
import {MongodbModel} from './metadata/mongodbmodel'; import {RoomStatus} from './enum'; export class Room extends MongodbModel { name: string; roomtype: string; floor: number; roomStatus: RoomStatus; description: string; constructor() { super(); this.name = null; this...
30c7bd9ea934282a620d66b7f182a33872f2d346
TypeScript
electronicSAINT/jabberwock
/packages/plugin-fontawesome/src/FontAwesomeNode.ts
2.78125
3
import { InlineNode } from '../../plugin-inline/src/InlineNode'; import { AbstractNodeParams } from '../../core/src/VNodes/AbstractNode'; export interface FontAwesomeNodeParams extends AbstractNodeParams { htmlTag: string; faClasses: string[]; } export class FontAwesomeNode extends InlineNode { static read...
f207172507a1755648f6d8540acbbc4b2c5e9230
TypeScript
mmmveggies/rainbow-of-fifths
/src/hooks/use-source-notes.ts
2.6875
3
import React from 'react' import { Input, InputEventNoteon, InputEventNoteoff } from 'webmidi' export type SourceNotes = Record<string, InputEventNoteon> export function useSourceNotes(source: Input) { const [notes, setNotes] = React.useState<SourceNotes>({}) React.useEffect( () => { const onNoteOn = (event: ...
92732aeab873cf648fe75d6c66093e8058215a51
TypeScript
0xrin1/edChat
/ts/messaging/clients/client.ts
2.546875
3
import Greeting from './greeting'; import Id from '../../utilities/id'; import RelayReference from '../relays/relayReference'; export default class Client implements Greeting { id: number; name: string; platform: string; project: string; ip: string; custom_keyboard: boolean; rela...
3b4dfe549cb29beb6556fa7450409679958cbf9f
TypeScript
2019-B-GR1-JS/js-pirca-escobar-nicole-stephanie
/02-typescript/01-Introduccion.ts
4.0625
4
// Tranpilador // tipo de compilador que transforma de //un lenguaje a otro // TYPESCRIPT // 1) TIPOS DE DATOS (TIPADOS) // 2) DECORADORES // 3) CLASES //const numero =0; const numero: number =0; //let nombre: string= "Nicole"; // DUCK TYPING // INFIREINDO EL TIPO DE DATO let nombre = "Nicole"; // nombre =1; ERROR le...
d72e59fd3be8e61df4d81e5d11d37b69c25545bf
TypeScript
narci2010/typescript-course
/src/pattern/Composite.ts
4.28125
4
// 组合模式 Composite // 特点:以树的形式展示对象的组合,并且可以以类似的方式处理每个枝点。 // 用处:当对象组合以树状存在,有父有子,并且对象的行为差不多时可以考虑组合模式,如菜单,游戏里的技能树。 // 注意:遍历组合的性能要求。 // 下面用TypeScript简单实现一下组合模式: // 技能树麻烦了点,技能激活要引入观察者模式,就以菜单为例吧。 // 菜单可以包括子菜单,点击菜单项时有子菜单则显示子菜单,没有时触发点击事件。 // 先声明一个抽象,包含菜单的名字,点击事件和添加Child,一般情况下Menu会维护一个childs集合,通过这个集合来添加子菜单, // 不过这里没有用这种方式,采用的是继承...
8a06789769b67e6ea09e478d631dae52d7f1536a
TypeScript
uhyo/resourcebundles
/packages/cli/src/util/handleOptionMultiple.ts
2.828125
3
export function handleOptionMultiple( option: string | string[] | undefined ): string[] { if (option === undefined) { return []; } if (typeof option === "string") { return [option]; } return option; }
51791ef2c0230bf4f232ceb2723319e03ed18ecd
TypeScript
MayorCurley/heros
/src/app/player.ts
2.765625
3
export class Player { firstName: string; lastName: string; team: string; position: string; overall: number; awareness: number; speed: number; acceleration: number; agility: number; strength: number; } /* { "firstName": "Tom", "lastName": "Brady", "team": "New Englan...
0d14cb770e6b0d02d6a8bb7c2919a450ab712da9
TypeScript
livyk/motyl
/src/helpers/stripUnit.ts
2.6875
3
const cssRegex = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/; export default function stripUnit(value: string | number): string | number { if (typeof value !== "string") return value; const matchedValue = value.match(cssRegex); return matchedValue ? parseFloat(value) : value; }
1dd71d033696b9251d9832c6f689a580daa96293
TypeScript
7affer/raycast
/src/scripts/sprites/sprite.ts
2.875
3
import { ISettings } from '../isettings'; import { Angle } from '../angle'; import { ISprite } from './isprite'; export class Sprite implements ISprite { public left: number = -1 public width: number = 0 public anglewidth: number = 0.2 public starttexture: number public endtexture: number publ...
e35db2f8498a26cf58c647b661d95c1e96b1052d
TypeScript
NichijouCC/web3d
/src/graph/mesh/vertexAttribute.ts
2.984375
3
namespace webGraph { export enum VertexAttTypeEnum { Position ="a_pos", UV0 ="a_texcoord0", Color0 ="a_color", BlendIndex4 ="a_blendindex4", BlendWeight4 = "a_blendweight4", Normal = "a_normal", Tangent = "a_tangent", UV1 = "a_texcoord1", C...
b865d5e87ebc146cf0e0ac31ad835e4302d38d82
TypeScript
abbasjnp/MaidsCar
/src/app/admin/practice2/simple-component.ts
2.625
3
import {Component,Input,OnChanges,SimpleChanges} from '@angular/core'; @Component({ selector:'simple', template:`you entered :{{simpleInput}}` }) export class SimpleComponent implements OnChanges{ @Input() simpleInput:string; ngOnChanges(changes :SimpleChanges){ for(let propertyName i...
e8b365af59366e8b39577c9139ea093352721e04
TypeScript
johnpmcclung/baseballbot
/baseball/events/RunScoredEvent.ts
2.984375
3
import { EventType, Team } from "../enums"; import { GameEvent } from "./event"; export class RunScoredEvent implements GameEvent { type: EventType; properties: RunScoredEventProperties; constructor (team: Team) { this.type = EventType.RunScored; this.properties = { "team": team }; } }...
ec50e6f5a7012022ffc1e151e2e5ccbdfd31e4cb
TypeScript
HanLeFS/products-redux-sagas
/project/src/api/fetchProduct.api.ts
2.546875
3
import axios from 'axios'; import { IProductResponse, Product } from 'src/models'; import { isSuccessfulResponse, axiosApi } from 'src/utils'; export const getProduct = async (id: string): Promise<IProductResponse> => { const url = process.env.REACT_APP_API_END_POINT ?? ''; try { const response = await axiosA...
08367b3df7b38e6d29aa233ad97354bdf9c2b33e
TypeScript
body-link/tachka
/server/common/rxjs-utils.ts
2.765625
3
import { MonoTypeOperatorFunction, Observable, of, OperatorFunction } from 'rxjs'; import { catchError, dematerialize, materialize, tap } from 'rxjs/operators'; import { TOption } from './type-utils'; export const UNDEFINED = of(undefined); export const catchErrorToUndefined = <T>(): OperatorFunction<T, TOption<T>> =...
80aee42726d501d6b2018caa509ec4120fc69029
TypeScript
AxisCommunications/media-stream-library-js
/streams/src/components/auth/www-authenticate.ts
3.109375
3
export type ChallengeParams = Map<string, string> export interface Challenge { type: string params: ChallengeParams } export const parseWWWAuthenticate = (header: string): Challenge => { const [, type, ...challenge] = header.split(' ') const pairs: Array<[string, string]> = [] const re = /\s*([^=]+)="([^"]...
1307b7440df00a9bbfede467f100902c59aa52af
TypeScript
kiranbatchu/supersaver
/src/pages/about/about.ts
2.578125
3
import { Component } from '@angular/core'; import { NavController } from 'ionic-angular'; @Component({ selector: 'page-about', templateUrl: 'about.html' }) export class AboutPage { wholefoods:string = "Savings: $0"; wholefoodDiscount:number = 0; uberDiscount:number = 0; salonDiscount:number = 0; restDis...
3e01bdc9cc9e5504982b421654637da555565678
TypeScript
llorz-o/rich-m
/src/utils/func/arr.ts
3.1875
3
/** @format */ type CommonArray<T> = { [key: number]: T length: number } export function each<T>(arr: CommonArray<T>, cb: (item: T, index: number, self: CommonArray<T>) => void): CommonArray<T> { const len: number = arr.length let i = 0 for (i; i < len; i++) { cb(arr[i], i, arr) } ...
a8e94a6ce5e0f0fff25524e3cd72f9bae8ae74aa
TypeScript
heshmAhmed/todos-frontend
/src/app/model/todo.model.ts
2.515625
3
export interface Todo{ id?: BigInteger title: string; desc: string; creatDate: Date; endDate?: Date; completed: boolean; }
aeb17014e8301f79dcd1d4a35c2090ca4b45a17b
TypeScript
Codeneos/vlocode
/packages/vscode-extension/src/lib/vlocodeContext.ts
2.90625
3
import * as path from 'path'; import type { ExtensionContext, Memento, ExtensionMode } from 'vscode'; import { singleton, getInstance } from '@vlocode/util'; import type VlocodeService from './vlocodeService'; /** * Minimal version of VScodes extension context. */ class VlocodeContext { constructor( /**...
db00e395bdfde5d8c9451ecb1b91df4e63227dd8
TypeScript
jakzo/things
/old-things/src/file-utils/file-types/json.ts
2.734375
3
import fs from 'mz/fs'; import * as goldenFleece from 'golden-fleece'; import { prettifyIfNecessary } from '../util/prettier'; export const readFile = async (filePath: string) => { const contents = await fs.readFile(filePath, 'utf8'); const value = goldenFleece.evaluate(contents); return { contents, value }; };...
bf3c34cbc3e42e6e8361464aab993ed16942e444
TypeScript
muradkhan101/book-trading
/src/user/user.ts
2.859375
3
export class User { public id : string; public email : string; public password : string; public lastName : string; public firstName : string; constructor(id: string, firstName: string, email: string, password: string) { this.id = id; this.firstName = firstName; this.email = email; this.passw...
38dcef81d3dca063f36b09c426847d4d6e91d0d2
TypeScript
xinapxix/invernadero
/main.ts
2.53125
3
basic.forever(function () { while (input.buttonIsPressed(Button.AB)) { if (input.temperature() >= 8 && input.temperature() <= 30) { basic.showString("TN") } else { if (input.temperature() > 30) { basic.showString("TA") music.playTone(988, music...
54d7995c4abaa704c00e0791bfe997858c4f1431
TypeScript
dhamotharang/node-s9foju
/app/modules/reporting/models/charts/stacked-bar-time-series/report-stacked-bar-time-series.model.ts
2.640625
3
import ReportTimeSeriesDataPoint from '../time-series/report-time-series-data-point'; import {ReportStackedBarTimeSeriesConfiguration} from './report-stacked-bar-time-series-configuration'; export default class ReportStackedBarTimeSeries<T> { public id: string; public displayName: string; public points: Array<Re...
d14545d5a3d457eee0c8e3667049ab61e31784b1
TypeScript
akhilanil/roster
/roster-frontend/src/app/shared/roster-input/roster-input-validator.ts
2.65625
3
import { ValidatorFn, AbstractControl, FormGroup, FormControl } from "@angular/forms"; import { RosterListCacheService } from '@services/cache-manager' import { ReplaySubject } from "rxjs"; import { CreateRosterRSModel } from "@interfaces/business-interface"; export class RosterInputValidator { constructor() {}...
c1b19280319d1cec24b284b22d9b80de71f7e1a9
TypeScript
william-gooch/root-rpg-model
/src/model/playbooks/drives.ts
2.796875
3
export interface Drive { name: string; description: string; } const drives = { "justice": { name: "Justice", description: "Advance when you achieve justice for someone wronged by a powerful, wealthy, or high-status individual.", }, "principles": { name: "Principles", description: "Advance whe...
7d6307cd36db432d1ee78b152c457f3174e61a38
TypeScript
guideofneb/guideofneb_tools
/src/gauss_seidel_solver/shared/areArrayEqual.ts
2.65625
3
const areArrayEqual = (firstArray : any[], secondArray : any[]) : boolean => { let isEqual = true; firstArray.map((v, i) => { if (secondArray[i] !== v) { isEqual = false; } }); return isEqual; }; export default areArrayEqual;
ff0a3e56c9703c31c2bb383c1146905a14722499
TypeScript
Erudition/elm-native
/src/transitions/index.ts
2.671875
3
import { CubicBezierAnimationCurve, Pair } from "@nativescript/core/ui/animation"; import { AnimationCurve } from "@nativescript/core/ui/enums"; import { Animation, AnimationDefinition, Color, View } from "@nativescript/core"; import { ease_in, ease_out, ease, linear, ease_in_out, animation_curve, normalizeCurve, part...
0308282389483c4c1ad086c52479f0b2420f80a7
TypeScript
frontend-park-mail-ru/2020_2_JMickhs
/src/components/popup/message-popup/message-popup.ts
2.609375
3
import type { AbstractComponent } from '@interfaces/components'; import * as template from './message-popup.hbs'; import './message-popup.css'; export default class MessagePopup implements AbstractComponent { private place: HTMLDivElement; activate(message: string, isError: boolean): void { if (this....
4d58ebef2dc1008b4fbda4ca3eccc11dfe6cbddb
TypeScript
NathanFlurry/tanks-typescript-canvas-socketio
/shared/Player.ts
2.78125
3
import { Client } from "../client/Client"; import { Game, generateId } from "./Game"; import { Utilities } from "./Utilities"; import { EntityState } from "./Entity"; import { BulletState, createBullet } from "./Bullet"; export interface PlayerState extends EntityState { id: number; positionX: number; posi...
0c608edc9a3e73a1fcc832e8cc609faafbe2b4e4
TypeScript
harerakalex/chatti-backend
/src/helpers/__test__/responseHandeler.helper.spec.ts
2.578125
3
import { ResponseHandler, IError } from '../responseHandler.helper'; describe(ResponseHandler, () => { let res: any; res = { status: jest .fn(() => ({ json: jest.fn(), })) .mockReturnValue({ json: jest.fn() }), }; it('Should send error response with provided status', () => { ...
fa97e6b76b2651378a260b3880b59878dc707b91
TypeScript
SvetlanaZhak/Aktia
/src/backend/utils.ts
2.5625
3
import fetch, { RequestInit } from 'node-fetch'; export function fetchJson(url: string, method?: string, body?: any) { const options: RequestInit = { method: method || 'GET', headers: { 'Content-Type': 'application/json' } }; if (body) { options.body = JSON.stringify(body); } return fetch(url, options); }
34039617f5b5ef82c7674cfd0ce7dd7561bc5c60
TypeScript
modulexcite/Glimpse.Client.Prototype
/src/request/component-models/LoggingComponentModel.ts
2.625
3
'use strict'; import { ComponentModel } from './ComponentModel'; import { IGlimpse } from '../../IGlimpse'; import { ILoggingComponentModel, ILoggingLevelModel, ILogMessageModel, ILogMessageSpan } from './ILoggingComponentModel'; import { ILoggingComponentState } from './ILoggingComponentState'; import { ILogMessage, ...
a3658a3728f3bab65c317fd55079f6df39ed0ee7
TypeScript
Ionaru/array-utils
/src/functions/sort-array-by-object-property.spec.ts
3.34375
3
import { beforeEach, describe, expect, it } from 'vitest'; import { sortArrayByObjectProperty } from './sort-array-by-object-property.js'; describe('sortArrayByObjectProperty', () => { let unsortedArray: Array<{ value: number }>; beforeEach(() => { unsortedArray = [ { value: 2 }, ...
25838e90554041728e97dc7e717d819fdba9f37f
TypeScript
GongT/stillalive
/src/test.ts
2.71875
3
import { openSync, read } from 'fs'; import 'source-map-support/register'; import { PassThrough, Transform } from 'stream'; import { promisify } from 'util'; import { startWorking } from './index'; const chars = ['i', 'W', '啊', '깦', 'あ', '😂', '👍🏽', '😂\u0300', 'X\u0300', 'Y\u0300', '\uD834\uDD1E']; function getRan...
f16cffd893c2c4247232660ebf3dbaff8dd1c766
TypeScript
brannonjames/weather
/src/store/settings/settings.reducer.ts
2.65625
3
import {SettingActionType} from "./settings.actions"; const initialState = { showSplash: true, metric: false }; const settingsReducer = (state = initialState, action) => { const { type, payload } = action; switch (type) { case SettingActionType.SET_IS_METRIC: return { ...state, metric: payload }; ...
cf8a462cb8f336ede49080411b403e440b8ca559
TypeScript
glarimy/glarimy-typescript
/glarimy-typescript-11/main.ts
4.15625
4
interface Library { add(book:Book):void; list():Book[]; } class SimpleLibrary implements Library { protected _entries: Book[]; constructor(){ this._entries = []; } add(book: Book): void{ this._entries.push(book); } list(): Book[]{ return this._entries; } ...
9cf7bc799c459a6072fae54b755e2465589b1e5d
TypeScript
nguyer/aws-sdk-js-v3
/clients/browser/client-mediaconnect-browser/types/_Messages.ts
2.828125
3
/** * Messages that provide the state of the flow. */ export interface _Messages { /** * A list of errors that might have been generated from processes on this flow. */ Errors: Array<string> | Iterable<string>; } export interface _UnmarshalledMessages extends _Messages { /** * A list of errors that mi...
fe6f5c0bc34ff3e20630b73df828d2d8e4205b0d
TypeScript
qjebbs/vscode-plantuml
/src/plantuml/formatRules.ts
2.59375
3
import { RulesWriting, RuleBlockWriting, RuleWriting, compile } from './formatter/ruleCompiler'; import { ElementType } from './formatter/analyst'; let ruleVariables = { //line begin LB: /^\s*/.source, //line end LE: /\s*$/.source, ArrowLeft: /(?:(?:(?:\s+[ox]|[+*])|(?:<\|?|<<|\\\\|\\|\/\/|\})|(?:\...
6c31e4aac29b3d0c498823251e10e9748b3f4a5d
TypeScript
lynxtaa/inoreader-filter-api
/api/models/Rule.ts
2.53125
3
import { prop, modelOptions, getModelForClass } from '@typegoose/typegoose' import { models, Types } from 'mongoose' import { ArticleProp, FilterType } from '../types' @modelOptions({ schemaOptions: { _id: false } }) class RuleDef { @prop({ enum: ArticleProp, type: String }) prop!: ArticleProp @prop({ enum: Filte...
38feb102848831c8833be1616e3b72623155710c
TypeScript
hocup/space
/client/src/game/EventEmitter.ts
3.34375
3
export class EventEmitter<T> { private subscribers: ((event: T) => void)[] = []; subscribe(subscriber: (event: T) => void){ this.subscribers.push(subscriber); } unsubscribe(subscriberIndex: number) { this.subscribers[subscriberIndex] = null; } emit(event: T) { for(let...
a65a9dee8f63c8119144ddb8e11166a0e2f0f107
TypeScript
mediamonks/seng-router
/src/lib/AbstractRoute.ts
2.953125
3
import { Promise } from "es6-promise"; import RouteRequirement, { Assertion } from "./RouteRequirement"; import RouteParser from "./RouteParser"; import RouteStringifier from "./RouteStringifier"; import GroupName from "./GroupName"; import IRouteTranslator from "./locale/IRouteTranslator"; import RouteValue from "./R...
095660181e41d3d29a49113aed983efdb9ed8eb3
TypeScript
lqxue/JsonToDart
/src/converter.ts
2.65625
3
const camelcase = require('camelcase'); class JsonToDart { classNames: Array<String> = []; classModels: Array<Result> = []; indentText: String; shouldCheckType: boolean; nullSafety: boolean; includeCopyWitMethod: boolean = false; mergeArrayApproach: boolean = true; nullValueDataType: St...
ce2d18134cdd5677e13286c410fa37e0b415b3e0
TypeScript
darkmarthur/TestGCF
/functions/src/test.ts
3.3125
3
async function myFunction(): Promise<string> { try { const rank = await myRank() return "firebase " + rank } catch (error) { return "error " + error } } function myRank() { // return Promise.resolve(1) return Promise.reject(":V") }
ec5a6477f8e6de08d422589e36a87e3135d5da15
TypeScript
le-ar/telegram-types-generator
/lib/parsers/parser_parameters.ts
3.0625
3
import { ParserHtml, ParserHtmlType } from "./parser_html"; class ParserParameters implements ParserHtml { parserParameter: ParserHtmlType; constructor(parserParameter: ParserHtmlType) { this.parserParameter = parserParameter; } parseHtmlToObject(html: string): { [key: string]: any } { ...
5050f89bf26c70c58f8a69d8ede9e372f2b164e1
TypeScript
Celleb/tsjs-di
/e2e-src/js-providers.ts
2.515625
3
/** * js-providers.ts * * @author Jonas Tomanga <celleb@mrcelleb.com> * @copyright (c) 2018 Jonas Tomanga * All rights reserved * @license MIT */ import { DI } from '../dist'; export class Engine { capacity = 2.5; constructor() { } } export class Car { private _name: string; constructor(...
378e3cf314b6011777e30c948423af6fd5a5d182
TypeScript
Shopify/quilt
/packages/react-cookie/src/hooks.ts
2.609375
3
import {useContext, useState, useCallback} from 'react'; import type {CookieSerializeOptions} from 'cookie'; import {CookieContext} from './context'; const NO_MANAGER_ERROR = [ 'Could not find react-cookie context.', 'You might be missing the <CookieUniversalProvider />', 'component in your application componen...
28f3df652abb69a9394e6294219c8ca47171247c
TypeScript
Sevda-HHH/RoomReservationGroupWork
/room_reservation_group_work/src/modules/reservations/reducer/index.ts
2.6875
3
import React from "react"; import { ACTION_TYPES } from "../../models/enumActions"; import { initialState } from "../../models/initalState"; import { IAction } from "../../models/types"; const reducer = (state = initialState, action: IAction) => { switch (action.type) { case ACTION_TYPES.ADD_RESERVATION: r...
c9b220388291f9d7759dee45b398708b6e881bb4
TypeScript
zoxjs/zox
/lib/Responses/RedirectResponse.ts
2.6875
3
import {IResponse} from "./IResponse"; import {OutgoingHttpHeaders, ServerResponse} from "http"; export class RedirectResponse implements IResponse { public statusCode: number; public headers: OutgoingHttpHeaders; public location: string; constructor(location: string, statusCode: number = 303...
9ba80e0941a7815138bacd18ec030669d4dd1906
TypeScript
cschleiden/imperaplus-client
/src/services/eventService.ts
3.109375
3
export interface IEventHandler<TPayload> { (payload?: TPayload): void; } export class EventService { private static _instance: EventService; public static getInstance(): EventService { if (!EventService._instance) { EventService._instance = new EventService(); } return...
a8863f5e16491c8a4301a6e0e61f9eed7fc19321
TypeScript
LuizCorrea-Dev/my-portfolio-code
/src/services/data/navigation.ts
2.59375
3
/** @format */ import navigationEnglish from '../../assets/data/navigationEnglish'; import navigationPortuguese from '../../assets/data/navigationPortuguese'; import { Language } from '.'; export interface Navigation { name: string; link: string; } export default function getNavigation(language: Langu...
546f1879ac43ac0b0f3fbfda1d2f33c9726c9d47
TypeScript
AhmadCR7/SFSU-Market
/application/server/src/database/entities/ListingImage.ts
2.625
3
import { PrimaryGeneratedColumn, Entity, CreateDateColumn, UpdateDateColumn, Column, BaseEntity, OneToMany, ManyToOne, } from 'typeorm' import { Listing } from './Listing' @Entity() // extend allows base sql commands link find() and insert() export class ListingImage extends BaseEntity { @PrimaryGene...
65246ebcc701540438174fb30cca0df466e4d67d
TypeScript
ilyesbrh/FarmyAi-Frontend
/src/app/Store/Actions/DetectionList.Action.ts
3.109375
3
import { detection } from '../model'; import { Action } from '@ngrx/store'; /** * For each action type in an action group, make a simple * enum object for all of this group's action types. */ export enum DetectionActionTypes { All = '[Detection] All', Notification = '[Detection] Notification', Add = '[De...
b34f35d923b549e49abf52f7ca90636faf305e7d
TypeScript
sarathganapathy/javascript-codility
/servers/server/types/auth.ts
2.703125
3
/** * @interface * @def interface for login data */ export interface PassportUserData { expires: string; role: string; username: string; } /** * @interface * @def interface for isAuthenticated object */ export interface IsAuthenticatedObject { isAuthenticated: boolean; username: string; } /...
0fc6777873f2b9c3cc0482468d9fa717ff3e4aeb
TypeScript
hobbydev71/portfolio
/src/pages/api/skills.ts
2.578125
3
import type { NextApiRequest, NextApiResponse } from 'next'; export default (req: NextApiRequest, res: NextApiResponse) => { const technologies = [ 'JavaScript', 'TypeScript', 'GraphQL', 'RESTful APIs', ]; const frameworks = ['React', 'Vue.js', 'Next.js', 'Gatsby', 'Svelte']; const databases = ['MySQL', 'M...
f474bbe24a867e9b3e0f1c03380bb1f94487b717
TypeScript
VinhoSantos/BattleRoyal
/src/client/src/scripts/player.ts
2.765625
3
import Render from './render'; import { GameHelper } from './helper'; import * as signalR from '@aspnet/signalr'; export class Player { coX: number; coY: number; posX: number; posY: number; gotoCoX: number; gotoCoY: number; vision = 2; speed = 1; private render: Render; isMovin...
3cfe0cf4325a5d598d38199d98815f33c920eed1
TypeScript
NerdWalletOSS/shepherd
/src/util/for-each-repo.ts
2.84375
3
import chalk from 'chalk'; import fs from 'fs-extra'; import { IRepo } from '../adapters/base'; import { IMigrationContext } from '../migration-context'; type RepoHandler = (repo: IRepo) => Promise<void>; interface IOptions { warnMissingDirectory?: boolean; } export default async ( context: IMigrationContext, ...
45dc722d203908d81c2c97d6b8bada3219c94d4c
TypeScript
Iittlefish/toDoList-backend
/src/user.ts
2.8125
3
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm' @Entity() export default class User { @PrimaryGeneratedColumn('increment', { type: 'int', unsigned: true }) uid: number; @Column({ type: 'string' }) account: string; @Column({ type: 'string' ...
7b5941c204f2c42ed94ae2fbbb37a18f95f45dc5
TypeScript
lizzzp1/tslint-microsoft-contrib
/src/preferArrayLiteralRule.ts
2.8125
3
import * as ts from 'typescript'; import * as Lint from 'tslint'; import * as tsutils from 'tsutils'; import { AstUtils } from './utils/AstUtils'; import { ExtendedMetadata } from './utils/ExtendedMetadata'; import { isObject } from './utils/TypeGuard'; interface Options { allowTypeParameters: boolean; } export c...
6ffbd236a76c239fefbe95802ac909908affaae3
TypeScript
vesanieminen/web-components
/packages/app-layout/test/typings/app-layout.types.ts
2.53125
3
import '../../vaadin-app-layout.js'; import { AppLayoutDrawerOpenedChangedEvent, AppLayoutOverlayChangedEvent, AppLayoutPrimarySectionChangedEvent } from '../../vaadin-app-layout.js'; const assertType = <TExpected>(actual: TExpected) => actual; const layout = document.createElement('vaadin-app-layout'); layout...
70c4fd0c3e9d245cf531672d44aaac5d04a62c91
TypeScript
amulyk/mariam-arabidze-personal-projectt-typescript
/source/main.ts
2.78125
3
import {subjectsModel, LMSModel, teachersModel, pupilsModel, groupsModel, gradebooksModel} from './school'; //test subjectsModel const math = new subjectsModel({title: "math", lessons: 24, description: "kj"}); const physics = new subjectsModel({title: "physics", lessons: 20, description: "kk"}); //console.log(math.s...
72a9528bde818e901fb01926397f2e12c131fe17
TypeScript
stephaneeybert/pierrepapierciseaux
/src/app/views/game/game.component.ts
2.640625
3
import { Component, OnDestroy, OnInit } from '@angular/core'; import { GameService } from '@app/core/service/game.service'; import { timer, Observable, Subscription, of } from 'rxjs'; import { Score } from './score'; import { ScoreStore } from '@app/core/store/score-store'; const WEAPON_ROCK: number = 1; const WEAPON_...
947b7a1403df6c0a20bcc6009f57f00a3d163c8b
TypeScript
frankPairs/parkbee-assessment
/src/store/garages/transactions/types.ts
2.625
3
/* State */ interface GaragesTransactionsState { data: { [doorId: string]: string | undefined } | null; } /* Actions */ enum GaragesTransactionsActionTypes { START_PARK = 'startPark', STOP_PARK = 'stopPark', } interface StartParkAction { type: GaragesTransactionsActionTypes.START_PARK; payload: { doorId: st...
2b85413fd0c6abdee04c8aaee4a47a64a70b1001
TypeScript
xiaochengbeier/tetris
/src/Square.ts
2.859375
3
import { IWiver, Point } from "./Types"; export class Square{ private _point:Point; private _color:string; private _IWiver:IWiver ; constructor(point:Point,color:string){ this._point = point; this._color = color; } getColor(){ return this._color; } getPoint(){ ...
959a7daff88fa506c2585e24801aa50dfc9a8c29
TypeScript
caizhengxin/vscodefileheader
/src/template.ts
2.53125
3
/** * @Author: JanKinCai * @Date: 2021-04-22 23:41:46 * @Last Modified by: JanKinCai * @Last Modified time: 2021-07-06 13:39:42 */ import * as vscode from 'vscode'; import * as path from 'path'; import * as fs from 'fs'; import * as art_template from 'art-template'; import * as editor from './editor'; class ...
9b50fe0b7fdb5a87391a56f895df6ab565b3227a
TypeScript
ThiagoMoraes21/Angular7
/Angular-Crash-Course/Typescript-Fundamentals/variable-declarations/main.ts
4.15625
4
// Studing variable scope // Implementing a function using the 'var' keyword function doSomething() { // the variable 'i' scope looks for the closest function // which means that the variable is avaible to every element on this function for(var i = 0; i < 5; i++) { console.log(i); } cons...
2cb358b3433e4cd03a0e02701fde9736f29b3660
TypeScript
Reeyou/Reeyou_blog_koa2
/src/controller/comment.ts
2.53125
3
/* eslint-disable no-undef */ import Comment from '../models/comment' import Reply from '../models/reply' import ServerResponse from '../common/serverResponse' export default class CommentController { /** * 获取评论列表 */ static async getCommentList(ctx: any) { const { pageSize, limit } ...
7454850d92c6fefa3d7b299051cb4af4125d547d
TypeScript
rmeja/ngx-callisto
/dist/app/modules/overlay/popup/popup.component.d.ts
2.53125
3
import { TemplateRef, EventEmitter } from '@angular/core'; import { Subject } from 'rxjs'; import { FormGroup } from '@angular/forms'; /** * Display a popup * @example * popup.open().subscibe(result=>{ * | // result = undefined or 'ok' * }) * <popup #popup> * | <div title>Some templating</div> * | <div body>...
fc037eb8809fc751e7702b985598d2f2b2c3bb02
TypeScript
verneleem/slash-boilerplate
/src/utils/onDeleteUpdateCache.ts
2.609375
3
import { ApolloCache, FetchResult } from '@apollo/client'; export function update<TData = Record<string, any>>( cache: ApolloCache<TData>, results: FetchResult<TData, Record<string, any>, Record<string, any>>, ) { const data: { [key: string]: any } = results?.data || {}; for (const [, mutations] of Object.entr...
2f7e921f2cdb0c54f66597c1a37748ed10078348
TypeScript
ECCC-CSSP/CSSPTools
/src/webs/CSSPWebToolsAng/client-apps/src/app/enums/generated/ClassificationTypeEnum.ts
2.640625
3
/* * Auto generated C:\CSSPTools\src\codegen\GenerateAngularEnums\bin\Debug\net6.0\GenerateAngularEnums.exe * * Do not edit this file. * */ import { AppLanguageService } from 'src/app/services/app/app-language.service'; import { EnumIDAndText } from 'src/app/models/generated/models/EnumIDAndText.model'; import { ...
07ed005027614f826a07aacd1dd1ce24ccb68227
TypeScript
HELL0ANTHONY/REST-API-with-Node-and-Typescript
/src/models/Project.ts
2.609375
3
import { Model, DataTypes as Type } from "sequelize"; import { sequelize } from "../database"; import Task from "./Task"; interface ProjectAttributes { id: number; name: string; priority: number; deliveryDate: Date; description: string | null; } interface ProjectInstance extends Model<ProjectAttributes>, ...
e0b6fc010a71f27b2c0d86bfd4f2cc6e2241d33a
TypeScript
tsiozos/print-sensors-server
/main.ts
2.671875
3
//initialization let stations: Array<number> let lastsync: Array<number> radio.setGroup(1) radio.setTransmitPower(7) radio.sendValue("SYNC",input.runningTime()/100) radio.sendValue("WAKE", 0) function printStations() { serial.writeLine("Registered Stations \n\r ---------") for (let i=0; i<stations.length; i+...
080a5434d86aba397721acd2738a21e56e8c83ca
TypeScript
McGalanes/clean-node-ts
/src/presentation/controllers/book/BookController.spec.ts
2.65625
3
import { GetBooksUseCase } from "../../../domain/usecases/book"; import { BookController } from "./BookController"; import { BookEntity } from "../../../data/repositories/book"; import { HttpResponse } from "../../protocols/http"; import { mock } from "../../../utils/mock-utils"; describe('BookController', () => { ...
cbaac926f9c2a4c70f779590ba87314e04272470
TypeScript
elena-roman/calculator
/src/app/calculator/operations/operation.ts
3.296875
3
export class Operation { protected value: number; private _operator: string; constructor(operator: string,value: number) { this._operator = operator; this.value = Number(value); } get operator(): string { return this._operator; } toString(operator: string) { ...
3992ef58c97323a77d1fff561465097931df3854
TypeScript
XuPeiYao/ngx-hm-tree
/src/app/shared/ts/element.insertAfter.ts
2.609375
3
export function insertAfter(newEl, targetEl) { const parentEl = targetEl.parentNode; if (parentEl.lastChild === targetEl) { parentEl.appendChild(newEl); } else { parentEl.insertBefore(newEl, targetEl.nextSibling); } }
4764ffaabe6c2a2634fa10fa651226bcc42118cf
TypeScript
lekiert/quickstep-client
/src/app/components/core/exercise/exercise-forms/brackets/brackets-form.component.ts
2.796875
3
import {Component, Input} from "@angular/core"; import {ExerciseFormInterface} from "../exercise-form.interface"; import {Exercise} from "app/exercise"; const styles = require('./brackets-form.component.scss'); const template = require('./brackets-form.component.html'); @Component({ selector: 'brackets-form', tem...
acbd46eaa3db3bb56e813ea59a1326dfa3165abb
TypeScript
saudahabib/quotes
/src/app/quote.ts
2.515625
3
export class Quote { public showAuthor: boolean; public showSubmitter: boolean; constructor( public id: number, public quote: string, public author: string, public submitter: string, public timePassed: Date, public likes: number, public hates: number ){ this.showAuthor= false; ...
d5afcb7624eec6f490af625da40ee17594dae583
TypeScript
pagoru/pixi3d
/src/skinning/skin.ts
2.90625
3
import { Mat4 } from "../math/mat4" import { Container3D } from "../container" import { Joint } from "./joint" /** * Represents a skin used for vertex skinning. */ export class Skin { /** * Creates a new skin. * @param parent The parent container node for the skin. * @param joints The array of joints incl...