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 |
|---|---|---|---|---|---|---|
57e165fe5478a81416094b3ae0559048affa2564 | TypeScript | LeonBonetti/BinanceControlByTelegram | /src/Client/index.ts | 2.65625 | 3 | import Bot from '../Telegram';
import {CreateUser, GetUserByUsername, UpdateUserDays, UpdateUserState, UpdateUserApiKey, UpdateUserApiSecret} from '../Models/User';
import {GetKey, CloseKey} from '../Models/Keys';
import {GetUserInfo} from '../Binance/Info';
const EmptySpeechs = require('../Speech/Empty.json')
Bot.on(... |
7851e1d138a51b856484a3ace92d758cce8416eb | TypeScript | Sam10715/NewBoatCase-Front-end | /src/app/boat-form/add-row-boat.ts | 2.578125 | 3 | import { FormControl, FormGroup, Validators } from '@angular/forms';
import { RowBoat } from '../shared/model/RowBoat.model';
export class AddRowBoatForm extends FormGroup {
constructor() {
super({
numberOfSeats: new FormControl('', [
Validators.required,
Validators.maxLength(100)
]),
... |
0356ade2f8febbde0919a5f7cc77d337c07574d0 | TypeScript | connorpk/Pictionary-App | /src/app/interfaces/player.interface.ts | 2.59375 | 3 | export interface Player{
displayName: string,
score: number,
isArtist: boolean,
isHost: boolean,
} |
3a3ebcce444e4942f7919f79810bf560bf5cd136 | TypeScript | xdave/typescript-fsa-redux-thunk | /src/issue-22.spec.ts | 2.890625 | 3 | import { expect } from 'chai';
import { AnyAction, applyMiddleware, createStore } from 'redux';
import thunk, { ThunkMiddleware } from 'redux-thunk';
import actionCreatorFactory from 'typescript-fsa';
import { reducerWithInitialState } from 'typescript-fsa-reducers';
import { asyncFactory } from './index';
/** Let thi... |
dcb3a90933ddcfe2209df4a4151b989c760f97e0 | TypeScript | electrode-io/electrode | /packages/xarc-app-dev/test/spec/dev-admin/log-parser.spec.ts | 2.84375 | 3 | /* eslint-disable @typescript-eslint/no-var-requires, prefer-arrow-callback */
const { parse } = require("../../../src/lib/dev-admin/log-parser");
import { describe, it } from "mocha";
import { expect } from "chai";
describe("log-parser", function() {
it("should return correct level and message for a simple error",... |
420a5ea248db8a70fe4393d7f3193e3e01bdedca | TypeScript | braidn/hackerrank-solutions | /deno/minimum-swap-two/challenge.ts | 3.5625 | 4 | export function minimumSwaps(arr: Array<number>): number {
const totalLength = arr.length - 1
let swapCount = 0
const minItem = arr.reduce((prev, next) => prev < next ? prev : next)
if (arr.indexOf(minItem) != 0) {
let toAdd = arr.splice(arr.indexOf(minItem), 1)[0]
arr.splice(0, 0, toAdd)
swapCoun... |
af2503ff071893226f628447cd4d2ee259066be4 | TypeScript | Bitreaper88/React-EX-collection | /code5/ex3/ex3.ts | 3.15625 | 3 | //postman
import express from "express";
import bodyParser from "body-parser";
const app = express();
const port = 4321;
let myObj1 = {name: "John",
age: 31,
city: "New York"};
let myObj2 = {name: "Jack",
age: 26,
city: "Dallas"};
let array: Array<any> = new Array();
array.push(myObj1);
array.push(myObj2);
app.ge... |
e9fd0081d308ccef99f26a963ccb049afa725895 | TypeScript | morawskiOZ/Monterail_Task | /src/helpers/components/MainForm/modifyValue.ts | 2.609375 | 3 | import { InputNames } from "ts/FormInput/FormInput_enum"
export const modifyValue = (name: InputNames, value: any) => {
switch (name) {
case InputNames.DURATION:
return (isNaN(value) || value === "") ? value : value / (60 * 60)
default:
return value
}
}
export const omitNill = (values) => {
... |
8cb05d9c4119f359fe90194647a627e5d902e1f9 | TypeScript | justphil/entwickler-magazin-html5-special-angular2-beispiel | /app.ts | 2.59375 | 3 | /// <reference path="typings/angular2/angular2.d.ts" />
import {Component, View, bootstrap} from 'angular2/angular2';
import {HobbiesService} from 'myAppModule/services';
import {HobbiesWidget} from 'myAppModule/widgets';
@Component({
selector: 'my-app',
appInjector: [HobbiesService]
})
@View({
template: `... |
cc9dd04ec52bf2da5c2bed1603cf74ab2de6a42d | TypeScript | weclaw1/vue_demo_app | /src/store/Auth.ts | 2.609375 | 3 | import { Module, VuexModule, Mutation, Action } from 'vuex-module-decorators';
import { BASE_URL } from '../repositories/Repository';
import store from './index';
import jwtDecode from 'jwt-decode';
export interface Token {
sub: string;
exp: number;
admin: boolean;
id: number;
}
@Module({ dynamic: true, store... |
a53aeafc88f23f0b00a0a2e3051e16ff38647d03 | TypeScript | ag-grid/ag-charts | /packages/ag-charts-community/src/chart/axis/cartesianAxisLabel.ts | 2.71875 | 3 | import { NUMBER, OPT_BOOLEAN, Validate } from '../../util/validation';
import { AxisLabel } from './axisLabel';
export class CartesianAxisLabel extends AxisLabel {
/**
* If specified and axis labels may collide, they are rotated to reduce collisions. If the
* `rotation` property is specified, it takes pr... |
c59dbba82daa3fbcafbc54b80e3d47e9c603665f | TypeScript | holyping/LinqToTypeScript | /test/tests/WhereAsync.ts | 2.84375 | 3 | import { Enumerable } from "../../src/index"
import { asAsync, asParallel, itAsync, itEnumerable } from "../TestHelpers"
describe("WhereAsync", () => {
itEnumerable("Basic", (asEnumerable) => {
const values = asEnumerable([1, 2, 3])
const trueFilter = values.whereAsync((x, i) => new Promise((e) => ... |
e9f405e31bce6e65e2d06bdefddd200555b99c8b | TypeScript | ietuday/learn-rxjs | /src/app/rxjs-group-by/rxjs-group-by.component.ts | 2.84375 | 3 | import { Component, OnInit } from '@angular/core';
import { from } from 'rxjs';
import { groupBy, flatMap, reduce, mergeMap, toArray, concatMap } from 'rxjs/operators';
@Component({
selector: 'app-rxjs-group-by',
templateUrl: './rxjs-group-by.component.html',
styleUrls: ['./rxjs-group-by.component.scss']
})
expo... |
75a76b91a6550df1ff18e43bbbf152d466df5f3a | TypeScript | xieyuheng/dustbin | /readonlylink/pages/projects/ranger/entry.ts | 3.53125 | 4 | import filesize from "filesize"
export interface EntryOption {
path: string
size: number
lastModified: number
}
export abstract class Entry {
path: string
size: number
lastModified: number
abstract info: {
content: string
title: string
}
constructor(opts: EntryOption) {
this.path = opt... |
adf883a8fa03e7674254519ca663ee795b95100b | TypeScript | george-aprozeanu/f10 | /f10-stream/src/iterable-stream.ts | 3.15625 | 3 | import {Stream, StreamAsyncIterable, StreamSyncIterable} from "./stream";
import {ExecutableStream} from "./executable-stream";
export type StreamIterable<Out> = StreamAsyncIterable<Out> | StreamSyncIterable<Out>;
export type StreamFn<Out> = () => (Iterable<Out> | AsyncIterable<Out>);
export class IterableStrea... |
c88b10b0207db425e0e3b29cf4546ab3eb392710 | TypeScript | scotteskridge/DojoAssignments | /Mean/AngularRoutes/src/app/notes/note.ts | 2.578125 | 3 | export class Note {
id;
author = {}
body = ""
constructor(id = 0, author = {}, body = ""){
this.id = id
this.author = author
this.body = body
}
}
|
dc49235c72002077be7de3dc0b141345d9751c9a | TypeScript | baoduong/tinder-clone | /frontend/src/app/models/models.ts | 2.515625 | 3 | export interface UserModel {
id: string;
title: string;
firstName: string;
lastName: string;
picture: string;
}
export class ListUserModel {
data: UserModel[] = [];
total: number | undefined;
page: number | undefined;
limit: number | undefined;
}
export interface LocationModel {
street: string;
... |
59efc10844b5b20fc2fb99ce26eef96f9674edbf | TypeScript | chucknezi/sam-design-system | /libs/packages/sam-formly/src/lib/formly/formly.validators.ts | 2.96875 | 3 | import { FormControl, ValidationErrors } from '@angular/forms';
import { FormlyFieldConfig } from '@ngx-formly/core';
/**
*
* @param control
* @param field
*/
export function minDateValidator(control: FormControl, field: FormlyFieldConfig): ValidationErrors {
let toReturn = null;
let minDateField = field.... |
01a382b1e715d529e08452d98203e39651b87091 | TypeScript | andy-schulz/thekla-core_outdated | /app/test/0_helper/browser_viewport.ts | 3.078125 | 3 | export interface BoundaryCheck { all: boolean;
any: boolean;
bottom: boolean;
left: boolean;
right: boolean;
top: boolean; }
export const boundingRect = (className: string) => {
// function taken from https://vanillajstoolkit.com/helpers/isoutofviewport/
var isOutOfViewport = function (elem... |
0971e678763286c6bce18cab1ff575a044b5c709 | TypeScript | kyokan/fn-client | /src/io/decoding.ts | 3.046875 | 3 | import {Reader} from './types';
import * as Long from 'long';
const MAX_VARIABLE_BYTE_SIZE = 16 * 1024 * 1024;
const MAX_ARRAY_SIZE = 255;
export function decodeUint8 (r: Reader, cb: (err: any, n: number | null) => void): void {
const buf = Buffer.alloc(1);
r.read(buf, (err, _) => {
if (err) {
return cb... |
86de095868c2e2b2b4de12d1ba4638be494d4e32 | TypeScript | rhom6us/NetLeaf | /dev/di/index.ts | 3.140625 | 3 | import {
IServiceCollection,
IServiceProvider
} from "../../libraries/extensions-dependency-injection-abstract/dist";
import {
TypedServiceCollection,
TypedServiceProvider
} from "../../libraries/extensions-dependency-injection-typed/dist";
interface ILog
{
log(...args:... |
028d48eef9c5e10b7fba1867011d5aa07c6235e9 | TypeScript | jhallat/universal-data-tools-ui | /src/app/data/data.service.ts | 2.515625 | 3 | import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable, throwError } from 'rxjs';
import { catchError } from 'rxjs/operators';
import { Data, DataError } from './data';
@Injectable({
providedIn: 'root'
})
export class DataService {
dat... |
6e5529a04bd40d707928ce74c1fdea283315ab45 | TypeScript | MiguDeveloper/introTypescript | /desustructuracion.ts | 3.546875 | 4 | (() => {
const avenger = {
nombre: 'Steve',
clave: 'Capitan America',
poder: 'Droga'
}
class Heroe {
nombre: string;
clave: string;
poder: string;
}
// con la desestructuracion ya no necesito tener el objeto y sacar uno por uno usando 'avenger'
c... |
8557fd81cb09afd11accf9dd5183980200b84f0d | TypeScript | meteor199/ohbug-server | /packages/transfer/src/api/report/report.service.ts | 2.515625 | 3 | import { Inject, Injectable } from '@nestjs/common'
import { ClientProxy } from '@nestjs/microservices'
import type { OhbugEvent } from '@ohbug/types'
import {
ForbiddenException,
TOPIC_TRANSFER_MANAGER_EVENT,
} from '@ohbug-server/common'
import type { OhbugEventLike } from '@ohbug-server/common'
import { format... |
eee7169fc878cb5723288b81eebed4c428c752ce | TypeScript | Turao/goodies | /src/delivery/domain/Delivery.ts | 3.109375 | 3 | export type DeliveryID = string;
export class Delivery {
public readonly id: DeliveryID;
public readonly name: string;
private completed: boolean;
constructor(id: string, name: string) {
this.id = id;
this.name = name;
this.completed = false;
}
public isComplete(): boolean {
return this.c... |
8c3bb8fd2dea5a235123c9f45a9eca9f343e8b38 | TypeScript | starpeace-project/starpeace-assets-types | /src/overlay/overlay-definition.ts | 3.359375 | 3 | import _ from 'lodash';
/**
* @memberof STARPEACE.overlay
* @property {string} id - identifier of asset
* @property {string} image - image path of asset
* @property {number} tileWidth - width of asset in tiles
* @property {number} tileHeight - height of asset in tiles
*/
export interface OverlayDefinitionJson {
... |
708b88faae2a814140335bde56b526794f322bf9 | TypeScript | cronjevh/sit-cli | /src/utils.ts | 3.09375 | 3 | import * as fs from "fs";
export function normalize(
value: string | undefined,
maxLength: number
): string {
if (value == null) return "";
let normalizedValue: string = value
? value
.trim()
.toLowerCase()
.replace(/([^a-zA-Z]+)/gi, "-")
: "";
return clamp(normalizedValue, ... |
6f6077349324edc467fbcfab806668d75d69cdaf | TypeScript | wbydc/ISUCT-data-protection | /src/common/OptionsParser.ts | 3.09375 | 3 | import * as fs from 'fs';
import * as encoders from '../encoders';
export type Operation = 'encode' | 'decode' | 'both';
export interface Options {
/**
* @property what to do with source
*/
operation: Operation;
/**
* @property encoder name
*/
encoder: string;
/**
* @prop... |
d6a8638e49878cc1341ffda8f69eb99abed0318e | TypeScript | arogozine/LinqToTypeScript | /src/sync/_private/toObject.ts | 3.0625 | 3 | export const toObject = <TSource, TKey extends keyof TSource>(
source: Iterable<TSource>,
selector: (x: TSource) => TKey): Record<TKey, TSource> => {
const map: Partial<Record<TKey, TSource>> = {}
for (const value of source) {
map[selector(value)] = value
}
return map as Record<TKey, ... |
38fd13fa35660f0f45b452e6555be8f52836dffa | TypeScript | slaviqueue/online-ide | /online-ide-frontend/src/styles/mixins/borderDivider.ts | 2.5625 | 3 | type Direction = 'top' | 'right' | 'bottom' | 'left'
function borderDivider (direction: Direction) {
return (props: any) => `border-${direction}: 1px solid ${props.theme.darkBorderColor};`
}
export default borderDivider
|
d5e6e95e9c1040606b81b9f5618ca973374d7bf3 | TypeScript | jherr/conquering-regexes-1 | /index.ts | 3.125 | 3 | import * as chalk from "chalk";
import numbers from "./numbers";
import good from "./good";
// Filter out just the 503 phone numbers
const phoneRe = /^(\(\d{3}\)|\d{3})-\d{3}-\d{4}$/;
const phones = numbers.filter(
(phone) => phone.match(phoneRe)?.[1].replace(/[()]/g, "") === "503"
);
// Print out the results
cons... |
a04e26ea2d5f35f97837ff8e38ace1b194c8881a | TypeScript | peracto/kiss-fetch-retry | /src/index.ts | 3.390625 | 3 | interface FetchRetryOptions {
maxRetries?: number,
waitPeriods?: number[],
shouldRetry?: (response: Response, retryIndex: number) => boolean,
waitTimeout?: (period: number, input: Request|string, response: Response,retryIndex: number) => number,
fetch?: typeof fetch,
}
const defaultWaitPeriods = [1... |
082b9294abd3bb2aaef640f2ed9ea63838fdaaa3 | TypeScript | Vindi96/PS | /src/app/model/pet.ts | 2.53125 | 3 | import { IPetBase } from './iPetBase';
export class Pet implements IPetBase {
Id: number;
Name: string;
Breed: string;
Gender: string;
Price: number;
CatDog: number;
Weight: number;
Height: number;
City: string;
Age: number;
Image?: string;
Discription: string;
constructor() {
this.Id = ... |
6343404a594e0dbe9dabd61a9095a8cb524d66f5 | TypeScript | ztiromoritz/setzling | /client/src/controls/rangeSlider.ts | 2.578125 | 3 | export function initializeRangeSlider(ws: WebSocket){
function sendCommunicationRangeUpdate(range: number) {
const msg = {
type: 'CommunicationRangeUpdate',
options: {
range: range
}
}
ws.send(JSON.stringify(msg));
}
// handle ran... |
b885600dd196fb9904e7747a35c3ea1b57aec951 | TypeScript | c0nrad/meth.js | /src/expression.ts | 3.109375 | 3 | import { Node, NodeType, SymbolNode, LiteralNode, OperatorNode, parseStr } from './parser'
import { TokenType } from './lexer'
import { CloneAST, astToMath } from './ast'
export class Expression {
ast: Node
constructor(a: string) {
this.ast = parseStr(a)
}
eval(scope: object): number {
... |
47f18f251e9543abe0e26773fd67039899e9e449 | TypeScript | iAmCodeHead/phonebook-api | /src/phonebook/phonebook.repository.ts | 2.515625 | 3 | import { Brackets, EntityRepository, Repository } from "typeorm";
import { CreatePhonebookDto } from "./dto/create-phonebook.dto";
import { PaginatedPhonebookResultDto } from "./dto/get-phonebook.dto";
import { PaginateDto } from "./dto/paginate.dto";
import { UpdatePhonebookDto } from "./dto/update-phonebook.dto";
imp... |
f92c585ffe518253a6159a70c211e73c72ab6659 | TypeScript | smartive/giuseppe | /packages/giuseppe/src/errors/ControllerErrorHandler.ts | 3.15625 | 3 | import 'reflect-metadata';
import { Request, Response } from 'express';
import httpStatus = require('http-status');
/**
* Default error handler. Does console.error with the error and sets the
* http response code to 500.
*
* @export
* @param {Request} _ express request object
* @param {Response} res express res... |
6eb62307c9067c95e99ad910fb9f3badc674e5e3 | TypeScript | 5app/base5-ui | /src/utils/getScrollParent.ts | 2.71875 | 3 | function getScrollParent(node: null| Element | HTMLElement): null | Element | HTMLElement {
const overflowY = window.getComputedStyle(node as Element).overflowY;
const isScrollable = !(
overflowY.includes('hidden') || overflowY.includes('visible')
);
if (!node) {
return null;
} else if (isScrollable && node.s... |
0ef0ed1b3817857dfba43719c2ac723546424ff1 | TypeScript | stphflwrs/sprouty-discord | /src/app/parsers/command-message.parser.ts | 2.703125 | 3 | import { MessageParsed, MessageParser } from '../models/parser';
import { Message } from 'discord.js';
interface CommandMessageParsed extends MessageParsed {
command: string;
argv: string[];
}
class CommandMessageParser implements MessageParser<CommandMessageParsed> {
public parse(message: Message): CommandMess... |
477d46b4fea2c9195b09a7effb828246b7061c70 | TypeScript | denwilliams/homenet-nodes | /nodes/scheduler.ts | 2.546875 | 3 | const name = 'scheduler';
export = function(RED) {
function Node(config) {
RED.nodes.createNode(this, config);
var node = this;
node.hour = parseInt(config.hour);
node.minute = parseInt(config.minute);
var current = new Date();
var hour = current.getHours();
var min = current.getMinutes... |
3fc6bead045e98f2326631b4fae4a48e979b9e05 | TypeScript | st-patrick/cactus | /web/src/scripts/charts/radarChart.ts | 2.671875 | 3 | // tslint:disable:prefer-for-of
import * as d3 from "d3";
import { RadarChartData, RadarChartDataPoint } from "@shared/charts/RadarChartData";
const max = Math.max;
const sin = Math.sin;
const cos = Math.cos;
const HALF_PI = Math.PI / 2;
export interface RadarChartConfig {
w: number,
h: number,
margin: { ... |
ba0116388a90f4b3a83a108ab7968c9f64c34737 | TypeScript | AlexSND/isp-test | /src/app/services/data.service.ts | 2.515625 | 3 | import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable, BehaviorSubject } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class DataService {
private DataStore = new BehaviorSubject([])
data: Observable<any> = this.DataStore.asObservable()
c... |
89291ea67cea4159c1e1e9b21bfed9be1fb7ccff | TypeScript | K4t4rron/CotecnaTest | /cotecna-test/src/app/calendar-day/isNextFiveDays.spec.ts | 2.625 | 3 | import {CalendarDayComponent} from './calendar-day.component';
import * as moment from 'moment';
describe ('isNextFiveDays', ()=>{
it('should return true if day is in the next five days ', ()=>{
let component = new CalendarDayComponent(null);
let day = moment().add(2,'day');
const res... |
92e618bbb8f1be5e99102082d018ee5855e04f75 | TypeScript | cameronaziz-tkww/assistant | /packages/eslint-plugin/src/tests/typeguards/nodex.test.ts | 2.515625 | 3 | import * as nodes from '../../typeguards/nodes';
import { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree } from '@typescript-eslint/experimental-utils';
import { NodeWithType } from '../../types/NodeHelperTypes';
describe('nodes', () => {
describe('isTSUnionType', () => {
it('should return true for type', () => {
... |
df6619b46bffc7c57c1af811e6b7d138510b059f | TypeScript | coopify/ethereum | /config/encrypt.ts | 2.671875 | 3 | import { IsNotEmpty, IsString } from 'class-validator'
import { CValidator, IValidationError } from '../lib/validations'
export class EncryptConfigs extends CValidator {
public isValid: boolean
@IsNotEmpty({ message: `ENCRYPT_PASSWORD is empty` })
@IsString({ message: `ENCRYPT_PASSWORD is not a String` })... |
75cfefb08dcfa299b2eabf254e2c77cfbc7a4eb4 | TypeScript | sodarin/anti-drug-project | /src/app/client/course-exam/course-exam.component.ts | 2.5625 | 3 | import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router'
@Component({
selector: 'app-course-exam',
templateUrl: './course-exam.component.html',
styleUrls: ['./course-exam.component.less']
})
export class CourseExamComponent implements OnInit {
totalSeconds: number = 900;
h... |
4077a6d605dccc590260f5a9d8d4235b04911bd4 | TypeScript | pongstylin/tactics | /src/models/PlayerSets.ts | 2.71875 | 3 | import ActiveModel from 'models/ActiveModel.js';
import serializer from 'utils/serializer.js';
import setsById from 'config/sets.js';
import ServerError from 'server/Error.js';
export default class PlayerSets extends ActiveModel {
protected data: {
playerId: string
sets: any[]
}
constructor(data) {
... |
c9b5fe43046286abf5b13c3b673defe7d686a98c | TypeScript | Sandaka/assessment-frontend | /src/app/models/item-detail.ts | 2.75 | 3 | export class ItemDetail {
buyingOption: string;
qty: number
constructor(buyingOption = '', qty = 0) {
this.buyingOption = buyingOption;
this.qty = qty;
}
} |
586f57ca9d69165b6807658bc3791eeefea1bc96 | TypeScript | battlelinegames/ASWebGLue | /src/examples/ColorTriangle/color_triangle.ts | 2.65625 | 3 | /**
* @author Rick Battagline / https://embed.com/wasm
*/
import {WebGLRenderingContext} from '../../WebGL';
const VERTEX_SHADER_CODE: string = `#version 300 es
precision highp float;
layout(location = 0) in vec2 position;
layout(location = 1) in vec3 color;
out vec4 c;
void main() {
gl_Position = v... |
7e8d3b74401789653ad563b50a7e908f2aea2457 | TypeScript | lim-lim-lim/myswaggerboiler | /controllers/UserService.ts | 2.875 | 3 | export function createUser(args, res, next) {
/**
* Create user
* This can only be done by the logged in user.
*
* body User Created user object
* no response value expected for this operation
**/
res.end();
}
export function createUsersWithArrayInput(args, res, next) {
/**
* Creates list of... |
81d310ca6242617a846b42674aa1ec040c634bf1 | TypeScript | wchronowski-public/Angular1_Client | /src/inputs/date/EmptyState.ts | 2.625 | 3 | import { IDateInputErrorDisplayState, ValidateCallback } from './IDateInputErrorDisplayState';
import { WorkInProgressState } from './WorkInProgressState';
export class EmptyState implements IDateInputErrorDisplayState {
public shouldShowErrors(): boolean {
return false;
}
public monthBlurred(callback: Vali... |
69b9c67a41b8f77001139e71b06b77e27b9af8ed | TypeScript | theodo/tyrion | /src/model/debtPareto.ts | 3.09375 | 3 | import { DebtItemInterface, PrioritizationTypes } from './types';
export const PRIORITIZATION_TYPES: { [prioritizationType: string]: PrioritizationTypes } = {
IS_CRITICAL: 'isCritical',
IS_DANGEROUS: 'isDangerous',
IS_CONTAGIOUS: 'isContagious',
IS_IDLE: 'isIdle',
};
export default class DebtPareto {
public... |
e743285f343a06f161d55a8a842a830e5e3be14c | TypeScript | KSXGitHub/denofun | /lib/either/Either.ts | 3.8125 | 4 | /**
* Either is a Functor (map), a Monad (flatMap)
* It contains either the left value of type Left, or the right value of the type Right,
* but never both, and it is never empty.
* Convenience properties left and right are provided to chose over which value a transformation can be made.
* Error handling methods l... |
7ba982f91674d3cfc6c27b11ae1d0bede5b82285 | TypeScript | brezhal/awesome-nest | /src/features/entities/cat.entity.ts | 2.65625 | 3 | import { Transform } from 'class-transformer'
import { Column, Entity } from 'typeorm'
import { CommonEntity } from './common.entity'
@Entity('cat')
export class CatEntity extends CommonEntity {
@Column({ length: 50 })
@Transform(value => `cat: ${value}`)
name: string
@Column()
age: number
@Column({ len... |
ae49289425bc60775335394304f3414cc26d2b4c | TypeScript | depekur/eating-time | /frontend/src/app/shared/DateParser.ts | 3.203125 | 3 | import * as moment from 'moment';
export interface IParsedDate {
date: Date;
day: string;
dayOfWeek: number;
month: number|string;
year: number;
textShortDay: string;
textDay: string;
textMonth: string;
timestamp: number;
}
const days = {
shortDays: [
'вс',
'пн',
'вт',
'ср',
'ч... |
f949fdce3055597f9bbd9038af17b0ec5d0477b2 | TypeScript | takanopontaro/footloose-client | /src/dialog-typings.ts | 2.71875 | 3 | import { FC } from 'react';
import { IProperties as IItemSelectorProperties } from './item-selector-typings';
export type IDialogType = '' | 'alert' | 'confirm' | 'prompt' | 'itemSelector';
export type IDialogReturnBase = string | true | false | null;
export type IDialogReturn<T extends IDialogType> = T extends ''
... |
b03d8f8fee7ea15e02bc839ef7080888db8690f3 | TypeScript | JoshK2/jotils | /src/components/remove-duplicates-in-array/remove-duplicates-in-array.ts | 3.6875 | 4 | /**
* @description
* remove duplicates value from array
* @param {Array.<number | string | boolean>} array an array
* @returns {Array.<number | string | boolean>} array without duplicates value
* @example
* import { removeDuplicatesInArray } from '@bit/joshk.jotils.remove-duplicates-in-array'
* export default re... |
31caffed6a191e38fb5a85b02b5332cc9fc45cc4 | TypeScript | pmb-development/JukeBox | /JukeBoxWeb/src/app/title/title.component.ts | 2.5625 | 3 | import { Component } from '@angular/core';
@Component({
selector: 'app-title',
templateUrl: './title.component.html',
styleUrls: ['./title.component.css']
})
export class TitleComponent {
public title: string;
private hour: number;
constructor() {
this.hour = new Date().getHours();
if (this.h... |
33c8397649ae4c2893b75ddf69b2827e2df94935 | TypeScript | JoyGitHubPlace/cocosMagicFrameWork | /ku/assets/Script/Manager/poolManager.ts | 2.765625 | 3 | import nodePool from "./nodePool";
export default class poolManager {
/**
* author by Joy
* object pool manager
*/
private static _instance: poolManager;
public static get instance(): poolManager {
if (!poolManager._instance) {
poolManager._instance = new poolManager();
... |
71cab395950840c6b989d4c90b9192430ba9e0a1 | TypeScript | urbalazs/Rocket.Chat.Electron | /workspaces/desktop-release-action/src/shell.ts | 2.53125 | 3 | import { spawn } from 'child_process';
import * as core from '@actions/core';
const mergeEnv = (env?: Record<string, string>) => {
if (!env) {
return undefined;
}
if (process.platform === 'darwin') {
return {
...process.env,
...env,
};
}
return env;
};
export const run = (
comma... |
ea0087e6a6d66485eac090b3130a85802b8ae104 | TypeScript | Coffeekraken/coffeekraken | /packages/tools/sugar/src/shared/css/parse/parseTransformRule.ts | 3.125 | 3 | import __parse from '../../../shared/string/parse.js';
/**
* @name parseTransformRule
* @namespace js.css.parse
* @type Function
* @platform js
* @status wip
* @private
*
* Parse the transform rule of an element and returns a simple object with each properties separated.
... |
243c704ff85ae8ddaffb0344929cc9f127525229 | TypeScript | prishedko/mrbt | /src/impl/SpawnExecutor.ts | 2.703125 | 3 | import * as child from 'child_process'
import chalk from 'chalk'
import {log} from './Utils'
import {ExecutionCallbacks, ExecutionContext, Executor, IndexedStrings, SpawnExecutorOptions} from '../api/CommonTypes'
export class SpawnExecutor implements Executor {
constructor(private command: string,
... |
1535c4c34f3822409589180bf416b7bf80316a62 | TypeScript | kolarus/weather-app-RNRD | /src/core/redux/reducers/user.ts | 2.75 | 3 | import {USER_ACTIONS} from '../action-types';
import {Action} from '../types';
const initialState = {
ui: {
isAuthorizationInProgress: false,
hasInvalidLoginAttempt: false,
},
settings: {
units: 'metric',
showWeatherFor: 5,
},
isAuthorized: false,
};
const user = (state = initialState, actio... |
2f0aaf7ccc953d88793ba10976cd5053957cb3b2 | TypeScript | eszthoff/tibetan-date-calculator | /dist/dts/generators/get-month-from-month-count.d.ts | 3.09375 | 3 | import { Month } from '../types';
/**
* Figures out the Tibetan year number, month number within the year, and whether
* this is a leap month, from a "month count" number. See Svante Janson,
* "Tibetan Calendar Mathematics", p.8 ff.
*
* @param {number} monthCount: the "month count" since beginning... |
79d9b37811422ed49301a1892b299b6860ea6db4 | TypeScript | twelvedevs/learn-scala-blog | /client-test/src/reducers/article.ts | 2.84375 | 3 | import { actionsEnums } from "../common/actionsEnums";
import { ArticleEntity } from "../model/article";
class ArticleState {
articlesList: ArticleEntity[];
public constructor() {
this.articlesList = [];
}
}
export const articleReducer = (state: ArticleState = new ArticleState(), action) => {
switch (a... |
dd219f047944aabb487b84cd600a5703d9b36e8b | TypeScript | IMRZ/tw-db | /src/generated/threekingdoms/collections/AudioBattleEnvironmentReverbJunctions.ts | 2.53125 | 3 |
import { CollectionCache, CollectionKey } from "../../../common";
import { AudioBattleEnvironments } from "./AudioBattleEnvironments";
import { AudioBattleEnvironmentReverbTypes } from "./AudioBattleEnvironmentReverbTypes";
import { AudioBattleEnvironmentReverbs } from "./AudioBattleEnvironmentReverbs";
export namesp... |
5f7489bf2795f96ffa9324a95599e68c9c7ac5e8 | TypeScript | yoo2001818/yage | /src/core/entityStore/paged/PagedEntityQuery.ts | 2.796875 | 3 | import { PagedEntityStore } from './PagedEntityStore';
import { PagedEntity } from './PagedEntity';
import { PagedEntityPage } from './PagedEntityPage';
import { EntityQuery } from '../types';
export class PagedEntityQuery implements EntityQuery {
store: PagedEntityStore;
criterias: string[];
constructor(store... |
e8048d30982a8dbcb820aad8bb927c89dabbf695 | TypeScript | farp80/Typescript-for-beginners | /ts/interfaces.ts | 3.6875 | 4 | console.log(" Interfaces... ");
interface Person {
age: number;
name: string;
getWorkDetails?(address: string): void;
readonly zipCode: number;
// it does not allow public nor private access modifiers.
}
interface American extends Person {
state: string;
}
let username: Person;
username = {
age: 30,
n... |
32fe06221143881f2a2e137748c5dc27e70a8ac9 | TypeScript | HasanTuncelCoban/CHAP | /src/app/classes/WhileLoop.ts | 2.640625 | 3 | export class WhileLoop{
static id: string = 's_while_loop';
static s_name: string = 'While';
whileExpression: string;
trueExpression: string;
falseExpression: string;
constructor(){}
setWhileExpression(while_exp: string){ this.whileExpression = while_exp; }
getWhileExpression(){ return this.whileExp... |
8731f87843f0c2ac06e67cd6bfae97aa594b6d20 | TypeScript | trailimage/blog | /src/regex.test.ts | 2.921875 | 3 | import { re } from './regex';
import { lipsum } from '@toba/test';
const nl = '\r\n';
const text = `some
text on more
than
one line`;
it('matches quote characters', () => {
expect('"say"“'.replace(re.quote.any, '')).toBe('say');
});
it('matches quote block', () => {
let quote = '“' + lipsum + nl + '“' + lipsu... |
458767917d73cceddfd069931d0289de78355064 | TypeScript | dreampulse/printing-client | /src/app/reducer/modal.ts | 2.78125 | 3 | import {Actions} from '../action'
import {ModalConfig} from '../type'
import * as modalActions from '../action/modal'
export type ModalState = {
isOpen: boolean
modalConfig: ModalConfig
}
const initialState: ModalState = {
isOpen: false,
modalConfig: null
}
const openModal = (state: ModalState, action: modal... |
55ae0e5608350e4609dfe23cf38b79c02f3c1d39 | TypeScript | aaronTheZinc/Space | /shared/spacex/company/index.ts | 2.53125 | 3 | import type { AxiosInstance, AxiosResponse } from 'axios';
export interface Company {
headquarters: Object;
links: Object;
name: string;
founder: string;
founded: number;
employees: number;
vehicles: number;
launch_sites: number;
test_sites: number;
ceo: string;
cto: string;
coo: string;
cto_propulsion: ... |
bc6ca9c853a2f495deed7da4b36f0e59217d491d | TypeScript | YogPanjarale/weather-app | /pages/api/weather.ts | 2.734375 | 3 |
import type { NextApiRequest, NextApiResponse } from 'next'
async function Handler(req: NextApiRequest, res: NextApiResponse) {
if (!!req.query.city) {
try {
const res_ = await fetch(
`https://api.openweathermap.org/data/2.5/weather?q=${req.query.city}&appid=${process.env.APPID}&units=metric`
);
co... |
116c7e9fd8c0f3f0d1626d65306427a4a5754f61 | TypeScript | uwgraphics/scattertasks | /js/exampleVis.ts | 2.546875 | 3 | module Scattertasks {
enum NumDims {
TwoPicked,
TwoDerived,
MultiDim
}
enum NumClasses {
OneClass,
TwoToFourClasses,
FivePlusClasses
}
enum DataDistrib {
Random,
Clusters,
Manifolds,
Linear,
Overlap
}
enum Spatial {
TwoNonSpatial,
TwoSpatial,
OneEach
}
... |
7c468c040d2eeb8eb8fc9259e3bca9b7e5e87ed4 | TypeScript | darvishiyan-mahdi/filterizr | /src/DefaultOptions.ts | 2.5625 | 3 | export interface IDefaultOptionsCallbacks {
onFilteringStart?: EventListener;
onFilteringEnd?: EventListener;
onShufflingStart?: EventListener;
onShufflingEnd?: EventListener;
onSortingStart?: EventListener;
onSortingEnd?: EventListener;
}
export interface IDefaultOptions {
animationDuration?: number;
... |
395492aee98b7cac7a9c274e0d91f86ca42c108a | TypeScript | hesam-tavakoli84/samuwrite | /src/editor/state/state.ts | 2.765625 | 3 | import * as monaco from "monaco-editor";
import { Dispatch, SetStateAction, useState } from "react";
export type Editor = monaco.editor.IStandaloneCodeEditor;
export type EditorModel = monaco.editor.ITextModel;
export type EditorOptions = monaco.editor.IStandaloneEditorConstructionOptions;
export interface EditorSt... |
5d4b184ddabdac409822f0bd7dcb76d4e05de945 | TypeScript | chrisworman/genetic-algorithm | /src/core/cachedFitnessGAContext.ts | 2.78125 | 3 | import { IChromosome } from "../core/interfaces/iChromosome";
import { IGAContext } from "../core/interfaces/iGAContext";
import { IGAContextFactory } from "../core/interfaces/iGAContextFactory";
import { IOperator } from "../core/interfaces/iOperator";
import { IPopulation } from "../core/interfaces/iPopulation";
impo... |
832889ee9730d6c26aac628e0d2433752cef2c97 | TypeScript | nanot1m/my-bookmarks-app | /src/storage/file-system-storage.ts | 2.625 | 3 | import { fileOpen, fileSave, FileSystemHandle } from "browser-nativefs";
import { get as idbGet, set as idbSet } from "idb-keyval";
import { AppState, upgradeState } from "./index";
const IDB_FILE_HANDLE_KEY = "idb_file_handle_key";
export async function saveFileHandle(handle: FileSystemHandle): Promise<void> {
aw... |
40e21f12ba4969b57a11aec2872b600108399065 | TypeScript | hiwelo/adhd-day | /src/data/medicationIntake/reducer.ts | 2.78125 | 3 | import { filter, uniqBy } from 'lodash';
import { v4 as uuid } from 'uuid';
import {
ADD,
EDIT,
REMOVE,
MedicationIntake,
MedicationIntakeAction,
} from './types';
const INITIAL_STATE: MedicationIntake[] = [];
export const reducer = (
state = INITIAL_STATE,
action?: MedicationIntakeAction,
): Medicatio... |
149bdc63a9c55f2b7a0b75ac6d0bb61c08a4fc86 | TypeScript | Kottackal-ET-Practice/AirlineDelayInsuranceApplication-Typescript | /public/src/services/authService.ts | 2.828125 | 3 |
// For authentication
class Authenticate {
public username: string;
public password: string;
static $inject = ['$http', '$q', 'AuthToken'];
constructor(private $http: ng.IHttpService, private $q: ng.IQService, private AuthToken) {
}
// For login
public login(username:string, password:s... |
c93cf66243f9dbf676fb5edf3695788f1b28ea8d | TypeScript | ziyadss/Node.js | /4-natours/api/v1/controllers/tourLocal.ts | 2.921875 | 3 | import { readFileSync } from 'fs';
import { writeFile } from 'fs/promises';
import { NextFunction, Request, Response } from 'express';
interface Tour {
id: number;
name: string;
duration: number;
maxGroupSize: number;
difficulty: string;
ratingsAverage: number;
ratingsQuantity: number;
price: number;
... |
2022bf5e4c1c016a6210eb910d6418c3f8d8ffd8 | TypeScript | nicholastanui/daily-quotes | /src/app/model/quote.ts | 2.6875 | 3 | export class Quote {
id: number;
name: string;
author: string;
submitter: string;
upVote: number;
downVote: number;
created: Date;
showDetails: boolean;
topQuote: boolean;
constructor(id: number, name: string, author: string, submitter: string, created: Date) {
this.id = id;
this.name = nam... |
e3d4b2970137abf0445001dbf88fd9ebb3f26e7c | TypeScript | 16010948/Project10-Twitter | /be/src/services/upload/index.ts | 2.625 | 3 | import fs, { createWriteStream, ReadStream } from 'fs';
interface File {
file: {
createReadStream(): ReadStream;
filename: string;
mimetype: string;
encoding: string;
};
}
const imgUpload = async (_: any, { file: { file: imgFile } }: any) => {
const { createReadStream, filename } = await imgFile... |
4b27303ac9ab808504722a815f6dfc8e27d2fd64 | TypeScript | rihorn2/bloom-ts | /src/bloom/BloomFilter.ts | 3.109375 | 3 | import { KMHasher } from "./Hashing/KMHasher";
import { IHasher } from "./Hashing/IHasher";
export interface IBloomFilter<T> {
numHashes: number;
loadingProgressCallback?: (n: number)=>void;
add(item: T): void;
contains(item: T): boolean;
peekFilter(): Uint16Array;
currentCount(): numb... |
d79acebf5f5aa8f429732c8f7496c70f96c52b7a | TypeScript | iGroza/swiftui-react-native | /src/utils/fonts/index.ts | 2.65625 | 3 | export const FontWeight = {
regular: 'regular',
bold: 'bold',
heavy: 'heavy',
medium: 'medium',
light: 'light',
};
export const Font = {
largeTitle: 'largeTitle',
title: 'title',
title2: 'title2',
title3: 'title3',
headline: 'headline',
subheadline: 'subheadline',
body: 'body',
callout: 'call... |
922585400f779ada5f16d53cddfecaa5a3b770dc | TypeScript | bonnici/advent-of-code-2020 | /ts/src/day21/index.ts | 3.3125 | 3 | import { readLines } from '../lib';
const input = readLines('src/day21/input.txt');
// console.log('input', input);
class Foods {
public foods: Food[] = [];
public allIngredients: Set<string> = new Set();
public allAllergens: Set<string> = new Set();
public allergenToIngredient: Map<string, string> = new Map(... |
cd117828f76ed8a3543b7bc1f7cab0a66a23d19c | TypeScript | sucharitha198/USTGLOBAL-HTD-GENERIC-24JUL2019--DEVATHI-SUCHARITHA- | /Typescript/index.ts | 3.4375 | 3 | // let myName = 'Sucharitha';// let myName:string = 'sucharitha' internal process
// let company;//let company:any
// company = 'TestYantra';
// company = 23;
// console.log(company);
// console.log(myName);
// let sample : number | string;
// sample = 10;
// console.log(sample); //union
// let myArray = ['suchi',2... |
4886f6102fbcf358a8b95e0b6073aaa9b7a8b0d3 | TypeScript | evgenydedenko/WebRtcDemo | /WebRtcDemoFrontend/src/app/models/user-model.ts | 2.8125 | 3 | import BasicProfile = gapi.auth2.BasicProfile;
export class UserModel {
dbId: number = 0;
googleId: string = '';
fullName: string = '';
email: string = '';
avatarUrl: string = '';
constructor(profile: BasicProfile | undefined = undefined) {
this.fillData(profile);
}
fillData(profile: BasicProfile... |
93dcc0e20a4a63d663e3716a92dd5fb5577b770d | TypeScript | jitu712/angular-reddit-clone | /src/app/components/create/createsubreddit/createsubreddit.model.ts | 2.515625 | 3 | import { FormlyFieldConfig } from '@ngx-formly/core';
export class CreateSubredditModel {
name!: string;
description!: string;
getFields(): FormlyFieldConfig[] {
return [
{
key: 'name',
type: 'input',
templateOptions: {
label: 'Name of Subreddit',
placeholder... |
65006c98ea2635528121012eae6b439a51eb3d54 | TypeScript | masaad-ua/learnAngular2 | /AngularANDwebpack/pomodoro-timer.ts | 2.640625 | 3 | import { Component, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
@Component({
selector: 'pomodoro-timer',
template: '<h1>{{ minutes}} : {{ seconds}}</h1>'
})
class PomodoroTimerComponent... |
577fb3191b67b8d60835a4ac4963a9ea68bd2dee | TypeScript | Coffeekraken/coffeekraken | /packages/postcss/s-postcss-sugar-plugin/src/node/mixins/margin/classes.ts | 2.671875 | 3 | import __SInterface from '@coffeekraken/s-interface';
import __STheme from '@coffeekraken/s-theme';
import { __keysFirst } from '@coffeekraken/sugar/array';
import __faker from 'faker';
/**
* @name classes
* @as @sugar.margin.classes
* @namespace node.mixin.margin
* @type Post... |
4ad49e5a4751c8751437e9d9c8652cd5b315b683 | TypeScript | baozihuihui/Algorithm | /leetCode/84_largest-rectangle-in-histogram.ts | 3.71875 | 4 | // function largestRectangleArea(heights: number[]): number {
// let area = 0,
// length = heights.length;
// if (heights.length === 0) {
// return area;
// }
// if (length === 1) {
// return heights[0];
// }
// heights.push(0);
// length = length + 1;
// let stack: number[] = [-1];
// for... |
4756d33cfa9ebbdc1e1adb9a5d11e7552023e6e1 | TypeScript | OctoD/redux-aar | /src/__tests__/readme.spec.ts | 3.15625 | 3 | import * as redux from "redux";
import aar from "..";
describe("tests the example in the readme 🐧", () => {
test("todo app example", () => {
interface ITask {
done?: boolean;
name: string;
}
interface IUpdateTask {
index: number;
task: ITask;
}
interface IState {
... |
e41924935f53bba02b4229a30baa261489d1dc85 | TypeScript | MulProj/PzTest | /SmartHousev3/WebApplication3/ClientApp/src/app/app.component.ts | 2.796875 | 3 | import { Component, OnInit } from '@angular/core';
import { HttpService } from 'src/app/Service/http.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit{
constructor(private httpService: HttpService)... |
01489014a13ed6f09a8c15e6c4c39edf6da94b4f | TypeScript | testangular5/test | /src/app/services/posts.service.ts | 2.53125 | 3 | import {Injectable} from "@angular/core";
import {Post} from "../models/Post";
import {Observable} from "rxjs/Observable";
import {HttpClient, HttpHeaders, HttpErrorResponse} from '@angular/common/http';
import 'rxjs/add/observable/throw';
import 'rxjs/add/operator/catch';
import {environment} from "../../environments/... |
be8b0cfd013f41b4811bca7dc9b144c07ee4b242 | TypeScript | DomiR/rxjs-commented-operators | /src/operators/endWith.ts | 3.046875 | 3 | /**
* End with operator
*
* @see
*
* @author Dominique Rau [domi.github@gmail.com](mailto:domi.github@gmail.com)
* @version 0.0.1
*/
import { Observable, of, Subscription, timer, interval, empty, VirtualTimeScheduler } from 'rxjs';
import { endWith as endWithOriginal } from 'rxjs/operators';
export function e... |
ce786392f855c295606b1f7eef4189840acb6955 | TypeScript | 1lukaszj/recipe-book | /src/app/recipes/ingredients.pipe.ts | 2.5625 | 3 | import {Pipe, PipeTransform} from "@angular/core";
import {Recipe} from "./recipe";
import * as _ from "lodash";
@Pipe({
name: 'ingredients',
pure: false
})
export class IngredientsPipe implements PipeTransform {
transform(recipes: Recipe[], args?: any): any {
let recipesFiltered: Recipe[] = [];
if (_.... |
cea7970ccbd0e8355b277685254d59f139f22c88 | TypeScript | matthe815/MajorasMaskOnline | /packassets.ts | 2.625 | 3 | import fse from 'fs-extra';
import path from 'path';
import zip from 'adm-zip';
// Copied from ML core. Needed for the packing process.
export class MonkeyPatch_Stringify {
original: any;
replacement: any;
patch() {
const BJSON = require('buffer-json');
this.original = JSON.stringify;
... |
5cb2b17e344488a6d13c0bd1f1d6fdc5f4005939 | TypeScript | bruzt/backend-graphql-typeorm | /src/utils/tests/checkHeadersAuthorization.test.ts | 2.65625 | 3 | import { Request } from 'express';
import connection from '../../database/connection';
import UserEntity from '../../entities/UserEntity';
import truncateDBTables from '../../testUtils/truncateDBTables';
import checkHeadersAuthorization from '../checkHeadersAuthorization';
describe('Utils checkHeadersAuthorization te... |
1ae8b9f5bbe6e4a9539bb1b1c98bccbc5bac66aa | TypeScript | Panduss/StudentEvaluationTool | /server/src/users/entity.ts | 3 | 3 |
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm'
import { BaseEntity } from 'typeorm/repository/BaseEntity'
import { Exclude } from 'class-transformer'
import { IsString, IsEmail, MinLength } from 'class-validator'
import * as bcrypt from 'bcrypt'
@Entity()
export default class User extends BaseEntity... |