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
8c074e44a294c9c0c1a3d4db818eb741c6b8672a
TypeScript
Kjina/thejoeun_typescript_ang2
/Animal.ts
4.53125
5
interface Animal{ //? 를 붙이면 선언해도되고 안해도됨 name:string; age:number; height:number; printInfo():void; } class Cat implements Animal{ name:string; age:number; height:number; constructor(name:string, age:number){ this.name = name; this.age = age; } printInfo(){ ...
8953d73da14f097bc6d147376f44b2d249397f59
TypeScript
shwoop-ltd/adventure-app-services
/src/lambdas/maps/get-challenge-prizes.lambda.ts
2.59375
3
import controller, { ApiResponse, ApiRequest } from '../-helpers/request-handler'; import { Persistence } from '../../core/persistence'; export async function get_challenge_prizes(event: ApiRequest, model: Persistence): Promise<ApiResponse> { // TODO: Get info about user const { map, id } = event.path; if (!ma...
d759fc31506311b5bf098a3fa1fd1f73a4c1cf69
TypeScript
Kalayagam/task_manager_web
/TaskManagerWeb/src/app/pipes/search-user.pipe.ts
2.625
3
import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'searchUser' }) export class SearchUserPipe implements PipeTransform { transform(items: any[], searchText: string): any[] { if(!items) return []; if(!searchText) return items; searchText = searchText.toLowerCase(); return items.f...
122512c41d6be4a45c381766fe36d3c122ce6a4e
TypeScript
MilanMirkovic/CrowdFunding
/client/src/app/models/commentar.model.ts
2.640625
3
import { ProjectInterface } from './project.model'; import { UserInterface } from './user.model'; export interface CommentarInterface{ id?:number; commentar?:string; project?:ProjectInterface; user?:UserInterface; } export class Commentar implements CommentarInterface{ id:number; commentar:st...
980ca69fc96cf0c5e9c689bc7aa1cb52d157a529
TypeScript
tsnobip/vscode-rescript-relay
/src/__tests__/graphqlUtils.test.ts
2.859375
3
import { buildSchema, parse, print } from "graphql"; import { addFieldAtPosition } from "../contextUtilsNoVscode"; const mockSchema = buildSchema(` type Dog { id: ID! name: String! } type Cat { id: ID! name: String! } union Pet = Dog | Cat """ A user. """ type User { id: ID! """ The age of the user. ...
3274842e841a14c7aee5935e7a165986fcf05ca7
TypeScript
DerrickDaKing/gowon
/src/commands/Lastfm/Stats/Scrobbles.ts
2.6875
3
import { Message } from "discord.js"; import { Arguments } from "../../../lib/arguments/arguments"; import { timeRangeParser, humanizedTimeRangeParser, parseDate, } from "../../../helpers/date"; import { dateDisplay, numberDisplay } from "../../../helpers"; import { LastFMBaseCommand } from "../LastFMBaseCommand"...
a0f92216045d15690e27c5adacd6e966a1f7139f
TypeScript
TautvydasDerzinskas/make-youtube-great-again
/src/services/common/drag.service.ts
3.015625
3
class DragService { public makeElementDraggable(element: HTMLElement, onDragCallback?: (x: string, y: string) => void) { let initX = 0; let initY = 0; let firstX = 0; let firstY = 0; element.addEventListener('mousedown', function (e: MouseEvent) { e.preventDefault(); initX = this.off...
0c67880f609fe3f0d8ca592137006b0f59b59c9c
TypeScript
kamilpraczyk/Crush
/src/lessons/tense/beGoingTo/beGoingToOneToThree.ts
2.6875
3
import { RawData } from '../../../types'; import { space, TypeId, id, capital, getNameFemale, getNameMale, getCountry, getPossessiveNameMale, getCity } from '../../helper/constants'; import explenation = require('./explenation'); import _ = require('underscore'); const separator = " "; const postfix = "."; const commo...
f776f008a9ac3603b6e49e70ddf5ae6dc7114f0c
TypeScript
Mygi/OnlineStore
/src/app/global/contracts/services/storage.provider.ts
2.921875
3
import { JsonConvert, OperationMode, ValueCheckingMode } from 'json2typescript'; import { Type } from '@angular/core'; export interface ISerialisable { deserialiseJson(json: string, objectType: any); serialiseJson(data: any); } /** * A (nearly) purely abstract class becuase interfaces are somewaht useless * ...
0cdfd72df7b5bc7ae0c910ef39e3637cd34513b8
TypeScript
skychx/Toy-Data-Structures
/02-LinkedList/ToyLinkedList.ts
3.71875
4
/* * @Author: skychx * @Date: 2021-02-03 22:10:00 * @LastEditors: skychx * @LastEditTime: 2021-06-16 22:56:09 * @FilePath: /Toy-Data-Structures/02-LinkedList/ToyLinkedList.ts */ import isEqual from 'lodash/isEqual'; // 这里把 null 也看成树节点 export type Node<T> = LinkedNode<T> | null; export type E<T> = T | null; // 链...
9012d40470228745503b831eddbd95708bee5714
TypeScript
stormhouse/FP-Glossary
/src/app/glossary/monad.component.ts
3.40625
3
import { Component } from '@angular/core'; @Component({ selector: 'app-monad', template: ` <h1>Monad</h1> <p>A monad is an object with of and chain functions. chain is like map except it un-nests the resulting nested object.</p> <pre><code class="language-javascript">{{code_one}}</code></pre> <p>of is also known a...
4bcb54ed33c89a74a62f9f6266e82274cdaf367e
TypeScript
SimonNadeau/projet2
/Cadriciel/client/src/app/race/event-handler/view-handler.ts
2.78125
3
import { TypingHandler } from "./typing-handler"; import { CameraState } from "../class/camera/cameraState"; const ZOOM_IN_KEYCODE: number = 187; // + const ZOOM_OUT_KEYCODE: number = 189; // - const CAMERA_CYCLE_KEYCODE: number = 67; // C export const VIEWCODES: number[] = [ZOOM_IN_KEYC...
f87ded937ff55fa294c2a33564aaa68055ac27ad
TypeScript
adamko034/adona
/src/app/core/store/reducers/auth/auth.reducer.spec.ts
2.53125
3
import { authActions } from 'src/app/core/store/actions/auth.actions'; import { userActions } from 'src/app/core/store/actions/user.actions'; import { TeamNameUpdateRequestBuilder } from 'src/app/core/team/model/requests/update-name/team-name-update-request.build'; import { UserTeamBuilder } from 'src/app/core/user/mod...
3f33b17431b61cb91fe791dbbd5e48912ce5912c
TypeScript
pmh-only/githubStarCalculator
/src/utils/ghapi.ts
2.578125
3
import { Config } from '../type/types.ts' import { ACCEPT, OAUTH_BASEURL, API_BASEURL, USER_AGENT } from '../constant/const.ts' async function _fetch (url: string, token: string) { return await fetch (API_BASEURL + url, { method: 'GET', headers: new Headers({ Accept: ACCEPT, 'User-Agent': USER_AG...
0f3ec398cb2db55a0288c171c5492bbcff40b4f2
TypeScript
wavesplatform/node-api-js
/src/api-node/leasing/index.ts
2.671875
3
import {TLong} from '../../interface'; import request from '../../tools/request'; /** * GET /leasing/active/{address} * Get all active leases for an address */ export function fetchActive(base: string, address: string, options: RequestInit = Object.create(null)): Promise<Array<ILeaseInfo>> { return request({ba...
d3e9a5498d3d545b81803342aa487919cf314551
TypeScript
highhi/react-graphql-firebase
/functions/src/app.ts
2.515625
3
import express from 'express' import helmet from 'helmet' import logger from 'morgan' import router from './routes' import { HttpError } from 'http-errors' const port = 3001 const app = express() app.use(helmet()) app.use(logger('combined')) app.use(express.json()) router(app) function onError(error: HttpError) { ...
31d26920caa92046eb568a0c00e77a7def16cc33
TypeScript
Nicolas-Baudvin/memento-front-reworked
/src/Components/Signup/utils/index.ts
2.625
3
import { InputName } from "../../Login/Form/types"; const inputs: Array<InputArrayProps> = [ { type: "email", label: "Email", placeholder: "exemple@gmail.com", tooltip: "L'email doit être valide", htmlFor: "email", }, { type: "password", label: "Mot de passe", placeholder: "••••••...
f66a0dc6026978fff48f31d0cb91ff095a4afaad
TypeScript
rodrigooler/monetify-imagini
/src/index.ts
2.59375
3
import { Background } from "./core/constructor/Background"; import { IBackground } from "./core/interface/IBackground"; import { GroupComponent } from "./core/component/GroupComponent"; import { Gender } from "./core/enum/Gender"; import { IUser } from "./core/interface/IUser"; const backgroundExemple: IBackground = {...
8ff08e81fd16c6682a49205ac81499bf65f01f82
TypeScript
KovalovIE/cleanArch
/modules/splashView/factory/splashScreenFactory.ts
2.59375
3
import { IRepository } from "../../common/stores/defaultRepository/IRepository"; import { MobXRepository } from "../../common/stores/defaultRepository/MobXRepository"; import { ISplashScreenPresenter, SplashScreenPresenter } from "../presenter/splashScreenPresenter"; import { ISplashScreenUseCase, splashScreenUseCase }...
cfa330a06f2ee1283fafb1bce5811299492fbbd9
TypeScript
tomsTestAccount/angular_wp
/src/app/_services/rt-form-validators.service.ts
2.59375
3
import { Injectable } from '@angular/core'; import {FormControl, Validators, AbstractControl,FormGroup} from '@angular/forms'; const dbgPrint_Validation = false; @Injectable() export class rtFormValidators { constructor() { } validateArray(c: FormControl) { let retValue = null; //= {notValid: t...
679eb5107a6ad957a391fdcfa86cd08e37a2e0fc
TypeScript
claranceliberi/ts-hub
/01. basics/03. non-exception-failures/legitimate-bugs/logicErrors.ts
3.296875
3
const value = Math.random() < 0.5 ? "a" : "b"; if (value !== "a") { // ... } else if (value === "b") { // This condition will always return 'false' since the types '"a"' and '"b"' have no overlap. // Oops, unreachable }
95deb8f3100cb9fc0171445f12dc02eed0de7f99
TypeScript
uStudioTeam/ts4ocds
/packages/utils/src/initializable/initializer.d.ts
2.890625
3
/** * @packageDocumentation * @module Utilities.Initializable */ /** * A type that picks all properties from an object that are not methods. */ export type Initializer<T> = Pick< T, NonNullable<{ [K in keyof T]: T[K] extends (...args: any[]) => any ? never : K }[keyof T]> >;
cf5f3f734538f012e1d43984f73183615788ebee
TypeScript
singtolee/CONSOLE
/src/app/editable-number/editable-number.component.ts
2.71875
3
import { Component, Input, forwardRef } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' const VALUE_ACCESSOR = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(()=>EditableNumberComponent), multi: true } @Component({ selector: 'app-editable-number', templa...
a65febd2dc9c22aaf2d71f847aba901b5a5b5a75
TypeScript
softmarshmallow/uguu-api
/example/index.ts
2.875
3
import { upload } from "../lib" import * as fs from "fs" const TEST_TXT_FILE_CONTENT = `# Read Me !!` const TEST_TXT_FILE_NAME = `file.txt` async function example() { try { // const file = Buffer.from(TEST_TXT_FILE_CONTENT) const file = fs.createReadStream('./example/file.txt') // const bl...
f1fd952c72e1cef9b0bab0d315b83c213dc996a0
TypeScript
raffecat/manglr-v0
/src/ast.ts
2.875
3
'use strict'; // abstract types. export type AttrMap = Map<string, string>; export interface Node { tag: string; } export interface Element extends Node { attribs: AttrMap; children: Node[]; } // concrete HTML types. export class Fragment implements Element { readonly tag: string = '#document'; attribs:...
92bc62d3ab157fd9c9ffb8ec17c2989b9f346819
TypeScript
scaleapi/scaleapi-node
/src/core/schemas/builders/object/property.ts
2.828125
3
import { Schema } from "../../Schema"; export function property<RawKey extends string, RawValue, ParsedValue>( rawKey: RawKey, valueSchema: Schema<RawValue, ParsedValue> ): Property<RawKey, RawValue, ParsedValue> { return { rawKey, valueSchema, isProperty: true, }; } export int...
e5167081af02ecd11efaa80422b7309018e6a39d
TypeScript
agilearchitects/intra
/src/shared/dto/update-time.dto.ts
2.84375
3
import { jsonType } from "@agilearchitects/server"; // DTO's import { IDictionaryDTO } from "./dictionary.dto"; export interface IUpdateTimeDTO { id: number; taskId: number; from: string; to?: string; comment: string; userId: number; tags?: (string | number)[]; rate?: number; } export class UpdateTim...
7a2c7ae699468554d0e3d4f12373112442a336df
TypeScript
emberjs/ember.js
/packages/@ember/-internals/glimmer/lib/helpers/helper.ts
3.15625
3
/** @module ember */ /** Use the `{{helper}}` helper to create contextual helper so that it can be passed around as first-class values in templates. ```handlebars {{#let (helper "join-words" "foo" "bar" separator=" ") as |foo-bar|}} {{!-- this is equivalent to invoking `{{join-words "foo" "bar" separator=" ...
106c56ecf1c3dd45f17c25d57d2a2ff060eda66b
TypeScript
porizi/mini-cms
/src/lib/cms/models.ts
2.890625
3
export interface ICmsDataDbModel { _id : string error?: string // Useful for checking if the mongodb operation caused an error } export class IRequestResponseStatus { static OK :string = 'OK'; static ERROR:string = 'ERROR'; } export interface IRequestResponse { data? : any // Data to be sent back to ...
809936cb4ce02332ee6d55b1fb9a5a11df56b2d1
TypeScript
Mercerenies/calculator-ts
/src/Numerical/Complex.ts
3.578125
4
import NumberLike from './NumberLike' import Floating from './Floating' export default class Complex implements NumberLike<Complex> { readonly real: number; readonly imag: number; constructor(real: number, imag: number) { this.real = real; this.imag = imag; } add(that: Complex): Complex { ret...
9fd62e0b7cd2e4f77da3a57d541971b3bf46641c
TypeScript
poop9/poop-server
/src/models/User.ts
2.59375
3
import { Column, Entity, PrimaryGeneratedColumn, Unique } from 'typeorm'; import { Base } from './Base'; @Entity() @Unique(['uuid']) export class User extends Base { @PrimaryGeneratedColumn() id!: number; @Column({ length: 50 }) nickname!: string; @Column() uuid!: string; }
89cc80e79d482c682b7abc3d009e0487b03ca501
TypeScript
kipprice/toolkip.ts
/src/typescript/html/_interfaces.ts
3.296875
3
namespace KIP { //.......................................... //#region INTERFACES AND TYPES export type IAttribute = IKeyValPair<string> | string | number; export interface IAttributes { [key: string]: IAttribute; } export type IChild = StandardElement | IElemDefinition | Drawable;...
86ab090e645caef39f92338737be559fe53843d9
TypeScript
juanpms2/test-integracion-continua-ejemplo
/src/pages/members/list/selectors.spec.ts
2.578125
3
import { getMembersState, getMembersList, getMembersListVM, getServerError, } from './selectors'; import { State } from '../../reducers'; import * as mappers from './mappers'; import { Member } from './viewModel'; describe('Members selectors', () => { describe('getMebersState', () => { it('should return ...
5f5d057945168a1473f92d920d173711d95dfd00
TypeScript
evollu/typesafe-actions
/src/create-action.ts
3.21875
3
import { StringType, ActionCreator } from './types'; import { action } from './action'; /** * @description typesafe action-creator factory */ export function createAction< T extends StringType, AC extends ActionCreator<T> = () => { type: T } >( type: T, creatorHandler?: ( action: <P = void, M = void>( ...
4e0abfef64543e343aacc4c5b0a138b20fff3aef
TypeScript
kennylerma/assemblyscript
/src/compiler.ts
2.59375
3
import { compileCall as compileBuiltinCall, compileGetConstant as compileBuiltinGetConstant } from "./builtins"; import { PATH_DELIMITER } from "./constants"; import { DiagnosticCode, DiagnosticEmitter } from "./diagnostics"; import { Module, MemorySegment, ExpressionRef, UnaryOp, BinaryOp, Nat...
b81dbacd06f948c5104f25ae3258d417a3313dc1
TypeScript
TrueChat/Frontend
/src/services/UserService.ts
2.5625
3
import {RegistrationData} from "./AuthService"; import {ConstraintViolation, Request, Response, ResponseHandler} from "./types"; export interface Image { imageURL: string } export type UserProfile = { first_name: string, last_name: string, username: string, about: string, images: Image[] } export type Su...
febe19375c66f381cb95611ed05d6e30ec33f702
TypeScript
essitepp/Fullstack
/osa9/patientor-backend/src/utils.ts
2.96875
3
import { Entry, EntryType, Gender, HealhtCheckRating, HealthCheckEntryInput, OccupationalHealthEntryInput, HospitalEntryInput, NewEntryInput, NewPatientInput, SickLeave, Discharge, HealthCheckEntry, Diagnosis, BaseEntry, HospitalEntry, OccupationalHealthEntry, } from "./types"; type PatientFields = { name: unknown, da...
c3d1fcb3b92e4eca9c6ed75b4cf8a7d7bec68e22
TypeScript
boilerz/tsconfig
/src/generate.ts
2.640625
3
import fs from 'fs'; import util from 'util'; import type { PackageJson } from 'type-fest'; import packageJson from '../package.json'; import cliConfig from './cli'; import { Config } from './common'; import defaultConfig from './default'; import reactNativeConfig from './react-native'; const mkdirAsync = util.promi...
a2fff413a899a9e270c9e2556b54aaed0d382b79
TypeScript
ls-espirit/fsxa-ui
/src/documentation/routes.ts
2.921875
3
const components = [ { label: "Accordion", path: "/components/accordion", meta: { description: "provides an item with a title which, when clicked, expands to show the element text.", }, children: [], }, { label: "Button", path: "/components/button", meta: { desc...
ce2020d2d015755eb7693acb38de7cb6ab615177
TypeScript
matiashrnndz/flight-data-app
/FlightDataMW/Services-Api/src/controller/flightController.ts
2.515625
3
import axios from 'axios'; import * as convert from 'xml-js'; import { Logger } from '../logger/loggerApi'; export class FlightController { constructor() { } async deliver(url: string, flight, protocol: string) { axios.post(url, flight, { headers: { "Content-Type": protocol } }) ...
30ea58a68a3cfcb77237fc2f2e9ca9c9f6097f94
TypeScript
amarczuk/that-build-library
/src/utils/clean.ts
2.890625
3
import * as fs from 'fs' import * as del from 'del' /** * Clean a folder (remove its contents) */ export async function clean(fld: string, leaveRoot: boolean = false) { if (!leaveRoot) { await del([fld]) } else { const promises = [] fs.readdirSync(fld).forEach(child => { promises.push(del(fld + '/' + chil...
2ee38c9b57e75ef6daa9355bad9ee90d420b82d9
TypeScript
SocialGouv/archimail-pst-extractor
/src/ColumnDescriptor.ts
2.71875
3
import long from "long"; import type { NodeInfo } from "./NodeInfo"; export class ColumnDescriptor { private readonly _ibData: number; public get ibData(): number { return this._ibData; } private readonly _cbData: number; public get cbData(): number { return this._cbData; } ...
879e6c8e9561e7fd4974368f4aca95837123e209
TypeScript
tmplinshi/vscode-autohotkey
/src/parser/model.ts
2.890625
3
import * as vscode from "vscode"; export interface Script { methods: Method[]; refs: Ref[]; labels: Label[]; variables: Variable[]; blocks: Block[]; } export interface Variable { name: string; document: vscode.TextDocument; line: number; character: number; method: Method; isGlobal: boolean...
dcbe9c8a55bebb076fd21501bd7a5ca929415832
TypeScript
anupvarghese/recipeql
/src/schema.ts
2.71875
3
import axios from "axios"; import { GraphQLInt, GraphQLList, GraphQLObjectType, GraphQLSchema, GraphQLString } from "graphql"; import qs from "querystring"; interface IQueryArgs { ingredients: string[]; dish: string; page: number; } interface IRecipeResponse { results: [ { title: string; ...
460b76200994433ddc425b913c36f2a80c3ea75e
TypeScript
anderjason/observable
/src/ReadOnlyObservable/index.ts
2.765625
3
import { ObservableBase } from "../Observable"; import { asyncGivenObservable } from "../Observable/_internal/asyncGivenObservable"; import { TypedEvent } from "../TypedEvent"; export class ReadOnlyObservable<T> implements ObservableBase<T> { static givenObservable<T>( observable: ObservableBase<T> ): ReadOnly...
0eb3baa7ebbfd920db1fa529546577776225fb10
TypeScript
green-fox-academy/jkerezsi
/week-03/day-03/trees.ts
3.40625
3
'use strict'; // trees = [ // {type:'American Hornbeam', color:'brown', age: '12', sex:'male'}, // {type:'Gingko', color:'green', age: '10', sex:'female'}, // {type:'Honey Locust', color:'light green', age: '444', sex:'male'}, // {type:'Japanese Pagoda', color:'yellow', age: '232', sex:'female'}, // {type:'Hardy Rubbe...
aaaa8c4743e1f5aebfde99359f400699983dbd87
TypeScript
Hawkie/WebLib
/src/ts/gamelib/Actors/Helpers/Angle.test.ts
2.6875
3
import { VerticallyAligned } from "./Angle"; test("right", () => { const a: number = 90; const result: boolean = VerticallyAligned(a); expect(result).toBe(false); }); test("left", () => { const a: number = -90; const result: boolean = VerticallyAligned(a); expect(result).toBe(false); }); test...
6370a8fa3f26c6891b6b3882d363d173533bc1c8
TypeScript
kalleguld/threeJS-crash-test
/view/app.ts
2.59375
3
class ThreeTest { readonly content: HTMLElement; numTests = 0; scene: THREE.Scene; camera: THREE.PerspectiveCamera; renderer: THREE.WebGLRenderer = null; lights: THREE.SpotLight[] = []; boxCircle: THREE.Group; texture: THREE.Texture; textureUrls = ["img/1.jpg", "img/2.jpg", ...
873bbc6b604f4e1b66d71b7be7b4902ae993ecb2
TypeScript
dongnguyenvie/Design-patterns-notes
/creational-patterns/builder-pattern/builder-pattern.ts
3.4375
3
/** * WHEN TO USE THE BUILDER PATTERN * * - When dealing a complex object that requires a lot of parammeters * - When trying to prevent mistakes from creating a complex objects * - When trying to avoid unreadable, big constructors that are sometimes required complex object creation */ ;(() => { const NonePat...
5f966947521c55e93635707b3f8348a8d203c857
TypeScript
01alchemist/js-to-ts-migration
/src/components/migration/index.spec.ts
2.734375
3
import * as path from "path"; import * as fs from "fs"; import { migrate } from "."; describe("Migration test suite", () => { describe("Export tests", () => { describe("When passing a commonjs single function module export", () => { it("Should replace module.exports with export", () => { const scri...
d0c8d9cee355d5b7c9f080d0ade076f304b83604
TypeScript
pshihn/lit-matrix
/src/parser.ts
3.515625
4
import { Token } from './tokenizer'; type Associativity = 'left' | 'right'; const associativityMap: { [op: string]: Associativity } = { '!': 'right', '*': 'left', '/': 'left', '+': 'left', '-': 'left' }; const precedenceMap: { [op: string]: number } = { '!': 4, '*': 3, '/': 3, '+': 2, '-': 2 }; ...
d745aa80a99f7a3d53498ecb980eed284c966f0f
TypeScript
raster-foundry/raster-foundry-docs
/src/app/services/auth.service.ts
2.53125
3
import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { Http, Response } from '@angular/http'; import { JwtHelper } from 'angular2-jwt'; import { SettingsService } from './settings.service'; export class TokenExpiredError extends Error { constructor(public message: string) { super...
148a977a3d1ada01aa8452eb59241371b4d2b3ee
TypeScript
isabella232/helium-js
/packages/http/src/models/PendingTransaction.ts
2.734375
3
import camelcaseKeys from 'camelcase-keys' import { Balance, CurrencyType } from '@helium/currency' import DataModel from './DataModel' export interface HTTPPendingTransactionObject { type: string txn: object | null status: string hash: string failed_reason: string | null created_at: string updated_at: s...
d4e3c6cf34007e15bc6900f30c4bef19537a25cf
TypeScript
ike18t/mock_module
/lib/test-fixtures.ts
2.609375
3
import { NgModule, Component, Injectable, Directive, Pipe, PipeTransform } from '@angular/core'; @Directive({selector: '[example-directive]'}) export class ExampleDirective {} @Pipe({name: 'examplePipe'}) export class ExamplePipe implements PipeTransform { transform(text: string) { return `Example: ${text}`; ...
e48a6c3e6ffbc85d00ec41367fb839722b7ebab7
TypeScript
mooyoul/is-webp-extended
/index.ts
2.9375
3
const RIFF = new Uint8Array([ 0x52, 0x49, 0x46, 0x46, ]); const WEBP = new Uint8Array([ 0x57, 0x45, 0x42, 0x50, ]); const ANMF = new Uint8Array([ 0x41, 0x4e, 0x4d, 0x46, ]); export async function isWebP(input: ArrayBuffer | Blob) { const chunk = await readBytes(input, 0, 12); const buf = new Uint8Array(chu...
6b6eedc7ffd915d880820bd5910f297ed3d7bd8b
TypeScript
atlj/kelime-oyunu
/src/utils/validate.ts
3.046875
3
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types function validateGame(obj): boolean { let result = true; if ( typeof obj !== "object" || typeof obj.name !== "string" || typeof obj.time !== "number" || typeof obj.questions !== "object" || //Might be u...
2c628351542945ed1a343b737e8463d1aca76624
TypeScript
rsboarder/Evo-UI-Kit
/projects/evo-ui-kit/src/lib/components/evo-paginator/evo-paginator.component.ts
2.765625
3
import { Component, Output, EventEmitter, Input, ChangeDetectionStrategy } from '@angular/core'; export interface PageEvent { currentPage: number; previousPage: number; pageSize: number; pagesTotal: number; } // use only odd numbers please const PAGES_VISIBLE = 5; @Component({ selector: 'evo-pagi...
a87fec5852ce808ab7c3ea45d58ed596424ab131
TypeScript
sea5625/class_mall
/src/apis/products.ts
2.6875
3
import axios from "axios"; import { PAGINATION_LIMIT } from "../utills/const"; export async function getAllProducts() { const response: any = await axios.get<ProductModel>( `http://localhost:4000/products` ); return response; } export async function getProducts(payload: number) { const respons...
748d56d12512f83c7a9b74a6965acd712aed96a5
TypeScript
FishOrBear/csg.ts
/src/core/math/Polygon3.ts
2.875
3
import { solidFromSlices } from "../../api/solidFromSlices"; import { CAG } from "../CAG"; import { fromPointsNoCheck } from "../CAGFactories"; import { areaEPS, getTag, _CSGDEBUG } from "../constants"; import { CSG } from "../CSG"; import { fromPolygons } from "../CSGFactories"; import { Matrix4x4 } from "./Matrix4"; ...
00ec61af39cf66e319ff33473e1b724cb9c0d1c1
TypeScript
weichx/hex-editor-ui
/src/math/matrix4x4.ts
3.046875
3
import {MathUtil} from "./math_util"; import {Quaternion} from "./quaternion"; import {Vector3} from "./vector3"; export const enum MatrixIndex { RotScale00, RotScale01, RotScale02, RotScale10, RotScale11, RotScale12, RotScale20, RotScale21, RotScale22, PositionX, PositionY,...
2a2d3ae4611d4756b80703c5399117c65764f3be
TypeScript
matthewjosephtaylor/say-my-name
/src/js/project/ProjectGlobals.ts
2.640625
3
export type ProjectPackage = { name: string; version: string; description: string; }; /** * @see webpack.config.js */ declare const PROJECT_PACKAGE: ProjectPackage; export function getProjectPackage(): ProjectPackage { return PROJECT_PACKAGE; } export function getProjectVersion(): string { return getProje...
7de0855bddbf6f83719e1e6f3504c033138672b6
TypeScript
joshdcuneo/tsm
/src/utility.ts
2.875
3
import { ObjectProto } from './types'; export const isType = <T>(type: ObjectProto, object: any): object is T => type.isPrototypeOf(object); export const isTypeP = <T>(type: ObjectProto) => (object: any): object is T => isType(type, object); export const immutable = <T>(proto: ObjectProto, object: T): T => Obj...
31ec35a5de740f1d3864daf81acbd619cd7ed843
TypeScript
ttionya/eslint-config
/tests/typescript/common/explicit-function-return-type/good.ts
2.953125
3
/* eslint-disable @typescript-eslint/no-unused-vars */ export default 1 function test(): void { // do something } interface IObjectType { foo(): number } const objectProp: IObjectType = { foo: () => 1, } const arrowFn = () => (): void => { /* do something */ }
993df05ca46ebac5c71bf731663d624bc1cc5203
TypeScript
maurer2/poescho-radio
/frontend/src/form-component/form-component.ts
2.578125
3
/* eslint-disable class-methods-use-this */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ /* eslint-disable no-underscore-dangle */ /* eslint-disable import/prefer-default-export */ import { LitElement, html, customElement, property, } from 'lit-element'; import { FormComponentStyles } from...
cdad72f562d58ac1efdafa16c0ef27edae3f9ac2
TypeScript
ChikaEche/coding-problems
/subarray-sort.ts
3.46875
3
function subarraySort(array) { let indx = [] let highest = -1 let smallest = -1 for (let i = array.length - 1; i > 0; i--) { if(array[i] < array[i-1]) { highest = highestIndex(array, i-1, array[i-1]); smallest = smallestIndex(array, i, array[i]) break; } } indx.push(smallest, highest) return indx }...
a4a771506fd1758b876c3c2877eab7277215c675
TypeScript
vkbhati1991/ts-decoraters
/src/controllers/LoginController.ts
2.875
3
import { NextFunction, Request, Response } from "express"; import { get, controller, use, bodyValidator, post } from "./decorators"; function logger(req: Request, res: Response, next: NextFunction) { console.log('middle call'); next(); } @controller('/auth') export class LoginController { @get('/logi...
3913c4d67405d58fbea592d83f273908a126932d
TypeScript
ester5775/GymnasticsStudio
/GymnasticsStudioClient/src/app/classes/lesson.ts
2.640625
3
export class Lesson { public Id:number; public Name:string; public TeacherId:number; public Day:string; public StartHower:string; public FinishHower:string; public MaxStudensNum:number; public MaxSerologersStudensNum:number; pu...
38b25833b597496e27fb7238bd5a65240b9a92b4
TypeScript
santigarcor/vscode-phpunit-extended
/src/Helper.ts
2.953125
3
export class Helper { private readonly regex = { method: /\s*(public\s+){0,1}function\s+(\w+)\s*\(/gi, class: /class\s+(\w*)\s*{?/gi }; public getRegex() { return this.regex; } public getClassNameOrMethod(editor, type: string): string | undefined { if (!this.regex.h...
c51504567e5b06462eccafac25997612e4ba874d
TypeScript
ivolimasilva/react-vite
/src/use-fetch.ts
2.75
3
import { useState, useEffect } from "react"; const getUrl = (year: string) => `https://ergast.com/api/f1/${year}/driverStandings.json`; interface Driver { driverId: string; permanentNumber: string; code: string; url: string; givenName: string; familyName: string; dateOfBirth: string; nationality: stri...
5f6d82c0cbdbf939ec5396d63b520b853c2c2e4e
TypeScript
unlock-protocol/unlock
/locksmith/src/controllers/v2/receiptController.ts
2.5625
3
import { Request, Response } from 'express' import { Receipt } from '../../models/receipt' import * as z from 'zod' import Normalizer from '../../utils/normalizer' import logger from '../../logger' import * as receiptOperations from '../../../src/operations/receiptOperations' export const PurchaserBody = z.object({ ...
ed9cf4ebb9479fa115c1c59021bfa7536c956e65
TypeScript
zyp94021/laya2.0-cli
/src/core/game/script/HLabel.ts
2.8125
3
/** * 多语言Label */ export default class HLabel extends Laya.Script { constructor() { super() } /** @prop {name:LanguageID,type:string}*/ public LanguageID: string /** @prop {name:IsFit,type:Bool}*/ public IsFit: boolean = true /** @prop {name:IsFill,tips:"1,0",type:Bool}*/ public IsFill...
2b9ce115e41ecc837237d1da89a5e8d80123e572
TypeScript
PrimeEuler/PWA
/public/certificates-viewer/dist/types/utils/download_from_buffer.d.ts
2.515625
3
/** * @license * Copyright (c) Peculiar Ventures, LLC. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /** * Download from buffer * * @example * ```js * import { downloadFromBuffer } from 'ui-utils'; * * downloadFromBuff...
ff1e6112f585f8fbb78c7be7fa6d1c183a8ff7eb
TypeScript
jeremydeal/savvy-stream
/savvy-stream-api/src/apis/airQualityApi.ts
2.75
3
import fetch from 'node-fetch' const key = "F4F31AC2-102C-48C7-B777-CEB8CA208E83" // see: https://docs.airnowapi.org/ForecastsByZip/query // API username: jeremy.n.deal const getUrl = (zip: string, date: string) => `http://www.airnowapi.org/aq/forecast/zipCode/?format=application/json&zipCode=${zip}&date=${date}&...
e77564285c535daecc7231a4cdf65794ab84c0dd
TypeScript
Ssioo/ArThings
/src/utils/iot-configurator.ts
2.609375
3
export enum DeviceConnectionType { BLE, WIFI, LTE, UWB, UNKNOWN } export interface MyIotDevice extends IotDevice { } export interface LatLng { latitude: number longitude: number altitude?: number } export interface IotDevice { address: string networkType: DeviceConnectionType name?: string l...
c86962b8a6a5325d83a8b07c29bdb7ecdef7b25e
TypeScript
esilva2902/stripe-course
/server/stripe-webhooks.route.ts
2.671875
3
import { Request, Response } from 'express'; import { db, getDocData } from './database'; // Remember, in order to initialize the Stripe node module, we must passed our STRIPE_SECRET_KEY: const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY); /** * ONE TIME PURCHASE / RECURRING CHARGE * * 5. Due to Stri...
251ddb06a586b0c44b7bd372b9b3a85dcd69c324
TypeScript
dongryphon/siesta
/tests/siesta/test/spies.t.ts
3.0625
3
import { describe } from "../../../index.js" import { Spy } from "../../../src/siesta/test/Spy.js" describe('Spy executing strategies', t => { let obj : { someProp : any, setSomeProp : (...args) => typeof obj } let obj2 : { someProp : any, setSomeProp : (...args) => typeof obj2 } t.beforeEach(t => { ...
64b68176608555252ed8ea604a8ba0a63a5fb195
TypeScript
howmanysmall/StyluaPlugin
/cli/index.ts
2.515625
3
export interface StyluaStudioArguments { _: string[]; p: number; port: number; h: boolean; help: boolean; path: string; files: string; config: string; } import { Application, Router } from "https://deno.land/x/oak/mod.ts"; import FormatController from "./Controllers/FormatController.ts"; import { ensureDir }...
0eaf158fe9aaf5e746181df408c190db115e3f06
TypeScript
akx/glitch2
/libglitch/modules/afterimage.ts
2.703125
3
import dataBlend from '../lib/dataBlend'; import * as p from '../param'; import GlitchContext from '../GlitchContext'; interface AfterimageOptions { strengthIn: number; strengthOut: number; counterStrengthOut: number; } function afterimage( glitchContext: GlitchContext, pOptions: Partial<AfterimageOptions>,...
fdf0fd298be56a3c2afd3a69afea638a8aa9fd43
TypeScript
robblovell/toy-public-package
/src/compareOrder.ts
2.984375
3
export const compareOrder = (a, b) => { const nameA = a.toUpperCase(); // ignore upper and lowercase const nameB = b.toUpperCase(); // ignore upper and lowercase if (nameA < nameB) { return -1; } if (nameA > nameB) { return 1; } return 0 }
b1b4182fa6fbce7a37222a19c4b00b08c2b77452
TypeScript
Raykid/Olympus
/trunk/src/engine/audio/AudioTagImpl.ts
2.6875
3
import { core } from "../../core/Core"; import { environment } from "../env/Environment"; import AudioMessage from "./AudioMessage"; import IAudio, { AudioPlayParams } from "./IAudio"; /** * @author Raykid * @email initial_r@qq.com * @create date 2017-10-30 * @modify date 2017-10-30 * * 使用Audio标签实现IAudio接口的实现类 ...
4c4988592c2186445dae710f601b55c3a4103598
TypeScript
green-fox-academy/somakanyasi
/Week04/Day-04/count-letters.test.ts
2.59375
3
'use strict'; import { countLetters } from './count-letters'; import { myString } from './count-letters'; const test = require('tape'); test('It should count the letters in a given string', (test) => { test.equal(countLetters(myString), true, 'should be the same'); test.end(); });
4f1fb8d5545f55e4f987b79ce27899036d74eb93
TypeScript
Atticus29/angular-recipe-box
/app/app.component.ts
2.703125
3
import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app/app.component.html' }) export class AppComponent { recipes: Recipe[] =[ new Recipe('Apple pie', 'Just make an apple pie'), new Recipe('Salad', 'you should already know'), new Recipe('Tv dinner', 'epic ...
109bb027a79230c363ef8e2c5ce1f02378e7f6fe
TypeScript
davidsantander9/intro-typescript
/src/exercises/06-fun-desestructuring.ts
3.28125
3
export interface Product{ desc: string; price: number; } const phone: Product = { desc: 'Nokia A1', price: 150, } const tablet: Product = { desc: 'iPad', price: 350, } export function calcISV( products: Product[]):[number, number] { let total: number = 0; products.forEach( ({ price })...
8a3af606153f7b611ae031ebc368142f4138996e
TypeScript
otienonick/Quote-App
/src/app/quote.ts
2.515625
3
export class Quote { id:number; author:string; quote:string; quoteDetails:string; showDetails:boolean; constructor(id:number,author:string,quote:string, quoteDetails:string,public completeDate: Date ) { this.id = id; this.author = author; this.quote = quote; this.quoteDetails = quo...
b47a11ad3204cae330d581cbfb4d5dbebe732d2c
TypeScript
lanets/scavengets
/angular-client/src/app/shared/services/challenge.service.ts
2.59375
3
import {EventEmitter, Injectable} from '@angular/core'; import { Http } from '@angular/http'; import 'rxjs/Rx'; import {Observable} from 'rxjs/Observable'; import {Challenge} from '@models'; @Injectable() export class ChallengeService { // Link to our api, pointing to localhost private readonly API = 'http://local...
15cbf4b3e86bdf1a448375df3f4243929b985c46
TypeScript
vmauricio93/MyPlanner
/src/app/shared/autocomplete.directive.ts
2.6875
3
import { Directive, ElementRef, Input, OnInit } from '@angular/core'; import autocomplete, { AutocompleteItem } from 'autocompleter'; type Option = string & AutocompleteItem; @Directive({ selector: '[appAutocomplete]' }) export class AutocompleteDirective implements OnInit { @Input() options: string[]; fetch: ...
afeadeed9122c208de5cf65e12bc35c0fef91af3
TypeScript
Fershark/react-native-login
/app/redux/AuthSlice.spec.ts
2.625
3
import configureMockStore from 'redux-mock-store'; import thunk from 'redux-thunk'; import authReducer, {logout, login, AuthState} from './AuthSlice'; import AuthService from '../services/AuthService'; jest.mock('../services/AuthService'); const mockStore = configureMockStore([thunk]); const initialState: AuthState =...
ce6755a31d9038acb8203cf4cf941f9f6163f677
TypeScript
MatheusClaudi/use
/src/app/models/detection/detection_report.ts
2.640625
3
import { DetectionAction } from '../enum/detection_action'; export class DetectionReport{ action: DetectionAction; label: string; previousNumberObjects: number; newNumberObjects: number; moment: Date; makeEntryReport(label, previousNumberObjects, newNumberObjects, moment){ this.actio...
91e94082d18fe5bf14a3f72cab300556df0f22f4
TypeScript
xiong35/type-challenges-solutions
/src/2070-DropChar-medium/index.ts
3.21875
3
namespace T2070 { /* 答案 */ type Split<S extends string, Arr extends string[] = []> = S extends `${infer F}${infer R}` ? Split<R, [...Arr, F]> : Arr type Length<S extends string> = Split<S>["length"] type DropChar< S extends string, C extends string, D extends string = "" > = Length<C>...
2d14127bb52f11fdff01952e89d70140d41c0158
TypeScript
njmyers/javascript-monorepo
/packages/component-library/src/utils/safe-ref.ts
2.65625
3
import * as React from 'react'; export const safeRefValue = (ref: React.RefObject<any>, value: string) => { if (ref.current) { return ref.current[value]; } return null; }; export const safeRefCall = (ref: React.RefObject<any>, method: string) => { const func = safeRefValue(ref, method); if (func && ty...
533c6413b89b23e06644b03262c25ad4849e6279
TypeScript
CobraWing/decodificador
/src/main/utils/Signal.ts
3.453125
3
/* * Copyright (C) 2017 Klaus Reimer <k@ailis.de> * See LICENSE.md for licensing information. */ /** * Internally used container for a signal handler function bound to an object. * * @param <T> The signal payload type. */ class Slot<T> { private func: (data: T) => void; private context: Object | null; ...
c9ee249abee930e72fbae476e8600b49117bb22e
TypeScript
abdoulayekeita/exmen
/gateway/src/main/webapp/app/shared/model/partener/type.model.ts
2.984375
3
export interface IType { id?: number; title?: string; } export class Type implements IType { constructor(public id?: number, public title?: string) {} }
310c1473f23dc78125cc479c43029dcb59fa780b
TypeScript
lingualogic/speech-framework
/src/bot/bot.ts
2.5625
3
/** @packageDocumentation * Dialog API Wrapper fuer BotComponent. * * Letzte Aenderung: 01.06.2020 * Status: gelb * * @module bot * @author SB */ // core import { OnSpeechErrorFunc } from '@speech/core'; // base import { Base } from '@speech/base'; // speak import { SpeakInterfac...
23b9548ed5b82ed4f6ce71f2d4540a7d5356ae7d
TypeScript
sweetmnstr/trade-cabinet-demo
/gateway-lead/src/modules/auth/auth.dto.ts
2.765625
3
import { ApiProperty } from '@nestjs/swagger'; import { IsEmail, IsUUID, Length } from 'class-validator'; import { ILoginDto, ISignupDto, IRefreshTokenDto, ITokenResponse } from 'trade-cabinet-types'; import { ToPhone } from '../../lib/decorators/transformers.decorator'; export class LoginDto implements ILoginDto { ...
ef43b41b8189b7ed6662e6aa7228c4829b6eef0a
TypeScript
ErliSoares/Koralium
/typescript-client/json/src/filterBuilder.ts
3.171875
3
/* * 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 in writing, software * distribut...
ef41b254cdc98e845f91d5bb394fe1501d85cf1b
TypeScript
KovalevichD/practice-js
/src/type-b/b8.mapLimit.ts
3.03125
3
/* * Задача b8: mapLimit * Есть массив url, есть функция fetch, которая возвращает промис * Есть ограничение по количеству параллельно запущеных request'ов * Нужно отправлять запросы ПАРАЛЕЛЛЬНО пачками, как только выполнились все N (переменная limit) запросов * отправлять следующие N запросов * Например, есть 12...
f5070d7a358b7389c71d911efe9a11abd472ced7
TypeScript
Jonathan-Brito/mentoria-typescript
/src/respostas/desafio1.ts
3.984375
4
// Resposta 1 const funcionario = { codigo: 10, nome: 'João' }; // Resposta 2 const funcionario2: {codigo: number, nome: string} = { codigo: 10, nome: 'joao' } // Respostas 3 e 4 interface Funcionario { // Já conhece interfaces? https://blog.logrocket.com/types-vs-interfaces-in-typescript/ codigo...
731b0bb7042724cb028c981e826b89fbecdb6f72
TypeScript
rzyns/type-plus
/src/Partial.spec.ts
2.765625
3
import { PartialExcept, PartialPick, assertType, PartialOmit } from '.'; test('make picked properties optional', () => { type Foo = { a: number, b: number, c: number, } const y: PartialPick<Foo, 'a'> = {} as any y.a = undefined assertType.noUndefined(y.b) assertType.noUndefined(y.c) }) test(...
a36d2cc6f85de1af670de8ed643767526ed9e935
TypeScript
jrod-disco/gamejam-ld48
/src/screens/controller.ts
3.484375
3
type ScreenName = string; //export type Name = string; export type Screen = { name: ScreenName; ref: any }; export type SetScreenProps = { name: string; isAnimated: boolean; onComplete?: () => void; }; export interface SceenController { setCurrentScreen: (props: SetScreenProps) => ScreenName; getCurrentSc...
d9891045b33e1c1418c1a8acb86ee9daa298bf6a
TypeScript
benwinding/react-admin-firebase
/tests/reference-document-parser.spec.ts
2.640625
3
import { applyRefDocs, RefDocFound, REF_INDENTIFIER, translateDocFromFirestore, translateDocToFirestore, } from '../src/misc'; import { FireStoreDocumentRef } from '../src/misc/firebase-models'; describe('reference-document-parser.spec', () => { test('test translateDocToFirestore', () => { const dataTo...