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
4992863ac3b028dd6a794c01152975547607d493
TypeScript
rwson/TypeScript
/4-Class/class-6.ts
3.28125
3
/** * class * typescript中的static * public private * build by rwson @11/5/15 * mail:rw_Song@sina.com */ class Greeter{ greeting:string; constructor(message:string){ this.greeting = message; } greet(){ return "hello," + this.greeting; } } var greet:Greeter; greet = new Greeter(...
110dcb4fa89a588217d9f0b773baa9896dc7a64c
TypeScript
getclaps/worker
/src/routes/validate.ts
3.03125
3
import * as er from '../errors'; // A non-empty scheme component followed by a colon (:), // consisting of a sequence of characters beginning with a letter and // followed by any combination of letters, digits, plus (+), period (.), or hyphen (-). const RE_PROTOCOL = /^[a-z][a-z0-9.+-]*:/i; export const validateURL ...
93e61022f2f9e5d1d0e18a475bd3da6840d2602a
TypeScript
danikaze/trpg-connector
/src/utils/logging.ts
2.984375
3
// tslint:disable:no-console export const msgLog = msg.bind(undefined, 'log'); export const msgError = msg.bind(undefined, 'error'); export const msgWarn = msg.bind(undefined, 'warn'); export const msgTable = table.bind(undefined); type MsgType = 'log' | 'error' | 'warn'; const COLOR_MAP: { [type: string]: string } = ...
adb6df04ee9cbdef34ea4a6720d0cfbabf42a610
TypeScript
marcoszanre/obfuscation-bot-typescript
/src/app/tableService.ts
2.765625
3
import * as debug from "debug"; // tslint:disable-next-line:no-var-requires const azure = require("azure-storage"); // Initialize debug logging module const log = debug("msteams"); // Initialize Table Service const tableSvc = azure.createTableService(process.env.STORAGE_ACCOUNT_NAME, process.env.STORAGE_ACCOUNT_ACCE...
16c4566b3c4ecce5c6cca979da178bcf9d88f1c7
TypeScript
kuhel/inferno
/packages/inferno-clone-vnode/src/index.ts
2.828125
3
/** * @module Inferno-Clone-VNode */ /** TypeDoc Comment */ import { createComponentVNode, createTextVNode, createVNode, directClone, EMPTY_OBJ, normalizeProps, VNode } from 'inferno'; import { combineFrom, isArray, isInvalid, isStringOrNumber, isUndefined } from 'inferno-shared'; import { Ch...
ed2b830b9bfab10f52f51a5e07b891b0b64b6734
TypeScript
Armenvardanyan95/gitam-web
/src/app/state/tags/tags.reducer.ts
2.578125
3
import { createReducer, on } from '@ngrx/store'; import { loadAllTagsSuccess, selectTag, deselectTag, deselectAllTags } from './tags.actions'; export interface TagsState { allTags: string[]; selectedTags: string[]; } const initialTagsState: TagsState = { allTags: [], selectedTags: [], }; /* tslint:disable-n...
4a7013e206497ab9323527ac3bb3a1550a5e85df
TypeScript
mingderwang/lds-jws2020
/packages/json-web-key-2020/src/restrictions/JsonWebKey2020.test.ts
2.90625
3
import { JsonWebKey } from '../JsonWebKey'; const message = Buffer.from('hello'); const recommended: any = [ { kty: 'OKP', crvOrSize: 'Ed25519' }, { kty: 'OKP', crvOrSize: 'X25519' }, { kty: 'EC', crvOrSize: 'secp256k1' }, { kty: 'EC', crvOrSize: 'P-256' }, { kty: 'EC', crvOrSize: 'P-384' }, { kty: 'RSA',...
382826bda14a23371fe18200974fc92fbd3fc71d
TypeScript
SoftwareSeniPT/Life-Coaching-Demo
/app/pages/training-schedule/training-schedule.red.ts
3.109375
3
/* * Reducer for Timeline component */ interface IObjectConstructor extends ObjectConstructor { assign(target: any, ...sources: any[]): any; } declare var Object: IObjectConstructor; const initialState: any = { scheduleSelected: 0, schedule: [{ name: "Monday", date: "May 3", sel...
ce6bc3394d960b39e44668002bd5907ac448cc1e
TypeScript
athleticspot/athleticspot
/web/src/main/webapp/app/training/results/validateDuration.ts
2.59375
3
import {FormGroup} from "@angular/forms"; export function validateDuration(group: FormGroup){ let isAtLeastOne = false; if (group && group.controls) { for (const control in group.controls) { if (group.controls.hasOwnProperty(control) && group.controls[control].valid && group.controls[contr...
41b98072b686262d156c95959151afe7e4af31e6
TypeScript
nccnm/100days_of_TypeScript
/day3_jquery_alike/myJQuery.ts
3.15625
3
class ElementManager { private elements: NodeListOf<Element>; constructor(selector: string) { this.elements = document.querySelectorAll(selector); } css(style: string | Object, value: string = '') { if (typeof style === 'string') { this.setStyle(style, value); ...
0df2dd4d9ef60caf521b6cd30c8ba435e27d4844
TypeScript
a-type/simulated
/lib/inputTransformers.ts
3.046875
3
export type PolymorphicInput = { [kind: string]: {} | undefined; }; export type PolymorphicFormValues = { kind: string; [other: string]: any; }; export const toPolymorphicInput = <T extends PolymorphicInput>( values: PolymorphicFormValues | null, ): T => { if (!values) return null; const { kind, ...rest ...
0acec8b7a16d759bdcf96b8e0cc6dd0c7f5dfab3
TypeScript
UAlbertaALTLab/click-in-text-chrome
/src/lib/transover_utils.ts
2.765625
3
// helper functions import XRegExp from 'xregexp/src' import {FailedTranslation, SuccessfulTranslation} from './transover_core' export const TransOver = { modifierKeys: { 16: 'shift', 17: 'ctrl', 18: 'alt', 224: 'meta', 91: 'command', 93: 'command', 13: 'Return' }, // fixme: are there handy utility types ...
14bcbfc615c8dbae23def7d525a95bce4f64e6cc
TypeScript
williamszk/statistical-learning
/angular_study/youtube-freeCodeCamp/01-intro-typescript/datatypes.ts
4.25
4
let lname = "Diffie"; // lname = 19; // type inference // does not need to define the datatype let fname: string = "Mark"; let newname = lname.toUpperCase(); console.log(newname); // declare let age: number; // assign age = 25; let dob = "25"; let result = parseInt(dob); let isValid: boolean; // by default thi...
2200d0e9908d3f4a1e460a991a93a43c581f8f4d
TypeScript
hikipuro/tea.js
/src/tea/parsers/dae/fx/texturing/DAEHint.ts
2.65625
3
import { DAEUtil } from "../../DAEUtil"; // parent: format export class DAEHint { static readonly TagName: string = "hint"; channels: string; range: string; precision?: string; space?: string; constructor() { this.channels = null; this.range = null; this.precision = "DEFAULT"; this.space = null; } st...
a22ac7aef53bb26f0b16a21239f5b88e4c1b2176
TypeScript
hitachimaverick/poolpi
/server/queues/outboundQueue.ts
2.6875
3
import * as path from 'path'; import * as fs from 'fs'; import * as extend from 'extend'; import { logger } from '../../server/logger/Logger'; class outboundQueueCollection extends Array<outboundQueue> { private _queuePath: string; private _isInitialized: boolean = false; constructor(...items) { su...
435d95c3b9dfea9d3bc22f528a8c613a383a06da
TypeScript
ilanuk/programming-with-types
/Chapter11/17_functor_interface.ts
3.71875
4
namespace FunctorInterface { /* TypeScript doesn't support HKT interface Functor<H<T>> { map<U>(func: (value: T) => U): H<U>; } class Box<T> implements Functor<Box<T>> { value: T; constructor(value: T) { this.value = value; } map<U>(func: (value: T) => U): Box<U> { return new Bo...
21bd3d73590c2433dec2e9b0a608d6f08e4438db
TypeScript
surikaterna/saft
/test/module.spec.ts
3.1875
3
import { Provides, Inject, Provider, Singleton, Injector } from '../src'; describe('Injector', () => { describe('Provides', () => { it('should return correct instance', () => { class MyModule { @Provides('Aloha') getAloha() { return 'Tjingeling'; } } const inje...
5687d3118ac75392f22688b7484ec6b61b22db0f
TypeScript
dhamotharang/previous_projects
/Phantom_Riskpal/clientPortalNg6/src/app/core/services/constant.type.ts
2.890625
3
export class ConstantType { public static limit = 15; public static sortCreatedAtDesc = { createdAt: 'desc' }; public static textMinLength = 2; // min length defined for text like fullname, department name, first name etc public static textMaxLength = 200; // max length defined for text like fullname, d...
af6fa278f6db3e1282880044bf17c1391fc14ec5
TypeScript
nguyer/aws-sdk-js-v3
/packages/util-user-agent-browser/src/index.spec.ts
2.71875
3
import { defaultUserAgent, appendToUserAgent } from "."; it("should response basic node default user agent", () => { let originUserAgent = ""; if (typeof navigator === "undefined") { navigator = {} as any; originUserAgent = "foo/1.0"; (navigator.userAgent as any) = originUserAgent; } else { origi...
1cc1948ac82be20d5319c9c203d93322f7cb069c
TypeScript
angular/angular-cn
/public/docs/_examples/universal/ts/src/uni/universal-engine.ts
2.515625
3
/** * Express/Connect middleware for rendering pages using Angular Universal */ import * as fs from 'fs'; import { renderModuleFactory } from '@angular/platform-server'; const templateCache = {}; // cache for page templates const outputCache = {}; // cache for rendered pages export function ngUniversalEngine(setu...
fb04041c0c11ebfa6e72a03131698cd670cd16e2
TypeScript
lucified/minard-ui
/src/js/modules/commits/reducer.ts
2.5625
3
import { mapKeys } from 'lodash'; import { Reducer } from 'redux'; import { logMessage } from '../../logger'; import { FetchError, isFetchError } from '../errors'; import Requests from '../requests'; import { CLEAR_STORED_DATA } from '../user'; import { ADD_DEPLOYMENT_TO_COMMIT, STORE_COMMITS } from './actions'; impo...
5690a58c9b1342f8054c75dd9adb3cc8c9019e96
TypeScript
zhoumingyang/PlumeGL
/src/example/shader/test_frag_webgl2.ts
2.609375
3
export const testFragmentSource = `#version 300 es precision highp float; precision highp int; #define LIGHT_NUMBER 5 in vec2 vUv; in vec3 vPos; in vec3 vNormal; uniform vec3 diffuse; struct Light { vec3 color; float intensity; }; uniform Light lights[LIGHT_NUMBER]; out vec4 glColor; ...
27c136967a707c3bc920376f5f6a24f67fb1db0b
TypeScript
xiong35/type-challenges-solutions
/src/0016-Pop-medium/index.ts
3.640625
4
namespace T0016 { /* 答案 */ type Pop<T extends any[]> = T extends [...(infer P), any] ? P : unknown; type Shift<T extends any[]> = T extends [any, ...(infer S)] ? S : unknown; type Push<T extends any[], E> = [...T, E]; type Unshift<T extends any[], E> = [E, ...T]; /* 测试 */ type arr1 = ["a", "b", "c", "d"]...
bbeb6d4d72e6369699e50dde3dcfc880f0e2ed05
TypeScript
CoderCow/c2j-Player
/src/ts/Utils/TemplateUtils.ts
2.75
3
module Player { 'use strict'; /** Provides utility methods for Dust template management. */ export class TemplateUtils { /** Asynchronously renders the dust template with the given name and contextData. */ public static render(templateName: string, contextData: any, callback: (out: string) => void): void { ...
2604edfc8cb33a8a6841be6b8dbae7133809ac89
TypeScript
xiaodemen/vue
/src/core/instance/render-helpers/bind-object-props.ts
2.625
3
import config from 'core/config' import { warn, isObject, toObject, isReservedAttribute, camelize, hyphenate, isArray } from 'core/util/index' import type { VNodeData } from 'types/vnode' /** * Runtime helper for merging v-bind="object" into a VNode's data. */ export function bindObjectProps( data: ...
d70b0e002b2fb28e2d402951fb1be8e24c2cd8af
TypeScript
coco-Tang/ttcar-vue-ts-vant
/src/typings/common.d.ts
2.859375
3
/* * @Author: coco-Tang * @Date: 2019-10-14 10:51:46 * @LastEditors: coco-Tang * @LastEditTime: 2019-10-22 13:44:22 * @Description: */ // 公共类型 declare namespace TTCAR { /** 用户信息 */ export interface UserEntity { userid: number; // 用户 id usercode: string; // user code username: string; // 用户名 ...
0258b40cd6eb88ce73b23abc913d233e4a47e7f3
TypeScript
bcgov/moh-prime
/prime-angular-frontend/src/app/modules/site-registration/shared/services/organization.service.ts
2.71875
3
import { Injectable } from '@angular/core'; import { BehaviorSubject, Observable } from 'rxjs'; import { Organization } from '@registration/shared/models/organization.model'; /** * @description * Service is considered a source of truth and should be set * directly from a HTTP response. */ export interface IOrgan...
94f6c90d8bcb1a6a6c40c8e8eea6950bcbcf0832
TypeScript
ThinhTranA/font-icon-to-csharp
/src/utils/stringUtils.ts
3.3125
3
export function toUnicodeString(unicode: number) { let unicodeString = unicode.toString(16); let prefix; if (unicodeString.length <= 4) { unicodeString = unicodeString.padStart(4, '0'); prefix = 'u'; } else { unicodeString = unicodeString.padStart(8, '0'); // Using codepoints from the upper bit...
aba23133b2a5146a9612fcd5781ad39eb0a0cac9
TypeScript
Braw115/yuefanba
/src/dinner-srv/ts/deamon/deed/index.ts
2.53125
3
import * as winston from "winston" import { Deed } from "../../model/users/deed" import { Users } from "../../model/users/users" import { System } from "../../model/crm/system" import { PayLog } from "../../model/users/paylog" const DEED_TIME_INTERVAL = 300 const DEED_FETCH_INTERVAL = DEED_TIME_INTERVAL * 1000 * 60 ex...
f9d826f0587cc097960f68017de7e314df745b0e
TypeScript
vncnzd/genealogy-visualizer
/src/typescript/models/person.ts
3.09375
3
import { SexOrGender } from "../sexOrGender"; import { SexOrGenderId } from "../sexOrGenderId"; export class Person { private id: string; private name: string; private description: string; private father: Person; private mother: Person; private children: Person[]; private datesOfBirth: ...
cd7db0eea99dd25ad1c3004b11713ab767ca841e
TypeScript
OisinKyne/EthTransactionMap
/frontend/src/app/validators/transaction-list.validator.ts
3.09375
3
import { AbstractControl } from '@angular/forms'; export function ValidateHashes(control: AbstractControl) { if (control.value) { //Parse the field to see if a valid set of hashes has been supplied. let hashes: string[]; try { const csv = parseCSV(control.value); } ...
7fb0c914aa00f9b1d8e8a1680ef40e27ae832bc0
TypeScript
EvgenyKalyuk/js-patterns
/src/strategy/index.ts
2.640625
3
import { IStrategy } from './strategy.interface'; export class Context { constructor(private _strategy: IStrategy) {} set strategy(strategy: IStrategy) { this._strategy = strategy; } public doSomeLogic(args: Array<string>): Array<string> { return this._strategy.doAlgorithm(args); ...
9e39b2dc185baf5621c83f4afeeeffb9525b1816
TypeScript
gannochenko/generators
/__deprecated/application.gatsby/template/[application_code_kebab]/src/components/default/[content_name_pascal]Detail/hooks/useCombinedData.ts
2.609375
3
import { HeritageObjectDetailType } from '../type'; import { normalizeHeritageObject } from '../../../../services/HeritageObject/normalize'; import { makePublicPath } from '../../../../util/makePublicPath'; import { HeritageObjectType } from '../../../../services/HeritageObject/type'; export const useCombinedData = ( ...
78d904d4ff7f1aafa473ab2c0312da785f86645d
TypeScript
meenniam/fastify-decorators-boilerplate
/src/modules/hello/hello.schema.ts
2.578125
3
import { Static, Type } from '@sinclair/typebox'; import { FastifyRequest } from 'fastify'; export const HelloTypes = Type.Object({ name: Type.String(), mail: Type.Optional(Type.String({ format: 'email' })), age: Type.Optional(Type.Number()) }); export const HelloParamsTypes = Type.Object({ helloId: Type.Stri...
27619b1fb79278eb4b096c959a72e00ab2a1945d
TypeScript
SomeGuy3000/scraper-interview
/src/otomoto/otomotoScraper.ts
2.671875
3
import { Credentials } from "../models/credentials.model"; import { Page } from "puppeteer"; import { FuelType, Offer, TransmissionType } from "../models/offer.model"; import { Context } from "../models/context.model"; import { runInPage } from "../scraping/runInPage"; import { getWatchedOffersTitledLinks, scrapeOffer ...
e62ec93a84cc8fed37096a96ae3db973ebdf9ea9
TypeScript
Shrkawy/audio-player
/hooks/audio-player-context-hook.ts
2.65625
3
import { useReducer } from "react"; import { Song } from "../models/Song"; import { playerReducer } from "./player-reducer"; export interface PlayerState { songs: Song[]; currentSong: number; } const initPlayerState: PlayerState = { songs: [], currentSong: 0, }; export const usePlayer = () => { const [play...
e7d300364744b640bc9f589b68e01b8e8d4523a7
TypeScript
antiwise/GameTemplateTS
/assets/scripts/framework/godGuide/GodCommand.ts
2.703125
3
import GodGuide from "./GodGuide"; /** * zxh */ let async = require('async'); //根据命令 export class GodCommand { static readonly DIALOGUE: string = 'dialogue';//对话框 static readonly FINGER: string = 'finger';//节点定位加手指指引 static readonly TEXT: string = 'text';//文本显示 static readonly LOCATOR: string = 'loc...
7aa965ed12d811f7e56db8a375b1a49655a6b6a7
TypeScript
automaticdreams/nest_example
/src/services/films/sortedfilm.service.spec.ts
2.59375
3
import { Test, TestingModule } from '@nestjs/testing'; import { SortedfilmService } from './sortedfilm.service'; import * as testArrays from '../../../test/testArrays' import { FilmsService } from './films.service' import { of } from 'rxjs' import { AxiosResponse } from 'axios' import * as functions from '../../common/...
4d18fd284fca95e8bee7e5e56f7d4d181adf77fd
TypeScript
mckiernantim/FamilrDnd
/src/app/no-undead-events.ts
2.59375
3
import { Event } from './event'; import { Component, OnInit } from '@angular/core'; export const noUndeadEvents: Event[] = [ { id:1, title:'Albino Dwarves', text:"The characters are ambushed by 1d4+3 Albino Dwarf Warriors that spring forth from a burrow. Any character with a passive perce...
ce27014d105d6a1b1a27eb93fef3b1bd17ca55e5
TypeScript
Untrii/labl-test
/src/hooks/useAPI.ts
2.59375
3
import { computed, watch, ref, nextTick, onBeforeMount } from 'vue' import { useStore } from 'vuex' import { key } from '@/store' import router from '@/router' import { baseApiUrl } from '@/config' import IProduct from '@/models/IProduct' import IVariant from '@/models/IVariant' export default function useAPI( sele...
27591ea60e7a568b18827d2b16084f3b1a052e32
TypeScript
ShiriNmi1520/OSTB
/server/giveCard.ts
3.5
4
const cards : Array<string> = ["2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A"]; const types : Array<string> = ["♠", "♥", "♣", "♦"]; export function getRandom(pools : Array<number>, count : number): Array<string> { const arr : Array<string> = []; for (let i : number = 0; i < count; i++) { let pool...
c01ac2ebda806bca08ee72e1c6cc644614e5e44b
TypeScript
quenktechnologies/wml
/lib/cli.d.ts
2.5625
3
import { Future } from '@quenk/noni/lib/control/monad/future'; import { Options } from './compile'; /** * CLIOptions */ export interface CLIOptions extends Partial<Options> { /** * inputExtension is the file extension used when searching for files to * compile. */ inputExtension: string; /*...
090e335a3e3502cb50b546a7694a67251dc34887
TypeScript
artifact-project/exility
/block/src/block/block.ts
2.65625
3
import XEvent, {DOMEvent, IEmitter} from '../event/event'; export interface BlockClass<A = {}, C extends object = {}> { new (attrs: A, options?: {context?: C}): Block<A, C>; template?: string; classNames?: any; } export type IBlock = typeof Block; export interface IBlockIds { [index: string]: IBlock; } export i...
209f3cea0a47f37a52af08348222b54dae8c8625
TypeScript
jasonraimondi/cryptozombies
/dapp/test/index.ts
2.703125
3
import { expect } from "chai"; import { ethers } from "hardhat"; import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import type { Contract } from "ethers"; describe("ZombieOwnership", function () { let zombies: Contract; let owner: SignerWithAddress; let addr1: SignerWithAddress; let ...
7db5660755097224ec002f92f30bff0b7b32eccc
TypeScript
Ink-grid/easyformui
/src/components/inputs/type.ts
2.71875
3
/** * interface forms */ import { formtype, FormsProps } from "../forms"; /** * omit props OF FormsProps */ type omitpProps = Omit<FormsProps, "form" | "onSubmit" | "children">; /** * types props for input Component * @author Rony cb * @version 1.0.0 * @param value necesarie for getInput * @param erros error...
e6363a725ad393be71428da47de734c049fa7751
TypeScript
naughtLdy/sandbox-typescript-meetup3
/src/store/modules/cs/index.ts
2.703125
3
import { RootState } from '~/store' import { defineModule, defineGetter } from '~/store/helpers'; import { actionCreatorFactory, combineMutation, combineAction, action, mutation } from 'vuex-typescript-fsa' interface User { name: string } export const namespace = 'csStore' const actionCreator = actionCrea...
d6c090b22ec95f5e74f2fae3f5e62cf58217e4dc
TypeScript
Valdecir190199/ListaTelefonicaAngular
/src/app/entidades/lista.ts
2.671875
3
export class Lista{ private nome : string; private numero : number; getNumero():number { return this.numero; } setNumero(numero:number) : void{ this.numero = numero; } getNome():string { return this.nome; } setNome(nome:string) : void{ this.nome = nome; } }
c772e70f095deb66b172f82e4bdac2c5b7663bb2
TypeScript
devskar/clicker-game
/src/manager/FileManager.ts
2.625
3
import editJsonFile, { JsonEditor } from 'edit-json-file'; class FileManager { filePath: string; saveEveryXSeconds: number; file: JsonEditor | null; cashedContent: any; constructor(filePath: string, saveEveryXSeconds: number = 15) { this.filePath = filePath; this.saveEveryXSeconds = saveEveryXSecond...
8e632791f9d075e88b2fa4365a264ecbce4c0492
TypeScript
isChosen/my-auction-form
/src/app/validator/validators.ts
2.578125
3
import { FormControl, FormGroup } from '@angular/forms'; // tslint:disable-next-line:import-blacklist import { Observable } from 'rxjs'; // 校验方法 export function mobileValidator(val: FormControl): any { const regExp = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/; const valid = regExp.test(val.value); ...
bd7a9c04b895b201ad6ee02cf2e1fed5bb31e312
TypeScript
infinitelifter/test-list
/src/containers/form/reducer.ts
3.109375
3
import { Reducer } from "redux"; import { ADD_ITEM, REMOVE_ITEM } from "../../constants"; export interface FormReducerState { items: string[]; } export const initialState = { items: [] }; export const formReducer: Reducer<FormReducerState> = ( state = initialState, action ): FormReducerState =>...
757ddb02d6125787aa7b83c1fe82e7cfc92eddaf
TypeScript
wizba/Galaxy
/src/app/Services/ShortestPath.service.ts
2.828125
3
import { Injectable } from "@angular/core"; import { GRAPH, PLANET_NAMES } from "../Graph/Graph"; @Injectable({ providedIn: "root", }) export class ShortestPath { private INFINITY: number = 9999; private myNodes: string[] = [ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J...
c23457201dad8ac3ff8289fa4dd613c27b1c9a72
TypeScript
dguo/blood-moon
/blood-moon.ts
2.671875
3
import Color from 'color'; import {BaseColorScheme, Theme} from './types'; function lighten(hex: string, value: number): string { const rgb = Color(hex) .lighten(value) .rgb() .array(); const lightenedHex = '#' + rgb .map(x => { const xHex =...
746b04d3e571fae5984fd33dd176194900e44f23
TypeScript
lguertin/log2990
/server/app/routes/crossword/crossword-generator/crossWordCreator.ts
2.625
3
import { CrossWordGrid } from "./types/crosswordGrid"; import { GameDifficulty, GridWord, GRID_DIMENSION } from "../../../../../common/crossword/constant"; import { BlackCellFiller } from "./crossword-content-filler/blackCellFiller"; import { injectable } from "inversify"; import { WordFiller } from "./crossword-conten...
4f232a52f4f121f960194a0a568dfda523a402f4
TypeScript
HaskellJacobCurry/haskell-ts
/dist/Typeclass/Control/Apply.d.ts
3.140625
3
import { HKT, URI1, URI2, Kind1, Kind2 } from '../../Common/HKT'; import { Functor, Functor1, Functor2, Functor2C } from '../Data/Functor'; /** * class (Functor f) <= Apply f where * ap :: f (a -> b) -> f a -> f b * alias :: (<*>) * liftA2 :: (a -> b -> c) -> f a -> f b -> f c * fstAp :: f a -> f b -> f a * ...
0b9596a4da4ecb53b72dc73844f7f453172a6ef5
TypeScript
bluelovers/random
/test/distributions/array-fill.test.ts
2.53125
3
import random from '../..' describe(`byte`, () => { const fn = random.dfArrayFill(); const tests = [ ['Array', new Array(10)], ['Uint8Array', new Uint8Array(10)], ['Buffer', Buffer.alloc(10)], ] as const; tests.forEach(function (arr) { it(`${arr[0]}`, () => { let ret = fn(arr[1]); expect(ret).t...
fbe7947734f39e55dc99193ee97e994d3347ac6c
TypeScript
UrosKuzmanov/MVC_mode_single_page_app
/TS/URLParser.ts
3.171875
3
export class URLParser{ hash:string public constructor(hash:string){ this.hash=hash } private extractor():string[]{ const no_hash=this.hash.substring(1) if(no_hash.length==0){ return [] }else{ return no_hash.split("/") } } public ...
3f6fbca29b129efbefa5988526fa4d0fe6af930d
TypeScript
andreineculau/git-resolver
/src/index.ts
2.578125
3
import logger from '@pnpm/logger' import got = require('got') import git = require('graceful-git') import normalizeSsh = require('normalize-ssh') import path = require('path') import parsePref, {HostedPackageSpec} from './parsePref' export {HostedPackageSpec} const gitLogger = logger // TODO: add namespace 'git-logge...
51da3f63b3130c2d0fef6044f570232472079154
TypeScript
dopeybobo/feathers-service-builder
/examples/chat/services/user.ts
2.640625
3
import { Application } from '@feathersjs/feathers'; import * as errors from '@feathersjs/errors'; import { ServiceBuilder } from 'feathers-service-builder'; import { UserRequest, validateUserRequest } from './hooks/validate'; import { toExternalUser } from './hooks/output'; export interface User { username: strin...
53f42e5ee43a687a6941d12d9fc520b30099ddd6
TypeScript
bvanderdrift/select-experiment
/src/analysis.ts
3.109375
3
import { SelectionType } from "./CountryPicker"; export interface ExperimentDataPoint { age: number; selectionType: SelectionType; optionCount: number; selectionTime: number; countryCode: string; } // Side-effects EVERYWHERE! export const filterByType = ( data: ExperimentDataPoint[], selectionType: Sele...
4a1aced56ced847a199e17f5b2d29ba83697b0bc
TypeScript
Rediker-Software/redux-data-service-react
/src/WithModelArray.ts
2.53125
3
import "rxjs/add/operator/switchMap"; import "rxjs/add/operator/combineLatest"; import { Observable } from "rxjs/Observable"; import { branch, ComponentEnhancer, mapPropsStreamWithConfig } from "recompose"; import { getDataService } from "redux-data-service"; import { plural } from "pluralize"; import rxjsConfig from ...
bf7cf276b55213ab0125c06de75adebf84fe4349
TypeScript
asteria-project/asteria-gaia
/src/com/asteria/gaia/common/lang/core/AsteriaRegistryAsync.ts
3.3125
3
import { AsteriaException } from '../exception/AsteriaException'; import { AsteriaObject } from './AsteriaObject'; /** * The <code>AsteriaRegistryAsync</code> interface defines the API that you must implement to create asynchronous * registries in Asteria projects. */ export interface AsteriaRegistryAsync<T> exte...
cf031e9bc0bed1998a1b37742ae56f2b8dbab713
TypeScript
shortalla/list-programs
/src/app/modules/activity/services/activity.service.ts
2.6875
3
import { Injectable } from '@angular/core'; import { ApiService, ActivityOptions } from '../../../core/api/api.service'; import { ActivityModel } from '../models/activity.model'; import { ActivityState } from '../store/activity.reducer'; /** * Service for handling events related to activities */ @Injectable() export...
2e84a506bde976ddda8cf4557cf7b3d7eeddc025
TypeScript
zichenma/TypeScript_Crawler_Basic
/2_12_Class_inherents/demo.ts
4
4
class Person { name = 'dell'; // 定义类属性 getName() { return this.name; } } const person = new Person(); // 类继承 class Teacher extends Person { getTeacherName() { return 'techer'; } } // 多太: class Teacher1 extends Person { getName() { // 重写之后依然可以用 super 去调用父类中的方法 // return super.getName() + '...
7a45ac1e359cc30831bb68d5b658e2d84c799629
TypeScript
lfmm/talk-core
/src/lib/src/core/models/layout.model.ts
2.75
3
export interface LayoutState { // right to left rtl: boolean; // visibility show: { header: boolean, nav: boolean, content: boolean, aside: boolean, footer: boolean }; // sizes sizes: { header: number, nav: number, content: number, aside: number, footer: number ...
fe79dd052981e8b2148bd900cdc5d81a4a93a669
TypeScript
marco-c/gecko-dev-wordified-and-comments-removed
/dom/webgpu/tests/cts/checkout/src/common/framework/resources.ts
2.78125
3
let baseResourcePath = ' . / resources ' ; let crossOriginHost = ' ' ; function getAbsoluteBaseResourcePath ( path : string ) { if ( path [ 0 ] = = = ' / ' ) { return path ; } const relparts = window . location . pathname . split ( ' / ' ) ; relparts . pop ( ) ; const pathparts = path . split ( ' / ' ) ; let i ; for ( ...
cc8c0f513d2f18d66e579cb4cb66378e8c8e8aa7
TypeScript
Trakkasure/graphics-experiments
/objects/DataModel/DataStructures.ts
3.15625
3
import { Vector2D } from "./Physics"; export class Point2D { // Point readonly x: number; readonly y: number; constructor(x: number, y: number) { this.x=x; this.y=y } add(v: Vector2D) { return new Point2D(v.mx+this.x,v.my+this.y); } } export interface Bounds { ...
7a5ebcf0d81d36bffe4402f82cf8a1b9dfad17d4
TypeScript
jonatasrmoura/API-NLW04
/src/database/index.ts
2.625
3
import { Connection, createConnection, getConnectionOptions } from 'typeorm'; export default async(): Promise<Connection> => { // aqui vou verificar se é um comando de teste ou se é um comando de ambiente de desenvolvimento // vou pegar toda as informações que tenho dentro o ormconfig.json const defaultOp...
b280a6610dfec3050623275159fed1b49c43c395
TypeScript
R0mze5/react-test-pet-project
/src/features/reactApi/containers/HooksReducer/reducer.ts
3.21875
3
import { hooksActions } from './actions'; type TNotes = any; interface IAction { type: string; payload?: any; } interface IState { notes?: TNotes; } // interface IReducer { // state: any, // action: IAction // } // export default function(state: IState, action: IAction): IState { // switch (action.type...
ffcb7f6d0877dca898df612fbce414e4a995a536
TypeScript
Prough123/cards
/src/n1-main/m2-bll/b1-registrationReducer/actions.ts
3.640625
4
export enum ACTIONS_TYPE { CREATE_USER = 'Registration/CREATE_USER', SET_IS_LOADING = 'Registration/SET_IS_LOADING', SET_IS_REGISTERED = 'Registration/SET_IS_REGISTERED', SET_ERROR = 'Registration/SET_ERROR', } export type NewUserData = { email: null | string, password: null | string, } //fun...
ceccf2df8152bc3ae6d142d6851b390c1635e898
TypeScript
baochengxu/ts-cesium
/src/plugin/lib/utils/OperationId.ts
2.90625
3
/* * @Author: wuyue * @Date: 2021-01-11 17:01:24 * @LastEditTime: 2021-03-07 02:06:07 * @LastEditors: Please set LastEditors * @Description: 工具类 */ import { EntityType } from '../ast' export default class OperationId { /** * @description: 获取一个新的GUID * @param {*} OperationId * @return {*} */ stat...
26826e9af24e816d678ad9fe1939e8acc9d44593
TypeScript
MrWillTurner/cloud-prvider-openstack
/src/models/openstack/openstack-authentication-request.model.ts
2.5625
3
export interface OpenStackAuthenticationRequestConfig{ applicationId: string, applicationSecret: string, } export class OpenStackAuthenticationRequest { private _model: any; constructor(_config: OpenStackAuthenticationRequestConfig) { this._model = { auth: { identity: { methods:...
1f449cc3dda561e1c51342df5c38e33c48bd8807
TypeScript
relief-melone/advent-of-code-2019-typescript
/test/test.08.02.ts
2.578125
3
import { expect } from 'chai'; import { mergeLayers, layerToGrid } from '../src/08.02/exec'; describe('Day 8 - Second Puzzle', () => { it('correctly merges layers', () => { expect(mergeLayers([ [0,2,2,2], [1,1,2,2], [2,2,1,2], [0,0,0,0] ])).to.deep.equal( [0,1,1,0] ); }); ...
415d6b8e7388d8de00f353e5c7c5b49bcb19a500
TypeScript
anst9000/music-events
/src/app/price-range.pipe.ts
2.625
3
import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'priceRange' }) export class PriceRangePipe implements PipeTransform { transform(value: number, ...args: any[]): string { if (value > 100) { return 'Expensive'; } else if (value > 30) { return 'Average'; } else { retur...
e2cac9056b7cb47520758bde0e046d702be162b4
TypeScript
tabwrangler/tabwrangler
/app/js/__tests__/settings.test.ts
2.671875
3
import Settings from "../settings"; let mockFunctionGet: jest.Mock; let mockFunctionSet: jest.Mock; beforeEach(() => { window.chrome = { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore:next-line i18n: { getMessage() { return ""; }, }, storage: { ...
8ac2f39f917df75a87a701eda270d6de1062bba5
TypeScript
tkow/key2union
/lib/file.ts
2.78125
3
import { existsSync } from 'fs'; import * as path from 'path'; import { CONFIG_NAME, DEFINITION_FILE,PACKAGE_JSON, UNIONTYPE_NAME } from './constants'; import { Config, JsonObject } from './interfaces'; import { tsTransform } from './tsTrasform'; export const getConfigFromPackageJson = (dir: string): Config | Error =>...
3275186065e6814a00fc8730d8373859bf494315
TypeScript
Tohman21/js-handy-filter
/src/condition-parser/index.ts
3.171875
3
import { isArray } from 'lib/type-guards'; import { Condition, ICondition, PlainCondition, SimpleValue, StringCondition } from 'conditions/types'; import { isICondition, isPlainCondition } from 'conditions/lib/type-guards'; import { ParseError } from './errors'; import { REGEXP_CONDITIONS_MAP, SIMPLE_CONDITIONS_MAP }...
0d24224a05789055243cd998770fec578f44361a
TypeScript
eliocapelati/lp-demo-app-connector-api
/web/app/shared/models/app-installation/endpoint.model.ts
2.859375
3
import {Deserializable} from "../deserializable.model"; export class Endpoint implements Deserializable<Endpoint> { endpoint: string; headers: Array<any>; max_retries: number; constructor(){ this.endpoint = ""; } deserialize(input: any): Endpoint { Object.assign(this, input); return this; } ...
51d2e8279aac573de16b788cfb047b09c1497588
TypeScript
neekolas/orm-redis
/src/Collections/RedisLazySet.ts
3.015625
3
import { getEntityFullId } from "../Metadata/Metadata"; import { EntityType, RedisManager } from "../Persistence/RedisManager"; import { LazySet } from "./LazySet"; /** * Redis-backed lazy set * * @export * @class RedisLazySet * @template T */ export class RedisLazySet<T> extends LazySet<T> { /** * Ma...
ccede94fe4f2c99c0c91c0ea32f0953748516cbf
TypeScript
5ocjal/tanks1990
/src/models/player.model.ts
2.59375
3
import { AnimationService } from '../utils/animationService'; import { Bullet } from './bullet.model'; import { PlayerState } from './enums/playerState'; import { Speed } from './enums/speed.enum'; export class Player extends Phaser.Physics.Arcade.Sprite { config; animationService = new AnimationService(); input...
37c6336021425947864f5ace295d78079da73cd3
TypeScript
viksatheboss/BeelivioTestTask
/Beelivio FrontEnd/BeelivioTaskApp/src/app/Services/auth.service.ts
2.515625
3
import { Injectable } from '@angular/core'; import jwt_decode from "jwt-decode"; import { JWTModel } from 'src/app/Models/JWTModel'; @Injectable({   providedIn: 'root' }) export class AuthService {   public isLoggedIn() {     const token = this.getAuthToken();     if (token === null || token === undefined)       ret...
f265feffbf2aa1a9d30003ba68224749864083b3
TypeScript
MaxStenex/express-blog
/server/src/models/User.ts
2.75
3
import mongoose, { Schema, Document } from "mongoose"; export interface UserType extends Document { firstName: string; lastName: string; email: string; password: string; } const userSchema: Schema = new Schema({ firstName: { type: String, required: true }, lastName: { type: String, required: true }, ema...
51bfde5f1efbe41cf2da552dae6bcc744e333db4
TypeScript
bodgery/bodgery-member-api
/test/pg-set-rfid.ts
2.578125
3
import * as assert from "assert"; import * as pg from "../src/db-pg"; import * as shortid from "shortid"; import { error_handler ,get_pg_connection ,test_member_data } from "../src/util"; describe( 'Changes a member\'s RFID', function () { let db: pg.PG; before( () => { db = get_pg_connec...
792b5cb9f720c12e8bbdc4ec0b2bb649cf0b2d60
TypeScript
basvdijk/domusto-philips-hue
/index.ts
2.53125
3
import config from '../../config'; // DOMUSTO import DomustoPlugin from '../../domusto/DomustoPlugin'; // INTERFACES import { Domusto } from '../../domusto/DomustoTypes'; import DomustoSignalHub from '../../domusto/DomustoSignalHub'; import DomustoDevicesManager from '../../domusto/DomustoDevicesManager'; // PLUGIN ...
2913976c5447fc2e4819b56a8252da66357b4f6d
TypeScript
whisperlab/slonik
/src/factories/typeParsers/createTimestampTypeParser.ts
2.78125
3
import type { TypeParser, } from '../../types'; const timestampParser = (value: string | null) => { return value === null ? value : Date.parse(value + ' UTC'); }; export const createTimestampTypeParser = (): TypeParser => { return { name: 'timestamp', parse: timestampParser, }; };
991a1da572b71d0b0cf6f2fee3c4556d26286bc0
TypeScript
craigfay/simtrader
/services/api/src/quote-providers/marketwatch.ts
2.765625
3
const fetch = require('node-fetch'); import { Quote } from '../entities'; /** * Attempt to get a quote for a given symbol from Marketwatch */ export async function getQuote(symbol): Promise<Quote> { try { // Fetch HTML const url = `https://www.marketwatch.com/investing/stock/${symbol}`; const response ...
6950db94d66de8469fa8b441445584316c2737d4
TypeScript
strong-config/node
/src/e2e/validate.ts
2.640625
3
import chalk from 'chalk' import type { Schema } from '../types' // Needed for commonjs-compatibility /* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/b...
75558b7582c842d860b2cccb9bf53ab63bbc0139
TypeScript
KaiVolland/react-geo-baseclient
/src/state/reducers/ActiveModulesReducer.spec.ts
2.625
3
/* eslint-env jest*/ import reducer from './ActiveModulesReducer'; import { ADD_ACTIVEMODULE, REMOVE_ACTIVEMODULE } from '../constants/ActiveModules'; const initialState: any[] = []; describe('ActiveModulesReducer', () => { it('returns the initial state', () => { expect(reducer(undefined, {})).toEqual(init...
44cad8e313093eb336f76fa514b99a5fcb58788d
TypeScript
dudluk/experiment
/src/runtime/templating/anchors.ts
2.71875
3
import { DOM } from "../dom"; function hasAttribute(name) { return this._element.hasAttribute(name); } function getAttribute(name) { return this._element.getAttribute(name); } function setAttribute(name, value) { this._element.setAttribute(name, value); } export function makeElementIntoAnchor(element: Element...
6a2b8c46b733e7805864a151e970fbeedbd86ab8
TypeScript
src-zone/material
/bundle/src/testutils/util.ts
3.078125
3
/** * Like spyOnAllFunctions, but that function has a bug in the current Jasmine, leading to exception * when trying it on a foundation class. */ export function spyOnAll(object: any) { let pointer = object; while (pointer) { for (const prop in pointer) { if (object[prop] && object[prop]....
ad578f3c42282e7e3b3a99bcc09508dc5f43660c
TypeScript
silky/refscript
/include/ambient/function.ts
3.359375
3
/*** Function ************************************************************/ interface Function { /** * Calls the function, substituting the specified object for the this * value of the function, and the specified array for the arguments of the function. * @param thisArg The object to be used as...
d942498aabcaa105d6cc721845b6051e0f84a43b
TypeScript
mukteshwarpatil/ApertureTechnologyRepo
/angular2-primeng-example-master/client/src/app/module/parser/interface.ts
2.65625
3
export class CourseData { public columns: string[] = []; public courses: any[] = []; } export interface ParserInterface { parse(data: any): CourseData; }
d35475796a2253da863b1116257a19e13c02a2c4
TypeScript
Coffeekraken/coffeekraken
/packages/postcss/s-postcss-sugar-plugin/src/node/mixins/color/docblocks.ts
2.625
3
import __SInterface from '@coffeekraken/s-interface'; import __STheme from '@coffeekraken/s-theme'; class postcssSugarPluginDocblockColorsMixinInterface extends __SInterface { static get _definition() { return {}; } } export { postcssSugarPluginDocblockColorsMixinInterface as interface }; /** * @__na...
f2d8cb3ed99728c10e147e60c91a36e2453438aa
TypeScript
Militao36/AppMaster
/src/controllers/Hero.ts
2.640625
3
import { NextFunction, Request, Response } from "express"; import heros from "../services/heros"; class HeroController { async search(req: Request, res: Response, next: NextFunction) { try { const { q } = req.query const data = await heros.search(q as string) return res....
03fb99506939f1b858b5d72952ec105679b98264
TypeScript
tic40/chat-bots
/gas-fightclub-slackbot/src/services.ts
2.515625
3
const postToSlack = ( text: string, channelName: string = SLACK_CHANNEL, imageUrl = null ): void => { const payload = { text, channel: channelName, icon_emoji: SLACK_BOT_ICON_EMOJI, username: SLACK_BOT_USERNAME, } if (imageUrl) { payload.attachments = [ { image_url: imageUr...
1471f18bd3349273e705e3881d9143e62d231d5c
TypeScript
Yeon22/TopCredu-Study-Angular
/angular-di-demo/src/app/factory/animal-factory.ts
3.21875
3
import { Animal, Config } from './animal'; //팩토리패턴 abstract class Factory { // 객체 생성방법 결정 create() { return this.createAnimal(new Config()); } abstract createAnimal(Config): Animal; } export class AnimalFactory extends Factory { // 객체 설정방법 결정 createAnimal(config: Config) { config.bark = "야옹야옹"; ...
dcfe1c3922b4772f0fa6bcf14a4c3039b31b712c
TypeScript
K24limiantao/cangku01
/src/routes/index.ts
2.8125
3
//定义路由 就是发送请求打开页面和接收请求返回页面 var express = require('express'); var passport = require('passport'); var Account = require('../models/account'); var ListRoles = require('../models/ListRoles'); var Post = require("../post01"); var router = express.Router(); //获取登录后的名字 let login_name = ""; var allRoles : String[] = []; let...
eb9e61c419b5ecc463f53b2b3e4da6c72b62b241
TypeScript
lqqokim/healthMonitoringPrediction
/frontend/pdm-web/src/client/sdk/pipes/match-name.pipe.ts
2.546875
3
import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'matchName' }) export class MatchNamePipe implements PipeTransform { transform(list: any[], labelfield: string, searchText: string): any { if (searchText && list && list.length > 0) { searchText = searchText.toUpperCase(); ...
10d3a5bf0d9396e6e1fcbfc12379337069dc439f
TypeScript
omarsagoo/sentry
/src/commands/moderation/unmute.ts
2.6875
3
import { Command } from 'discord-akairo'; import { Message, Permissions, GuildMember } from 'discord.js'; import { Mutes } from '../../models/mutes'; import { Servers } from '../../models/server'; import { unmute } from '../../structures/muteManager'; import { logUnmute } from '../../structures/logManager'; import { ch...
f510f30b0e11bce185816b531ebcbbf1669e05cf
TypeScript
tosbaha/editions
/projects/Mallard/src/authentication/services/apple-oauth.ts
2.765625
3
import invariant from 'invariant'; import qs from 'query-string'; import { authWithDeepRedirect } from '../deep-link-auth'; const appleRedirectURI = 'https://idapi.theguardian.com/auth/apple/auth-redirect-editions?redirect-for=editions'; const appleDeepLinkRedirectURI = 'theguardianeditions://auth/apple/auth-redire...
f94a5cbb96fbfc464b0133f7875750a064f95d77
TypeScript
mikeludemann/helperFunctions_TypeScript
/src/Math/Other/roundIndex.ts
2.640625
3
function roundIndex(value: number, index: number) { result = 0; if ((typeof value !== 'number')) { return false; } if (index == null || index == "" || typeof index !== 'number') { result = parseFloat(a.toFixed(1)); } else { result = parseFloat(a.toFixed(index)); } return result; }