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 |
|---|---|---|---|---|---|---|
a424019908f1155cfcab2c44634093b90dbd5c79 | TypeScript | hemantv/ReactNativePaperGalleryProject | /src/Assets/Data/Code/Appbar/AppbarCode.ts | 2.609375 | 3 | const AppbarCode = () => `import React, {useState} from 'react';
import {Platform, View} from 'react-native';
import {Appbar, Checkbox} from 'react-native-paper';
const MORE_ICON = Platform.OS === 'ios' ? 'dots-horizontal' : 'dots-vertical';
const AppbarDemo = () => {
const [subtitleChecked, setSubtitleChecked] = u... |
9170180245574eb4715914609fb60d0f0654fb71 | TypeScript | backstage/backstage | /packages/config-loader/src/sources/MergedConfigSource.ts | 2.59375 | 3 | /*
* Copyright 2023 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ... |
55621717654fe08369ca9b663b771e4734c1fab2 | TypeScript | seregaa020292/capitalhub | /frontend/src/app/store/modules/auth.ts | 2.921875 | 3 | import { MutationTree } from 'vuex'
export interface IAuthState {
loggedIn: boolean
expire: number | null
csrf: string
}
/**
******************************
* @State
******************************
*/
export const state = (): IAuthState => ({
loggedIn: false,
expire: null,
csrf: '',
})
/**
***********... |
2bbc71ff7a38fc67c0b91f7f3588dc23226efee0 | TypeScript | contiamo/restful-react | /src/util/processResponse.ts | 2.578125 | 3 | export const processResponse = async (response: Response) => {
if (response.status === 204) {
return { data: undefined, responseError: false };
}
if ((response.headers.get("content-type") || "").includes("application/json")) {
try {
return {
data: await response.json(),
responseError... |
886d34eb41e94b586343385c46b4e1c75bff58f4 | TypeScript | ahmedNY/express-typescript-boilerplate | /src/auth/currentUserChecker.ts | 2.6875 | 3 | import { Action } from 'routing-controllers';
import { Connection } from 'typeorm';
import { User } from '../api/models/User';
import { Logger } from '../lib/logger';
import { TokenInfoInterface } from './TokenInfoInterface';
export function currentUserChecker(connection: Connection): (action: Action) => Promise<User... |
c5a7d29ea5364f03634a3a2badf7578e925329a6 | TypeScript | andrewandzz/my-messages | /MyMessages.Api/ClientApp/src/app/shared/services/account.service.ts | 2.515625 | 3 | import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable, of } from 'rxjs';
import { catchError, map } from 'rxjs/operators';
import { Token } from '../interfaces/token.interface';
import md5 from 'crypto-js/md5';
import { environment } from 'src/en... |
792a260e4992b34520e091a5345a9edf1de2a04f | TypeScript | alchemist/alchemist-core | /src/registries/node-generator-registry.ts | 2.8125 | 3 | import {INodeGenerator} from "../generators/inode-generator";
import {INode} from "../models/nodes/inode";
export class NodeGeneratorRegistry
{
private generators: Array<INodeGenerator> = [];
public getGeneratorsFor = (node: INode): Array<INodeGenerator> => {
return this.generators.filter(x => x.canHa... |
33b110970e5374efa7c66bde0b2cfe2a714acfb5 | TypeScript | pankajparkar/ng-rfx | /projects/rfx-lib/src/lib/model.ts | 2.578125 | 3 | import {AbstractControl, AbstractControlOptions} from '@angular/forms';
import {TypedFormArray, TypedFormControl, TypedFormGroup} from './forms/typed-form-control';
export interface ErrorMessages {
[k: string]: ErrorMessages | string;
}
export type ErrorMessageResolver = (control: AbstractControl, path: string[]) =... |
3319e978766556d8d246fe9f78c6431d5915cfbc | TypeScript | shternberga/codelex-prep-course | /exercises/00-warm-up/src/31-sum-all.ts | 4.03125 | 4 | export {};
/**
* Implement a function which takes two integers and returns the sum of every number between (inclusive), for example:
*
* - 1, 4 will return 1 + 2 + 3 + 4 which is 10
*/
const sumAll = function(a: number, b: number): number {
let sum: number;
for (let i = a; i <= b; i++) {
sum += i... |
b50e2a274d033a4c82d8c6a09aa8a41ef987e073 | TypeScript | ktt-ol/sgTraffic | /app/data.ts | 3.28125 | 3 | /// <reference path="typings/tsd.d.ts"/>
require('source-map-support').install();
export interface DataSet {
totalIn:number;
totalOut:number;
detailIn:number[];
detailOut:number[];
}
export class Ring {
private value:number[];
private pointer:number = 0;
private valuesCount:number = 0;
constructor(pr... |
d3e6ca4f1def0ec10ad7411b69d89722c0e193aa | TypeScript | nguyer/aws-sdk-js-v3 | /clients/browser/client-opsworks-browser/types/_Volume.ts | 2.921875 | 3 | /**
* <p>Describes an instance's Amazon EBS volume.</p>
*/
export interface _Volume {
/**
* <p>The volume ID.</p>
*/
VolumeId?: string;
/**
* <p>The Amazon EC2 volume ID.</p>
*/
Ec2VolumeId?: string;
/**
* <p>The volume name.</p>
*/
Name?: string;
/**
* <p>The RAID array ID.</p>
... |
988c2c9a0ba636f8743ed598a4e8b0555a8cdcf9 | TypeScript | jpwardd/ticket-manager-rails | /client/src/store/types.ts | 2.625 | 3 | // Auth Types
export type User = {
firstName: string;
lastName: string;
email: string;
owner: boolean;
manager: boolean;
receptionist: boolean;
};
// Services Types
export interface Service {
id: string
name: string
price: string
category: string
user: User
}
export type formElement = React.Form... |
f6a3f783fe28d37d32d8fd2d9d8156054db105c0 | TypeScript | Bhanukamax/vc-todo-app | /api/src/modules/repository/todo.repository.ts | 2.96875 | 3 | import { TodoStatus } from "../enums/todo-status.enum";
import TodoModel from "../models/todo.model";
import { ITodoQuery, ITodoQueryInput } from "../types/index.types";
export interface ITodoRepository {
queryTodos(args: ITodoQueryInput): Promise<any>;
toggleAllTodos(status: TodoStatus): Promise<any>;
addTodo(d... |
acb4c76650bfbf2af852a5a07f1c0080ee6ca6f1 | TypeScript | knopkem/dicomweb-proxy | /src/dimse/wadoUri.ts | 2.53125 | 3 | import { ConfParams, config } from '../utils/config';
import { LoggerSingleton } from '../utils/logger';
import { fileExists } from '../utils/fileHelper';
import { compressFile } from './compressFile';
import { waitOrFetchData } from './fetchData';
import path from 'path';
import fs from 'fs';
import { stringToQueryLev... |
fd27ca6c210451365cba7e27917f57d943fdc2a7 | TypeScript | GiovanaNp1/Adoption-For-Love | /Back-End/src/services/CreateUserJudge.ts | 2.546875 | 3 | import { getRepository } from 'typeorm';
import Judge from '../models/RegisterJudge';
interface Request {
name: string;
id_judge: string;
email: string;
password: string;
}
class CreateUserJudge {
public async execute({
name,
id_judge,
email,
password,
}: Request): Promise<Judge> {
con... |
b8d72013dd2a4a1f6b48199d13bd14384dbd2ee9 | TypeScript | Dan-Ayettey/catalog-app | /src/controller/productController.ts | 2.71875 | 3 | import ProductModel from "../model/productModel";
class ProductController{
private productModel: ProductModel;
constructor(productModel:ProductModel) {
this.productModel=productModel
}
setImage=(image:number)=>{
this.productModel.setImage(image);
}
setIsDropable=(isDrop:bool... |
f190be9ea1eff54bf2170af8d15a3822aea7fc74 | TypeScript | coderofsalvation/react-admin | /packages/ra-core/src/dataProvider/useGetList.ts | 2.984375 | 3 | import { Pagination, Sort, ReduxState } from '../types';
import useQueryWithStore from './useQueryWithStore';
/**
* Call the dataProvider.getList() method and return the resolved result
* as well as the loading state.
*
* The return value updates according to the request state:
*
* - start: { loading: true, load... |
9ccafd8a9056b97bf6088276ba0ca4c4464b7529 | TypeScript | pdxmholmes/dirty-fingernails | /src/bot/commands/handlers/new-group.ts | 2.625 | 3 | import * as moment from 'moment';
import {
IBotRequest,
Utils,
log
} from '../../../core';
import {
Group,
IGroup
} from '../../../core/models';
import { IGame } from '../../../core/games';
import { ICommand } from '../command';
import { needsGame } from '../traits';
interface INewGroupArguments {
timeUnt... |
98fb7edd6f6e650ae10d1107370a89c94841ab3c | TypeScript | waqas0ahmad/e-com-api | /src/models/response.model.ts | 2.5625 | 3 | import { UserTypes } from "./account-request.model";
export class ResponseModel<T>{
Status:number | undefined;
Message:string | undefined;
Data:T | undefined;
}
export class AccountResponseModel{
Id:number | 0;
Username:string;
Password?:string;
DisplayName:string;
FirstName:strin... |
fd6a629188004e7618b1ddc660af487025977bc4 | TypeScript | Sed2295/typescript | /typescript/clases.ts | 3.296875 | 3 | ( () => {
/*
Forma 1 de crear una clase e inicializar las propiedades
class Avenger {
nombre:string;
equipo:string;
nombreReal:string;
//son opcionales por eso el signo y en el constructor no se inicializa
puedePelear?:boolean;
peleasGanadas?:number;
... |
0449c9fffe07ef9b7b8ae31d7eb9e8460bdfb20c | TypeScript | ankitkarna99/indianspice-admin | /src/core/services/LocalStorageService.ts | 2.78125 | 3 | export default abstract class LocalStorageService {
private static ACCESS_TOKEN: string = "INDIAN_SPICE_ACCESS_TOKEN";
static clearTokens() {
localStorage.clear();
}
static setAccessToken(token: string): void {
localStorage.setItem(this.ACCESS_TOKEN, token);
}
static getAccessToken(): string | nu... |
4912b0480be3b7aa43700b025438ac8fbc87a61a | TypeScript | iankuratri/learning-reactjs | /12-react-query-zustang-router/src/react-query/hooks/usePostsInfinite.ts | 2.703125 | 3 | import { useInfiniteQuery } from "@tanstack/react-query";
import axios from "axios";
interface Post {
id: number;
title: string;
body: string;
userId: number;
}
export interface PostQuery {
pageSize: number;
userId?: number;
}
const usePostsInfinite = (query: PostQuery) => {
const { pageSize, userId } ... |
1f73fae607448efba290fc2f8c4416b8804686dc | TypeScript | rickmugridge/mismatched | /src/matcher/AllOfMatcher.micro.ts | 2.9375 | 3 | import {assertThat} from "../assertThat";
import {match} from "../match";
import {MatchResult} from "../MatchResult";
import {Mismatched} from "./Mismatched";
import {AllOfMatcher} from "./AllOfMatcher";
import {validateThat} from "../validateThat";
import {ContextOfValidationError} from "./DiffMatcher";
describe("All... |
de4a84b9b5a0b3a9e007cf08ca3bfeb81e64b0db | TypeScript | filipemerker/pl-util | /src/hobbies.spec.ts | 3.109375 | 3 | import { getHobby, getHobbies } from './hobbies';
import HOBBIES from './data/hobby.json';
describe('test hobbies.js', () => {
describe('test getHobby function', () => {
let hobby = '';
beforeEach(() => {
hobby = getHobby();
});
it('should return not empty string', () => {
expect(typeof... |
b61401dbb343b378d1cf6ffb18d8839df148c8ba | TypeScript | lteam18/nosh | /src/main.ts | 2.65625 | 3 | import fs from "fs"
(function (){
const argv = process.argv
if (argv.length <= 2) {
console.log("nosh <filepath> [...argument]")
return
}
const filepath = process.argv[2]
const str = fs.readFileSync(filepath).toString()
process.argv.shift()
switch (process.env["ENGINE"]) ... |
8c1a2aa2b8f34a4aba04a70d791569c211791077 | TypeScript | alevosia/ownit-home-loans | /src/typings/form.d.ts | 2.796875 | 3 | interface FormState {
index: number
submitted: boolean
submitting: boolean
sent: boolean
error: any
responses: Responses
}
type QuestionType = 'CHOICES' | 'INPUT'
interface Question {
id: string
inquiry: string
description?: string
type: QuestionType
choices?: Choice[]
... |
f02c488750c81c74ffbb17f8b17561c2a559d1a2 | TypeScript | Gaubee/TheLastShip | /web-server/class/pixelCollision.ts | 2.59375 | 3 | const canvas = document.createElement("canvas");
const canvas2 = document.createElement("canvas");
// canvas.style.background = "blue";
// canvas2.style.background = "red";
// setTimeout(function () {
// document.body.appendChild(canvas);
// document.body.appendChild(canvas2);
// });
const ctx = canvas.getConte... |
eba2d7edead74e6f67c383c55b04e4589cc1a8b8 | TypeScript | mateus-pinheiro/peddi-projects | /src/api-core/commons/dto/order.dto.ts | 2.9375 | 3 | // const { BaseDTO, fields } = require('dtox')
// Define order mapping
// const ORDER_MAPPING = {
// table: Number(),
// guests: Number(),
// amount_price: Number(),
// status: Number(),
// restaurant_id_cloud: Number(),
// // waiter: fields.WaiterDTO()
// };
// const WAITER_MAPPING = {
// ... |
a55985c56dd3e07867e29d460b46702f414458de | TypeScript | ScriptCamilo/learning-typescript | /src/typeAnnotation/aula16.ts | 3.34375 | 3 | // STRUCTURAL TYPE SYSTEM
type User = { username: string; password: string };
type VerifyUserFn = (user: User, sentUser: User) => boolean;
const verifyUser: VerifyUserFn = (user, sentUser) => {
return (
user.username === sentUser.username && user.password === sentUser.password
);
};
const dbUser = { username... |
6bd0c99d153e750b337468f169ad336e845f5411 | TypeScript | Eirenliel/node-steamapits | /src/utils/fetch.ts | 2.578125 | 3 | import { createDeflate, createGunzip } from 'zlib';
import { parse } from 'url';
import https from 'https';
import http from 'http';
const reg = /<h1>(.*)<\/h1>/;
export default (url: string, headers: {} = {}) : Promise<any> => {
const fetch = url.startsWith('https') ? https.get : http.get;
const options = Object.as... |
22ddf0b2e3a25ca86c5bcd88fd8caee1fc44f965 | TypeScript | bigcommerce-labs/hello-world-bc | /app/import/fn/extract/extract-csv-handler.ts | 2.765625 | 3 | 'use strict';
const csv = require('csvtojson');
const _ = require('lodash');
import { Handler, Context, Callback } from 'aws-lambda';
import { CsvDataRow } from '../../../types/csvs'
interface ExtractCsvRowJson {
}
interface ExtractCsvResponse {
statusCode: number,
rowCount: number,
rows: any[]
}
... |
e7d1850410052ddb5c8ce2585d3e80c1d0fa7b89 | TypeScript | coolchem/raappid | /test/unit/service_system/manager/cli-manager.spec.ts | 2.5625 | 3 | /**
* Created by varunreddy on 12/17/15.
*/
import cm = require("../../../../src/lib/service_system/managers/cli-manager");
import chai = require('chai');
describe('cli-manager Test cases', () => {
var expect = chai.expect;
describe("processArguments",()=>{
it("should throw error if less than 2 co... |
c1a7f31830563d66d97221e9e2a1611b38744c5f | TypeScript | mm7456/MoveableBox | /src/app/app.component.ts | 2.640625 | 3 | import { Component, HostListener } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'BoxDemo';
public widgetIds: Array<number> = [];
public id = 1;
widgetElement = null;
selectedWidge... |
db4157ec81743a9a658085922700d17bb0f5f817 | TypeScript | luciotato/create-near-app | /templates/angular/src/app/app.component.ts | 2.546875 | 3 | import { Component, Inject, OnInit } from '@angular/core'
import { login, logout } from '../utils'
import { WINDOW } from './services/window.service'
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent implements OnInit {
greeting: string
newGreeting: string
s... |
75d70e49e7ba95a05f3474115344b88e1ecf746d | TypeScript | wangtengda0310/liuyao | /kanliuyao/build/libs/laya/net/URL.d.ts | 3.03125 | 3 | /**
* <p><code>URL</code> 提供URL格式化,URL版本管理的类。</p>
* <p>引擎加载资源的时候,会自动调用formatURL函数格式化URL路径</p>
* <p>通过basePath属性可以设置网络基础路径</p>
* <p>通过设置customFormat函数,可以自定义URL格式化的方式</p>
* <p>除了默认的通过增加后缀的格式化外,通过VersionManager类,可以开启IDE提供的,基于目录的管理方式来替代 "?v=" 的管理方式</p>
* @see laya.net.VersionManager
*/
ex... |
c9236401b8150afe436dad169a37fab2d0b3e3a6 | TypeScript | Lorddoyo/quotes | /src/app/quote.ts | 2.5625 | 3 | export class Quote {
public showDescription:boolean
constructor(public id:number, public name:string, public description:string){
this.showDescription=false
}
}
|
71062031ced4ffad6f2b6934cc5951d977600798 | TypeScript | NikhilMishra123/Angular_Js | /hello-world/src/app/signup-form/custom-validator.ts | 2.90625 | 3 | import {AbstractControl, ValidationErrors , } from '@angular/forms'
export class UsernameValidator{
static cannotContainSpace(control : AbstractControl) : ValidationErrors|null{
if( (control.value as string).indexOf(' ')>=0)
return {
cannotContainSpace :'Has space in it' };
}
static shouldBeUnique(contr... |
18cfba57a753313132791a7c4ed578f0a8ea176f | TypeScript | Sanagiig/vue0.2 | /src/utils/assert/index.ts | 2.6875 | 3 | import { makeMap } from "../convert/index";
/**
* Get the raw type string of a value, e.g., [object Object].
*/
const _toString = Object.prototype.toString
// Browser environment sniffing
export const inBrowser = typeof window !== 'undefined'
export const UA = inBrowser && window.navigator.userAgent.toLowerCase()
e... |
0e1f30ef849109309e127e43637f7b629f3125e3 | TypeScript | gustavowarmling/mestres-da-web | /src/services/ProductServices/CreateProductService.ts | 2.71875 | 3 | import { getRepository } from 'typeorm'
import Product from '../../models/Product';
interface Request {
name: string,
description: string,
size: number,
price: number,
sku: string;
}
class CreateProductService {
public async execute({ name, description, size, price, sku }: Request): Promise<Product> {
... |
1facedb50f2d4dfc773afc010b9a0c121dd8a2ba | TypeScript | vikuviku6666/lan-tech_front-dev | /src/utils/sortProduct.ts | 3.328125 | 3 | import { Dict } from '../types';
/**
* for a given order key/value object, generates a callback function
* @param order
* @returns (item: Dict) => number
*/
const sortProduct =
(order: Dict) =>
(a: Dict, b: Dict): number => {
// todo: implement sort by `price` and `quantity`
// todo: make sort by `name` a c... |
ed783813ed7377c68cae474b9f2a441434f5edd0 | TypeScript | inkorcoder/aow | /src/render/render.ts | 2.6875 | 3 | import { Map } from "./map";
import { Grid } from "./../core/grid";
import { Vector } from "./../math/vector";
import { Texturer } from './../core/texturer';
export class Render {
canvas: HTMLCanvasElement;
ctx: CanvasRenderingContext2D;
width: number;
height: number;
isRunning: boolean;
onRenderCallbacks: Fun... |
503611b1b74ff62070395efe67fcd78fa41404f7 | TypeScript | U1F30C/liberet-challenge | /web/models/service.ts | 2.59375 | 3 | export enum ServiceType {
Immediate = "Immediate",
Enableable = "Enableable",
}
export interface Service {
activeServices: { userId: string; serviceId: string }[];
id: string;
name: string;
cost: string;
serviceType: ServiceType;
}
|
dcae4589a8047e39fd0168e10d23ee8652d34422 | TypeScript | ajiekc905/bipWatchFaceEditor | /src/Images.ts | 2.875 | 3 | import {Reader} from './DataReader';
import {Logging} from './Logging';
export default class RawImage {
// palette: Uint32Array;
public width: number;
public height: number;
public usdedPaletteColors: number;
public name: string;
// private section for stupid linter
private palette: ImageData[]; // color... |
ad772834b05a2fb4af4032e90765d68bce049895 | TypeScript | asvny/formatjs | /packages/ecma402-abstract/NumberFormat/ToRawPrecision.ts | 3.203125 | 3 | import {RawNumberFormatResult} from '../types/number';
import {repeat, getMagnitude} from '../utils';
export function ToRawPrecision(
x: number,
minPrecision: number,
maxPrecision: number
): RawNumberFormatResult {
const p = maxPrecision;
let m: string;
let e: number;
let xFinal: number;
if (x === 0) {... |
f8abe5aea6862950bdfd0250e85eba0d6e04fd37 | TypeScript | rnaidenov/typescript-design-patterns | /observerPattern.ts | 3.84375 | 4 | /**
* *** OBSERVER PATTERN *** *
*
* - Subscription model maintaining a one-to-many relationship between a
* a subject and its observers
* - Whenever the subject's state changes, the observers are notified
*
* - Requirements:
*
* * Subject, whose state will be monitored (***BeingLateSubject***)
* ... |
ea3e816a30bd4fdf920d18ef3452f6e34a99738f | TypeScript | simondel/core | /packages/core/src/exceptions/Exception.ts | 3.640625 | 4 | /**
* Represents basic type of exception.
* @author Alex Chugaev
* @since 0.0.1
*/
export abstract class Exception extends Error {
/**
* Gets other error which was the cause of this exception.
* @author Alex Chugaev
* @since 0.14.0
*/
readonly cause: Error | undefined;
/**
* Initializes new in... |
5a93071487e87b56636f30329bb429e195dda909 | TypeScript | chouchouxsl/ts-study-notes | /02-ts进阶/ts泛型.ts | 4.125 | 4 | export {}
/*
泛型的基本使用
*/
function sumArr<T, U>(x: T, y: U): [T, U] {
return [x, y]
}
sumArr(1, 2)
sumArr(1, '2')
sumArr('2', '2')
sumArr('2', false)
/*
泛型接口
*/
interface IsumObj<T, U> {
X: T
Y: U
}
function sumObj<T, U>(x: T, y: U): IsumObj<T, U> {
return {
X: x,
Y: y
}
}
conso... |
8dc7be4156f3c683ba552a673b1125c82a221fa7 | TypeScript | kellerjmrtn/Chess-AI | /class/square.ts | 2.796875 | 3 | import { Piece } from "./piece.js";
export class Square {
contains: Piece;
currLegalMove: boolean;
rank: number;
file: number;
constructor(rank: number, file: number, contains?: Piece){
this.currLegalMove = false;
this.rank = rank;
this.file = file;
if(typeof conta... |
f6f0cd88942478aa26ff3a3d9adeadc7903b6261 | TypeScript | Ice-cor/z-ui-react | /lib/_util/classes.ts | 3.453125 | 3 | export default function classnames(...names: (string | undefined)[]) { // arguments的解构
return names.filter(value => value).join(' '); // 使用filter去除空值,不留空格
}
// 简化类名的写法
interface Options {
extra: string | undefined;
}
interface ClassToggles {
[K: string]: boolean;
}
function scopedClassMaker(prefix: stri... |
927e59cfe647e62155eaad24fb2fb7bcb948596b | TypeScript | DevWouter/thennext-todo | /web/src/app/models/task-page-navigation.ts | 3.078125 | 3 | /**
* Object that contain settings for the task-page.
* Whenever we leave something to `undefined` we mean it won't be changed.
* Setting values to `null` means set to setting to `undefined` (AKA: remove it).
*/
export class TaskPageNavigation {
/**
* The tasklist where we need to navigate to.
* Set to null... |
c90d2a5e1f1a4a2e19232118e22e0f022445ead0 | TypeScript | losi999/Toolset | /toolset-react/src/auth/login/propTypes.ts | 2.734375 | 3 | export type LoginFormFields = keyof LoginFormValues;
export type LoginFormValues = {
username: string;
password: string;
};
export type LoginFormValidations = {
form?: {
invalidCredentials: boolean,
},
username: {
required: boolean,
} | null,
password: {
required: b... |
c5538ecf5c51dc82172f7be597b777d6bbd9a0f3 | TypeScript | MrBlenny/event-framework | /src/components/HttpRequest/HttpRequest.ts | 2.625 | 3 | import { Component } from '../../Component';
import { IMergeComponentSignatures, IOnHttpRequestEvent } from '../../types/events';
import { HttpLambda } from '../HttpLambda';
import { HttpServer } from '../HttpServer';
import { HttpRequestEvent } from './HttpRequestEvent';
/** Responsible for ingesting HttpRequestEvent... |
fadc028bb50daeb14e7caf9a288e4f9f51549c93 | TypeScript | carltheperson/same-app-different-design-patterns | /mvc-architecture/src/models/pet.ts | 3.140625 | 3 | import { Schema, model, Document } from "mongoose";
import { createUid } from "../utils";
const petSchema = new Schema({
id: String,
name: String,
points: Number,
imageUrl: String,
});
const dbModel = model<Pet & Document>("pet", petSchema);
export class Pet {
public id: string;
public name: string;
pu... |
8bd86e02105fb7dfb394684148b75b6baca825c0 | TypeScript | simtechmedia/sacred-geometry | /scripts/models/StateModel.ts | 3.078125 | 3 | class StateModel
{
public stateChagneSignal : Signal = new Signal();
public static STATE_START : String = "STATE_START";
public static STATE_CREATE : String = "STATE_CREATE";
public static STATE_RESIZING : String = "STATE_RESIZING";
public static MAX_DEPTH : number = 2;
... |
bd70f277c37ae187f5ff471f225c8cca51290ebd | TypeScript | gvr37leo/designerv8 | /src/widgets/pointerwidget.ts | 2.625 | 3 | class PointerWidget extends Widget{
anchorelement: HTMLAnchorElement
newbutton: HTMLButtonElement
selectelement: HTMLSelectElement
// value:string
constructor(public attribute:Attribute, public designer:Designer){
super()
this.rootElement = string2html(`<span><a href="">goto</a> <se... |
b7943fa37789771f61ddbae5b6012b5ca891a208 | TypeScript | stanislavKostenko/decart-accounting-api | /src/modules/projects/dto/project.ts | 2.53125 | 3 | import { IsNotEmpty, IsNumber, IsString, MaxLength, MinLength } from 'class-validator';
import { Address } from '../../../interfaces/project.interface';
import { messages, ValidationType } from '../../../enums/project.enum';
import { AbstractDto } from '../../../classes/dto.abstract';
export class CreateProjectDto ex... |
dc595115796f20408706179bbad4a3f83b728258 | TypeScript | btzzar/personal_finance_web_app | /03-back-end/src/components/expense/dto/AddExpense.ts | 2.6875 | 3 | import Ajv from "ajv";
interface IAddExpense {
accountId:number;
category: string;
value: number;
currency: "eur"|"rsd"|"usd"|"gbp";
}
const ajv = new Ajv();
const IAddExpenseValidator = ajv.compile({
type: "object",
properties: {
accountId:{
type: "integer",
m... |
bfd75e74a1ed336435bcfa203cf121530466a73d | TypeScript | softm-gerardoponce/prueba-mapa | /src/app/roadmap/objects/stage.ts | 2.828125 | 3 | export class Stage extends Phaser.GameObjects.Image{
private _scene;
private image;
public label = "";
private status:number = 0;
constructor(scene, x, y, texture){
super(scene, x, y, texture);
this._scene = scene;
this.setInteractive();
this.on('pointerover'... |
3ece6b9c222287b6c93e961cc3cf5d945bfc82ff | TypeScript | the-owl/gleam-backend | /src/entity/Appointment.ts | 2.734375 | 3 | import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from 'typeorm';
import * as moment from 'moment';
import { Clinic } from './Clinic';
const momentTransformer = {
from (date: Date) {
return moment(date);
},
to (m: moment.Moment) {
return m.toDate();
}
};
@Entity()
export class Appointment ... |
bfdc67d004914653a1d64fbef262f504c414d96e | TypeScript | danbk88/opora-backend-challenge | /src/api/dal/drivers.dal.ts | 2.578125 | 3 | import { DriverStatsInSeason } from "../db/models/driverStatsInSeason";
import { BaseDAL } from "./base/base.dal";
import * as _ from 'lodash';
import { DriverInRace } from "../db/models/driverInRace";
export class DriversDAL extends BaseDAL{
private readonly GET_DRIVERS_SP_NAME: string = "get_drivers_of_seas... |
567acbaf35e87b7a1bbed64a01c715f8dfe798e0 | TypeScript | wesleyh-dev/sidetree | /lib/bitcoin/BitcoinRawDataParser.ts | 3.140625 | 3 | import ErrorCode from './ErrorCode';
import SidetreeError from '../common/SidetreeError';
import { Block } from 'bitcore-lib';
/**
* Parser for raw bitcoin block data
*/
export default class BitcoinRawDataParser {
/**
* The beginning of each block contains the magic bytes indicating main or test net
* follo... |
06bbc197654b8cb193a9c84b3ab62b34c7f2ba4e | TypeScript | VugarAhmadov/island.is | /libs/shared/utils/src/lib/createXRoadAPIPath.ts | 2.671875 | 3 | import { logger } from '@island.is/logging'
export enum XRoadMemberClass {
GovernmentInstitution = 'GOV',
EducationalInstitution = 'EDU',
PrivateCompany = 'COM',
}
/**
* Constructs a valid X-Road API base url from the various parts required
*/
export const createXRoadAPIPath = (
xRoadBasePath: string,
xRo... |
243b51f2bbe877ea4da388e3eda283ef5c73107a | TypeScript | ibrayo1/ScriptMan | /public/js/account.ts | 3.546875 | 4 | // This class is the basic "Account" class.
export class Account {
username: string
playerId: number
score: number
rotation: number
x: number
y: number
angle: number
color: string
// Basic constructor. On account creation you only need two things:
// 1: the userna... |
8683fd2573f1f104fbdb0894960293fc49af03f6 | TypeScript | dankrajnak/dank.io | /src/View/Hooks/useFullScreen.ts | 2.578125 | 3 | import { useEffect, useState } from "react";
import useSafeWindow from "./useSafeWindow";
const useFullScreen = (): [number, number, JSX.Element | null] => {
const [window, flash] = useSafeWindow();
const [width, setWidth] = useState(window ? window.innerWidth : 0);
const [height, setHeight] = useState(window ? ... |
5dc7e68d17577e25aa92873ddabce4030a473e0c | TypeScript | Shotzoom/sportsengine-auth | /source/services/AuthService/request.ts | 3.078125 | 3 | import * as qs from "../../utils/qs";
import { MessageKind } from "./Message";
import { send } from "./send";
interface IRequestConfig {
id: string;
callback: string;
authorize: string;
}
type RequestCallback = (error: Error, response: IResponse) => void;
enum RequestState {
Idle,
Pending,
Complete
}
in... |
097a8dc3b444295ff5aee17e7a33be22fa7858ea | TypeScript | SphericalWorld/spherical-world | /server/components/PlayerData.ts | 2.6875 | 3 | import { Component } from '../../common/ecs/Component';
import { THREAD_MAIN, THREAD_PHYSICS } from '../../src/Thread/threadConstants';
import type { Networkable } from '../../common/Networkable';
type Props = { name: string };
export class PlayerData extends Component<Props> implements Networkable {
static threads... |
530053f01692d7012070939c969a833b02d69c97 | TypeScript | maxxyp/assettTracking | /wwwsrc/tests/unit/common/ui/converters/limitValueConverter.spec.ts | 2.59375 | 3 | /// <reference path="../../../../../typings/app.d.ts" />
import {LimitValueConverter} from "../../../../../app/common/ui/converters/limitValueConverter";
describe("the LimitValueConverter module", () => {
let limitValueConverter: LimitValueConverter;
beforeEach(() => {
limitValueConverter = new Limit... |
50db29c99e50a58c12e6aae94fa1269b3d322986 | TypeScript | vishneuski/vishneuski-home-Angular | /lesson-14-directives-pipes-reactive-forms/src/app/form/form.component.ts | 2.515625 | 3 | import {Component, OnInit} from "@angular/core";
import {
FormControl,
FormGroup,
Validators,
AbstractControl
} from "@angular/forms";
import {Status} from "./model/status";
import {FormService} from "./form.service";
import {of} from "rxjs";
import {map} from "rxjs/operators";
@Component({
selector: "app-fo... |
e24d2dda6965cd0d48dc53bce4886afcab5a167f | TypeScript | MartinYounghoonKim/vue-typescript-boilerplate | /src/constants/env.constants.ts | 2.796875 | 3 | function getEnvConstants () {
const { NODE_ENV } = process.env;
const S3_BASE_URI = process.env.S3_BASE_URI;
let API_BASE_URI = '';
if (NODE_ENV === 'production') {
API_BASE_URI = process.env.PRODUCTION_API_BASE_URI;
} else if (NODE_ENV === 'development') {
API_BASE_URI = process.en... |
473763fcf6022fbb8b23e8a9bec8a8f7df74ba24 | TypeScript | Micro-Incr/micro-upload-express | /server/middlewares/multer.ts | 2.53125 | 3 | import 'dotenv/config';
import multer from 'multer';
import {Request} from 'express';
import path from 'path';
import {MODE} from '../config/baseConfig';
const uploadFolderName = MODE === 'development' ? 'images/development' : 'images/production';
const storage = multer.diskStorage({
destination: function (req, f... |
f858194f46e808d7aa61977fdaec755939542577 | TypeScript | jorbuedo/react-reactive-var | /src/index.test.ts | 2.828125 | 3 | import { makeVar, useReactiveVar } from './'
import { renderHook, act } from '@testing-library/react-hooks'
describe('makeVar', () => {
it('creates a ReactiveVariable that can be read and updated', () => {
const testVar = makeVar('TEST_VARIABLE')
expect(testVar()).toBe('TEST_VARIABLE')
testVar('TEST_UP... |
afd1d7b51c255bbd1daa8544f50a5a9d27c630f2 | TypeScript | Rikon-Li/my-app | /src/store/index.ts | 2.828125 | 3 | import { createStore, Reducer, compose, Action } from "redux";
enum ActionType {
Add = "Add",
}
enum Status {
All = "all",
Todo = "todo",
Finish = "finished",
}
interface ListItem {
id: number;
value: string;
status: Status.Todo | Status.Finish;
}
interface StoreState {
value: string;
dataSource: ... |
ad9f6e645123e75e4cc5341163265b3cb797e398 | TypeScript | daomaker/toll-bridge-subgraph | /src/utils.ts | 2.65625 | 3 | import { BigInt, Address, BigDecimal } from '@graphprotocol/graph-ts'
import { DycoToken } from '../generated/templates/DycoToken/DycoToken'
export let ZERO_INT = BigInt.fromI32(0)
export let ZERO_DEC = BigDecimal.fromString('0')
export let EMPTY_STRING_ARRAY = new Array<string>()
export let ONE_INT = BigInt.fromI32(1... |
5b0e663f1ccc3d20b0d390ad294372bc108fd202 | TypeScript | tomcoolnl2/sudoku | /src/Sudoku.ts | 3.203125 | 3 | import {
RegionSettings,
RowSettings,
ColumnSettings,
SeriesIndex,
GridMatrix,
GridMatrixCoörds,
GridMatrixIndex,
GridMatrixRegionSeries,
GridMatrixSeries,
N,
SudokuInputValue,
GridMatrixRegionSelection
} from './typings'
import { shuffle } from './utils'
export class Sudoku {
/** The number a cell ha... |
fb2764bcc7835e958cc0a806149ce0e8a234751d | TypeScript | Millermiller/subbackend | /src/Scandinaver/Asset/Domain/Term.ts | 2.765625 | 3 | import { User } from '@/Scandinaver/Core/Domain/User'
import { Entity } from '@/Scandinaver/Core/Domain/Contract/Entity'
import TermDTO from '@/Scandinaver/Asset/Domain/DTO/TermDTO'
export class Term extends Entity {
private _id!: number
private _active!: boolean
private _value!: string
private _user: User
... |
54b41b3fc3224d4fb15880f76a3586777c7d97d8 | TypeScript | TreeZhou/paoku | /src/Utils/Tool.ts | 2.734375 | 3 | /**
*
* @author cxw
*
*/
class Tool {
public constructor() {
}
/**
* 根据name关键字创建一个Bitmap对象。name属性请参考resources/resource.json配置文件的内容。
* Create a Bitmap object according to name keyword.As for the property of name please refer to the configuration file of resources/resource.json.
*/
public... |
1c1f0f374b2fa7888121486ade3812b7939f7c7d | TypeScript | aeroheim/midori | /src/pipeline/background-pass.ts | 2.796875 | 3 | import { WebGLRenderer, WebGLRenderTarget } from 'three';
import { Pass } from 'three/examples/jsm/postprocessing/Pass';
import { Background } from '../background';
class BackgroundPass extends Pass {
private _background: Background;
/**
* Constructs a BackgroundPass.
* @param {Background} background
*/
... |
a5c665ab12ce3f8e95c78e8d5b8145b6e4f7a81e | TypeScript | devcord/devmod-core | /src/utils/config/hydrateRoles.ts | 3.109375 | 3 | /*
* Gabe Dunn 2020
* Function to take a list of RoleResolvables and turn it into a list of Roles
*/
import { Guild } from 'discord.js'
import {
ConfigRoleInterface,
LiveConfigRoleInterface
} from '../../types/interfaces/ConfigRolesInterface'
import { NullRoleError } from '../../types/errors/NullRoleError'
... |
1203f3b93437aed379e42b7699735028bdf87b6b | TypeScript | nasum/todo-tools | /packages/todo-cli/src/commands/archive.ts | 2.546875 | 3 | import commander from 'commander'
import { Config } from '../config'
import { ConfigUtil } from '../lib/configUtil'
import { ToDoTextFileOperator } from '../lib/fileOperator'
import { displayTodo } from '../lib/displayTerminal'
export function makeArchiveCommand(config: Config): commander.Command {
const cUtil = new... |
cfeb66e8e36e0cbc9b7fcd1c316688eb53881f0d | TypeScript | pengyuenhao/EatFoodGame | /TypeScriptProject/assets/scripts/project/util/TouchUtil.ts | 2.953125 | 3 | import {Singleton} from "./Singleton";
import { IUtil } from "./Util";
export class TouchUtil extends Singleton implements IUtil{
private areaMap;
//全局区域状态
private globalAreaStatus : AreaStatus;
onConstructor(){
this.areaMap = new Map();
}
/**
* 注册一个触摸区域,只有在区域内的触控才会被识别
* @pa... |
56de4fb087e55253165517897195075083e41341 | TypeScript | wacul/gaxd | /src/source.ts | 2.703125 | 3 | import {expose} from "./expose";
export interface IframeSourceParams {
element?: HTMLIFrameElement;
selector?: string;
trackingName?: string;
destinationOrigin : string;
}
export interface RedirectSourceParams {
origins : string[];
trackingName?: string;
openOptions?: {
windowName: string;
windo... |
6bc3d8ace8769938891491ad7b301f3de94ecc19 | TypeScript | mmcclimon/synergy-js | /src/channels/slack.ts | 2.65625 | 3 | import BaseChannel from './base';
import SynergyEvent from '../event';
import SlackClient from '../slack-client';
import Logger from '../logger';
export default class SlackChannel extends BaseChannel {
private targetedRegex: RegExp;
slack: SlackClient;
constructor(arg) {
super(arg);
this.slack = new Sla... |
e4b57f16ee5acdb6b20b3d9cce68310c248b0954 | TypeScript | ubatsukh/ubatsukh.github.io | /blendlayer/app/BlendLayer.ts | 2.65625 | 3 | // The `///amd-dependency ...` allows us to import AMD modules and provide a name
// for them in the compiled JS. TypeScript relies on some helpers for building
// classes. JS API disabled the option for TypeScript to automatically generate these
// for us. So we import them as we create a class, mainly `__extends` and... |
207fa1d2547a46681c021c5c7ec1c7c7aae0f359 | TypeScript | gatsbyjs/gatsby | /packages/gatsby/src/utils/slices/stitching.ts | 2.9375 | 3 | import * as path from "path"
import * as fs from "fs-extra"
import { generateHtmlPath } from "gatsby-core-utils/page-html"
interface ISliceBoundaryMatch {
index: number
end: number
syntax: "element" | "comment"
id: string
type: "start" | "end"
}
function ensureExpectedType(maybeType: string): "start" | "end... |
e6bd1268cfee7f584fae9a0ee863d96dd350bbfc | TypeScript | tmcw/graphql-code-generator | /packages/plugins/other/visitor-plugin-common/src/mappers.ts | 2.796875 | 3 | import { RawResolversConfig, ParsedResolversConfig } from './base-resolvers-visitor';
export type ParsedMapper = InternalParsedMapper | ExternalParsedMapper;
export interface InternalParsedMapper {
isExternal: false;
type: string;
}
export interface ExternalParsedMapper {
isExternal: true;
type: string;
impo... |
be0247253538a94bdab44c2d75513bd95dcc3083 | TypeScript | smulhall1337/JhipsterCRM | /src/main/webapp/app/shared/model/contact-sub-status.model.ts | 2.6875 | 3 | export interface IContactSubStatus {
id?: number;
name?: string;
subTypeOfName?: string;
subTypeOfId?: number;
}
export class ContactSubStatus implements IContactSubStatus {
constructor(public id?: number, public name?: string, public subTypeOfName?: string, public subTypeOfId?: number) {}
}
|
2e54290d2374ed55beb58b644829fe8183246366 | TypeScript | input-output-hk/cardano-js-sdk | /packages/ogmios/src/Ogmios/TxSubmissionClient.ts | 2.515625 | 3 | import { InteractionContext, TxSubmission, ensureSocketIsOpen, safeJSON } from '@cardano-ogmios/client';
import { Ogmios, TxId } from '@cardano-ogmios/schema';
import { WebSocket } from '@cardano-ogmios/client/dist/IsomorphicWebSocket';
import { baseRequest } from '@cardano-ogmios/client/dist/Request';
import { nanoid ... |
c0d7a049fa1db8150e598f1580ca8bb9568ff5e4 | TypeScript | hota1024/nekochat-server | /src/ma/index.ts | 2.671875 | 3 | import axios from 'axios'
import xml from 'fast-xml-parser'
export interface MaWord {
surface: string
reading: string
pos: string
baseform: string
}
export interface MaResult {
total_count: number
filltered_count: number
word_list: { word: MaWord | MaWord[] }
}
export interface ParseResult {
ResultSe... |
8f6a7ca53ed11b24fc983da5d94c99901c6594c9 | TypeScript | suncoast-devs/nexus | /src/components/models/Assignment.ts | 2.765625 | 3 | import { Attr, Model, BelongsTo, HasMany } from 'spraypaint'
import { AssignmentEvent, Homework, Person, StudentEnrollment } from '.'
import { ApplicationRecord } from './ApplicationRecord'
export type ScoreInfoType = {
generateGif: boolean
title: string
progressReportTitle?: string
style: {
iconColor: str... |
d292774188c34e7ff56ac50fbbf2425677134211 | TypeScript | anchan828/typeorm-helpers | /packages/transformers/src/utils.ts | 3.171875 | 3 | export function isNullOrUndefined<T>(obj: T | null | undefined): obj is null | undefined {
return typeof obj === "undefined" || obj === null;
}
|
630e7b18e5845350e07584e971713ccd379dba4f | TypeScript | wanghengwei/whitebox | /worker/activity.ts | 3.40625 | 3 | import { Observable } from "rxjs";
export interface Metadata {
type: string;
name: string;
}
// action 的返回值。
// 有些动作没有返回,比如sleep
// 业务act Result必须要能反映是否失败,如果失败,必须有失败信息;如果成功,需要有数据?。
export class ActionResult {
// // 动作基本信息
// // metadata: Metadata;
// // 错误信息。null表示没有错误
// error: any;
// constructor(pu... |
6db086d8a30ce643fd93a252c3e6408d51743b5d | TypeScript | TimMaa/MA2018Typescript | /app/main.ts | 4.1875 | 4 | // Interface which implements a format for People
// This can be used just like a string identifier
interface Person {
firstName: string;
lastName: string;
}
class Student {
person: Person;
age: number;
constructor(private _person: Person, private _age: number){
this.person = _person;
... |
387c2d39b5a669f20d889168f42b0c2531c46de7 | TypeScript | avadavat/truth-fiddle | /src/util/generateUrlFromQuery.ts | 3.03125 | 3 | // Given a query string, like 'p and q', returns the url
// 'truthfiddle.com?q=p%20and%20q'.
// Appends the ?q parameter to the base url and then URI encodes the string.
export function generateUrlFromQuery(query: string): string {
const baseURL = window.location.host;
const url = baseURL + '?q=' + query;
return ... |
5b6bf57bc7ed0b853124353fe61fea5f68b0245f | TypeScript | fetzi/php-file-types | /src/extension.ts | 2.734375 | 3 | 'use strict';
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from 'vscode';
import * as path from 'path';
import * as fs from 'fs';
import { Namespace }from './namespace';
let ns = new Namespace();
// this... |
c148a242865cacb5d31a1d0ccc25bbccbd96f9d8 | TypeScript | Karin001/ng-series-study | /src/app/pages/angular/form/reactive-form/reactive-form.component.ts | 2.625 | 3 | import { Component, OnInit } from '@angular/core';
import { FormGroup, FormControl, Validators, FormBuilder, FormArray } from '@angular/forms';
@Component({
templateUrl: './reactive-form.component.html',
styleUrls: ['./reactive-form.component.less']
})
export class ReactiveFormComponent implements OnInit {
... |
c92238bd3b0004e7d8cb652cd1de190404eeef96 | TypeScript | JMCPuddick/MarsRover | /src/controllers/Mission-Controller.spec.ts | 2.6875 | 3 | import { readFileSync } from "fs";
import { MissionController } from ".";
import { Vector2 } from "../core";
import { InputParser } from "../services";
const Dummyinput = readFileSync('./src/tests/DummyInput.txt', 'utf8');
describe('Mission Controller', () => {
// Arrange
let mockMissionSize: Vector2 = new Ve... |
2403566c01311e2232be9ff776d82c62ace2d006 | TypeScript | tkryskiewicz/react-airlines | /src/payment/PaymentCard.ts | 2.703125 | 3 | import * as Moment from "moment";
export class PaymentCard {
constructor(
public cardNumber: string = "",
public cardType: string = "",
public expiryDate?: Moment.Moment,
public securityCode: string = "",
public cardholdersName: string = "",
) {
}
public clone() {
return new PaymentCar... |
bb89311fbd2928fd5212bfaf5bb5b86fb588f726 | TypeScript | liandao0815/online_teaching_fe | /src/app/config/table-config.ts | 2.765625 | 3 | // 表格信息类型
export interface TableInfo<T> {
loading: boolean;
total: number;
data: T[];
pageNum: number;
pageSize: number;
}
// 表格数据请求响应数据类型
export interface ResponseDataOfTable<T> {
code: number;
data: { list: T[]; total: number };
message: string;
}
// 表格数据请求参数类型
export interface RequestParamOfTable {... |
969da5f5950f4743306f1aedc978b8cd23b32388 | TypeScript | retrive123/jhipster-sample-application | /src/main/webapp/app/shared/model/authentic-key.model.ts | 2.59375 | 3 | import { IProductDetails } from 'app/shared/model//product-details.model';
export interface IAuthenticKey {
id?: number;
uniqueKey?: number;
productId?: number;
assignmentStatus?: boolean;
validStatus?: boolean;
productDetails?: IProductDetails;
}
export class AuthenticKey implements IAuthenti... |
026a173d1c525d994182ba68bf255211c278a5b7 | TypeScript | Sammons/morbid | /src/extraction/extraction-interfaces.ts | 2.578125 | 3 |
export interface ExtractedIndex {
indexname: string;
unique: boolean;
struct: 'BTREE' | 'HASH' | 'GIST' | 'GIN';
cols: string[];
}
export interface ExtractedColumn {
columnname: string;
position: number;
nullable: boolean;
primary_key: boolean;
column_default: string;
type: string;
}
export inter... |