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 |
|---|---|---|---|---|---|---|
2e9b25f730484e940b4e60a97a3d1f4a12146ed4 | TypeScript | gct256/md-doc | /src/modules/models/options.ts | 2.921875 | 3 | import path from 'path';
import { pathExists, stat } from 'fs-extra';
import { defaultFragmentsDir } from '../utils/dirs';
import { Logger, SignaleLogger, NullLogger } from '../utils/Logger';
/** オプション */
export interface Options {
/** ヘッダファイル */
headerFile: string;
/** フッタファイル */
footerFile: string;
/** C... |
b9ce2221a311f71d1691a9d2aa1b823395cb07ba | TypeScript | guilhermeborgesbastos/live-resume | /src/app/core/directive/internationalization.directive.ts | 2.59375 | 3 | import { Directive, ElementRef, Input, OnInit} from "@angular/core";
import { LOCALE_ID, Inject } from "@angular/core";
import { EllipsisPipe } from "../pipe/ellipsis.pipe";
@Directive({ selector: "[appInternationalization]" })
export class InternationalizationDirective {
private _data: any[] = [];
@Input() ... |
321364a5d3506f5287ab07de88407beaa7e32bec | TypeScript | maja1007/Typescript | /main.ts | 3.0625 | 3 | /*
Skapad av: Martina Jansson
Kurs:HT18 DT173G Datateknik GR (B), Webbutveckling III, 7,5 hp
*/
"use strict";
declare function require(name:string); // Make it possible to use require in TypeScript
var fs = require('fs');
//Class
class FilePublisher {
filename: string;
constructor(name: string) {
this.fi... |
214738efc5110341041a96d26ac3b918c23dedb9 | TypeScript | grzegorz-bielski/rxsv | /packages/core/src/tests/combiners.test.ts | 3.03125 | 3 | import { Observable, of } from 'rxjs';
import { Reducer, witness } from '../types';
import { combineReducers, combineEffects } from '../combiners';
/* eslint-disable @typescript-eslint/no-unused-vars */
describe('combiners', () => {
const action = { type: 'NOOP' };
describe('combineReducers', () => {
... |
2d076b274ea05d669806f43932c8164fa1ade4e8 | TypeScript | nhn/tui.grid | /packages/toast-ui.grid/stories/theme.stories.ts | 2.84375 | 3 | import Grid from '../src/grid';
import '../src/css/grid.css';
import { OptColumn, OptThemePresetNames, OptPreset } from '../types/options';
import { cls } from '../src/helper/dom';
import { Side } from '../types/store/focus';
type ThemeOptions = { preset: OptThemePresetNames; extOptions?: OptPreset };
export default ... |
b9fc41336bbcc1199ae2866bca6a9f40190cd7df | TypeScript | JunjaK/droneWeb | /src/views/test/test.ts | 3.25 | 3 | class Control {
private state: any;
}
interface SelectableControl extends Control {
select(): void;
}
const a = new Control();
class Button extends Control implements SelectableControl {
select() {
console.log('click');
}
}
const b:SelectableControl = new Button();
function buildName(firstName: string, ...p... |
9e4b2c5ab050c5e14ab8fe4ac96d966d912fde77 | TypeScript | masterraf21/cinema-webservice-api | /backend/scripts/tester.ts | 2.578125 | 3 | /* eslint-disable @typescript-eslint/no-unused-vars */
// import from
import * as uHelper from '../src/controllers/user/user.helper'
import * as movieHelper from '../src/controllers/movie/movie.helper'
import * as showtimeHelper from '../src/controllers/showtime/showtime.helper'
import * as showController from '../src... |
1a1fc96086d05f4d5ae86819c838d2bf39c78a0c | TypeScript | SocialGouv/code-du-travail-numerique | /packages/code-du-travail-modeles/src/modeles/common/factory/seniority.ts | 2.53125 | 3 | import { SeniorityLegal } from "../../base";
import {
Seniority16,
Seniority44,
Seniority176,
Seniority275,
Seniority413,
Seniority650,
Seniority1090,
Seniority1404,
Seniority1483,
Seniority1486,
Seniority1505,
Seniority1517,
Seniority1518,
Seniority1527,
Seniority1596,
Seniority1597,
... |
d5fc7f72c67d46e57bad9fdda80c600b54cbfa09 | TypeScript | nordnet/ui | /src/Molecules/Tooltip/Tooltip.types.ts | 2.546875 | 3 | import React from 'react';
import { InModal, Position } from 'common/PopOver/PopOver.types';
import { BasePlacement, Rect } from '@popperjs/core';
import { Theme } from 'theme/theme.types';
type OffsetFunctionArg = {
popper: Rect;
reference: Rect;
placement: BasePlacement;
};
type BareOffset = [number, number];... |
b18752f929d788805834536b5347e003121c69db | TypeScript | qiushangzhe/Mj-server | /server/game/model/game.model.ts | 2.5625 | 3 | import { MjCard } from '../../game/model/MjCard/mjCard';
import { SPlayer } from './smartPlayer';
import { PlayerInfoInterface } from '../../../common/interfaces/playerInfo.interface';
import * as log from 'log4js';
import { MjDesk } from './MjDesk';
import { Action } from '../../../common/enums/action.enum';
export cl... |
4d32b83b8acef9a239b66c5eb8b4667b61993ab6 | TypeScript | adisak1618/seven-peaks-quiz | /lib/loading.ts | 2.515625 | 3 | export default class ProgressBar {
/** Show the progress bar and begin animating it. */
start: () => void;
/** End the progress bar animation. */
finish: () => void;
constructor() {
this.start = () => {
const mainBody = document.getElementById("main")
if (mainBody) {
let wrapper = doc... |
cc97e5547e1d0955dc039a3864b6088f84210c6f | TypeScript | rylandg/rto-shared | /src/optional.ts | 3.5 | 4 | import * as t from 'io-ts';
/**
* Type lambda returning a union of key names from input type P having type A
*/
type FieldsWith<A, P> = { [K in keyof P]-?: (A extends P[K] ? K : never) }[keyof P]
/**
* Dual for FieldsWith - returns the rest of the fields
*/
type FieldsWithout<A, P> = Exclude<keyof P, FieldsWith<A... |
e1c74c529a4addd876715ab1cd75513949d3e075 | TypeScript | jba123/evm-lite-client | /cli/src/commands/ConfigSet.ts | 2.546875 | 3 | import * as Vorpal from "vorpal";
import * as inquirer from 'inquirer';
import Globals from "../utils/Globals";
import Session from "../classes/Session";
export default function commandConfigSet(evmlc: Vorpal, session: Session) {
let description =
'Set values of the configuration inside the data directo... |
db7a5a59c9d9af37f2d788406f2b597ff313cd47 | TypeScript | PreeduS/Angular7 | /frontend/src/app/shared/auth.interceptor.ts | 2.578125 | 3 | import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent } from '@angular/common/http';
import { Observable } from 'rxjs';
import { tap } from 'rxjs/operators'
export class AuthInterceptor implements HttpInterceptor {
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>{
// ... |
e3ebc28c28d809fc14e6e2d14e2e6d1eabd9de2b | TypeScript | ZakVien/MovieList | /src/hooks/useAddToList.ts | 2.546875 | 3 | import { useMutation, useQueryClient } from 'react-query'
interface AddToUserListArguments {
listId: string,
movieId: string;
userSessionId: string;
}
async function fetchAddToUserList(args: AddToUserListArguments): Promise<void> {
const { listId, movieId, userSessionId } = args;
const url = new URL(`https:... |
d83734ff780f5364cb60fcbc4b7fc3d19d75cb01 | TypeScript | EvlavTech/arquinator-backend | /src/app/errors/BaseError.ts | 2.796875 | 3 | class BaseError extends Error {
public statusCode: number;
constructor(description: string, statusCode: number) {
super(description);
this.statusCode = statusCode;
}
}
export default BaseError;
|
e354ad0cf8bf161c7b587831e2fdb233212ca152 | TypeScript | JouNishimaki/twinte-front | /src/adapter/store/tableData/index.ts | 2.765625 | 3 | /**
* API通信を伴う状態処理
*
* - 時間割はPeriod配列ですべてのモジュールをまとめて保持する
* - 任意のコンポネントで時間割は作成される
* - isLoginはページ初回に毎回確認が行われる
*/
import { Getters, Mutations, Actions } from 'vuex'
import { S, G, M, A } from './type'
export const state = (): S => ({
timeTables: [],
isLogin: false,
moduleList: ['春A', '春B', '春C', '秋A', '秋B',... |
8f230837dfffde728c8ca9347eb609a82e48448c | TypeScript | DefinitelyTyped/DefinitelyTyped | /types/jsrsasign/modules/KJUR/asn1/x509/X500Name.d.ts | 3.203125 | 3 | declare namespace jsrsasign.KJUR.asn1.x509 {
interface X500NameParam {
C: string;
O: string;
CN: string;
}
/**
* X500Name ASN.1 structure class
* @param params associative array of parameters (ex. {'str': '/C=US/O=a'})
* @see KJUR.asn1.x509.X500Name
* @see KJUR.a... |
3e9bfb30b3c6983eee4d8a8c0edde135d21d6d1b | TypeScript | BriteSnow/node-cloud-bucket | /src/driver.ts | 2.859375 | 3 | import { Readable, Writable } from 'stream';
import { BucketFile, BucketType } from './types.js';
// Note: right now use generic default with F (file) any
export interface Driver<F = any> {
type: BucketType;
name: string;
toFile(orgFile: F): Omit<BucketFile, 'bucket'>;
/** Return the path of a cloud "file obje... |
7ea3749eaeff40330264348fc48a97065e067663 | TypeScript | zzorba/ArkhamCards | /src/data/types/FaqEntry.ts | 2.625 | 3 | import { Entity, Column, PrimaryColumn } from 'typeorm/browser';
@Entity('faq_entry')
export default class FaqEntry {
@PrimaryColumn('text')
code!: string;
@Column('text', { nullable: true })
text?: string;
@Column('text', { nullable: true })
updated?: string;
@Column('datetime', { nullable: true })
... |
7f73be8d1c812f4d3d3eb608631365906f8453e8 | TypeScript | lapprand/mdc-manga | /app/src/ts/filter/filter.model.ts | 2.953125 | 3 | // type and factory function to build initial state
export type Filter = {
itemType: string;
}
export function createFilter({
itemType = ""
}: Partial<Filter>) {
return {
itemType
}
} |
26e16e7b4b5aab14d56ec6731eeac7aadd6b6486 | TypeScript | Joatin/rss-feed | /src/server.ts | 2.671875 | 3 | import * as Koa from 'koa';
import * as Router from 'koa-router';
import * as bodyParser from 'koa-bodyparser';
import {getTopWords} from "./get-top-words";
const app = new Koa();
const router = new Router();
router.get('/', async (ctx) => {
ctx.body = 'Welcome to the RSS word counter start by posting to /top-words... |
ad25b3555bcc08a480970f553f4e8820bda38484 | TypeScript | dogrod/leetcode-record | /src/isomorphic-strings.ts | 3.625 | 4 | interface AlphabetIndexMaps {
first: AlphabetIndexMap,
second: AlphabetIndexMap
}
interface AlphabetIndexMap {
[key: string]: number
}
/**
* @param {string} s
* @param {string} t
* @return {boolean}
*/
const isIsomorphic = (s: string, t: string) => {
if (s.length <= 1) {
return true
}
const alpha... |
e2bd87edfcb4e4a506768db8b3cbd1348073df18 | TypeScript | AntunPrskalo/nodejs-simple-tic-tac-toe | /src/resolvers/Query.ts | 2.5625 | 3 | import { IGame, IPlayer, Status } from '../model/game.model';
const Query = {
async getHistory(parent, args, { gameModel, logger }, info) {
const gameId: string = args.data.gameId;
const playerId: string = args.data.playerId;
let games: IGame[] = [];
if (gameId) {
const... |
7256bd28572a1f880898b6888d2361b581ef2332 | TypeScript | int0h/throttle | /src/tests/index.ts | 3.375 | 3 | import test from 'ava';
import throttle from '..';
function fn(cb: Function) {
cb();
}
class Timeline {
last: number;
calls: number[] = [];
push = () => {
if (this.last) {
this.calls.push(Date.now() - this.last);
}
this.last = Date.now();
}
getAvgPause() {... |
26fae83321db643be213c0e733a272fc67aa0d18 | TypeScript | SunnySunhwa/wooltari | /src/app/dev/user/password-validator.ts | 2.734375 | 3 | import { AbstractControl } from '@angular/forms';
export class PasswordValidator {
static match(form: AbstractControl) {
// 매개변수로 전달받은 검증 대상 폼 모델에서 password와 confirmPassword를 취득
const password1 = form.get('password').value;
const password2 = form.get('confirmPassword').value;
// password와 confirmPa... |
954261967e4d51bfa9a034ed371b0224b9b4c181 | TypeScript | d4n13l-4lf4/Aplicaciones-Web | /02 Typescript/clases.ts | 3.921875 | 4 | console.log("Hola mundo");
console.log("jajaja");
//let hola:any;
let hola: number | string = "Hola brow";
const adios = "Adiós brow";
hola = adios;
// adios = hola -> error porque no se puede re-asignar a una variable de solo lectura
//hola = 1 // error -> Duck typing
/* Tipos de datos */
let nombre1: string = "D... |
c49bf8720723429192a18a5e7c051c79ac010374 | TypeScript | google/blockly | /core/renderers/thrasos/info.ts | 2.65625 | 3 | /**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
// Former goog.module ID: Blockly.thrasos.RenderInfo
import type {BlockSvg} from '../../block_svg.js';
import {RenderInfo as BaseRenderInfo} from '../common/info.js';
import type {Measurable} from '../measurables/base.js';
import ... |
aa0897b8b170283648c0fd6c59d8d7b9f2b227f0 | TypeScript | CoreyCole/leetcode-ts | /src/2-add-two-numbers/solution.ts | 3.796875 | 4 | import { LinkedList } from 'typescript-collections'
/**
* You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.
* You may assume the two numbers do not... |
27d805b0d37bce04a14feecb574f13f07593c355 | TypeScript | jiehangWu/image-repository | /src/utils/utils.ts | 2.59375 | 3 | import { v4 as uuidv4 } from 'uuid';
import * as fs from 'fs';
import {
InternalServerErrorException,
Logger,
NotFoundException,
} from '@nestjs/common';
import * as sharp from 'sharp';
import * as path from 'path';
const logger = new Logger('Utils');
const OUTPUT_ROOT = './output';
const UPLOAD_ROOT = './... |
e1422e6b027b2b2549b0ea29272fbf7d673e67ad | TypeScript | creyes-dev/curso-fullstack | /6_Angular/08_formularios/formularios/src/app/reactivo-form-dos/reactivo-form-dos.component.ts | 2.703125 | 3 | import { Component } from '@angular/core';
import { FormGroup, FormControl } from '@angular/forms';
import { FormBuilder } from '@angular/forms';
import { Validators } from '@angular/forms';
import { FormArray } from '@angular/forms';
@Component({
selector: 'app-reactivo-form-dos',
templateUrl: './reactivo-form-do... |
eb413fe9b382437e0d173c4e17b914a9832b07d4 | TypeScript | Spuntagano/twitchclips | /src/app/redux/modules/channels/index.test.ts | 2.65625 | 3 | import { expect } from 'chai';
import { fetchMock, mockStore } from '../../../helpers/TestHelper';
import { IChannelsAction, GET_CHANNELS_REQUEST, GET_CHANNELS_SUCCESS, GET_CHANNELS_FAILURE, GET_CHANNELS_RESET, getChannels } from './';
import channelMock from '../../../mocks/channel';
const errResponse = {
message: ... |
72e8b15c1d06b451e0db0a1ce2b42a2b5baa70c1 | TypeScript | henck/typeui | /docs/controls/Types.d.ts | 2.671875 | 3 | /**
* Certain attributes are applicable to several controls. These are
* typed in this file.
*/
declare type Size = 'mini' | 'tiny' | 'small' | 'medium' | 'large' | 'big' | 'huge' | 'massive';
declare type HorizontalAlignment = 'left' | 'center' | 'right';
declare type VerticalAlignment = 'top' | 'center' | 'botto... |
63f631835b7afe1a4cbc452e875a6bad7fd24199 | TypeScript | championswimmer/vuex-module-decorators | /src/module/stateFactory.ts | 3.046875 | 3 | import { Module as Mod } from 'vuex'
const reservedKeys = ['actions', 'getters', 'mutations', 'modules', 'state', 'namespaced', 'commit']
export function stateFactory<S>(module: Function & Mod<S, any>) {
const state = new module.prototype.constructor({})
const s = {} as S
Object.keys(state).forEach((key: string)... |
b434085f995024255681775b8d28db2aeb869ce8 | TypeScript | vercel/next.js | /packages/next/src/trace/trace.ts | 3.125 | 3 | import { SpanId } from './shared'
import { reporter } from './report'
const NUM_OF_MICROSEC_IN_NANOSEC = BigInt('1000')
let count = 0
const getId = () => {
count++
return count
}
// eslint typescript has a bug with TS enums
/* eslint-disable no-shadow */
export enum SpanStatus {
Started,
Stopped,
}
export cl... |
4a9838bbe81db356d522f8de7189d38299a6341a | TypeScript | sliceofbytes/ngx-tinynodes | /libs/ngx-editorjs/src/lib/directives/ngx-editorjs.directive.ts | 2.515625 | 3 | import {
AfterViewInit,
Directive,
ElementRef,
Inject,
Input,
OnChanges,
OnDestroy,
SimpleChanges
} from '@angular/core';
import EditorJS from '@editorjs/editorjs';
import { NgxEditorJSService } from '../services/editorjs.service';
import { Block } from '../types/blocks';
import { NgxEditorJSConfig, NGX... |
09bd6887ad6091309d01a18a36286274b571c5e7 | TypeScript | bryanneva/rxjs-gql-demo | /src/cats/Cat.ts | 2.90625 | 3 | import {BehaviorSubject} from "rxjs/index";
import {CatRepository} from "./CatRepository";
export class Cat {
public description: BehaviorSubject<string> = new BehaviorSubject<string>("");
public age: BehaviorSubject<number> = new BehaviorSubject<number>(0);
public lastUpdated: BehaviorSubject<string> = ne... |
4e88ced7cd5e97bb5fa7ca66c6606f8f5010912d | TypeScript | ektal12/japanese-lh | /src/pages/review-a-lesson/review-a-lesson.ts | 2.515625 | 3 | import { Component, ViewChild } from '@angular/core';
import { IonicPage, NavController, NavParams, Content } from 'ionic-angular';
import { DataStoreProvider } from '../../providers/data-store/data-store';
@IonicPage()
@Component({
selector: 'page-review-a-lesson',
templateUrl: 'review-a-lesson.html',
})
export... |
75a5b1814b6e404bd6b6f06cfcc041efaabe4232 | TypeScript | yhlese/vue-typeScrpit-antDesign | /src/utils/common.ts | 3.78125 | 4 | /**
* 数字转汉字
* @param num
*/
export const numToUppercase = (num: any) => {
const numMap: Array<string> = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十'];
let len = String(num).length;
let _str: string = '';
if (len === 1) {
_str = numMap[num];
} else if (len === 2) {
if (num === 10) {
... |
101fc8f95074e60bf154fb0114905c1487363ed1 | TypeScript | noheroes/demo_jenkins | /src/ClientApp/src/app/core/functions/http-punku-headers.ts | 2.5625 | 3 | import { PUNKU_ACTIONS } from '../enums/punku-actions.enum';
import {
IAppGlobalConfig,
IAppSession,
IAppUser,
IServerConfig,
} from './../store/app.state.interface';
import { PUNKU_HEADERS } from '../enums/punku-headers.enum';
export const buildPunkuHeaders = (
configuration: IServerConfig,
appSession: IA... |
10e9047cea5896ae839c4c25eeb1805aa570cf57 | TypeScript | taosut/hahuBackend | /src/main/webapp/app/shared/model/notification-meta-data.model.ts | 2.609375 | 3 | export interface INotificationMetaData {
id?: number;
name?: string;
value?: string;
blobValueContentType?: string;
blobValue?: any;
notificationId?: number;
}
export class NotificationMetaData implements INotificationMetaData {
constructor(
public id?: number,
public name?: string,
public va... |
04f35bc818f0509c00a581f1a661ec65fb534bcd | TypeScript | megu3k/typescript-for-javascript-developers | /src/overloads.ts | 3.578125 | 4 | export {};
function double(value:number):number;
function double(value:string):string;
function double(value:any):any{
// console.log(typeof value);
// 上ですでに定義しているため、numberかstring意外の型はこないため例外処理不要。
if (typeof value === 'number'){
return value * 2;
} else {
return value + value;
}
}
console.log(double(10... |
643b5304a00baa3315d93f964431caa31a40908f | TypeScript | Yemachu/site | /src/ygo/project/model.ts | 2.75 | 3 | import { createReducer } from "typesafe-actions";
import { add, reorder, remove, select } from "./actions";
import { card, Card, actions } from "../card";
export type Project = {
readonly cards: Readonly<{ [id: string]: Card }>;
readonly order: string[];
readonly selected?: string;
}
const defaultProject: Proj... |
59a146ecbdd3f8fbb181924689bfe76e36e7e057 | TypeScript | texnic/math1 | /main.ts | 2.546875 | 3 | function display_c () {
basic.clearScreen()
y = 1
x = 0
d = 0
while (d < c) {
d += 1
x += 1
if (x > 5) {
x = 1
y += 1
}
led.plot(x - 1, y - 1)
}
}
WSJoyStick.onKey(KEY.F, function () {
display_problem()
})
input.onButtonPressed(... |
e20f9a3d8ef645bddf904eb489bffac3991b9add | TypeScript | Ait0ne/myVideoChat | /server/src/models/channel.model.ts | 2.640625 | 3 | import mongoose, {Schema} from 'mongoose';
export interface IMessage {
userId: mongoose.Types.ObjectId | string,
text: string,
createdAt: Date
}
export interface IChannel extends mongoose.Document {
messages: IMessage[],
members: any[],
lastMessage: IMessage,
newMessages: Map<string,boolea... |
709ca250cb260bc0c472e85ea6bd2ea15a784df9 | TypeScript | akaztp/test-exam-maker | /src/exam/logic/reducers/questions.reducer.spec.ts | 2.78125 | 3 | import { AsyncDataSer } from '../../../utils/asyncData';
import { Question } from '../../models/question';
import * as reducer from './questions.reducer';
describe('Exam/logic/reducers/questions', () =>
{
let questionsA: AsyncDataSer<Question[]> = null;
beforeEach(() =>
{
const questions: Questio... |
b5b841f2fbc04b162cbcd34d5bf96ae3bcdf67d3 | TypeScript | iamvane/nabiui_next | /src/redux/redux-fixed.d.ts | 2.515625 | 3 | declare module "redux-fixed" {
export type ThunkAction<R, S, E> = (dispatch: Dispatch<S>, getState: () => S, extraArgument: E) => R;
export interface Dispatch<S> {
<R, E>(asyncAction: ThunkAction<R, S, E>): R;
}
export interface Dispatch<S> {
<A>(action:A &{type:any}): A &{type:any};
... |
4326ad7f69494949e0935ed25c83d4dcb2d09289 | TypeScript | chipster/chipster-web | /src/app/views/sessions/session/visualization/venn-diagram/venn-circle.ts | 2.546875 | 3 | import Circle from "../model/circle";
export default class VennCircle {
constructor(
public datasetId: string,
public filename: string,
public data: Array<Array<string>>,
public circle: Circle
) {
datasetId;
filename;
data; // array of tuples containing symbol and identifier (both of wh... |
484bb89e9b645f0370c5329e20b1d641a723bf3c | TypeScript | ksxnodemodules/nodemonorepo | /packages/typescript/convenient-typescript-utilities/test/lib.test/functions.test/func.test/unwrap.test/index.test.ts | 2.96875 | 3 | import { func } from '../../../../../index'
const { unwrap } = func
describe('without arguments', () => {
const lv0 = 'Returning Value'
const lv1 = () => lv0
const lv2 = () => lv1
const lv3 = () => lv2
const mkfn = <X>(x: X) =>
() => expect(unwrap(x)).toBe(lv0)
it('level 0', mkfn(lv0))
it('level 1'... |
d9504d13055eb4b306dfb083f2fff349eda63790 | TypeScript | tesseract-olap/tesseract-ui | /packages/cube-audit/index.d.ts | 2.65625 | 3 | import * as OlapClient from "@datawheel/olap-client";
export = CubeAudit;
declare namespace CubeAudit {
const auditorFactory: (options: AuditorFactoryOptions) => Promise<Auditor>;
const auditServer: (
server: OlapClient.ServerConfig,
callback?: (report: CubeReport) => void
) => Promise<AuditorResult>;
... |
b4f87ae95fa933c6a32dcad9cc6d2f04b917aa33 | TypeScript | strangerintheq/hare-and-carrots | /src/reborn/game/MiniMap.ts | 3.015625 | 3 | import {Sector} from "../data/Sector";
import {Map} from "./Map";
import {Cell} from "../data/Cell";
import {CellType} from "../data/CellType";
import {restoreSector} from "../storage/SectorStorage";
let s = 3;
export class MiniMap {
private readonly empty: Sector = new Sector(0, 0, 21);
private readonly ctx... |
03e8a45b7a026b21ed499c9062282bde63bba767 | TypeScript | istephielicious/webpack-envi-setup | /dev-src/Model.ts | 3.140625 | 3 | import {Employee} from "./Employee";
import {Event} from "./Event";
//Logger
import { PrintLogger, printLog } from "./Logger";
export class Model implements PrintLogger{
log: string;
private employee :Employee[] = [];
private selectedIndx : number = -1;
constructor (emp?:Employee) {
printLog(t... |
00ae0c3420a67b1467140e50499f70146ec71739 | TypeScript | owsas/sentiment-multilang | /src/lib/lexicon.ts | 2.59375 | 3 | /**
* Loads the data from the json files
* and exports it more information
* about the language
*/
const emoji = require('../../langs/emoji.json');
const en = require('../../langs/en.json');
const es = require('../../langs/es.json');
const fr = require('../../langs/fr.json');
const it = require('../../langs/it.js... |
6140ecbeb7e637e762d21f78faae119b7230f967 | TypeScript | latestchatty/chromeshack | /src/builtin/image-uploader/uploaderStore.ts | 2.734375 | 3 | import { arrHas, packValidTypes } from "../../core/common";
import { createStore } from "../../core/createStore";
export const imageFormats = "image/jpeg,image/png,image/gif,image/webp";
export const videoFormats =
"video/mp4,video/webm,video/x-matroska,video/quicktime,video/x-flv,video/x-msvideo,video/x-ms-wmv,vi... |
879d054c0308b52e8e0f7897ecec72de6b10a97e | TypeScript | Leon-Bor/haus-cms | /src/models/classes/socket-error.model.ts | 2.765625 | 3 | export class SocketError {
key: string;
message: string;
constructor(obj: SocketError = {} as any) {
this.key = obj?.key;
this.message = obj?.message;
}
}
|
b173abfe6874d1c258deef7fe841f2be1a125375 | TypeScript | pasechnik/koa-ts-adapter | /src/request/AddMessage.test.ts | 2.90625 | 3 | import { AddMessage } from './AddMessage';
import { validate } from 'class-validator';
describe('request/AddMessage', () => {
let addMessage: AddMessage;
const validatorOptions = {};
beforeAll(() => {
addMessage = new AddMessage();
});
it(`has the expected class properties'`, async () => ... |
e803061871f328fe6474b272fd3165503732d065 | TypeScript | huaweicloud/huaweicloud-sdk-nodejs-v3 | /services/cts/v3/model/UserInfo.ts | 2.640625 | 3 | import { BaseUser } from './BaseUser';
export class UserInfo {
public id?: string;
public name?: string;
public domain?: BaseUser;
public constructor() {
}
public withId(id: string): UserInfo {
this['id'] = id;
return this;
}
public withName(name: string): UserInfo {
... |
4f156c2c7dcd56bb953a7bd9e41eeaa69f61bf09 | TypeScript | nunof07/smalltypes | /src/test/scalar/NotTest.ts | 3.15625 | 3 | import {
False,
Not,
True
} from '@main';
import { expect } from 'chai';
import { suite, test } from 'mocha-typescript';
/**
* {@link Not} test.
*/
@suite
export class NotTest {
@test
public isScalar(): void {
expect(
new Not(true).isScalar()
).to.equal(true, 'Must be ... |
ae0b0ea5730a6d8f2d8b45a22f16c6d5311fb33b | TypeScript | winterdogdog/Erp | /src/app/common/statistic/statistic.ts | 2.734375 | 3 | /**
* Created by 小亮 on 2017/6/10.
*/
export class StatisticConstant{
/**
* 统计时间
* 1.每年 2 每月 3.每周
* @type {[{name: string; value: string}]}
*/
public static readonly STATISTIC_TIME_ARR = [
{"name":'statistic_time_week', 'value':3},
{"name":'statistic_time_month', 'value':2},
{"name":'stat... |
671cbf03badfda388e1059b83514bff61a02cc5d | TypeScript | Singleware/restdb | /release/types/common/filters.d.ts | 2.65625 | 3 | /*!
* Copyright (C) 2018-2020 Silas B. Domingos
* This source code is licensed under the MIT License as described in the file LICENSE.
*/
import * as Class from '@singleware/class';
import * as Types from '../types';
import { Query } from './query';
/**
* Common driver, filters class.
*/
export declare class Filte... |
162145fd50e7fee1e0343f8692140468ce1e645b | TypeScript | OIDC2020-watermelon/FrontEnd | /src/models/saga/reducers/seller.ts | 2.796875 | 3 | import { TAsyncState } from './../../../types/redux/state/stateTypes';
import { addPerformanceApi, deletePerformanceApi } from './../api/seller';
import { createReducer, ActionType } from 'typesafe-actions';
import { takeEvery } from 'redux-saga/effects';
import { produce } from 'immer';
import createAsyncSaga, {
as... |
10afa2467d14d8529eb8b0d495ac0f5fc5baa95b | TypeScript | darkman2040/HonestProject | /src/app/landingPage/_services/teamService.ts | 2.515625 | 3 | import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { Team } from '../models/Team'
import {RegisterTeam} from '../models/RegisterTeam'
@Injectable()
export class TeamService {
public userId: string;
constructor(private http: ... |
a5b7fe60689c8b2f3e1c3cd7adbd02d76a7d08cb | TypeScript | felamaslen/budget | /src/api/controllers/planning/utils/calculations.ts | 2.671875 | 3 | import type { CalculationRows } from '../types';
import type { ParameterRow } from '~api/queries/planning';
import { StandardRates, StandardThresholds } from '~shared/planning';
function getTaxFreeAllowance(taxCode: string): number {
if (taxCode === 'OT') {
return 0;
}
const match = taxCode.match(/^(\d+)L$/... |
9a5d570ff0fac4e46488456a6789ee6db9f45982 | TypeScript | zhenxingchen/react-init-sample | /src/shared/context/index.ts | 2.65625 | 3 | import * as React from 'react';
interface IAppState {
demo: string;
}
interface IAppContext {
state: IAppState,
dispatch: (param: {type: string, payload: any}) => void
}
export const AppContextAction = {
demo: 'demo'
};
export const AppContextReducer = (state: IAppState, action: {type: string, payload: any}... |
bcc8fe009e0affa36b6f70c97d44cb7d3730a928 | TypeScript | TarunKumar-01/TarunKumar | /9. Typescript/a1/4.ts | 3.34375 | 3 | let names = ["a", "b", "c"];
let myArr: any = [];
const myFun = (arr: any) => {
for (let i of arr) {
let myObj = { name: i, length: i.length };
myArr.push(myObj);
}
return myArr;
};
const temp = myFun(names);
console.log(temp); |
2a5d2cfd912f35c6139588250662ca8365a7ed97 | TypeScript | AniRate-Project/anirate-api | /src/core/errors/InternalServerError.ts | 2.890625 | 3 | import { ErrorLogLevel } from "@log";
import { HttpError } from "./HttpError";
export class InternalServerError extends HttpError {
public readonly logLevel: ErrorLogLevel = ErrorLogLevel.ERROR;
public readonly name: string = "InternalServerError";
public static readonly statusCode: number = 500;
public stati... |
1be17d7e1091e9e9fe9530aed720caaa80c26210 | TypeScript | mtatran/team-manager-back | /src/authentication/currentUserChecker.ts | 2.625 | 3 | import { Request } from 'express'
import { Action } from 'routing-controllers'
import { verify } from 'jsonwebtoken'
import { JwtToken } from '../types/index'
import { userService } from '../services/userService'
export function currentUserChecker (action: Action) {
const request: Request = action.request
// If t... |
a2cea5e2b8979eb6fe5d501ffa47b48e57f173c8 | TypeScript | romankagan/elastic-charts | /src/mocks/utils.ts | 2.734375 | 3 | import seedrandom from 'seedrandom';
import { DataGenerator } from '../../src';
/**
* Forces object to be partial type for mocking tests
*
* SHOULD NOT BE USED OUTSIDE OF TESTS!!!
*
* @param obj partial object type
*/
export const forcedType = <T extends object>(obj: Partial<T>): T => {
return obj as T;
};
e... |
9614937e70e38cf97cc91a87904c57d81027622f | TypeScript | joshsauder/PathFindingVisualization | /algorithms/Dijkstra.ts | 3.21875 | 3 | import { node } from '../models/Graph';
import { AStar, TwoWayAStar } from './AStar';
/**
* Dijkstra's Shortest Path Finder
*
* @param start - the starting node
* @param end - the ending node
* @param grid - the grid of nodes
* @returns - a list of nodes that were visited
*/
export function Dijkstras(start: ... |
2ed14c2a745209df231f319a23c2fe70a74f9332 | TypeScript | rashiop/udra-library-api | /src/resources/fine/fine.model.ts | 2.515625 | 3 | import { model, Schema } from 'mongoose';
import { ActiveStatus } from '../../helper';
import { error } from './fine.constant';
import { IFine, IFineDoc, IFineModel } from './fine.type';
const schemaFields: Record<keyof IFine, any> = {
amount: {
type: Number,
required: [true, error.amountRequired]
},
up... |
a7e3897fd78b8f6478b2a0123417e5d585c181a1 | TypeScript | shmyaksi/inspections | /TS/InspectionsTS/GenericTypeMismatch.ts | 3.578125 | 4 | //Inspection is ON by default
//TS 3.9.5
//case1
class Foo123<T, U, D = number> {
}
let zz: Foo123;
//case2
interface Circle1<T, R = string> {
kind: "circle";
radius: number;
}
let zz1: Circle1;
//case3
interface Square<T, U = number, R = string> {
kind;
sideLength: number;
}
declare let y: Squar... |
4e4216dad9d8de23846ab5508d9d8a8c2178238a | TypeScript | purva2906/EmpowHer | /src/util/analyze-tone.ts | 2.859375 | 3 | import camelcaseKeys from 'camelcase-keys';
import ToneAnalyzerV3 from 'ibm-watson/tone-analyzer/v3';
import { IamAuthenticator } from 'ibm-watson/auth';
import { IBM_TONE_API_KEY, IBM_TONE_API_URL } from '../util/secrets';
import { PostDocument, ToneCategory } from '../types';
const toneAnalyzer = new ToneAnalyzerV3(... |
7c3ed1b5909fcc9417d41b38099f923da2e1ea55 | TypeScript | iannisdezwart/node-date-time-formatter | /index.ts | 3.3125 | 3 | export const getMinutes = (
date: Date
) => date.getMinutes().toString().padStart(2, '0')
export const isSameYear = (
date1: Date,
date2: Date
) => date1.getFullYear() == date2.getFullYear()
export const isSameDate = (
date1: Date,
date2: Date
) => (
isSameYear(date1, date2)
&& date1.getMonth() == date2.getMon... |
1a4430b12c2b32592a288ebd2ce5ebbf12bc233e | TypeScript | kobatastu/Daily_Bet | /client/src/serverTypes/userTypes.ts | 3.0625 | 3 | import { guardRunTimeError } from '../common/guardRunTimeError';
export type LawUserData = {
id: number;
email: string;
password: string;
name: string;
coin: number;
picture: string;
life_flag: number;
};
export type UserData = {
id: number;
email: string;
password: string;
name: string;
coin:... |
1ac60d21d29442456f4f9914f53ae43e6a02bd2b | TypeScript | pedro-arruda-moreira/offline-token-generator | /index.ts | 2.953125 | 3 | import { ModeOfOperation, utils as AESUtil } from "aes-js";
import { sha384 } from "js-sha512";
export interface TimeGenerator {
getTime(): number;
}
export class OfflineTokenGenerator<T = string> {
constructor(
private key: string,
private aesBits: number,
private ttl: number = 5... |
f6bfafe68cd3225d8dc783e5230c8c457acec854 | TypeScript | jasonaden/restore | /src/utils/parseJson.ts | 2.5625 | 3 |
import {transform} from './transform';
export function parseJson (
datePattern: RegExp = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/,
revive: (key: string, value: any) => any = (k, v) => v,
data: any,
headers
) {
var reviver = function (key, value) {
if (typeof value == 'string' && value.match(dat... |
6319d3df1e02b2dafb8cb3cd19846a08c275d7b3 | TypeScript | jrgermain/whichbeatle-web | /src/services/youtube.test.ts | 2.609375 | 3 | import { getVideoUrl } from "./youtube";
import fetchMock, { enableFetchMocks } from "jest-fetch-mock";
enableFetchMocks();
describe("getVideoUrl", () => {
beforeAll(() => {
process.env.YOUTUBE_API_KEY = "abcdefg";
});
it("calls fetch with the correct parameters", async () => {
await getVideoUrl("Someth... |
6bd96a54cc9cdd08963a1815f1ad2c393010e9ae | TypeScript | susheelhbti/angular-firebase-chat-app | /src/app/components/auth/login/login.component.ts | 2.59375 | 3 | import { Component, OnInit } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms';
import { AuthService } from 'src/app/services/auth.service';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.css']
})
export class Logi... |
e63e56ec66a02bb2b8e5c7e11be2ef3e0ac89667 | TypeScript | wewoor/tiny-sql-parser | /src/token.ts | 3.328125 | 3 |
/**
* We break SQL language down into below 7 main language elements:
* 1. Keywords,
* 2. Identifier -> show database/tables/functionName/tableName/columnName/...
* 3. Clauses, -> from/where
* 4. Expressions, -> 1+1
* 5. Predicates, -> WHERE id = 1
* 6. Queries, -> select
* ... |
f8158844b246621e983686cbd9e3772fccf21f7f | TypeScript | JeroenCommandeur/Fenix | /Binders/VisibilityBinder.ts | 2.75 | 3 | module Fenix.Binders {
export class VisibilityBinder extends Fenix.Base.BinderBase {
static AttributeName(): string {
return "visibility";
}
public OnPropertyChange(value: any) {
var reverse = this.GetValueByKey("REVERSE")
var isRow = this.GetValueByKey... |
c2edd6d09978dbb8eff4684a0ad1d0e83bb24aba | TypeScript | buhichan/graphql-mongoose-service-template | /src/models/validate.ts | 2.84375 | 3 | import { IMeta } from "./meta";
import { valid } from "joi";
export type IMetaConstraint = boolean | {
anyOf?:IMetaConstraint[]
allOf?:IMetaConstraint[]
not?:IMetaConstraint
if?:IMetaConstraint,
then?:IMetaConstraint,
else?:IMetaConstraint,
properties?:{
[name:string]:IMetaConstrain... |
3216bbdf0a6e2e2ed073f6e41139620056c729f8 | TypeScript | bolddp/fluent-aws | /dist/node/ApiNode.d.ts | 2.984375 | 3 | import { FluentAwsConfig } from "../FluentAwsConfig";
import { PromiseChain } from "./PromiseChain";
/**
* A node in the fluent API hierarchy. The responsibility of a node in the
* hierarchy, e.g. an Ec2 or EcsTask instance, is to resolve its parent
* before it resolves itself to make sure that all pending promises ... |
c3f65168d126b1643d8ab207e4e904b502b287cf | TypeScript | spacerecycler/typed-screeps | /src/tombstone.ts | 2.53125 | 3 | interface Tombstone extends RoomObject {
/** The tombstones game objects id. */
id: string;
/** The tick that the creep died. */
deathTime: number;
store: StoreDefinition;
/** How many ticks until this tombstone decays */
ticksToDecay: number;
/** The creep that died to create this tombs... |
45590e4931e53e7bf37c5ed660c9cd5a52826396 | TypeScript | rskogsberg/typescript-sorting-comparison | /src/assets/Hooks/swap.ts | 3.09375 | 3 | export function swap(i: number, j: number, array: number[]) {
const tempHolder: number = array[j];
array[j] = array[i];
array[i] = tempHolder;
} |
47db5eef623323f07c998c82857f83c128f8bd1c | TypeScript | Agnaro/pomodoro | /src/app/services/settings/settings.interface.ts | 2.625 | 3 | export interface TimerState {
tickSpeed: number;
time: number;
isTicking: boolean;
onBreak: boolean;
}
export type PartialTimerState = Partial<TimerState>;
export type TimerStateKeys = keyof TimerState; |
a660e631d3de3906faa5e3ad23b74389d606ea16 | TypeScript | esantini/React_Example | /src/myModules/bank/RewardsStore.ts | 2.65625 | 3 | import { ReduceStore } from "flux/utils";
import AppDispatcher from "../../AppDispatcher";
import BankBalanceStore from "./BankBalanceStore";
import constants from "./constants";
interface IAction {
type: string;
}
class BankRewardsStore extends ReduceStore<string, {}> {
public getInitialState() {
return "Basic"... |
da662e3445662c7d11c4a20d137826b14ac60c39 | TypeScript | ksimar/angular-assignment | /src/app/app.service.ts | 2.640625 | 3 | import {Injectable} from "@angular/core";
import {Task} from "./task";
//import {document} from "@angular/platform-browser/src/facade/browser";
@Injectable()
export class AppService {
//to be done when user clicks some button or enters after typing details
/* tasks: Task[] = [{
title: "assignment",
descri... |
a4dce00ac72371d9a3120c14dcf1e2d98765e175 | TypeScript | skyhitz/mobile | /skyhitz-common/src/stores/sign-up-validation.store.ts | 3 | 3 | import { observable, computed } from 'mobx';
export class SignUpValidationStore {
@observable usernameError: string = '';
@observable usernameValid;
@observable displayNameError: string = '';
@observable displayNameValid;
@observable emailError: string = '';
@observable emailValid;
@observable backendErr... |
53268820c961e9d9ce1aa8535250ed27510f354c | TypeScript | 1553517982/shootGame | /src/gamecore/battle/command/IdleCommand.ts | 2.75 | 3 | //待机命令
class IdleCommand extends BaseCommand implements ICommand {
//命令id 防止重复包
commandid: number
//命令时间戳 防止广播过期包
commandtimestamp: number
//命令类型
commandtype: CommandType
/**命令参数*/
//主人
ownerid: number
//朝向
dir: number
public constructor(param: any) {
super(param)
this.commandtype = CommandType.Idle
}... |
88262680dd2af530b544b2155c11169a77422eff | TypeScript | alxtsg/WebHost | /src/types/error-response.d.ts | 2.640625 | 3 | export default interface ErrorResponse {
/**
* Error code for machine.
*/
code: string,
/**
* Human-readable error message.
*/
message: string
};
|
127196b247480b159c57318c38ae65b064b2fae0 | TypeScript | ZZYSonny/monaco-treesitter | /src/adapter/tree-sitter/helper.ts | 2.703125 | 3 | import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
import Parser from 'web-tree-sitter';
/**
* Generate a Monaco Error Marker
* with range equal to node range
*/
function nodeToMarker(node: Parser.SyntaxNode, message: string): monaco.editor.IMarkerData{
return {
startLineNumber: node.startPosit... |
82c09b21efa9d09e12bbb9029375c2c70c648321 | TypeScript | inexistence/typeN | /sample/user.ts | 2.65625 | 3 | import {Type} from "class-transformer";
export class User {
@Type(() => Number)
public id: number;
public nickname: string;
public openid: string;
constructor() {
}
public getName(): string {
return this.nickname;
}
} |
68817a8b99505b1576277677c8c378a621fbd55a | TypeScript | darshani28/joplin | /packages/tools/build-plugin-repository.ts | 2.59375 | 3 | import * as fs from 'fs-extra';
import * as path from 'path';
import * as process from 'process';
const { execCommand, execCommandVerbose, rootDir, resolveRelativePathWithinDir, gitPullTry } = require('./tool-utils.js');
interface NpmPackage {
name: string;
version: string;
date: Date;
}
function pluginInfoFromSea... |
390779e5906e79a5328dbe51915393ce048dcbcb | TypeScript | PimentelM/mystera-reborn | /src/client/bot/state/units/walking/FollowTarget.ts | 3.015625 | 3 | import {StateUnitClass} from "../../../Interfaces";
import {Game} from "../../../game/Game";
import {Player} from "../../../game/player/Player";
export interface FollowTargetState{
steps : number
maxDistance: number
}
export class FollowTarget extends StateUnitClass{
state: FollowTargetState;
readonl... |
e63b51f2ba2edb3233da75d721188f6388dbc909 | TypeScript | Sage-Bionetworks/Synapse-React-Client | /src/lib/containers/table/SynapseTableUtils.ts | 2.59375 | 3 | import { ColumnType, QueryResultBundle } from '../../utils/synapseTypes'
export const getColumnIndiciesWithType = (
data: QueryResultBundle | undefined,
...columnTypes: ColumnType[]
) => {
const columnsOfTypeEntity: number[] = []
data?.selectColumns?.forEach((el, index) => {
if (columnTypes.includes(el.col... |
0e0ac0217373b221d00bdc55a30f55406d2e46e5 | TypeScript | xucongli1989/x-package-version-strict-check | /index.ts | 2.6875 | 3 | import * as fs from "fs"
import * as path from "path"
import semver from "semver"
import commander from "commander"
//通过命令行获取项目根路径(默认为当前项目)
commander.option('--path [path]', 'your project path.').parse(process.argv)
let projectRootPath = "./"
if (commander.path) {
projectRootPath = path.resolve(commander.path)
}
... |
463bd46e99aec6d3be1f5df0ac37c90fc7069073 | TypeScript | nguyer/aws-sdk-js-v3 | /clients/browser/client-elasticsearch-service-browser/types/_AdditionalLimit.ts | 2.734375 | 3 | /**
* <p> List of limits that are specific to a given InstanceType and for each of it's <code> <a>InstanceRole</a> </code> . </p>
*/
export interface _AdditionalLimit {
/**
* <p> Name of Additional Limit is specific to a given InstanceType and for each of it's <code> <a>InstanceRole</a> </code> etc. <br/> Attrib... |
dd68547c3c016f36160d460985379f589b503926 | TypeScript | muniraj1152/custom-dropdown | /src/store/posts/reducer.ts | 2.75 | 3 | import { GET_POST_LIST_FAIL, GET_POST_LIST_SUCCESS } from './actionTypes';
const initialState: any = {
pending: false,
posts: [],
error: null,
};
export default (state = initialState, action: any) => {
switch (action.type) {
case GET_POST_LIST_SUCCESS:
return {
...state,
posts: actio... |
758772a26a218a4af15dcc9e9d87dede7ed000ba | TypeScript | torihedden/appointment-app | /src/app/app.pipe.ts | 2.65625 | 3 | import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'upper'
})
export class UpperPipe implements PipeTransform {
transform(description: string): string {
return description[0].toUpperCase() + description.substr(1);
}
}
|
0db15d7e468a7d710a569c775949b76e971d36cf | TypeScript | socsieng/typedoc-plugin-typescript-declaration | /tests/test-data/type/operator-expected.d.ts | 3.09375 | 3 | declare namespace test {
type StatusType = keyof StatusTypes;
type StatusTypes = {
/**
* Success
*/
success: string;
/**
* Failure
*/
failure: string;
}
/**
* Options:
*
* - `on`:
* Represents the on state.
*
* Examples of things that can be turned on:... |