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 |
|---|---|---|---|---|---|---|
ec199119c7d14ea54908e9c28986c0d73891f9f7 | TypeScript | Simeon1/noteAPI | /src/server.ts | 2.578125 | 3 | import express, {Request, Response} from 'express';
import { NoteController } from './controller/note.controller';
import { createConnection } from "typeorm";
class Server {
private noteController: NoteController;
private app: express.Application;
constructor(){
this.app = express();
this.... |
57cb84497862b899efaed1264390492ba1a754cd | TypeScript | DOSYCORPS/big-associative | /src/test/internal/Writable.ts | 2.71875 | 3 | export type Writable<T> =
{
-readonly [P in keyof T]: T[P];
}
export function Writable<T>(elem: T): Writable<T>
{
return elem as Writable<T>;
} |
afeaf764be652fe4125b12bf17f060bfc17f4b98 | TypeScript | daveg7lee/instaclone-backend | /src/user/createAccount/createAccount.resolvers.ts | 2.515625 | 3 | import bcrypt from 'bcrypt';
import client from '../../client';
import { Resolvers } from '../../types';
import { checkEmail, checkUsername } from '../user.utils';
const resolvers: Resolvers = {
Mutation: {
createAccount: async (
_,
{ firstName, lastName, username, email, password }
) => {
... |
36be753f70070d1525e45ffd720c7eaa8f75f14e | TypeScript | ScottMGerstl/express-api-seed | /src/framework/logging/logging.service.ts | 2.765625 | 3 | import * as moment from 'moment';
import { Container } from 'typedi';
import { ConfigService } from '../config/config.service';
import { IErrorTrackingConfig } from '../config/config.interface';
export class LoggingService {
public static log(error: Error): void {
let timestamp: moment.Moment = moment();
... |
226f84751126e0fc15ca63f2cd216cfa31d96dc2 | TypeScript | miguelyoobic95/ngIfModalBug | /design-system/stencil/src/components/form/form-color-picker/form-color-picker.spec.ts | 2.515625 | 3 | import { TestWindow } from '@stencil/core/testing';
import { YooFormColorPickerComponent, DEFAULT_COLOR } from './form-color-picker';
describe('YooFormColorPickerComponent', () => {
it('should build', () => {
expect(new YooFormColorPickerComponent()).toBeTruthy();
});
describe('Rendering', () => {... |
a4127b00e6d8612dad0a59f72147ea8f1436f2c4 | TypeScript | JohnCSimon/typescript-express-starter | /src/dto/votes.ts | 2.71875 | 3 | import * as url from 'url';
export type UpVote = {
votedUrl: url.Url;
upvotes: number;
downvotes: number;
}
export class UpVoteDTO {
votedUrl: url.Url;
upvotes: number;
downvotes: number;
constructor(votedUrl: url.Url, upvotes: number, downvotes: number ) {
this.votedUrl = v... |
5a059da6e534abfc94e1cd70b547ec212d1cfa14 | TypeScript | eliriand/DigitalOffice-frontend | /src/app/data/api/company-service/models/department.ts | 2.671875 | 3 | /* tslint:disable */
/* eslint-disable */
/**
* Specific department data.
*/
export interface Department {
/**
* Department description.
*/
description: string;
/**
* Specific director user id this department.
*/
directorUserId?: string;
/**
* Department name.
*/
name: string;
}
|
b4bfad849b47e44e9b41b43e3c66d53122b8d985 | TypeScript | FeatureNinjas/logpack-vscode | /src/LogPackEntry.ts | 2.546875 | 3 | import * as vscode from 'vscode'
import * as fs from 'fs'
export class LogPackEntry extends vscode.TreeItem {
constructor(
public readonly label: string,
public readonly path: fs.PathLike,
public readonly file: fs.Dirent
) {
super(label,
file.isDirectory() ? vscode.TreeItemCollapsibleState.Co... |
44f9728fe1fee04877cb2cabbe45d759a1b61f49 | TypeScript | davcaro/marketplace | /client/src/app/chat/chat.model.ts | 2.546875 | 3 | import { User } from '../users/user.model';
import { Item } from '../items/item.model';
import { ChatMessage } from './chat-message.model';
export class Chat {
public id: number;
public item: Item;
public users: { userId: number; archived: boolean; user: User }[];
public messages: { pagination: { limit: number... |
451680eaee390ce858ab8ba5eed5683f87be0866 | TypeScript | aimhubio/aim | /src/aimcore/web/ui/src/utils/app/updateUrlParam.ts | 2.859375 | 3 | import { PathEnum } from 'config/enums/routesEnum';
import getUrlWithParam from 'utils/getUrlWithParam';
import { setItem } from 'utils/storage';
/**
* function updateURL has 2 major functionalities:
* 1. Keeps URL in sync with the incoming argument "data"
* 2. Stores updated URL in localStorage if App is no... |
198efae5a06ba55c5c56090087582b14e03f724e | TypeScript | jymfony/jymfony | /src/Component/Security/types/Role/RoleHierarchy.d.ts | 2.71875 | 3 | declare namespace Jymfony.Component.Security.Role {
/**
* Represents a role hierarchy.
*/
export class RoleHierarchy extends implementationOf(RoleHierarchyInterface) {
private _hierarchy: Record<string, Set<string>>;
/**
* Constructor.
*/
__construct(hierarch... |
31099f7ee7e9fe6fb186a1f1ef40526c5a344954 | TypeScript | ughoavgfhw/kqstats | /src/twitch/chat.ts | 2.65625 | 3 | import * as websocket from 'websocket';
import * as IRC from './IRC';
const TWITCH_SOCKET_HOST = 'wss://irc-ws.chat.twitch.tv:443/';
interface ChannelData {
joinHandler?: (_?: any) => void;
joinTimeout?: any;
}
export class TwitchChatClient {
private client: websocket.client = new websocket.client();
... |
1d0d77249e7541a37a9e45617a559bbb54174018 | TypeScript | reimagined/resolve-cloud-common | /utils/mergeEnvironmentVariables.ts | 2.890625 | 3 | export function mergeEnvironmentVariables(
original: Record<string, string>,
extending: Record<string, string | null>
): Record<string, string> {
const result = {
...original
}
for (const [key, value] of Object.entries(extending)) {
if (value == null) {
delete result[key]
} else {
res... |
d76f8d6f97e087ef62777e3a33a2bbe24017b6d5 | TypeScript | Chris-Johnston/github-web-launcher | /lib/chrome_launch.ts | 2.8125 | 3 | import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import * as parseGitConfig from 'parse-git-config';
import { By, Capabilities } from 'selenium-webdriver';
import { Driver, ServiceBuilder } from 'selenium-webdriver/chrome';
import { ChromeDriver } from 'webdriver-manager-replacement';
... |
4b279a5d33bc22604134e58590359ca0c0b2abfb | TypeScript | mikamo3/gas-suppli-common | /src/model/SuppliAmount.ts | 2.84375 | 3 | import { Suppli } from "./Suppli";
import { HasId } from "./types";
export type ISuppliAmountValues = Omit<SuppliAmount, "suppli">;
export class SuppliAmount implements HasId {
id: number;
amount: number;
suppliId: number;
private getSuppli: () => Suppli;
constructor(suppliAmountWithoutRelation: ISuppliAmoun... |
8ea808c487fc5ce3808f2717f7892e28ed23f105 | TypeScript | segardd/projetHalterFront | /src/DAO/daoAPI.ts | 2.609375 | 3 | import {GQLAPIManager} from '../datasourceManagement/graphQLAPIManager';
import {dao} from './dao';
import {gql} from 'apollo-angular';
export abstract class daoAPI<T extends Object> implements dao<T>{
public find(id: string,query: any[], type: {new(): T}): T{
var objet = new type();
retur... |
d93651de95a2642fa912b486c9fa9af992270adc | TypeScript | ComMouse/hackathon-nyu | /site/src/scene/StartScene.ts | 2.53125 | 3 | /**
* Created by ComMouse on 2015/11/8.
*/
module scene {
export class StartScene extends BaseScene {
private text:egret.TextField;
private count:number;
public create() {
this.count = 0;
this.createLayout();
this.touchEnabled = true;
this.a... |
dbf1492b19d008ad3941f16fea6bd597720a1e35 | TypeScript | scp504677840/Angular | /StructuralDirectives/src/app/unless.directive.ts | 2.921875 | 3 | import {Directive, Input, TemplateRef, ViewContainerRef} from '@angular/core';
/**
* 除非条件为真,否则将模板内容添加到DOM。
* 如果分配给“appUnless”的表达式计算为真值,那么将模板元素从DOM中移除,将模板元素(重新)插入到DOM中。
*/
@Directive({
selector: '[appUnless]'
})
export class UnlessDirective {
private hasView = true;
/**
* 构造函数
*
* @param {TemplateRe... |
207e6fdcbfd3f33acdba921a0fcbd62a7c74a1b5 | TypeScript | Coffeekraken/coffeekraken | /packages/tools/s-bench/src/shared/interface/SBenchSettingsInterface.ts | 2.609375 | 3 | // @ts-nocheck
import __SInterface from '@coffeekraken/s-interface';
/**
* @name SBenchSettingsInterface
* @namespace shared.interface
* @type Class
* @extends SInterface
* @interface
* @status beta
* @platform js
* @platform ... |
f4f26be80ada9961d3614b16e8eded70a6c577ac | TypeScript | aadilelectronics/mini-task-mgr-devza | /src/app/models/task.model.ts | 2.9375 | 3 | import { Priority } from '../shared/enums';
// ?-------------------------------------------------------------------------
export interface Task {
id: number;
message: string;
due_date?: string;
priority?: Priority;
assigned_to?: number;
assigned_name?: string;
created_on?: string;
}
// ?----------------... |
5013ed8eac588ac12a0bd4af2671e55406b6b739 | TypeScript | abdulsalaam/story-mean-biz | /backend-biz/src/api/stories/story.ts | 2.578125 | 3 | /* @abdul : 07-07-2019 */
import * as Mongoose from "mongoose";
export interface IStory extends Mongoose.Document {
userId: string;
title: string;
description: string;
viewCount:number;
published: boolean;
status: boolean;
createdAt: Date;
updateAt: Date;
}
export const StorySchema = new Mongoose.Sche... |
5307a891a59dee68a737c51ae85f6cfda9b3fc91 | TypeScript | deanmoses/tacocat-gallery-redux | /src/redux/selectors/draft-selectors.ts | 2.984375 | 3 | //
// Redux selector functions
//
// The job of a selector function is to "select" (aka retrieve) some bit of state
// out of the Redux store.
//
// The Redux store should store plain javascript objects so this is a good place
// to turn that plain object into a specific class.
//
import { RootState } from '@src/redux... |
bde4f81ff6fa9aa246b2d9ea7c2d3f5dcfeab421 | TypeScript | zjkipping/angular-environment-specific-service-implementation | /src/app/data-layer/book/book.service.ts | 2.5625 | 3 | import { Observable } from 'rxjs';
export interface Book {
id: string;
name: string;
}
export abstract class BookService {
abstract books: Observable<Book[]>;
abstract async addBook(name: string): Promise<void>;
abstract async updateBook(book: Book): Promise<void>;
abstract async removeBook(id: string)... |
4ad7d543f73cb8a9e417d2f9d3442a9bd9993a2c | TypeScript | amplication/amplication | /packages/amplication-server/src/core/git/dto/inputs/RemoteGitRepositoriesWhereUniqueInput.ts | 2.546875 | 3 | import { Field, InputType } from "@nestjs/graphql";
import { EnumGitProvider } from "../enums/EnumGitProvider";
import { Min, Max, IsInt } from "class-validator";
@InputType()
export class RemoteGitRepositoriesWhereUniqueInput {
@Field(() => String, { nullable: false })
gitOrganizationId!: string;
@Field(() => ... |
6fd069333a8c4801cc1248bf967463243f16c363 | TypeScript | arflit/movies-explorer-api | /src/models/user.ts | 2.84375 | 3 | import mongoose, { Document, Model } from 'mongoose';
import bcrypt from 'bcryptjs';
import { ErrorWithStatusCode } from '../middlewares/error-with-status-code';
export interface IUser extends Document {
name: string;
email: string;
password: string;
}
export interface IUserAPI extends Model<IUser> {
findUser... |
c5078f99772173c78a9963ff51c03e2006220136 | TypeScript | chenz24/globs | /lib/exports.ts | 2.546875 | 3 | import { MutableRefObject } from "react"
import { getCommonBounds, getNodeBounds, getGlobBounds } from "lib/bounds-utils"
import { IData } from "./types"
class Exports {
copyToSvg(
data: IData,
elements: Record<string, MutableRefObject<SVGElement>>
) {
const {
globs,
nodes,
globIds,
... |
b5121fd98e8d58a7bb7d722d015a8fc5683b90e8 | TypeScript | i9or/dungeon.ts | /src/game/PlayerCharacter.ts | 2.953125 | 3 | import { DungeonManager } from "./DungeonManager";
import { Entity } from "./Entity";
import { OBSTACLES, FLOOR_TILE, HERO_TILE } from "../constants";
export class PlayerCharacter implements Entity {
private movementPoints: number;
private cursors?: Phaser.Types.Input.Keyboard.CursorKeys;
private x: number;
pr... |
a701d769da87caef7d7fa1e183657b27b5507f02 | TypeScript | x1n13y84issmd42/aller-hack-oscar | /src/app/lib/render/IFramesExtractor.ts | 2.859375 | 3 | import { VideoDesc, ClipDesc } from "./Types";
export interface IFramesExtractor<FT> {
get(i: number): Promise<FT[]>;
}
export type VideoMap = {
[k: string]: VideoDesc;
};
export type VideoClipMap = {
[k: string]: ClipDesc[];
};
export namespace VideoClipMap {
export function put(vcm: VideoClipMap, vID: string,... |
17757749aab1a0486e70491e699c06ce5e6365e7 | TypeScript | declspec/aemo-technical-test | /src/app/utils/error-collection.ts | 3.421875 | 3 | // Simple utility class for managing errors associated with unique field names.
export class ErrorCollection {
private errors: { field: string, message: string }[] = [];
public add(fieldName: string, ...messages: string[]) {
messages.forEach(m => this.errors.push({ field: fieldName, message: m }));
... |
9720d94297d5291fd26f261f0b584b6ee1aecdb2 | TypeScript | flyover/three.ts | /src/math/Interpolant.ts | 3.21875 | 3 | /**
* Abstract base class of interpolants over parametric samples.
*
* The parameter domain is one dimensional, typically the time or a path
* along a curve defined by the data.
*
* The sample values can have any dimensionality and derived classes may
* apply special interpretations to the data.
*
* This class... |
eae89282f5ae189c15694f03c0600eea64c124fc | TypeScript | edbentley/spectate | /src/core/state.ts | 3.28125 | 3 | import { Component } from "./components";
import { EffectResult, EffectResultState, EffectVal } from "./effects";
import { SpecBase } from "./spec";
import {
isVariable,
Variable,
getInitValue,
VariableValue,
VariableComparitor,
} from "./variables";
export type SpecState<Spec> = {
state: SpecStateVars<Spe... |
2e5ba4c950c4f3530d6db89f949b7f57acce5312 | TypeScript | tremho/humanTest | /src/ExchangeCommon.ts | 3.21875 | 3 | /**
* Object structure returned by a test.
* Tests return a Promise that resolves with an object with the following properties:
*
* | Property | Type | Purpose |
* | :------- | :--- | :------ |
* | passed | boolean | True if the test has passed, false if not; will be undefined for skip or error
* | skipped | b... |
3a0ea5fdf9d4a012bd9280a90e034823c5dd28bd | TypeScript | HamishBrindle/vue-typescript-starter | /src/lib/interfaces/CustomStore.interface.ts | 2.8125 | 3 | import { Store } from 'vuex';
/**
* Interface for the CustomStore's root-state
*/
interface IRootState {
version: string;
}
/**
* Interface for our App's root state
*/
export interface ICustomStore extends Store<IRootState> {
/**
* Indicates if the Vuex state has been loaded from local storage
* and is ... |
d22d9916712f0be1c4f9cca4045208e02ecc04b0 | TypeScript | dan-kez/go-links | /api/src/entity/Link.ts | 2.609375 | 3 | import { IsNotEmpty, IsUrl } from 'class-validator';
import {
BaseEntity,
Column,
CreateDateColumn,
Entity,
PrimaryGeneratedColumn,
} from 'typeorm';
@Entity()
export default class Link extends BaseEntity {
@PrimaryGeneratedColumn()
public id!: number;
@Column({
length: 100,
unique: true,
})... |
004f98c9fac2d76063eeb7362c5d6e03611b2fd7 | TypeScript | patryk-fuhrman/tibia-enemylist | /src/app/enemy-list/models/enemy.ts | 2.65625 | 3 | import { Attributes } from './attributes'
export class Enemy {
public id: number
public type: string
public attributes: Attributes
constructor(
id: number,
type: string,
attributes: Attributes,
) {
this.id = id
this.type = type
this.attributes = Att... |
8f39b47fcce992be456360fb5039f8e0f29735a5 | TypeScript | ricardofiorani/JSSCC | /src/canvas.ts | 2.53125 | 3 | class CanvasRenderer {
canvasID: string;
canvas: HTMLCanvasElement;
ctx: CanvasRenderingContext2D;
loader: AssetLoader;
hitDetector: HitDetector;
palette: Palette;
paletteName: string;
initialized: boolean;
loadEvents: number;
scale: number;
song: Song;
chan: Channel... |
900cf8b501e28b86074d60669d078819a4e2bf00 | TypeScript | cmakler/kgjs | /src/ts/controller/listeners/listener.ts | 2.8125 | 3 | /// <reference path="../../kg.ts" />
module KG {
export interface ListenerDefinition extends UpdateListenerDefinition {
param: string;
expression?: string;
}
export interface IListener extends IUpdateListener {
onChange: (scope: { params: {}, drag: {} }) => void;
}
/*
... |
06b18698bbbe81b28bcc47f6be7c7464e403a9b1 | TypeScript | RyanCavanaugh/derny | /src/types.ts | 2.609375 | 3 | export interface Renderer {
renderFiles(files: File[], opts: Options): string;
parse(content: string): File[] | undefined;
}
export type File = { fileName: string, content: string };
export interface Options {
wrap: boolean;
}
|
148a36c143dc75f2c0e71529839234435d8fa934 | TypeScript | gabrieluy/web-challenge | /api/src/posts/posts.service.ts | 2.6875 | 3 | import { Inject, Injectable, NotFoundException } from '@nestjs/common';
import { CreatePostDto } from './dtos/create-post.dto';
import { Post } from '../entities/post.entity';
import { UpdatePostDto } from './dtos/update-post.dto';
import { REPOSITORIES } from '../constants/constants';
import { Repository } from 'typeo... |
45fdd04eddbb3295a69516950bcbaacfda3d5499 | TypeScript | duvet86/docker-express-mongodb | /src/lib/utils.ts | 3.234375 | 3 | /**
* Normalize a port into a number, string, or false.
*/
export const normalizePort = (val: string) => {
const p = parseInt(val, 10);
if (isNaN(p)) {
// named pipe
return val;
}
if (p >= 0) {
// port number
return p;
}
return false;
};
|
f91fc2af25cf7753246b6f0da39cea2f47bac517 | TypeScript | Firas-Hechmi/recipes-manager | /src/app/services/shopping-list.service.ts | 2.734375 | 3 | import { Subject } from "rxjs";
import { ShoppingList } from "../models/ShoppingList.model";
export class ShoppingListService{
shoppingListSubjet=new Subject<ShoppingList[]>();
private shoppingList: ShoppingList[]=[
new ShoppingList("ras zebi",3,"Pizza")
];
emitShoppi... |
12ab667c6c28783c17322022fab005f4236bdec2 | TypeScript | damonpam/testing-tools | /packages/bdd_initializer/src/utils/Logger.ts | 2.75 | 3 | /* eslint-disable no-console */
import chalk from 'chalk';
import { emoji, get } from 'node-emoji';
class Logger {
public redChalk = chalk.red;
private greenChalk = chalk.green;
private yellowChalk = chalk.yellow;
public exit(message: string, code: number): void {
console.log(this.redChalk(`${emoji.door} ... |
02d429c8d29340bf7250641e98d4acef67547fc8 | TypeScript | isso0424/spoedit-browser | /src/client/api/requester.ts | 2.703125 | 3 | import axios from "axios";
import {IRequester} from "../../usecase/requester";
const baseURL = "https://api.spotify.com/v1";
export class Requester implements IRequester {
async getData(
endpoint: string,
queries?: Record<string, string>,
headers?: Record<string, unknown>
): Promise<Record<string, unk... |
80ad9eb6d096e50509778cfee15eb2628a48ae37 | TypeScript | Doise/Social | /src/services/posts/toggleLike.ts | 3.15625 | 3 | import { IPost, IToggleLikeInput } from "../../interfaces/IPost";
import Post from "../../models/post";
/**
* Toggles like/dislike for a post from a given user.
*
* @param { IToggleLikeInput } toggleLikeInput The user and the post to be liked.
* @returns { Promise<IPost> } The post liked.
*/
export default async ... |
4f46d2ea6b81c9af38df8943fba0a8c3e5bd47ed | TypeScript | Mikkael3/paytrail-lib | /src/rest/entities/payment.ts | 3.015625 | 3 | import {
OrderDetails as OrderDetailsData,
Payment as PaymentData,
RequestData,
} from "../interfaces";
import OrderDetails from "./order-details";
import paymentConsts from "../../consts/payment";
const CURRENCIES = ["EUR"];
const LOCALES = ["fi_FI", "sv_SE", "en_US"];
class Payment implements RequestData<Pay... |
81034fbea622f27fb5c074ede91530d9f496d339 | TypeScript | rajkrishnamurthy/quicktype | /src/JSONSchemaInput.ts | 2.8125 | 3 | "use strict";
import { List, OrderedSet, Map, fromJS, Set } from "immutable";
import * as pluralize from "pluralize";
import { MapType, ClassProperty } from "./Type";
import { panic, assertNever, StringMap, checkStringMap, assert, defined } from "./Support";
import { TypeGraphBuilder, TypeRef } from "./TypeBuilder";
... |
8925f24410832febe20d959f277392d9504fec30 | TypeScript | nghiemnguyen99/IOT | /src/model/users/user.entity.ts | 2.640625 | 3 | import {
Column,
Entity,
JoinColumn,
OneToOne,
PrimaryGeneratedColumn,
} from "typeorm";
@Entity()
class UserBase {
@PrimaryGeneratedColumn("uuid") id: string;
@Column("text", { nullable: true })
public firstname: string;
@Column("text", { nullable: true })
public lastname: string;
@Column("text... |
6d6d8296bc4c4754330e4dd389e47cde6c6193aa | TypeScript | sujeongy/openos | /src/reducer/tree.ts | 2.625 | 3 | import { EnodeGubun } from "../enum";
const initialState: TOrganizationState & TFavoriteState = {
organizationTreeData: [],
organizationExpandedKeys: [],
favoriteTreeData: [],
favoriteExpandedKeys: [],
};
export const SET_ORGANIZATION_TREE_DATA = `tree/SET_ORGANIZATION_TREE_DATA` as const;
export const SET_OR... |
f990bd23ef65f86688999a820699ca75e5b6f1b5 | TypeScript | redaktor/nlp | /src/text/nlp/sentence/negate.ts | 3.1875 | 3 | "use script";
import _ = require("../_");
//negate makes s sentence mean s opposite thing.
function negate(s) {
//these are cheap ways to negate s meaning
// ('none' is ambiguous because it could mean (all or some) )
let logic_negate = {
//some logical ones work
"everyone": "no one",
"everybody": "nob... |
afb51f4d96cd35c0a5a686f0fa1c60b18717a623 | TypeScript | xuntee/vscode-sftp | /src/utils.ts | 2.765625 | 3 | export function flatten(items) {
const accumulater = (result, item) => result.concat(item);
return items.reduce(accumulater, []);
}
|
d4efc1a1c73def83e29069db01779183e4a8f27b | TypeScript | KarynaMatsenko/multidesk-server | /src/types/botEventEmitter.ts | 2.953125 | 3 | type Arguments<ArgumentArray> = ArgumentArray extends unknown[] ? ArgumentArray : never;
type ObjectKeys<Keys> = Keys extends keyof Record<string, unknown> ? Keys : never;
export interface ITypedEventEmitter<BotEvents extends Record<string, unknown>> extends NodeJS.EventEmitter {
on<Key extends ObjectKeys<keyof Bo... |
d28ff2525d8e97f231f6b9c65aa7b49a28f326a4 | TypeScript | venkataramkishore/angular2rxjs | /src/client/app/shared/models/user.model.ts | 2.59375 | 3 |
/*
*Holds the user information
* {"loginId":2,"lastLoginDatetime":null,"userName":"ramkishore@gmail.com",
* "approvalFlows":[],"contracts":[],"roleId":1,"role":"Admin","firstName":"Ram","lastName":"Kishore"}
*/
export class User {
public loginId: number;
public lastLoginDatetime: string;
public userName:... |
540c711df8148a1404bb0ec336b42e795448d5b7 | TypeScript | blendsdkarchived/dep_blend_ts_version | /src/ui/View.ts | 2.703125 | 3 | /// <reference path="../Blend" />
/// <reference path="../layout/Layout" />
/// <reference path="../dom/Dom" />
/// <reference path="../mvc/View" />
/// <reference path="../interface/BoxLayoutInterface" />
/// <reference path="../interface/ViewConfigInterface" />
/// <reference path="../interface/ViewBoundsInterface" /... |
2a2a816dee863fc99a62ae3a9224b2ee8b61e380 | TypeScript | nachoscocco/demo-typescript | /11)tipo-retorno-func.ts | 3.15625 | 3 | (()=>{
const sumar = ( s1: number, s2: number): number =>s1 + s2;
const nombre = ():string => 'Hola Nacho';
const obtenerSalario = ():Promise<string> =>{
return new Promise ((resolve,reject)=>{
resolve('Nacho');
reject('scocco');
});
}
obtenerSalario()
.then( a =... |
e1b0fb5f4b44db35f37487d935db9581338f02ee | TypeScript | isaacdomini/branches_front_end_private | /app/objects/sigmaNode/sigmaNodeHelpers.ts | 2.875 | 3 | import {
decibels,
percentage_as_decimal,
seconds,
timestamp
} from '../interfaces';
import {calculateRecall} from '../../forgettingCurve';
export function calculatePercentOpacity(
{
lastReviewTime,
lastEstimatedStrength,
now
}: {
lastReviewTime: timestamp,
lastEstimatedStrength: decibels,
now: times... |
e3b842ab64d490030dfae0039263de17601fd03d | TypeScript | FF3300-studio/hackustica-pattern-generator-a | /src/ts-old-2/tiles/wave.ts | 3.0625 | 3 | import paper from "paper";
import { interpolate_points } from "../geometry/interpolation";
import { Line, line_from_p_a } from "../geometry/line";
export function curve_squaring_handles(
p0: paper.Point,
p1: paper.Point,
a0: number,
a1: number,
s: number
): Array<paper.Point> {
// We need to calculate the ... |
46ec45c813a5d360fac8355cb46aec7b2f02efe0 | TypeScript | caotsinghua/rnnote | /app/utils/request.ts | 2.546875 | 3 | // import Storage from './storage'
import qs from 'qs'
import Toast from 'react-native-root-toast'
const defaultHeaders = {
'Content-Type': 'application/json; charset=UTF-8'
}
const statusMessageMap = {
400: '请求错误',
401: '未授权,请登录',
403: '拒绝访问',
404: '请求地址出错',
408: '请求超时',
413: '上传文件过大!',
500: '服务器内部错误'... |
df19b6c0843ffe41eb4a5560ddbb5f7d7f1ef110 | TypeScript | geriley/cooper-pantry | /apps/api/src/app/entities/address.entity.ts | 2.53125 | 3 | import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
@Entity()
export class Address {
@PrimaryGeneratedColumn()
public id: number;
@Column()
public address1: string;
@Column({ nullable: true })
public address2: string;
@Column()
public city: string;
@Column()
pu... |
7b4ae54bdf8d0a531bffbc7e7d921bb7cfc80ed3 | TypeScript | ldh2016/test | /testExtends/src/Animal.ts | 3.1875 | 3 | /*
* 动物类;
*/
class Animal {
/**动物名字*/
public name: string;
constructor() {
}
/**动物外形(每个动物外形不一样的 所以要在子类重写)*/
public setSkin(): void {
}
/**动物跑的方法*/
public run(): void {
}
} |
83863826661f521c9489af7ee017db5784643056 | TypeScript | markostj/angular-todos | /src/app/modules/todos/store/todo.reducer.ts | 2.671875 | 3 | import { createReducer, on } from '@ngrx/store';
import {
addTodo,
deleteTodo,
updateCompletion,
updateTodo,
} from './todo.action';
import { Todo } from '../models/todo';
export interface State {
todos: Todo[];
}
export const initialState: State = {
todos: [],
};
export const todosReducer = createReduce... |
46a1eee2940cc5e180db35b7988c1dea58c19ba1 | TypeScript | jeuvreyl/factorio-calc | /src/app/calc/shared/assembling-machine.model.ts | 2.609375 | 3 | interface AssemblingMachineObject {
name: string;
iconUrl: string;
craftingSpeed: number;
ingredientCount: number;
craftingCategories: Array<string>;
recipe: string;
}
export type AssemblingMachine = Readonly<AssemblingMachineObject>;
|
4a27b22b752d4297502717dbdacc752d834e560b | TypeScript | Bhaikko/recipe-angular-app | /src/app/shared/ingredient.model.ts | 2.6875 | 3 | export class Ingredient {
// A shortcut for defining constructor along with its memebers
constructor (public name: string, public amount: number) {}
} |
cd70474cecfaadadec57ab1c329a844c962992b8 | TypeScript | SamA21/TM470-20B-SA | /TM470/ClientApp/src/app/venues/components/create-venue.ts | 2.546875 | 3 | import { Component, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import $ from 'jquery';
import 'bootstrap';
@Component({
selector: 'create-venue',
templateUrl: './create-venue.html'
})
export class CreateVenueComponent {
public venue: VenueViewModel;
public ErrorMessageSho... |
f82059796b31db295c246864520b04e2b8570692 | TypeScript | baahrens/react-md | /packages/transition/src/useTransition.ts | 3 | 3 | import { Dispatch, RefCallback, useEffect, useReducer, useRef } from "react";
import { useEnsuredRef } from "@react-md/utils";
import {
ENTER,
ENTERED,
ENTERING,
EXIT,
EXITED,
EXITING,
TransitionAction,
TransitionStage,
UNMOUNT,
} from "./constants";
import { getNextStage } from "./getNextStage";
imp... |
afd935a598c5afa68b655e843bbab8239987ff96 | TypeScript | project-koku/koku-ui | /src/store/priceList/selectors.ts | 2.6875 | 3 | import type { RootState } from 'store/rootReducer';
import { stateKey } from './reducer';
export const getRateTierTimeRange = (unit: string) => {
const sep = unit.split('-');
if (sep.length === 2) {
return { unit: sep[0], range: sep[1] };
}
return { unit: null, period: null };
};
export const rateFlatter... |
60df72f0e88f84c881e3db7a02f612a9882151e3 | TypeScript | vickenstein/express-association | /src/controller/ApplicationError.ts | 2.65625 | 3 | import * as ExtendableError from 'es6-error'
// @ts-ignore: ExtendableError miss match imported interface
export class ApplicationError extends ExtendableError {
_log: string
message: string
stack: any
['constructor']: typeof ApplicationError
static status: number
constructor(message: any = 'There was an... |
b9fdb7db2750af9c3efca4fb7500c377dbe15bb9 | TypeScript | future4code/Pedro-Sekine | /5-modulo/17-bloco/LabECommerce/src/endpoints/createProduct.ts | 2.828125 | 3 | import { connection } from "../connection";
import { Request, Response } from "express";
import { v4 as generateID } from "uuid";
const errors = {
MISSING_DATA_BODY: {
status: 400,
message: "Body of the request must contain name, price and imageURL.",
},
PRICE_NAN: {
status: 400,
message: "Price ... |
13fb9b52e7d8acc8777b22a0dc4fddba871d5821 | TypeScript | Jebiel/mobile_computing_project | /models/AutocompleteResult.ts | 2.53125 | 3 | export interface AutocompleteResult {
type: string;
geocoding: AutocompleteResultGeocoding;
intentions: any[];
features: Feature[];
}
export interface Feature {
type: string;
geometry: Geometry;
properties: Properties;
distance: number;
}
export interface Geometry {
... |
6c34cc3b5f7cca25ba7bf655c141eda19e4fa856 | TypeScript | Quang-Nhan/JSXPath | /ts/index.spec.ts | 2.90625 | 3 | import { runPath, runPaths } from './index';
const getTestDescription = (result) => {
return result.description ? `${result.path}: ${result.description}` : result.path;
}
describe('Misc Tests' , () => {
let json;
describe('Array of mixed values', () => {
beforeEach(() => {
json =[1 , "2", {o: 3}, [... |
ec3223e6afa34ff1e278ae81426de0edbff6fcf3 | TypeScript | cyjo9603/chalkak | /front/src/reducers/user/updateUserInfo.ts | 2.75 | 3 | export const UPDATE_USER_INFO_REQUEST = 'UPDATE_USER_INFO_REQUEST' as const;
export const UPDATE_USER_INFO_SUCCESS = 'UPDATE_USER_INFO_SUCCESS' as const;
export const UPDATE_USER_INFO_FAILURE = 'UPDATE_USER_INFO_FAILURE' as const;
export interface UpdateInfo {
familyName?: string;
firstName?: string;
birth?: str... |
0c44d8024e7e3b1f092aba91bbc897eb0aff44e9 | TypeScript | cometkim/re-typescript | /ts_inspiration/___to_fix.d.ts | 4.0625 | 4 | interface Dictionary<T> {
[key: string]: T;
}
export let keys: keyof Dictionary<number>; // string | number
export let value: Dictionary<number>["foo"]; // number
//////////////////////////////////////////////////////////
type TypeName<T> = T extends string
? "string"
: T extends number
? "number"
: T exten... |
aa32abe71fdb279f3ab478288ba2a19ef31eeee1 | TypeScript | hachi-eiji/sandbox-todo-app | /mock-api/src/tasks/tasks.service.ts | 2.71875 | 3 | import { Injectable } from '@nestjs/common';
import { Task } from './task';
@Injectable()
export class TasksService {
findAll(): Task[] {
const result = [];
const date = new Date(2020, 0, 1);
for (let i = 0; i < 9; i++) {
result.push({
id: i * 100,
title: `タイトル${i}`,
descrip... |
a87412962e96275c2c2174034e74fd6b065b5bda | TypeScript | nguyer/aws-sdk-js-v3 | /clients/node/client-codedeploy-node/types/_InstanceInfo.ts | 2.921875 | 3 | import { _Tag, _UnmarshalledTag } from "./_Tag";
/**
* <p>Information about an on-premises instance.</p>
*/
export interface _InstanceInfo {
/**
* <p>The name of the on-premises instance.</p>
*/
instanceName?: string;
/**
* <p>The ARN of the IAM session associated with the on-premises instance.</p>
... |
8f5760f0d826548dcf8c9265bdd67ed6f929ddf1 | TypeScript | ZedTT/ReStyle | /ReStyle-Backend/src/routes/tradeRequestRoutes.ts | 2.59375 | 3 | import { Express } from "express";
import { getIncomingTradeRequestsForUser, updateTradeRequestStatus } from '../controllers/tradeControllers';
const tradeRequestRoutes = (app: Express) => {
/**
* Routes for trade request inbox page.
*/
app.route('/api/traderequests')
// To get all the incom... |
65208de5a65712213738c3ac6c384c282b37bcb7 | TypeScript | kristianmandrup/typescript-ast-processor | /packages/node-matcher/src/occurrence.ts | 3.046875 | 3 | import { createCountingASTNodeTraverser } from '@tecla5/qast-traverser'
import { isNonEmptyStr, isEmpty } from './_util'
import { BaseNodeTester } from './base'
export interface INodeOccurrenceTester {
countInTree(query: any): number
countOccurrence(options: any): number
}
export function createNodeOccurrenceTest... |
9c2312afc5fc592945cd99808ce64d233219d9c0 | TypeScript | alvesitalo/e-commerce | /src/app/api.service.ts | 2.53125 | 3 | import { Injectable } from '@angular/core';
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { Observable, throwError } from 'rxjs';
import { catchError } from 'rxjs/operators';
import { Banner } from 'src/models/banner';
import { Category } from 'src/models/category';
import { Course } fro... |
55b5a14bb921b891bf5589acddb861b04510d9b2 | TypeScript | FawwazMayda/LearnWeb | /tsc-start/hello.ts | 3.328125 | 3 | const msg: String = "CountryBalls"
function toCapitalCase(word: String) {
return word[0].toUpperCase() + word.slice(1).toLowerCase()
}
console.log(`Len: ${msg.length}`)
for(let i=0;i<msg.length;i++) {
console.log(`${i} => ${msg[i]}`)
}
console.log(msg.slice(0,10))
console.log(msg.slice(4,6))
console.log(`Upperc... |
f59b2241b2693f318f524991f15ad0f3b400c369 | TypeScript | sonuk-dev/Game-page | /src/app/game/snake/snake.component.ts | 2.625 | 3 | import { Component, OnInit } from '@angular/core';
import { Router } from "@angular/router";
import { ScoreService } from "../score.service";
@Component({
selector: 'app-snake',
templateUrl: './snake.component.html',
styleUrls: ['./snake.component.css', '../start/start.component.scss']
})
export class SnakeCompo... |
9f69f0188b7d543e7d906d5f473f106b6b487ef5 | TypeScript | ericbiewener/utlz | /src/index.ts | 3.046875 | 3 | import execa from 'execa'
import fs from 'fs'
import path from 'path'
import { spawnSync, SpawnSyncOptionsWithStringEncoding } from 'child_process'
export function sleep<T = void>(ms = 0, value?: T): Promise<T> {
return new Promise((resolve) => setTimeout(() => resolve(value), ms))
}
export function isFile(filepath... |
cf094a86f88eb96a1ac01ee15fdf135897b15172 | TypeScript | evan-lin9/mini-snabbdom | /src/mini-snabbdom/patch.ts | 3.1875 | 3 | import createElement from './createElement'
import { vnode, VNode } from './vnode'
import { isDef } from '../utils';
function isEle(pet: Element | VNode): pet is Element {
return (pet as Element).tagName !== undefined;
}
function addVnodes(parentNode: Node, vnodes: VNode[]) {
// console.log(parentNode)
for(let... |
c725776592c74aca7f8a9e8c91bb00efa57449be | TypeScript | SAP/fundamental-ngx | /libs/cdk/src/lib/utils/directives/auto-complete/auto-complete.directive.ts | 2.890625 | 3 | import { Directive, ElementRef, EventEmitter, HostListener, Input, Output } from '@angular/core';
import { BACKSPACE, CONTROL, DELETE, ENTER, ESCAPE, LEFT_ARROW, RIGHT_ARROW } from '@angular/cdk/keycodes';
import { KeyUtil } from '../../functions/key-util';
export interface AutoCompleteEvent {
term: string;
fo... |
9dfabcfb0d67efc673e417bc676e0cb0e7c1374e | TypeScript | gizak/batch | /lib/helpers.ts | 2.515625 | 3 | export function newObjProxy<T>(obj: any, shadow: T): T {
obj = obj || {}
const handler = {
get(target, prop, receiver) {
if (prop in obj && obj[prop] !== undefined) {
return Reflect.get(obj, prop)
}
return Reflect.get(target, prop, receiver)
}
}
return new Proxy<T>(shadow, handler)
} |
3ef7f286a8929bcc759efdcb9c92fb3b949d1040 | TypeScript | edgardleal/backup | /src/presenter/cli/command/show.ts | 2.671875 | 3 | /**
* show.ts
* Copyright (C) 2021
*
* @author Edgard Leal <edgard.leal@gmail.com>
* @module show.ts
*/
import BackupReader from '../../../db/backup-reader';
import DBFactory from '../../../db/db-factory';
import Out from '../Out';
import Since from '../since';
import { formatSize } from '../size';
import Comman... |
e9c2f4c14aa35a3150bb0fe9af14890326946e6a | TypeScript | chrishumboldt/rocket-utility | /src/utility/transform/transform.utility.spec.ts | 2.640625 | 3 | /**
* @author Chris Humboldt
*/
import { RocketTransform } from './transform.utility';
describe('Rocket Transform Utility:', () => {
// Tests.
it('Should transform bytes into a readable string.', () => {
expect(RocketTransform.bytes({ bytes: 2000 })).toEqual('2 KB');
expect(RocketTransform.bytes({ bytes... |
8222a3f2e7c54cc3f6549a45fdfa6bdff143bb41 | TypeScript | six2020/six-react | /02-typescript-2/src/10.ts | 3.3125 | 3 | export {}
interface List{
readonly id: number;
name: string;
age?: number
}
interface Result{
data: List[]
}
function render(result: Result){
result.data.forEach((value)=>{
console.log('value.id ====>>>>', value.id);
console.log('value.name ====>>>>', value.name);
if(val... |
9a7e01acadd7ac5e0c62eadbcdc7f39e6b6004de | TypeScript | robinsound/vscode-go-impl-methods | /src/interfaces-stubs-generator.ts | 2.59375 | 3 | import * as cp from 'child_process';
import { dirname } from 'path';
import * as vscode from 'vscode';
import { Receiver } from './receiver';
export class InterfaceStubsGenerator {
pattern: RegExp;
constructor(private editor: vscode.TextEditor | undefined) {
this.pattern = /^\/\/\s*([a-zA-Z_][a-zA-Z0-9_]*)\s+... |
9b12b0136967fec7ddc77660b9f5af48aed62b5e | TypeScript | carlgrimsborn/StoreApp | /src/reducers/userReducer.ts | 2.859375 | 3 | import {User} from '../Types';
const initUser: User = {
id: 0,
surname: '',
lastname: '',
email: '',
password: '',
items: [],
};
const UserReducer = (user: User = initUser, action: any) => {
if (action.type === 'SET_USER') {
const newUser = action.user;
return {
...user,
...newUser,
... |
b230147ab9c196f767614a47dbb7300431cb5236 | TypeScript | k3nNyJP/atcoder | /abc240/c/Main.ts | 3.234375 | 3 | function searchCombination(items: number[], target: number): boolean {
if (target === 0 || items.indexOf(target) !== -1) {
return true;
} else if (items.every((item) => item > target)) {
return false;
}
const searched = [];
for (let i = 0; i < items.length; i++) {
const item = items[i];
if (... |
7cb23fe1c39dd632f2787ffe9e2268cd7fadd3ad | TypeScript | aicacia/flash-cards | /src/lib/state/decks.ts | 2.640625 | 3 | import { debounce } from "@aicacia/debounce";
import Automerge from "automerge";
import { createStore } from "./store";
export interface IDeck {
name: string;
createdAt: string;
updatedAt: string;
}
export const deckStore = createStore("decks", {
table: new Automerge.Table<IDeck>(),
});
export function creat... |
0cc46c909db27adfc258b7033c73afb66c5a53c0 | TypeScript | gg1122/vscode-tabster | /src/modules/tabster-hot/utils.ts | 2.59375 | 3 | import { HOT_SET_LABEL_1 } from "./consts";
import { THotLabel } from "./models";
export function isHotLabel(key: THotLabel | string): boolean {
for (let i = 0; i < 10; ++i) {
if (key === `${HOT_SET_LABEL_1.slice(0, -1)}${i}`) {
return true;
}
}
return false;
}
export function... |
c0dc83652ad339021a9851acd4cac5bf741c91b1 | TypeScript | RaulALR/weather-app | /src/app/shared/utils.ts | 2.515625 | 3 | import { Injectable } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs';
import { MatIconRegistry } from '@angular/material';
import { DomSanitizer } from '@angular/platform-browser';
@Injectable()
export class Utils {
public days = ['Sunday', 'M... |
ee4de68c99aeb54acef718f28ca25c3af267d120 | TypeScript | pokt-network/pocket-js | /src/rpc/models/application.ts | 3.25 | 3 | import { Hex } from "../.."
import { StakingStatus } from "./staking-status"
/**
*
*
* @class Application
*/
export class Application {
/**
*
* Creates a Application object using a JSON string
* @param {String} json - JSON string.
* @returns {Application} - Application object.
* @memberof Applicati... |
ccadeb954c8cd813a56a6206730471128b407b66 | TypeScript | pranavkaushik9/react-typescript-grpahql-apollo-mobx-express-sample | /web/src/shared/domain/trade.ts | 2.84375 | 3 | import { observable } from "mobx";
type TradeSide = 'BUY' | 'SELL';
type TradeStatus = 'OPEN' | 'NOMINATED';
export class Trade {
@observable id: string;
@observable side: TradeSide;
@observable status: TradeStatus;
@observable price: number;
@observable quantity: number;
@observable counterPa... |
ee8893732ca76723076cb626f1da62968f71cf35 | TypeScript | DefinitelyTyped/DefinitelyTyped | /types/gulp-sort/index.d.ts | 2.734375 | 3 | // Type definitions for gulp-sort 2.0
// Project: https://github.com/pgilad/gulp-sort
// Definitions by: Joe Skeen <https://github.com/joeskeen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
/** Sort files in stream by path or any custom sort comparator */
import g... |
1a4704112ca0dc8e97b4c97af454669b2e788499 | TypeScript | maddalax/Logicful | /frontend/app/src/util/Cache.ts | 2.71875 | 3 | const cache: { [key: string]: any } = {};
export function cacheSet(key: string, value: any) {
cache[key] = value;
}
export function cacheGet(key: string) {
return cache[key];
}
export function cacheClear(key: string) {
delete cache[key];
}
|
0e4254a65808c94bdb6dc298e972721361b3bc42 | TypeScript | xRahman/Kosmud | /Src/Shared/Physics/VehiclePhysics.ts | 2.75 | 3 | /* Part of Kosmud */
// Augment global namespace with number-related functions and constants.
import "../../Shared/Utils/Number";
import { ClassFactory } from "../../Shared/Class/ClassFactory";
import { Attributes } from "../../Shared/Class/Attributes";
import { Angle } from "../../Shared/Utils/Angle";
// import { ... |
217249deeb099031734972adfcafe2885770a45e | TypeScript | aceunlonely/Unknow | /main/base/base.ts | 2.609375 | 3 | class Body{
oid : string;
}
class BasicAttr {
//strength
str_base : number;
str_max : number;
str_bonus: number;
str : number;
//vitality
vit_base : number;
vit_max : number;
vit_bonus:number;
vit : number;
//focus
focus_base : number;
focus_max : number;
fo... |
31c3cb32e2592e465691574ef134a40cf840c598 | TypeScript | crusaider/hass-node-scripting-host | /src/rx-operators/newState.ts | 2.703125 | 3 | import { HassEntityBase } from 'home-assistant-js-websocket';
import { OperatorFunction } from 'rxjs';
import { pluck } from 'rxjs/operators';
import { StateChangedEvent } from './../StateChangedEvent';
/**
* Plucks the new state from a emitted {@link StateChangedEvent}.
*
* @template T Type of the entity that has ... |
6dfe08ff26dfe26e0270b010c027a3f771f9b806 | TypeScript | HXWfromDJTU/leetcode-daily | /141.环形链表.ts | 4.0625 | 4 | /**
* @param {ListNode} head
* @return {boolean}
*/
var hasCycle = function(head) {
// 边界条件
if (!head || !head.next) return false
const startTime = new Date().getTime()
const gap = 500
let hasTail = false
// 使用一个固定时间进行循环,让链表找自己的尾巴
while(new Date().getTime() - startTime < 500) {
if... |
037a3f61f6ca54150d105103f96c1f676b8fcde0 | TypeScript | scarlos723/inventario-angular | /src/app/services/cliente.service.ts | 2.6875 | 3 | import { Injectable } from '@angular/core';
import { Cliente } from '../interfaces/cliente';
@Injectable({
providedIn: 'root'
})
export class ClienteService {
clientes: Cliente[];
constructor() {
let client1 : Cliente = {
id : 1,
cedula : 1061481512,
nombres : 'Camilo Andres',
ape... |