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 |
|---|---|---|---|---|---|---|
38db2c74e5966bb5cbb20abf304c1807612850b5 | TypeScript | mrdulin/react-examples | /ts-example/src/actions/promise-all.ts | 2.546875 | 3 | import { createAction } from 'redux-actions';
import * as t from '../actionTypes';
import * as fetch from 'isomorphic-fetch';
const request = (status: boolean) => {
return new Promise((resolve, reject) => {
setTimeout(() => {
if (status) {
resolve('success');
} else {
reject('failed')... |
192cecef7ab04d6d5f762709d9bc832ee0ef604b | TypeScript | marcello3d/jsondiffpatch-flatten | /src/deltaTypes.ts | 2.953125 | 3 | import {
AddDelta,
AnyDelta,
ArrayDelta,
ArrayMoveDelta,
DeleteDelta,
ObjectDelta,
ReplaceDelta,
UnidiffDelta,
} from './jsondiffpatch-types';
export type AddDeltaType = {
type: 'add';
delta: AddDelta;
newValue: unknown;
};
export type ReplaceDeltaType = {
type: 'replace';
delta: ReplaceDelta... |
1edf6062bf6c5c521977e6ea45b65e93471d7985 | TypeScript | blakeembrey/back-row | /app/stores/session.ts | 2.75 | 3 | import { Store } from 'marty'
import extend = require('xtend')
import SessionConstants from '../constants/session'
export interface SessionState {
connection?: any
sessions?: {
[sessionId: string]: Session
}
}
export interface Session {
id: string
state: SessionStateState
options: SessionStateOptions
... |
5a7f321dac3a357981ec8806a24662087be0aecc | TypeScript | Rodrigobanselmo/video-plataform | /src/types.ts | 3.4375 | 3 | /* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/ban-types */
/* eslint-disable no-shadow */
/* eslint-disable @typescript-eslint/no-unused-vars */
export interface IInterface {
author: {
name: string | number;
avatar: string[];
};
content: object;
isAnswered... |
24307bd88340acddb002c06a518b0b44f57fca9c | TypeScript | Jacks128/tytusx | /20211SVAC/G35/codigof/src/ejecucion/Expresion/Simbolo.ts | 3.359375 | 3 | import { TIPO_DATO } from './Tipo';
export class Simbolo {
identificador: string;
tipo: TIPO_DATO;
valor: any;
constructor({identificador_,tipo_,valor_}:{identificador_:string, tipo_: any, valor_: any}) {
this.identificador=identificador_;
this.tipo=tipo_;
this.valor=valor_;
... |
62baf99010b8ab0e9e8b815db3dd9e1f35384f29 | TypeScript | tyblue/blog | /code/accumulate/design-pattern/template.ts | 3.6875 | 4 | abstract class AbstractClass {
public TemplateMethod() {
this.SpecificMethod();
this.abstractMethod1();
this.abstractMethod2();
}
public SpecificMethod() {
console.log("抽象类中的具体方法被调用...");
}
public abstract abstractMethod1(); //抽象方法1
public abstract abstractMetho... |
6be9531c7a2dfc3b4f448879ebaf64b9e36fbd88 | TypeScript | juesvema/SQLlite-Android | /Frontend/src/app/student/services/dialog/dialog.service.ts | 2.53125 | 3 | import { WeekInformationComponent } from './../../week-information/week-information.component';
import { Injectable } from '@angular/core';
import { MdDialog, MdDialogConfig } from '@angular/material';
@Injectable()
export class DialogService {
/**
*
* @param dialog MdDialog to open components in dialog
*... |
54b1728461629c929dbd3a12e2eceb3ee73b327d | TypeScript | vermicida/kc-angular-altran | /src/app/datos-contacto.pipe.ts | 3.140625 | 3 | import { Pipe, PipeTransform } from '@angular/core';
import { Contacto } from './contacto';
// Los Pipes son clases decoradas con el decorador '@Pipe'. Es necesario
// indicar el metadato 'name'; en él establecemos el nombre del Pipe, que
// será el que usemos en un template para aplicarlo.
// También, un Pipe debe ... |
753d057bbbaa5931f7458180b2750bb204a2aa22 | TypeScript | qetr1ck-op/nodejs-patterns | /src/6.design-patterns/1.factory/2.game/characters-mixins.ts | 3.546875 | 4 | import { pipe } from 'rambda'
interface ICharacter {
health: number
name: string
}
//🍿
type Constructor<T = {}> = new (...args: any[]) => T
class Character implements ICharacter {
health = 100
constructor(public name: string) {}
}
//🍿
const Mover = <TBase extends Constructor<ICharacter>>(Base: TBase) =>
c... |
bee0eabfc7b16a799ba3aeb84c3cc2a63096a4cd | TypeScript | SayMeowArtem/Diplomafrontend | /src/store/ducks/subscribes/actionCreators.ts | 2.546875 | 3 | import { AddSubscribeActionInterface, DeleteSubscribesActionInterface, FetchAddSubscribeActionInterface, FetchDeleteSubscribesActionInterface, FetchSetSubscribesActionInterface, SetSubscribesActionInterface, SubscribeActionType } from "./contracts/actionTypes";
export const AddSubscribe = (payload: any): AddSubscribe... |
7132429f716d2ac18ef69572395467693d5f94c7 | TypeScript | nickjmaxwell/konekuto-app | /src/app/models/user.ts | 2.640625 | 3 | import {TeamMember} from './team-member';
export class User extends TeamMember{
constructor(
public id: number,
public username: string,
public email: string,
public teams?: Array<number>
) {
super(id, username);
}
}
|
0f462f4ed542be319f186843e48aa9ade8993b13 | TypeScript | gao525280067/gf-ui | /src/utils/PublishSubscribe/index.ts | 3.4375 | 3 | export type PublishSubscribeCallback = (...payload: any[]) => void;
const subscribe = (
type: string,
cb: PublishSubscribeCallback,
SubscriberMap: { [key: string]: any[] }
) => {
if (SubscriberMap[type]) {
if (!SubscriberMap[type].includes(cb)) {
SubscriberMap[type].push(cb);
}
} else {
Sub... |
308976f64cb62065448cd69339e2b362ff3b4064 | TypeScript | ignacioPastor/playing-ngrx | /src/app/task/state/reducers/task.reducer.ts | 2.953125 | 3 | import * as taskActions from './../actions/task.actions';
/**
* Here we handle the actions result of the effects.
* Right now just success cases, but it could handle actions in case of errors.
*/
export function taskReducer(state = [], action: taskActions.Action) {
switch (action.type) {
case taskActions.LOAD... |
ac87e8a3c4aec4482144539ba398c963e562bd94 | TypeScript | diegoherrera/Ejemplo6 | /test.ts | 3.1875 | 3 |
let arregloa: number[] = [1, 2, 3, 4, 5, 6];
let arreglob: Array<number> = [12, 33, 43, 54, 62];
arregloa.forEach(element => {
console.log(element);
});
for (let i = 0; i < arreglob.length; i++) {
console.log(arreglob[i]);
} |
1ed6322b562aed3df32338f80c7b65d6783bca04 | TypeScript | devzolo/node-sql-database | /src/driver/oracle/OracleResultSetRowList.ts | 2.703125 | 3 | import { SQLResultSetRowList } from '../../api';
//import { print } from "util";
import { OracleResultSetRow } from './OracleResultSetRow';
export class OracleResultSetRowList extends SQLResultSetRowList {
private pointer = 0;
private columns: any;
private rows: any;
constructor(rs: any) {
super();
th... |
989595caf5d97517bea6904020abeadba871abfb | TypeScript | mass10/typescript.note | /code/generator/src/Main.ts | 3.375 | 3 |
namespace Main {
/**
* ジェネレーターを返します。
*/
function* enumUsers(): IterableIterator<string> {
const users = [
"Jimi Hendrix",
"Freddie Mercury",
"Aretha Franklin",
"Billie Holiday",
"Louis Armstrong",
"Sam & Dave",
"Donny Hathaway",
];
for (const u of users) {
yield u;... |
2081c69b452a30f68879c026d6ff22b1218c8651 | TypeScript | YOU-i-Labs/react-admin | /packages/ra-core/src/form/formMiddleware.spec.ts | 2.546875 | 3 | import { LOCATION_CHANGE } from 'react-router-redux';
import { destroy } from 'redux-form';
import formMiddleware from './formMiddleware';
import { REDUX_FORM_NAME } from './constants';
import { resetForm } from '../actions/formActions';
describe('form middleware', () => {
it('does not prevent actions other than ... |
67fcdaf6b8b589661358146e1babeb741429f127 | TypeScript | ganzf/notrino | /src/ui/modules/parser/Variables.ts | 3.296875 | 3 | export class Reference {
}
export class Variable {
// Line of the definition
line: number = -1;
// name of the variable
name: string = '';
// Label to display if nothing else is available
label: string | null = null;
// Variable type
type: string | null = null;
// Variable type params (pointer t... |
9f744b799a88bbed604c7b21cc1379e95822c316 | TypeScript | J-bar123/GhostWriter | /frontend/src/app/_services/user.service.ts | 2.609375 | 3 |
import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {User} from '../_models/user';
import {Observable} from "rxjs";
interface GoalSet{
minutegoal: number;
caloriegoal: number;
}
@Injectable({ providedIn: 'root' })
export class UserService {
constructor(priva... |
60ab1455d77cdc9d2736b452fda68e0591b9c03a | TypeScript | TheCodingWaffle/super-spork | /src/user/user.service.ts | 2.65625 | 3 | import { Injectable } from '@nestjs/common';
import { JwtService } from '@nestjs/jwt';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { User } from './user.entity';
@Injectable()
export class UserService {
constructor(
@InjectRepository(User) private readonly us... |
fb9579f0118706daac1b32c1ee482c14381f5dc5 | TypeScript | nilshohmann/restype | /src/authentication/RestAuthentication.ts | 2.640625 | 3 | import { AuthConfig } from '../core/HttpConfig';
import { HttpReqest } from '../core/HttpRequest';
import { logger } from '../core/Logging';
import { Authenticator } from './Authenticator';
import { BasicAuthenticator } from './BasicAuthenticator';
import { ChallengeAuthentication } from './ChallengeAuthentication';
i... |
bbc55b4c743426cd0560c223569db631cecc54b0 | TypeScript | sarahatwork/swagger-mock-validator | /lib/swagger-mock-validator/transform-string-to-object.ts | 2.515625 | 3 | import * as yaml from 'js-yaml';
import {SwaggerMockValidatorErrorImpl} from './swagger-mock-validator-error-impl';
const parseJson = <T>(pathOrUrl: string, rawString: string): T => {
try {
return JSON.parse(rawString);
} catch (error) {
throw new SwaggerMockValidatorErrorImpl(
'SWA... |
67c8a6a1b10574cb247bd4f29998398ee588a653 | TypeScript | beau6183/ts-open-graph-scraper | /src/media.ts | 2.515625 | 3 | import _ from 'lodash'
import fields from './fields'
import {
OGData,
OGDataRaw,
OGImage,
OGMedia,
OGMusicSong,
OGOptions,
OGVideo,
OGTwitterPlayer,
OGTwitterImage,
} from './types'
/*
* media setup
* @param string ogObject - return open open graph info
* @param string options - options the user h... |
aed8129305d7c6e972d02101eacbdfa198db6473 | TypeScript | sergio44444/prfinal | /src/main/webapp/app/entities/empresa/list/cliente.filtro.pipe.ts | 2.5625 | 3 | import { PipeTransform, Pipe } from '@angular/core';
import { Empresa } from '../empresa.model';
@Pipe({
name: 'empresafiltro',
})
export class EmpresaFiltroPipe implements PipeTransform {
transform(empresas: Empresa[], searchTerm: string, searchTerm2: string): Empresa[] {
if (searchTerm !== '') {
empres... |
15303a8022ff1bfff081c794f416f3512bc4a745 | TypeScript | reginafaller/EIA2 | /Endabgabe_copy/nemo.ts | 2.78125 | 3 | namespace fisch {
export class Nemo {
x: number;
y: number;
dx: number;
dy: number;
a: number;
b: number;
constructor(){
this.x = 0;
this.y = Math.floor(Math.random() * crc.canvas.height);
this.dx = 2;
this.dy =... |
fc9ad2de67eb09c1bb4c6a5e3cbc139c19a2fc58 | TypeScript | benbotto/formn | /src/modelgenerator/model/model-column.spec.ts | 3.25 | 3 | import { ModelColumn, DefaultColumnFormatter } from '../';
describe('ModelColumn()', () => {
let col: ModelColumn;
beforeEach(() => col = new ModelColumn(new DefaultColumnFormatter()));
describe('.getName()', () => {
it('returns undefined by default.', () => {
expect(col.getName()).not.toBeDefined();... |
ceb10ba918770264f2599f877c10793f3489e4cc | TypeScript | timyc/wjclient | /project/src/game/play/ai/action/AIUnitPlayAction.ts | 2.53125 | 3 | class AIUnitPlayAction extends AIUnitAction {
private m_Anim: EntityClipType
public constructor(anim: EntityClipType) {
super()
this.m_Anim = anim
}
OnEnter(): void {
this.GetUnit().mEntity.UpdateAction(this.m_Anim, false)
}
public OnUpdate(delta: number): AIUnitReturn {
return AIUnitReturn.NEXT
}
} |
2aa101257fd7c53062ae1fef444b5ecd7746cdb7 | TypeScript | Technopark-Altair/test1-KekW228321 | /src/app/app.component.ts | 2.765625 | 3 | import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css' ]
})
export class AppComponent {
title = 'homework2';
firstOperands: number;
secondOperands: number;
operator1: string;
operator2: string;
result: boolean;
Error: string... |
5a65d9cc002b9ae310a1bea157d599a1ee3c60ff | TypeScript | Wyden971/xrpawn | /src/core/models/BlockData.ts | 2.53125 | 3 | import {ec as EC} from "elliptic";
import SHA256 from "crypto-js/sha256";
import {v4 as uuid4} from 'uuid'
import {AvailableBlockTransactionType} from "./Block";
import {Transaction} from "./Transaction";
import {Security} from "./Security";
import {Loan} from "./Loan";
import {User} from "./User";
import {Balances, Bl... |
718c64c9ddf3990e4ade5df23583e4754239cafb | TypeScript | JuliaGizmos/WebIO.jl | /packages/webio/src/DomNode.ts | 2.96875 | 3 | import createLogger from "debug";
const debug = createLogger("WebIO:DomNode");
import WebIONode, {
WebIODomElement,
WebIONodeSchema,
WebIONodeContext,
} from "./Node";
import {createWebIOEventListener} from "./events";
import createNode from "./createNode";
export const DOM_NODE_TYPE = "DOM";
const enum DomNam... |
b38b000f45c7fb39a83d489cea907bf9f4ccaba7 | TypeScript | ryym/wracket | /frontend/lib/bookmark-lister.ts | 2.8125 | 3 | import {iter, Iter} from './iter';
import {
Bookmark,
BookmarkById,
BookmarkStatus,
SearchCondition,
getStatusesFromFilter,
} from './models';
// TODO: Use iterator more efficiently.
export const selectShownIds = (
byId: BookmarkById,
cdtn: SearchCondition,
count: number | null = null,
): string[] => {... |
f373e57b814f8596fa4967e5aac2dab27b5a66dc | TypeScript | AnkitM19/UserDetails-mysql-authentication-typeorm | /src/Service/user.service.ts | 2.5625 | 3 | /* eslint-disable @typescript-eslint/no-unused-vars */
import {
Injectable,
NotFoundException,
UnauthorizedException,
} from '@nestjs/common';
import { Users } from '../sql model/User.Entity';
import { InjectRepository } from '@nestjs/typeorm';
import { UserRepository } from '../sql model/user.repository';
import... |
6fa0cf4e152e12135cf60d672c00ddbce24124eb | TypeScript | 4-sight/sudoku | /src/Game/utils/solver/index.ts | 2.8125 | 3 | import { Givens } from "../../types"
import Grid, { GridState } from "./Classes/Grid"
import GridAreaGroup from "./Classes/GridAreaGroup"
import { bifurcate } from "./strategies/"
export type GridAreaGroups = [GridAreaGroup, GridAreaGroup, GridAreaGroup]
export default (givens: Givens): [GridState[], boolean] => {
... |
68281c3e7758db95196efe3a63732aed8156264c | TypeScript | lpaladin/json-inline-doc | /src/jsonCommentWriterBase.ts | 3.078125 | 3 | import * as wrap from 'word-wrap';
import {
IJSONComment, IJSONCommentConfiguration, IReplacer
} from './types';
/**
* Base writer to add comments to stringified JSON.
* JSON stringify implementation is based on the following code:
* https://github.com/douglascrockford/JSON-js/blob/2a76286e00cdc1e98fbc9e9ec658... |
e9316d92aa5c8946bb76942c5de356ec0091d498 | TypeScript | PyroTechniac/Constellations | /src/lib/structures/base/Piece.ts | 3.03125 | 3 | import type { Store } from './Store';
import type { ConstellationClient } from '../../Client';
import { mergeDefault } from '../../util/Utils';
import { join } from 'path';
/**
* The common class for all pieces.
*/
export class Piece {
/**
* The name of this Piece
*/
public name: string;
/**
* The file lo... |
30eb4958956676ef8cdaf4fa9ed1d14cb67c4030 | TypeScript | PhilVargas/tetris | /src/typings/index.ts | 2.734375 | 3 | export enum CellType {
E = "E",
I = "I",
O = "O",
Z = "Z",
S = "S",
T = "T",
J = "J",
L = "L"
}
export type PieceType = CellType.I | CellType.O | CellType.Z | CellType.S | CellType.T | CellType.J | CellType.L
export type PieceTypes = ReadonlyArray<PieceType>
export interface IPieceOffset {
readonly ... |
a1676dbaab9dc16b0cfe35f216ab84b1a35b1a5a | TypeScript | knuhol/dkdb-fe | /src/hooks/useBooks.ts | 2.65625 | 3 | import mapKeys from 'lodash/mapKeys';
import useFetch from './useFetch';
import { GetBooksParams, getBooksUrl } from '../utils/fetchUtils';
import { BooksParams } from '../utils/urlUtils';
export type Tag = {
slug: string;
name: string;
color: 'red' | 'orange' | 'blue' | 'green' | 'yellow' | 'purple';
};
expor... |
57ce01c3a02ec86475637e53799fd8d00178de79 | TypeScript | svrakata/kegg-parser | /src/brite/human_diseases/get_human_diseases.ts | 2.734375 | 3 | import convertJSONToCSV from "../../utilities/convert_json_to_csv"
import getBriteCategoryList from "../get_brite_list"
import briteHumanDiseasesParser, { IBriteHumanDiseasesEntry } from "./brite_human_diseases_parser"
type TOutputType = "csv" | "json"
interface IGetHumanDiseasesOptions {
outputType: TOutputType
... |
5ff8e59bdb5f0d7ef5132669357a59d64e83cbc1 | TypeScript | ciruz/Video-Hub-App | /node/main-extract.ts | 2.796875 | 3 | /**
* This file contains all the logic for extracting:
* first thumbnail,
* full filmstrip,
* the preview clip
* the clip's first thumbnail
*
* All functions are PURE
*
* Huge thank you to cal2195 for the code contribution
* He implemented the efficient filmstrip and clip extraction!
*/
// =================... |
d488c0b2d342e8b0c1c0978dce9e40395c2bf48a | TypeScript | MiK546/csv-arrays | /test/generateCsv.test.ts | 2.5625 | 3 | import {expect} from "chai";
import {generateCsv} from "../src/generateCsv";
import {HeaderStyle} from "../src/types";
describe("generateCsv", () => {
it("should generate csv synchronously", () => {
const csvResult = generateCsv([[1, 2], ["a", "b"]]);
expect(csvResult).to.equal("1,a\n2,b\n");
... |
004d65fc197b85104340a93446f12c39679a4031 | TypeScript | johanneslumpe/styled-props | /src/utils/text/overflowWrap.ts | 2.765625 | 3 | import { OverflowWrapPropertyCombined } from '@johanneslumpe/css-types';
import { style } from '../../style';
import { StyleOptions } from '../../types';
export interface OverflowWrapProps<T> {
/**
* The `**overflow-wrap**` CSS property applies to inline elements, setting whether the browser should insert line b... |
e0d10828d95414dd7bd2a45156814594169b8e01 | TypeScript | cuo9958/wekf-server | /src/model/user.ts | 2.515625 | 3 | import { Model, DataTypes } from "sequelize";
import db from "../db/mysql";
class User extends Model {}
User.init(
{
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
nickname: {
type: DataTypes.STRING(100),
... |
1634a2b1cdcf9ac8baad05ae6e8444f4bbf390c1 | TypeScript | yuhangwang/MirrorAI | /mirror-ai/app/js/MirrorAI.ts | 2.734375 | 3 | declare function require(name:string);
export function
MirrorAI()
{ let spawn = require('child_process').spawn;
let py = spawn('python', ['app/py/proxyMirrorAI.py']);
let data = [1,2,3,4,5,6,7,8,9];
let dataString = '';
let d = py.stdout.on('data', function(d) {
dataString += d.toString();... |
f3f16e6e2d3d157b95dc3fa5ba472a7067483ee9 | TypeScript | edin/VueStarterKit | /client/src/kit/Services/AuthService.ts | 2.765625 | 3 | import { ILogger, Logger } from "../Logger/Logger";
import { RestClient } from "../Rest/RestClient";
import { IAuthService, IAuthUser, ILoginResult, IResetPasswordResult, IUpdatePasswordResult, IVerifyAccountResult } from "./AuthServiceTypes";
export class AuthService implements IAuthService
{
static AuthInfoKey: ... |
139bb1ab7ed0a9a18fabf92ad6e6513d82db7fca | TypeScript | semanticlink/semantic-network | /src/representation/get.ts | 2.75 | 3 | import { LinkedRepresentation } from 'semantic-link';
import { NamedRepresentationFactory } from './namedRepresentationFactory';
import { TrackedRepresentationFactory } from './trackedRepresentationFactory';
import { ResourceQueryOptions } from '../interfaces/resourceQueryOptions';
import { ResourceLinkOptions } from '... |
8cd1f2068a1182de503e2d72ae4d365c1ac0f6ff | TypeScript | PlayGuitar-CoderQ-Sub/design-patterns-test | /OOP/index.ts | 3.375 | 3 | interface CatProps {
name: string;
sex: number;
age: number;
weight: number;
color: string;
}
class Cat implements CatProps {
name = 'kaka';
sex = 0;
age = 0;
weight = 0;
color = 'red';
}
let res = new Cat();
console.log(res.age); |
ca35ed7258a5257dea5bebd598d6e42bce8262b6 | TypeScript | gksander/CIE-ColorConverter | /src/Luv.ts | 2.65625 | 3 | import { NumericTriple } from "./Matrix";
import { DEFAULT_OPTIONS, kE, kK } from "./consts";
import { ConverterOptions } from "./types";
import { getRefWhiteMtx } from "./getRefWhiteMtx";
import { XYZToLab, XYZToRGB, XYZToxyY } from "./XYZ";
import { LabToLCHab } from "./Lab";
export const LuvToLCHuv = (Luv: NumericT... |
ff735e90779b0c18dd57b613955f32a3614414d3 | TypeScript | luminuszz/nlw-3-happy-backend | /src/modules/users/infra/typeorm/entities/user.entity.ts | 2.5625 | 3 | import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
} from 'typeorm'
@Entity('users')
export class User {
@PrimaryGeneratedColumn({ type: 'uuid' })
id: string
@Column({ type: 'varchar', nullable: false })
name: string
@Column({ type: 'varchar', nullable: false })
email: string
@... |
979943246f47e3eaf4906018d1522b8c3d6e3bd7 | TypeScript | klasa-forks/core | /src/lib/caching/structures/messages/MessageAttachment.ts | 2.703125 | 3 | import type { APIMessageAttachmentData } from '@klasa/dapi-types';
/* eslint-disable camelcase */
/**
* @see https://discord.com/developers/docs/resources/channel#attachment-object
*/
export class MessageAttachment implements APIMessageAttachmentData {
/**
* Attachment id.
* @since 0.0.1
*/
public readonly... |
3c7a24251949bb37d55f37e573c7b356f21716a3 | TypeScript | HaskellJacobCurry/haskell-ts | /dist/DataStructure/Clojure/LazySequence.d.ts | 2.765625 | 3 | import { Kind1, URI1 } from '../../Common/HKT';
import { Populatable1 } from '../../Typeclass/Data/Populatable';
import { Bool } from '../../Instance/Data/Bool';
import { Int } from '../../Instance/Data/Int';
import { Unit } from '../Data/Unit';
interface LazySequence<T> {
value: T;
done: Bool;
next: () => ... |
1688548750766be5d2877380ed887d449e2c6e62 | TypeScript | Erudition/elm-native | /src/dom/basicdom/ViewNode.ts | 3.140625 | 3 |
import DocumentNode from './DocumentNode';
import { logger as log } from './Logger';
import TextNode from './TextNode';
const dashRegExp = /-/g
export function normalizeElementName(elementName: string) {
return `${elementName
.replace(dashRegExp, '')
.toLowerCase()}`
}
export function* elementIte... |
c71a274881e4642361d9d0381a99d0f3fd6f3e3d | TypeScript | VanemalP/recipe-nutrition-modelling-api | /src/data/entities/measure.entity.ts | 2.703125 | 3 | import { Entity, Column, OneToMany, PrimaryGeneratedColumn, ManyToOne } from 'typeorm';
import { Product } from './product.entity';
/**
* Measure entity
*/
@Entity('measures')
export class Measure {
/**
* Id of the measure
*/
@PrimaryGeneratedColumn('uuid')
id: string;
/**
* Product that have this m... |
75040f2e3cd3fd58f1b67a8c717e6608fc0446e4 | TypeScript | Azein/frontend_sim | /src/domains/tasks/logic/distribute-keys.ts | 2.53125 | 3 | import {
reduce, drop, head, values,
} from 'ramda'
import { generateTask } from './generate-task'
type KeysAndTasks = {
usedKeys: string[]
unusedKeys: string[]
currentTasks: FormedTaskPool
}
type DistributeKeys = (
selectedTasks: TaskPool,
keysPool: string[],
) => KeysAndTasks
export const distributeKe... |
f23393964988263c4d598d0f3edf70c831943913 | TypeScript | vfcosta/angular-theme | /src/app/shared/services/events-hub.service.spec.ts | 2.703125 | 3 | import { EventsHubService } from './events-hub.service';
describe("EventsHubService", () => {
let eventsHubService: EventsHubService;
it("emits events for the known events", (done) => {
const eventListener = () => {
};
// creates the events hub service which known the event "Event1"
... |
3c931beea31906f5dd60632ffa87473460208c96 | TypeScript | MikeWarren2014/OpenSourceRoadsSite | /src/app/services/fake-sender.service.ts | 2.734375 | 3 | import { SenderService } from "./sender.service";
import { Injectable } from "@angular/core";
import { Observable, of } from "rxjs";
import { delay } from 'rxjs/operators';
import { EmailMessage } from "../models/email-message/email-message";
@Injectable()
export class FakeSenderService implements SenderService{
... |
acdcbb92d8c8d1c23ca214988c17a0273e48281c | TypeScript | ngcarmelo/ProjectsPortfolio | /project-portfolio/src/app/components/login/login.component.ts | 2.609375 | 3 | import { Component, OnInit } from '@angular/core';
//to be able to access the parameters that we receive from this url and redirects:
import { Router, ActivatedRoute, Params } from '@angular/router';
//Import of the user model: (Import of the user class)
import { User } from '../../models/user';
//import the service,... |
bb5627b17c0b845aced8885ae551b78f41dae693 | TypeScript | whh8162880/Melon3D_ES5 | /src/game/unit/actions/FollowAction.ts | 2.5625 | 3 | module rf{
export class FollowAction extends ActorAction{
static posDic:{[key:number]:number} = {};
static keyDic:{[key:number]:number} = {}
constructor(){
super()
this.stateID = StateDefine.FOLLOW
}
target:ActionActor;
distance:number = 300;
min_dis:number = 200
max_dis:number = 1200;
ch... |
ec1493fbecafb8f04106d898f0316287da661043 | TypeScript | gerrysaporito/1337c0d3 | /Leet 0102 - Binary Tree Level Order Traversal.ts | 4.03125 | 4 | /**
* Definition for a binary tree node.
* class TreeNode {
* val: number
* left: TreeNode | null
* right: TreeNode | null
* constructor(val?: number, left?: TreeNode | null, right?: TreeNode | null) {
* this.val = (val===undefined ? 0 : val)
* this.left = (left===undefined ? nul... |
3110c9912100d820071050f92f7b706cb5993ba9 | TypeScript | djr-taureau/investment-portfolio-demo | /src/app/core/domain/enum/date-part-type.enum.ts | 2.578125 | 3 | export interface DatePartType {
name: string;
id: string;
}
export class DatePartTypeEnum {
static readonly MON = { name: "MON", id: "M" } as DatePartType;
static readonly QTR = { name: "QTR", id: "Q" } as DatePartType;
static readonly YEAR = { name: "YEAR", id: "Y" } as DatePartType;
}
|
52a9d13c0be4f04153d7715f32aaa0d815664fa7 | TypeScript | bitsy-ui/bitsy-framework | /packages/bitsy-ui-state/src/useWindowCallback.ts | 2.96875 | 3 | import EventEmitter from 'eventemitter3';
import { useState, useEffect, useCallback } from 'react';
type UseWindowCallback = <S>(defaultCallback: (...args: any[]) => any, deps: any[], path: string) => any;
const useWindowCallback: UseWindowCallback = (defaultCallback, deps, path) => {
// Create the usecallback call... |
f11b8d39b511bfd1a596bbadd22fb54a3ce54606 | TypeScript | ventful/Customer-Support-Software-with-Ticketing-System | /Mobile App Code/src/app/shared/models/Setting.ts | 2.609375 | 3 | export class Setting {
id: number;
name: string;
value: string;
private: boolean;
created_at?: string;
updated_at?: string;
constructor(params: Object = {}) {
for (let name in params) {
this[name] = params[name];
}
}
} |
39f83fea06107d10bacf57fe07f58239734c46cb | TypeScript | marmelab/react-admin | /packages/ra-core/src/util/getValue.spec.ts | 2.515625 | 3 | import getValue from './getValue';
import expect from 'expect';
describe('getValue', () => {
it('returns directly the value if it is not an object', () => {
expect(getValue(10, 'foo.bar')).toEqual(10);
});
it('returns the value at specified path if it is an object', () => {
expect(getValue(... |
894d02c7ceb654786c2527311a3c210faefe0891 | TypeScript | CDSeattleMEAN201710/jack_brounstein | /angular/angular-demo/src/app/cars/filter.pipe.ts | 2.703125 | 3 | import { Pipe, PipeTransform } from '@angular/core';
import { Car } from "./car"
@Pipe({
name: 'filter'
})
export class FilterPipe implements PipeTransform {
transform(cars: Array<Car>, search_text: string): Array<Car> {
if(!search_text){ return cars }
search_text = search_text.toLowerCase()
retu... |
2a3a1276104d543551a4708754a7f231934543b7 | TypeScript | hraniere/nlw-01 | /server/src/controllers/FacilitiesController.ts | 2.734375 | 3 | import { Request, Response, response } from 'express'
import knex from '../database/connection'
class FacilitiesController {
async create(req: Request, res: Response) {
const {
name,
email,
whatsapp,
latitude,
longitude,
city,
uf,
categories,
} = req.body
... |
c93b725904214417cc230c43269bfebac7772d14 | TypeScript | no-chris/chord-symbol | /packages/chord-symbol/types/index.d.ts | 3.109375 | 3 | export {
Chord,
ChordInput,
ChordParseFailure,
CustomFilter,
FormattedChord,
MaybeChord,
NormalizedChord,
ParserConfiguration,
RendererConfiguration,
chordParserFactory,
chordRendererFactory,
};
/**
* An object that may be a chord data object or a chord parsing failure object.
*/
type MaybeChord = Chord |... |
a4990bd33c8dc85d6e52bc08efb0522aaf5d177c | TypeScript | cyco/WebFun | /test/helpers/script.ts | 2.515625 | 3 | import {
Result,
ConditionChecker,
EvaluationMode,
InstructionExecutor
} from "../../src/engine/script";
import { ConditionImplementations } from "src/engine/script/conditions";
import { InstructionImplementations } from "src/engine/script/instructions";
import { Condition, Instruction } from "src/engine/objects";
... |
15c07321a3da9b6fa25b5b4f3e3b05775b442211 | TypeScript | yurimikushov/airline-tickets | /src/utils/__tests__/splitToThousands.test.ts | 2.71875 | 3 | import { splitToThousands } from '../splitToThousands'
test('should don`t split numbers that less 999 modulo', () => {
expect(splitToThousands(0)).toBe('0')
expect(splitToThousands(999)).toBe('999')
expect(splitToThousands(-999)).toBe('-999')
})
test('should split numbers that more 999 modulo', () => {
expec... |
6b120140901d530873d9fe2b9b4d96e9dc3f0495 | TypeScript | future4code/Mayara-Amaral | /semana16/aula46/src/endpoints/getCountByGender.ts | 2.515625 | 3 | import { Request, Response } from "express";
import { selectCountByGender } from "../data/selectCountByGender";
export const getCountByGender = async (req: Request, res: Response) => {
try {
const count = await selectCountByGender(req.query.gender as string)
res.status(200).send(count)
} catch... |
a6fe84181535fbf8d1cd0bf0b9b73fe9bfc8a3f9 | TypeScript | nderise/spartacus | /feature-libs/cart/saved-cart/core/connectors/saved-cart.adapter.ts | 2.515625 | 3 | import { Cart } from '@spartacus/core';
import { Observable } from 'rxjs';
export abstract class SavedCartAdapter {
/**
*
* Abstract method used to load a single saved cart
*/
abstract load(userId: String, cartId: String): Observable<Cart>;
/**
*
* Abstract method used to load a list of saved cart... |
5b854cf0cdc05245ca882f821501df67c4a07f94 | TypeScript | ossang/olib-admin | /olib-admin-dashboard/src/app/@olib/@olib-chart/olib-chart-text/olib-chart-text-config.model.ts | 2.59375 | 3 | export class OlibChartTextConfig{
private title : any;
private status : string;
private value : any;
constructor(){
}
/**
* Getter $title
* @return {any}
*/
public get $title(): any {
return this.title;
}
/**
* Getter $status
* @return {string}
*/
publ... |
56d39a0966aa0c5f9f043b7e7b44097708bd4c57 | TypeScript | PeterKaffeeKrieger/teambuktu | /src/app/model/Info.ts | 2.640625 | 3 | import {DataObject} from "./DataObject";
export class Info extends DataObject{
constructor(private _name: string) {
super(_name);
}
get name(): string {
return this._name;
}
}
|
23c113cd318cfed717ab0d9dac49b8365a9b9268 | TypeScript | wan54/datahub | /datahub-web/@nacho-ui/core/tests/unit/utils/lib/is-primitive-test.ts | 3.203125 | 3 | import isPrimitive from 'dummy/utils/lib/is-primitive';
import { module, test } from 'qunit';
module('Unit | Utility | lib/is-primitive', function() {
test('it works for positive cases', function(assert) {
const resultA = isPrimitive('Ash Ketchum');
const resultB = isPrimitive(5);
const resultC = isPrimi... |
1f7df139aa3c0372f2f0ce8585dbd26dfa79a548 | TypeScript | maapteh/graphql-modules-app | /packages/server/src/middleware/allowed-origin/allowed-origins.ts | 2.65625 | 3 | import express from 'express';
import { ORIGINS_LIST } from './origins-list';
/**
* ONLY ALLOW ORIGINS WHICH WE DO ALLOW
*/
export const ALLOWED_ORIGIN = (
req: express.Request,
res: express.Response,
next: express.NextFunction,
) => {
const origin = req.get('origin');
if (origin) {
cons... |
2d86a813c25212b24ac641dc70a97338941aeb6f | TypeScript | RamAddict/flwarrior | /src/__test__/grammarTransforms/grammar.test.ts | 2.75 | 3 | import { IAlphabet } from "@/lib/Alphabet";
import Immutable from "immutable";
import { inspect } from "util";
import {
addNonTerminalSymbol,
addTerminalSymbol,
fromDBEntry as createGrammarFromDBEntry,
removeTerminalSymbol,
removeNonTerminalSymbol,
getBodiesOfHead,
IIGrammar,
getFollows,... |
dc627488a2e9970a7949b571e1576d0221cbea7d | TypeScript | gios/diploma-nets | /src/app/shared/net/linkConnections.ts | 2.515625 | 3 | import * as joint from 'jointjs';
import { find } from 'lodash';
import { ILinkConnection } from './net.interface';
const defaultLinkOptions = {
label: ''
};
export function link(
id: number,
connectFirst: joint.dia.Cell,
connectSecond: joint.dia.Cell,
options = defaultLinkOptions
) {
options = Object.as... |
946183f2e30c114f07f5dfae6ebbd60eaf84f022 | TypeScript | jcabanillas/clinicbox | /src/models/telefono.ts | 2.546875 | 3 | // Evento model based on the structure of evento
// https://api.github.com/users/{username}
export interface Telefono {
id: number;
tipo: string;
numero: string;
extension: string;
}
|
8dbfee53e64c42154fecea9ce18d98af86a40dc9 | TypeScript | keyur2714/Angular_6_2 | /InputDemo/src/app/app.component.ts | 2.578125 | 3 | import { Component,OnInit } from '@angular/core';
import { Lookup } from './my-dropdown/lookup-model';
import { Server } from './server/server.model';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit{
count... |
ecb4b3789dfb259e16be4037355bb6888722f575 | TypeScript | jingkeke/ramda_utils | /src/FuncUtils.ts | 2.96875 | 3 | // 这里面的感觉只是用于 class 的 比如debounce https://steelsojka.github.io/lodash-decorators/
//
export function debounce(func, delay) {
let timeout;
return (...args) => {
clearTimeout(timeout);
timeout = setTimeout(() => {
func(...args);
}, delay);
};
}
/**
* @param {Function} func
* @param {number} wa... |
71df017171dce25f414b9b410b34242d9afb1711 | TypeScript | andywer/deep-assert | /src/index.ts | 2.53125 | 3 | import { deepEquals as internalDeepEquals, Options } from "./deep-equals"
export * from "./deep-equals"
export default function deepEquals(actual: any, expected: any, opts?: Options) {
const result = internalDeepEquals(actual, expected, [], opts)
if (result instanceof Error) {
// Keep the stack trace short a... |
b56c4cf1bb1706bb0645f76b107a51644bc10f99 | TypeScript | IronOnet/codebases | /codebases/pipedrive.com(dashboard)/webpack---lib/client/hooks/useInterval.ts | 2.6875 | 3 | import { useRef, useEffect, DependencyList } from 'react';
interface UseIntervalOptions {
runImmediately: boolean;
deps?: DependencyList;
}
// copied over from leadbooster
// Inspired by Dan Abramov - https://overreacted.io/making-setinterval-declarative-with-react-hooks/
export function useInterval(callback: () => ... |
bf7224c088899800a5f0f00aae2bce5ed8e36075 | TypeScript | yuersen/fx | /src/object/isFunction.ts | 3.640625 | 4 | import type from './type';
/**
* 检测当前参数是否为函数
*
* @function
* @memberof Fx
* @param {Any} obj 任意类型的数据
* @returns {Boolean}
* @example
*
* // -> true
* Fx.isFunction(function test() {});
*
* // -> false
* Fx.isFunction({});
*
* // -> false
* Fx.isFunction(2019);
*/
const isFunction = (obj: any): boolean... |
993e6451721bd6e48aa9777075a56e4daecd0b78 | TypeScript | raulrozza/Gametask_API | /src/modules/players/domain/entities/fakes/FakeUnlockAchievementRequest.ts | 2.53125 | 3 | import { IUnlockAchievementRequest } from '@modules/players/domain/entities';
import { IAchievement, IUser } from '@shared/domain/entities';
import { FakeAchievement, FakeUser } from '@shared/domain/entities/fakes';
import faker from 'faker';
import { v4 as uuid } from 'uuid';
interface IConstructor {
game?: string;... |
4c798dd538d5f60d28b368b524f521c8f7502cd4 | TypeScript | taomas/mrapi | /packages/create-mrapi-app/src/install.ts | 2.671875 | 3 | import { exec } from 'child_process'
const execa = (
cmd: string,
options?: { cwd: string; env?: { [name: string]: string | undefined } },
): Promise<string | Buffer> => {
if (process.env.verbose == 'true') {
console.log(' $> ' + cmd)
}
return new Promise((resolve, reject) => {
exec(
cmd,
... |
4a345db4a774543c5fd7afc6eeb9be48a3bfdd51 | TypeScript | Mujib517/angular4-training | /src/shared/math.spec.ts | 3.28125 | 3 | import { Math } from './math';
describe("Math Service", ()=> {
let math;
beforeEach(function () {
//Arrange
math = new Math();
});
describe("Add function", ()=> {
it("should add two number and return result", function () {
//AAA
//Act
var c ... |
743ad78fa0aa286815eb0b508da2575352bdcaf0 | TypeScript | massmediagroup-5/node.js-presentation | /controllers/OrderController.ts | 2.5625 | 3 | import {
Authorized, Body, CurrentUser, JsonController, Post,
} from 'routing-controllers';
import { Order } from '../models/Order';
import { OrderService } from '../services/OrderService';
import { User } from '../models/User';
import { ValidationError } from '../errors/ValidationError';
import { ResourceNotFoundE... |
d7f2268d5563135e62a2bcb6e4e30a4488bf4678 | TypeScript | karthikapp/base | /src/app/pipes/competitornames.pipe.ts | 2.59375 | 3 | import { Pipe, PipeTransform } from '@angular/core';
import { FirebaseService } from '../services/firebase.service';
import "rxjs/add/operator/map";
@Pipe({
name: 'competitornames'
})
export class CompetitornamesPipe implements PipeTransform {
competitorlists: Object[];
constructor(public firebaseservice: Fireba... |
370d16b96fd94468628afeaf20507570fa5607b2 | TypeScript | Esirei/Legit9ja.com-RN | /src/navigation/NavigationService.ts | 2.515625 | 3 | import {
NavigationActions,
StackActions,
NavigationContainer,
NavigationRoute,
NavigationDispatch,
NavigationPopActionPayload,
} from 'react-navigation';
import { DrawerActions } from 'react-navigation-drawer';
import RouteNames from './RouteNames';
import { PostScreenParams } from '@screens/post/types';
i... |
f0dcd9258365a6812fa76a6da038501d5914c8ed | TypeScript | tarvyn/nodejs-guide | /graphQL/app/graphql/post/post.input.ts | 2.71875 | 3 | import { IsNotEmpty, MinLength } from 'class-validator';
import { Field, InputType } from 'type-graphql';
import { Post } from '../../models/post.model';
@InputType()
export class PostInput implements Partial<Post> {
@Field({ nullable: true })
id?: string;
@Field()
@IsNotEmpty({ message: 'Title field is requi... |
325aac4a13d8577011dd15aedb01006c05ef6ea4 | TypeScript | AdinoWayne/VuMucDiThu | /code/dynamic-programming/2379-minimum-recolors-to-get-k-consecutive-black-blocks.ts | 2.953125 | 3 | function minimumRecolors(blocks: string, k: number): number {
let min_count = Number.MAX_VALUE
for(let i=0; i<blocks.length; i++){
let black_count = 0, count = 0
for(let j=i; j<blocks.length; j++){
if(blocks.charAt(j) == 'B') black_count++
else{
black_coun... |
0a58986bc3b4f55a27a2abd06dcc2a7e6d966136 | TypeScript | osvodef/collision-buffer-research | /src/bitBuffer.ts | 3.34375 | 3 | import { CollisionDetector, Marker } from './types';
export class BitBufferImpl implements CollisionDetector {
private width: number;
private height: number;
private buffer: Uint8Array;
constructor(width: number, height: number) {
// Width must be a multiple of 8
this.width = Math.ceil... |
5c7bd5d119ef3e87d9d11fbd402e8f779b80e1b7 | TypeScript | epicmaxco/vuestic-ui | /packages/docs/page-config/ui-elements/tree-view/index.ts | 2.640625 | 3 | import { VaTreeViewOptions } from "./api-options";
import apiDescription from './api-description';
const treeNodeType = `
interface TreeNode {
id: number | string
children: TreeNode[]
level?: number
checked?: boolean | null
disabled?: boolean
expanded?: boolean
hasChildren?: boolean
matchesFilter?: boo... |
5b65cffada54289b72bc684e311c7a76f0b99367 | TypeScript | icivann/ivann | /src/app/ir/OutModel.ts | 2.59375 | 3 | class OutModel {
constructor(
public readonly name: string,
) {}
static build(options: Map<string, any>): OutModel {
return new OutModel(
options.get('name'),
);
}
}
export default OutModel;
|
d61996601df18822b2c6c4d93245a1d5666a804e | TypeScript | 8Observer8/express-example-ts | /src/server/App.ts | 2.65625 | 3 | import * as express from "express";
import * as http from "http";
// Playground: https://repl.it/@8Observer8/My-First-Express-Server-in-TypeScript
class App
{
private _port = process.env.PORT || 3000;
public constructor()
{
const app = express();
app.get("/",
(request, respons... |
5c79258ba091771997c12c6e34122eca6e813786 | TypeScript | jhipster/prettier-java | /packages/prettier-plugin-java/src/printers/lexical-structure.ts | 2.65625 | 3 | import { printTokenWithComments } from "./comments/format-comments";
import { join } from "./prettier-builder";
import { BaseCstPrettierPrinter } from "../base-cst-printer";
import {
BooleanLiteralCtx,
FloatingPointLiteralCtx,
IntegerLiteralCtx,
IToken,
LiteralCtx
} from "java-parser";
import { builders } fro... |
1d3db7319bfaf77b1c273e2777266daca2faa1e6 | TypeScript | flowtsohg/mdx-m3-viewer | /src/parsers/m3/camera.ts | 2.515625 | 3 | import BinaryStream from '../../common/binarystream';
import IndexEntry from './indexentry';
import Reference from './reference';
import { Float32AnimationReference } from './animationreference';
/**
* A camera.
*/
export default class Camera {
version = -1;
bone = -1;
name = new Reference();
fieldOfView = n... |
046e89ee3f0162439ce210594350b90916d992b2 | TypeScript | isyed-intuit/website | /minarets-api/minarets/tours.ts | 2.765625 | 3 | import LRUCache from 'lru-cache';
import { ApiBase } from './apiBase';
import type { ListAllResponse, ListResponse, Tour, TourSummary, TourWithChildren } from './types';
const cache = new LRUCache<string, TourWithChildren>({
max: 100000,
maxAge: 60 * 60 * 1000, // 60 minutes
});
export class Tours extends ApiBas... |
07137275ce51e42cba78d8ea7cf8999bcba08eef | TypeScript | dsfb/sw-backend | /frontend/src/api/generic/generic-api.ts | 3.015625 | 3 | import {getAxiosInstance} from "./axios-instance";
import {AxiosResponse} from "axios";
export interface PageData {
next: number | null;
prior: number | null;
pageTotal: number;
recordTotal : number;
}
export interface PagebleResponse<T> {
data: T[];
page: PageData;
}
export interface Resourc... |
b76a464413c00dc9e2ddca3eda2a209663238388 | TypeScript | project-accelerate/m.app | /backend/app/common/ConfigService.ts | 2.765625 | 3 | import { Service } from 'typedi'
@Service()
export class ConfigService {
constructor(public configs = process.env) {}
private forceOptional = false
makeOptional() {
this.forceOptional = true
}
get(variable: string) {
if (this.forceOptional) {
return this.configs[variable] || variable
}
... |
8be1cc59919058a4dd66f326def7474a2b9327ce | TypeScript | yuanhjty/algorithms-in-typescript | /src/singly-linked-list/values.ts | 2.921875 | 3 | import ListNode from './list-node';
export default function values<T>(head: ListNode<T>): T[] {
let curr = head.next;
const result: T[] = [];
while (curr) {
result.push(curr.value);
curr = curr.next;
}
return result;
}
|
06aa1f4eb9947d88c1ee7c23d4f41f00122658aa | TypeScript | abdulbeard/frogger | /src/app/models/Game.ts | 2.6875 | 3 | export class Game {
lives: number;
extra: number;
level: number;
score: number;
posX: number;
posY: number;
facing: string;
log: number;
current: number;
highest: number;
dead: number;
win: number;
won: Array<any>;
constructor() {
this.lives = 5;
... |