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 |
|---|---|---|---|---|---|---|
ab598cfdf7c14cd32337541c8a92ddeaa6e023bd | TypeScript | jianhan/tw-syncer | /src/users/lookup/Parameters.ts | 2.84375 | 3 | import { ArrayMaxSize, ArrayMinSize, ArrayUnique, IsArray, IsBoolean, IsNumber, IsString } from "class-validator";
/**
* Parameters represents twitter api parameters when fetching users, it will be used
* for validations to ensure input parameters all valid before API call.
*
* @export
* @class Parameters
*/
exp... |
ea1b22db8c2b0575b2409197d32aeae40dd49e1c | TypeScript | bshawn/sandbox | /web-client/src/data/block.ts | 3.015625 | 3 | import { GetBlockResult } from "eosjs/dist/eosjs-rpc-interfaces";
interface GetBlockResultWithTransactions extends GetBlockResult {
transactions?: any[];
}
export class Block {
public id: string = "";
public timestamp: string = "";
public previousId: string = "";
public actionCount: number = 0;
public raw... |
dbaca3c3c279c7f100d221dc00afa91eb12f596d | TypeScript | aabuhijleh/better-github-profile | /src/utils/parseExtendedData.ts | 2.578125 | 3 | import { ExtendedData } from "src/types";
export const parseExtendedData = (data: string) => {
try {
return JSON.parse(data) as ExtendedData;
} catch (err) {
console.error("could not parse extended data", err);
return null;
}
};
|
81d4231a027a72ea94c1b01d651e28af0580f0a1 | TypeScript | Edward-Upton/CS261-Software-Engineering | /frontend/src/types.d.ts | 2.796875 | 3 | export interface IUser {
_id: string;
email: string;
}
export interface IEvent {
_id: string;
name: string;
eventType: string;
start: Date;
end: Date;
host: string | IUser;
participants: string[] | IUser[];
inviteCode: string;
feedback: IField[];
}
export type FieldTypes = "mood" | "rating" | "s... |
6e832bb390757076d990124ffa6b17982bf17483 | TypeScript | Miggslopes/vuestic-ui | /packages/docs/src/scripts/generators/documentation.ts | 2.53125 | 3 | import { NodePlopAPI, CustomActionFunction, AddActionConfig } from 'plop'
/**
* generator/documentation.js
*
* Exports the generators so plop knows them
*/
// eslint-disable-next-line
const fs = require('fs')
// eslint-disable-next-line
const { execSync } = require('child_process')
// eslint-disable-next-line
cons... |
60fde774fd1b1c8ba48a327e41e3b1798327d7b7 | TypeScript | brandonpsmith/validasaur | /tests/rules/min_length.test.ts | 2.703125 | 3 | import { minLength } from "../../src/rules/min_length.ts";
import { invalid } from "../../src/utils.ts";
import { assertInvalid, assertValid, fakeUtils } from "../utils.ts";
import { Validity } from "../../src/types.ts";
Deno.test("rules.minLength(4)(5) should be invalid", () => {
assertInvalid(
minLength(4)(5, ... |
0c9346965ce16a900367c51fccfe5f15553e92c0 | TypeScript | koleg-core/api | /src/app/organisation.service.ts | 2.546875 | 3 | import { Organisation } from "domain/organisation";
import { OrganisationRepository } from "../domain/repos/organisation.repository";
import { Job } from "../domain/user/Job";
import { ReturnCodes } from "../domain/enums/return-codes.enum";
import { ReadableUser } from "../domain/user/ReadableUser";
import { StatelessU... |
f8feec5d409ae8802284df6b88f942c99cdb925c | TypeScript | ralphschuler/expressions-library-template | /src/index.ts | 2.78125 | 3 | // Importing object bases (CompBase, LayerBase, PropertyBase)
// TypeScript types (Layer, Comp, Value, Color etc)
// and global functions from 'expression-globals-typescript'
import { Comp, Layer } from 'expression-globals-typescript';
import { fromOtherFile } from './otherFile';
// Creating a new composition ob... |
ac572336fa3e0685a29bf7a4a0cc3a9f520f185d | TypeScript | htndev/hospital-server | /src/common/utils/security.ts | 2.78125 | 3 | import { genSalt, hash, compare } from 'bcrypt';
export class Security {
static async cryptPassword(password: string): Promise<string> {
const salt = await genSalt();
return await hash(password, salt);
}
static async comparePasswords(password: string, realPassword: string): Promise<boolean> {
return... |
e02d8549287f3b62c23e3da3f063eb1c8e7da1d5 | TypeScript | cwang22/lean-script | /src/index.ts | 2.859375 | 3 | import parse from './parser/index'
import compile from './compiler/index'
import Continuation from './util/Continuation'
let stackLength: number
let inExecute: boolean = false
function GUARD(args: Array<any>, f: Function) {
if (--stackLength < 0) throw new Continuation(f, args)
}
function Execute(f: Function, args... |
1f7bcd5d9b14043120fef94f9442683d6cea6260 | TypeScript | katk0smos/roblox-ts | /src/transpiler/spread.ts | 2.796875 | 3 | import * as ts from "ts-morph";
import { checkNonAny, transpileCallExpression, transpileExpression } from ".";
import { TranspilerError, TranspilerErrorType } from "../errors/TranspilerError";
import { TranspilerState } from "../TranspilerState";
import {
isArrayType,
isIterableIterator,
isMapType,
isSetType,
isSt... |
92b0210c4513f5c4fd3366d7fc58e0a6a42c6a80 | TypeScript | kikarto/zd1 | /src/libs/board.ts | 3.015625 | 3 | import { Model } from '../enums/model';
import { ICard } from '../interfaces/card';
import { IPerson } from '../interfaces/person';
import { IScore } from '../interfaces/score';
import { IStarship } from '../interfaces/starship';
import { checkWhoWin } from './card';
import { Connect } from './connect';
import { parseP... |
83a59c3a2fa197cedfcc3c3aba290892b95ccca0 | TypeScript | dmarine/SafoodAdmin | /src/app/models/food.ts | 2.765625 | 3 | export class Food {
id: number
name: string
category_id: number
restaurant_id: number
image: string
description: string
price: number
constructor(name: string, category_id: number, restaurantid: number, description: string, price: number) {
this.name = name
this.category_id ... |
78be4263743283ed14cfc26ae4f5c1cc45205f5f | TypeScript | fabrix-app/spool-broadcast | /lib/config/spool.ts | 2.59375 | 3 | // tslint:disable:max-line-length
/**
* Spool Configuration
*
* @see {@link https://fabrix.app/doc/spool/config
*/
export const spool = {
type: 'misc',
/**
* API and config resources provided by this Spool.
*/
provides: {
resources: ['controllers', 'models', 'services', 'events', 'crons', 'emails'],... |
a2028f5d23e240cf89527131d5a64efdd525fa7e | TypeScript | idahopotato1/kilo | /test/key-controls.spec.ts | 2.953125 | 3 | import { expect } from 'chai'
import { KeyControls } from '../lib/'
describe('KeyControls', () => {
let ctrls: KeyControls
const keyDown = (code: string) => {
const evt = new KeyboardEvent('keydown', { code } as any)
document.dispatchEvent(evt)
}
const keyUp = (code: string) => {
const evt = ne... |
aa9d6f6fcec1f8669f3b022bada55847eb7e8cea | TypeScript | Sean-Char/angular2-hello-world | /src/app/courses.component.ts | 2.609375 | 3 | import { Component } from '@angular/core';
@Component({
selector: 'courses',
template: `
{{ text | summary:25 }}
` // can also interpulate methods
})
export class CoursesComponent {
text = `
Lorem Ipsum simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the... |
8eb6cd72c841497f7184b7b8496f1c119def1ebf | TypeScript | tuftjs/tuft | /__tests__/pre-handlers/body-parser.test.ts | 2.921875 | 3 | import { requestSymbol } from '../../src/context';
import { createBodyParser } from '../../src/pre-handlers/body-parser';
import { HTTP_HEADER_CONTENT_TYPE, HTTP_HEADER_CONTENT_LENGTH } from '../../src/constants';
import { PassThrough } from 'stream';
type MockTuftContext = {
request: {
headers: {
[key: st... |
041010b356c672e897ca07b893df6bcc9f6ad4a4 | TypeScript | sass/embedded-host-node | /lib/src/value/calculations.ts | 2.984375 | 3 | // Copyright 2023 Google Inc. Use of this source code is governed by an
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
import {hash, List, ValueObject} from 'immutable';
import {Value} from './index';
import {SassNumber} from './number';
import {SassString} fr... |
b53c2b05a971e390437296e398f3c8019cd85e6f | TypeScript | lennonc/puz-parser | /lib/crossword.ts | 2.578125 | 3 | import fs from 'fs';
import Header from './header';
export default class Crossword {
public header?: any;
public puzzle?: any;
public details?: any;
public board?: any;
constructor(options?: any) {
this.header = new Header();
this.puzzle = {};
this.details = {};
this.board = {};
if (opt... |
830f0e4af335d9cdd5d2179d7ada1be5de61cfe5 | TypeScript | Ralphvanderneut/100dayscodeprojects | /ralph-portfolio/src/composables/ItemSelected.ts | 2.59375 | 3 | export function ItemSelected(emit: any){
const OnItemSelected = (id: number): void =>{
emit("selected",id);
}
return { OnItemSelected }
} |
eb25082526b008611bde9629ebab57c006289f66 | TypeScript | donmahallem/nadezhda-server | /src/routes/users/users-endpoints.ts | 2.5625 | 3 | import {
Request,
Response,
NextFunction,
RequestHandler
} from "express";
import {
Validator,
Schema,
ValidatorResult
} from "jsonschema";
import {
UserDatabase
} from "./../../database/user-database";
import {
RouteError
} from "./../";
export class UsersEndpoints {
public stat... |
e7ffd82e7b20fa775bbe6d54d91d8bcf1951149a | TypeScript | BlokDust/BlokDust | /app/lib/utils/src/StorageType.ts | 2.6875 | 3 | module Utils {
export class StorageType {
static memory = new StorageType("memory");
static session = new StorageType("session");
static local = new StorageType("local");
constructor(public value:string) {
}
toString() {
return this.value;
}
... |
6d6cab442eacdcfcc77ec3fbef726821143832fb | TypeScript | peterkhayes/pitchfinder | /src/detectors/acf2plus.ts | 3.140625 | 3 | import { PitchDetector } from './types';
export interface ACF2Config {
sampleRate: number;
}
const DEFAULT_PARAMS: ACF2Config = {
sampleRate: 44100,
};
export function ACF2PLUS(params: Partial<ACF2Config> = DEFAULT_PARAMS): PitchDetector {
const config = {
...DEFAULT_PARAMS,
...params,
};
const { s... |
5585c8a7f31cb418dcc75ec145464972b1bf24af | TypeScript | sevenClover/typescript | /05.联合类型.ts | 2.640625 | 3 | {
let a:string|number|boolean = "123"
a=123;
let b:number=123;
let bb:Number=new Number(123)
b.toLocaleString()
console.log(b.toLocaleString())
} |
63f5cfbeb3ed13968f4c390a849bb7ac15a2bc0a | TypeScript | berapakinibmembunuhks/one | /src/core/tasks/task-spec.impl.ts | 2.8125 | 3 | import type { ZTaskSpec } from './task-spec';
export function addZTaskAttr(target: Record<string, string[] | null>, name: string, value: string): void {
const subIdx = name.lastIndexOf(':');
if (subIdx >= 0) {
addZTaskAttr(target, name.substr(0, subIdx), name.substr(subIdx + 1));
}
const values = target... |
8c88dff5b8ba5b2e44fafec6fcc60427130f5f56 | TypeScript | scottspiller/StarWarsVue | /src/models/People.ts | 2.9375 | 3 | import {Person} from '../models/Person';
export class People {
public count: number = 0;
public next: string = '';
public previous: string = '';
public persons: Person[] = [];
constructor(obj: any = null) {
if (obj) {
this.count = obj.count || 0;
this.next = obj.nex... |
eabd7f54c8c21270c815263414907812f970ca78 | TypeScript | pooltogether/contracts | /test/lists/DoubleLinkedList.test.ts | 2.828125 | 3 | import { should } from 'chai';
import { DoubleLinkedListInstance } from '../../types/truffle-contracts';
const DoubleLinkedList = artifacts
.require('./lists/DoubleLinkedList.sol') as Truffle.Contract<DoubleLinkedListInstance>;
should();
const emptyData = '0x0000000000000000000000000000000000000000';
const headDa... |
5f53ba551e5602c381dc03f828058a24f8e2b901 | TypeScript | GhostfromTexas/mixer-wrapper | /source/ChatWrapper.ts | 2.828125 | 3 |
import BeamClient = require("beam-client-node");
import BeamSocket = require("beam-client-node/lib/ws");
// Internal Objects for Beam Module
import * as Chat from "beam-client-node/defs/chat";
import { Event } from "./common/utils/Event";
export interface ChatClearMessages {
clearer: {
user_name: string;
user_... |
10aab3b46d8e9da24ceb3aef8ff5786817ef6105 | TypeScript | juliocesarcsc/marvel-test | /src/app/models/character.model.ts | 2.578125 | 3 | export class Character {
public id: number;
public name: string;
public description: string;
public comics: Comics;
public thumbnail: Thumbnail;
}
export class Thumbnail {
public path: string;
public extension: string;
}
export class Comics {
public available: number;
}
|
67d31f3df96f5f36dcaffbf317f1b56ac5ef692b | TypeScript | tavaresl/soul-collector | /src/assets/scripts/core/geometry/Rectangle.ts | 3.078125 | 3 | import { game } from "../Game.js";
export class Rectangle {
static draw(
x: number,
y: number,
width: number,
height: number,
rotationDegrees: number = 0,
backgroundColor: string = '#000000',
): void {
const context = game.drawContext;
context.save();
context.translate(x + wid... |
63ba2937ba64344eb9c5a66de13f91126064ef87 | TypeScript | JoacoAllende/ventas | /frontend/src/app/components/product/product-filter-description.pipe.ts | 2.65625 | 3 |
import { PipeTransform, Pipe } from '@angular/core';
import { Product } from 'src/app/models/product';
@Pipe({
name: 'descriptionFilter'
})
export class ProductFilterDescriptionPipe implements PipeTransform {
transform(products: Product[], searchDescription: string): Product[] {
if (!products || !sea... |
87a01d154f12f98b66946a99778028fbf18ee3a1 | TypeScript | zr8091/common-core-swagger-ui | /src/app/common/ApiFilter.ts | 2.609375 | 3 | import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'apiFilter',
pure: false
})
export class ApiFilter implements PipeTransform {
transform(items2: any[], filter: String): any {
if (!items2 || !filter) {
return items2;
}
let items =JSON.parse(JSON.stringi... |
cf998eca9875a2112da9f9be17a1a8e8155cc91c | TypeScript | qqqdu/bingo | /src/component/popClass.ts | 2.671875 | 3 | /*
弹窗类
**/
class PopClass extends egret.Sprite{
private image:egret.Bitmap = new egret.Bitmap();
private img;
public width:number;
public height:number;
public listen;
private buttonWidth = 47;
private type;
private hadConstructor;
private label1;
private label2;
private... |
24ede48d74e481a09c052e8132e1a4d05fdadb90 | TypeScript | tkuye/Streamer | /src/reducers/streamReducer.ts | 2.890625 | 3 | import _ from "lodash"
import {
FETCH_STREAM,
FETCH_STREAMS,
CREATE_STREAM,
EDIT_STREAM,
DELETE_STREAM
} from '../actions/types'
const streamReducer = (state:object={}, action:any) => {
switch (action.type) {
case FETCH_STREAMS:
return {...state, ..._.mapKeys(action.pay... |
97591f829f60285c89cf95ec17e767dd0c5baa28 | TypeScript | 1337programming/angular2-sample-starter | /server/src/product-schema.ts | 2.796875 | 3 | import {
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
GraphQLList,
GraphQLInt,
GraphQLFloat,
GraphQLNonNull
} from 'graphql';
// In memory data store
const ProductStore = require('./product-database.json');
console.log(ProductStore);
const OtherData = new GraphQLObjectType({
name: 'OtherData',
f... |
57788fc58e72352014acd9e7a9cf5a298347aff5 | TypeScript | pnp/sp-dev-fx-webparts | /samples/react-property-bag-editor/src/webparts/shared/utils.ts | 2.71875 | 3 | import * as _ from "lodash";
import { Web } from "sp-pnp-js";
require("sp-init");
require("microsoft-ajax");
require("sp-runtime");
require("sharepoint");
import DisplayProp from "./DisplayProp";
/**
* Various utilitty functions used by the React-ProprtyBag* Webparts
*
* @export
* @class utils
*/
export default ... |
a40dd3cf431af3348cb26a1a2c0473166d7a6feb | TypeScript | vadimnevinskiy/kama | /src/redux/profile-reducer.ts | 2.703125 | 3 | import {profileAPI, usersAPI} from '../api/api'
import {FORM_ERROR} from 'final-form'
import {ContactsType, PhotoType, PostType, ProfileType} from '../types/types'
import {AppStateType} from "./redux-store";
import {Dispatch} from "redux";
import {ThunkAction} from "redux-thunk";
const ADD_POST = 'ADD-POST'
const DELE... |
aa215077baaacbea38ac7fd3de35942903495731 | TypeScript | kiwicom/orbit | /packages/orbit-components/src/primitives/ButtonPrimitive/common/getSizeToken.ts | 2.59375 | 3 | import { SIZE_OPTIONS, TOKENS } from "./consts";
import type { Size } from "../types";
import type { Theme } from "../../../defaultTheme";
const getSizeToken = (
size: Size,
theme: Theme,
): {
height: string;
fontSize: string;
} => {
const tokens = {
[TOKENS.heightButton]: {
[SIZE_OPTIONS.LARGE]: t... |
7f23ba469ccad2d72effdbfe612369fb95c37c62 | TypeScript | jcteague/efate | /packages/efate/src/utils.ts | 2.9375 | 3 | const isOfType =
<T>(type: string) =>
(value: any): value is T =>
typeof value === type;
export const isObject = isOfType<object>('object');
export const isFunction = isOfType<Function>('function');
export const isString = isOfType<string>('string');
|
1a3913eef85126d7cbb31c16c97736ec07182e4b | TypeScript | LuisAntonioDeMelo/AngularStudy | /Object-paradigm/Carro.ts | 2.65625 | 3 | import Veiculo from './Veiculo'
export default class Carro extends Veiculo {
private numeroDePortas : number
constructor(modelo:string,numeroDePortas :number,velocidade :number){
super()
this.modelo = modelo
this.velocidade = velocidade
this.numeroDePortas = numeroDePortas
... |
f47de529bef35f6374605baa5bf6d3e1a8cbc077 | TypeScript | tajpouria/GOF-design-pattenrs | /Patternts/Behavioral_Patterns/Strategy/ConceptualStrategy.ts | 3.4375 | 3 | namespace conceptualStrategy {
export class Context {
constructor(private strategy: Strategy) {}
doSth(data: any[]) {
return this.strategy.doAlgorithm(data);
}
}
interface Strategy {
doAlgorithm<T = string>(data: T[]): T[];
}
class ConcreteStrategyA implements Strategy {
doAlgorit... |
8381f15ab7015c208dfd5566226d8bc5dc8ef784 | TypeScript | js-works/js-cockpit | /boxroom/stuff/i18n-2022-06-21/localize/localize.ts | 2.859375 | 3 | import {
formatDate,
formatNumber,
formatRelativeTime,
getCalendarWeek,
getDirection,
getFirstDayOfWeek,
getWeekendDays,
parseDate,
parseNumber
} from './localize-utils'
export {
validateTranslations,
AbstractLocalizer,
Adapter,
Category,
DateFormat,
DayNameFormat,
Direction,
Locale,
... |
4b3ee347a3784ee7451b64fdf41574e7f8062498 | TypeScript | YutoHayashi/web-hosting-app | /view/www/pages/api/hello.ts | 2.515625 | 3 | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from 'next'
type Data = {
name: string;
email: string;
password: string;
}
export const org = {
register: async ( params: Data ): Promise<object> => {
let data = {};
... |
4c05e67f1196a6029137d52b1693f0f885cbfa8f | TypeScript | sylingd/SimpleVideoWeb | /src/api/video/submit.ts | 2.53125 | 3 | import { IVideo } from 'src/types';
import ajax from 'src/ajax';
const URL = "video";
interface IResponse {
id: number;
}
export default async function(req: IVideo) {
const res = await ajax({
url: URL,
post: {
name: req.name,
image: req.image,
aid: req.aid,
category: req.category
}
});
if (res.... |
a9bc3d2f56f58acc777bd11a671c24793b2420d6 | TypeScript | nexus-devtools/nydus | /src/versioned.ts | 2.859375 | 3 | /// <reference types="node" />
// Goal: Convert https://github.com/Blizzard/heroprotocol/blob/ffb1e5d53cce1a90a46febf44614c9c11bd3ed12/decoders.py#L168 to TypeScript
//
import { isArray } from "util";
import { BitPackedBuffer } from "./bitbuffer";
import * as NydusError from "./errors";
export class VersionedDecoder... |
914e787b42f5a27f01e0b1282b8a4d38278d328a | TypeScript | daledeleo/comunitarias | /src/app/clases/centro-acopio/centro-acopio-class.ts | 2.59375 | 3 | export class CentroAcopioClass {
id?:string;
name: string;
address?: string;
contactName:string;
contactPhone:string;
photo:File;
latitude?: number;
longitude?: number;
createdBy: string;
constructor(){}
public setCreateBy(createdBy:string){
this.createdBy=c... |
b8623c37d7ff1ac06d666319c19524663735081d | TypeScript | frydlewicz/AutoComplete | /public/js/stopwatch.ts | 2.875 | 3 | class Stopwatch {
private time: number;
public start(): void {
this.time = Date.now();
}
public end(): number {
return Date.now() - this.time;
}
}
|
078e110474089c7849c749448de9a381d5627acb | TypeScript | lebronjs/mini-utils | /src/utils/verify.ts | 2.6875 | 3 | export default {
/**
* 判断是不是数组
*/
isArrayLike: (param: any): boolean => {
return {}.toString.apply(param).slice(8, -1) === 'Array';
}
};
|
f6c75974a9bb7316469c420b76630657734ca969 | TypeScript | penkong/devref-full-ts-graph-cra-auth | /app/services/list/src/database/access/connectDb.ts | 2.53125 | 3 | /* eslint-disable @typescript-eslint/no-non-null-assertion */
import { MongoClient } from 'mongodb'
import { config } from '../../config'
import { Database, Listing } from '../../@types/types'
// ---
const { DBURL, MONGOUSER, MONGOPASS, DBNAME } = config
const url = DBURL!
.replace('<MONGOUSER>', MONGOUSER!)
.r... |
fc3d55e94b5fd9aec267eb3764534791ae9793a3 | TypeScript | abdiUNO/Feather-Backend | /src/database/factories/PostFactory.ts | 2.53125 | 3 | import { define } from 'typeorm-seeding';
import { Post } from '../../entity/post.entity';
import Faker from 'faker';
import { User } from '../../entity/user.entity';
declare global {
interface Date {
subHours: any;
subMinutes: any;
subDate: any;
}
}
define(Post, (faker: typeof Faker, settings: { user... |
b4a391fe3a35bdec2d09008e91006f9968476794 | TypeScript | haridevelops/OpenThoughtsApp | /src/app/shared/registration.modal.ts | 2.578125 | 3 | export class Registration {
public username: string;
public password: string;
constructor(name, password) {
this.password = password;
this.username = name;
}
} |
f64af27bef698a08d2e3566c6d4d0b35fc7b3a16 | TypeScript | ithiris/Angular-crud-Application | /crud/src/app/employee.service.ts | 2.578125 | 3 | import { Injectable } from '@angular/core';
import {Subject} from 'rxjs/Subject';
import {EventEmitter} from '@angular/core';
import {Employee} from "./employeemodel";
@Injectable({
providedIn: 'root'
})
export class EmployeeService {
startedEditing = new Subject<number>();
employeeChanged =new EventEmitter<Empl... |
188e4860e70231183f67d1cac21cc1a1ac3683fc | TypeScript | christianscott/ts_get_imported_files | /src/resolver.ts | 2.59375 | 3 | import * as tsConfigPaths from "tsconfig-paths";
import { Dependency } from "./parse";
import { Preconditions } from "./preconditions";
export class Resolver {
private readonly matchPath: tsConfigPaths.MatchPath;
constructor(
tsConfigFilePath: string,
private readonly resolvableExtensions: readonly string... |
7dc06317e109fba2df2780e054a81a92fcadae46 | TypeScript | famedzeus/flexReporter | /src/app/store/utils.ts | 3.21875 | 3 | import { Injectable } from '@angular/core'
import { orderBy as orderFn } from 'lodash'
import * as deepFreeze from 'deep-freeze'
@Injectable()
export class PaginationService {
orderBy = orderFn
sortDataset (dataset: Array<any> = [], sortField: string = '', page: number = 0, size: number = 20) {
if (dataset.le... |
abfb751457e7529a57b5aa32e3f408f2865cb991 | TypeScript | roopertti/yearly-album-challenge | /src/routes/AuthRoutes.ts | 2.53125 | 3 | import express from 'express';
import passport from 'passport';
import { User as UserReduxType } from '../client/types/userTypes';
import { IUser } from '../models/User';
const AuthRouter: express.Router = express.Router();
/* Spotify User API scopes */
const SpotifyScopes = ['user-read-email', 'user-read-private'];... |
fd1bf7507435caea74595e1a758619cbf3b2dcfb | TypeScript | ReseauEntourage/entourage-webapp | /src/core/useCases/authUser/authUser.selectors.ts | 2.53125 | 3 | import { createSelector } from 'reselect'
import { AuthUserState } from './authUser.reducer'
interface AppState {
authUser: AuthUserState;
}
export function selectIsLogging(state: AppState) {
return state.authUser.isLogging
}
export function selectStep(state: AppState) {
return state.authUser.step
}
export fu... |
5456f749174d7e94e9a7de233a30eab5d4318c99 | TypeScript | monetha/claims-js-sdk | /dist/models/claim.d.ts | 2.84375 | 3 | import BigNumber from 'bignumber.js';
export interface IClaim {
/**
* Dispute id
*/
id: number;
/**
* Id of the deal which dispute was opened for
*/
dealId: number;
/**
* Dispute's requester id
*/
requesterId: string;
/**
* Dispute's respondent id
*/
... |
25d260fa3299e92dacc7c1051555e14364815927 | TypeScript | kkpgarcia/luna-imgui | /src/engine-dev/Loader.ts | 2.8125 | 3 | import { Resource, Directory, AppCache, CacheType } from "@luna-engine/utility";
export default class Loader
{
private _loaderError = false;
private _loadersCount = 0;
private _progress = 0;
private _currentLoaded = 0;
constructor(loadMap: { textures, shaders }, onComplete: Function, onError: Func... |
4128a10fe5b3cccd98ea341d2a345106793f47b0 | TypeScript | oromano/nestjs-response-utils | /src/response-transformer/response-codes/meta-response-generator.ts | 2.859375 | 3 | import { MetaResponse } from './meta-response';
import { ResponseCode } from './response-code';
import { HttpStatus } from '@nestjs/common';
export class MetaResponseGenerator {
/**
*
*
* @static
* @template resultType
* @param {resultType} value
* @param {ResponseCode} responseCode
* @memberof M... |
d36fad729f9dfbb616e1db15a048dae9c80ae17a | TypeScript | OlehBabiak/typescript | /home_work_ts/Parlament.ts | 3.125 | 3 | import {Party} from "./Party";
import {Deputy} from "./Deputy";
class Parlament {
country: string;
city: string;
parties: Party[]
constructor(country: string, city: string, parties: Party[]) {
this.country= country
this.city=city
this.parties =parties
}
addParty(parties: ... |
77a851d2128e7acf953871a670e580e09c474dc8 | TypeScript | JoseAngelGallardoPerez/wallet-frontend | /src/app/core/helpers/options.helper.ts | 3.046875 | 3 | import { OptionModel } from '@models/option.model';
import { OptionsPrefixes } from '@app/core/constants/optionsPrefixes';
import { camelCaseToSnakeCase, snakeToCamelCase } from '@helpers/stringHelpers';
export class OptionsHelper {
private readonly fieldPrefix: string;
private readonly fieldRegExp: RegExp;
pri... |
47f3cbd206514c2117480b2f6ff40fdede5de934 | TypeScript | HRashidi/webpay-bahamta | /index.d.ts | 2.546875 | 3 | // Payment Interfaces
export interface IPaymentResult {
payment_url : string
}
export type IPaymentError =
| 'INVALID_API_CALL'
| 'INVALID_API_KEY'
| 'NOT_AUTHORIZED'
| 'INVALID_AMOUNT'
| 'LESS_THAN_WAGE_AMOUNT'
| 'TOO_LESS_AMOUNT'
| 'TOO_MUCH_AMOUNT'
| 'INVALID_REFERENCE'
| 'INVALID_TRUSTED_PAN'
| 'INVAL... |
d2929c059bea8a84c1d5c28fcc34e03a10f2a741 | TypeScript | AnsarSamad/MeanStack | /client/app/model/Task.ts | 2.84375 | 3 | export class Task {
title: string;
activity: string;
assignto: string;
sprint: string;
hours: number;
status: string;
isDone: boolean;
content: string
constructor(title: string, done: boolean) {
this.title = title;
this.isDone = done;
}
setContent(content: ... |
5f5ed88ee8c628cd550d07e8182438f02ad9b3f8 | TypeScript | PinkiNice/billy_sharer | /src/api/index.ts | 2.546875 | 3 | import { User } from '@/db/models/User';
export async function createNewUser(id, username) {
let existingUser = User.findOne({ id });
if (existingUser) {
return;
}
let user = new User({
username: username,
id: id,
});
await user.save();
return user;
}
export async function syncUserUserna... |
a61fc0b93785393c7c69db6aee8f5998b66e0ab8 | TypeScript | adamkekesi/VaccinationHelper | /backend/src/auth/dto/doctor-register.dto.ts | 2.625 | 3 | import {
IsBoolean,
IsDate,
IsEmail,
IsNotEmpty,
IsPhoneNumber,
MaxLength,
} from "class-validator";
import { Serializable, JsonProperty } from "typescript-json-serializer";
import { PasswordRestrictions } from "src/shared/decorators/validation/password-restrictions.decorator";
@Serializable()
... |
0f68f96d838341224500b3702987b55069374a1b | TypeScript | backupforks/tsql | /src/expr-library/assert/throw-if-null.ts | 2.5625 | 3 | import * as tm from "type-mapping";
import {AnyBuiltInExpr, BuiltInExprUtil} from "../../built-in-expr";
import {ExprUtil} from "../../expr";
import {OperatorNodeUtil} from "../../ast";
import {OperatorType} from "../../operator-type";
export type ThrowIfNullExpr<
ArgT extends AnyBuiltInExpr
> =
ExprUtil.Inter... |
134de7f91d1adbd2349d3f4edebddf43a2042b15 | TypeScript | amidos2006/SokobanGeneration | /src/Global.ts | 3.203125 | 3 | declare interface Math{
randObj:any;
setRandomObject(randObj:any):void;
randInt(maxValue:number):number;
sign(value:number):number;
}
Math.setRandomObject = function(randObj:any):void{
Math.randObj = randObj;
}
Math.random = function (): number {
return Math.randObj.real(0, 1, false);
}
Math.... |
ac123c9e94b0a34281afb0da1f67260986762b47 | TypeScript | sirian/js | /packages/workflow/src/MarkingStore/MultipleStateMarkingStore.ts | 2.84375 | 3 | import {Marking, MarkingPlaces} from "../Marking";
import {MarkingStoreInterface} from "../MarkingStoreInterface";
export class MultipleStateMarkingStore<K extends string> implements MarkingStoreInterface<any> {
public readonly property: K;
constructor(property: K) {
this.property = property;
}
... |
cd9c1b441ce5388afd94ea86fdc871d914d3c664 | TypeScript | Granjow/launchpad-mini | /types/lib/brightness.d.ts | 2.953125 | 3 | /**
* This method finds the best duty cycle match for the given brightness.
* @param {Number} t Brightness level between 0 and 1
* @returns {Array.<Number>} Array [ numerator, denominator, fraction ]
*/
export function getNumDen(t: number): Array<number>;
|
65adfc8a701be89a7dd452454462fc76bb8eb062 | TypeScript | David-Orson/Voice-Assistant | /src/components/renderers.ts | 2.75 | 3 | export function objDelete(message: any, todoObj: any) {
let itemIndex = message.slice(23);
console.log(`item index ${itemIndex}`);
delete todoObj[itemIndex];
}
export function objRender(todoObj: any, todoList: any) {
for (let i: number = 0; i < Object.keys(todoObj).length; i++) {
let ul = document.createE... |
4cee125a7a0d0b3a05a9b122b437feb6c16acae7 | TypeScript | Benjaminyuan/UniqueSSO | /dashboard/src/api/rest.ts | 2.65625 | 3 | import { LoginType } from "@/constant/loginType";
import {
EmailForm,
LoginResponse,
OauthForm,
PhoneForm,
SMSForm,
} from "@/model/form";
import axios, { AxiosInstance } from "axios";
class Endpoint {
static emailLogin = (service: string) =>
`/cas/login?type=${LoginType.Email}&service=${service}`;
... |
808c49a2818f007d94ef48194d82e7d741ea817f | TypeScript | lmd-dev/lmd-dev-lmd-ant | /src/views/view-ants.ts | 2.71875 | 3 | import { ControllerAnts } from "../controllers/controller-ants";
import { View } from "./view";
/**
* View responsible for ants
*/
export class ViewAnts extends View
{
//Controller responsible for ants
private readonly _controllerAnts: ControllerAnts;
/**
* Constructor
* @param controllerAnts ... |
6341a7f98ddc3f42e17e5db85d50fac740515574 | TypeScript | iskilber/adk | /react/http/src/lib/errors/http-request.error.ts | 2.578125 | 3 | import { HttpRequest } from '../http-request';
export class HttpRequestError extends Error {
constructor(
public readonly request: HttpRequest,
public readonly origError: any
) {
super(origError && origError.message ? origError.message : 'Http request failed!');
}
}
|
c06807b105a5f2ae60e51e408512627abc8b1769 | TypeScript | gmahi/abaplint | /src/abap/syntax/_inline.ts | 2.703125 | 3 | import {Scope} from "./_scope";
import {ExpressionNode, StatementNode} from "../nodes";
import * as Expressions from "../expressions";
import * as Statements from "../statements";
import {INode} from "../nodes/_inode";
import {Registry} from "../../registry";
import {Table, View} from "../../objects";
import {TypedIden... |
e6b5f6711350fce151d72f1446d9d6b49a880bec | TypeScript | andreofner/torchsim | /js/src/torchsim/observers/ClusterObserver/Helpers/CatmullRom.ts | 3.015625 | 3 | // import * as THREE from 'three';
import { Vector3 } from 'three';
import { InvalidStateException } from '../../../exceptions';
export class CatmullRom {
// private splineCoefs: number[][];
// private tangentCoefs: number[][];
private p0: Vector3;
private p1: Vector3;
private p2: Vector3;
pri... |
cc14d7bb6a02ba1ffe437c4d245193fe4b730f62 | TypeScript | kkoon9/SwimintheServer-nestJS | /src/dayRecord/dayRecord.controller.ts | 2.546875 | 3 | import { Body, Controller, Post, ValidationPipe } from "@nestjs/common";
import { ApiOkResponse, ApiOperation, ApiTags } from "@nestjs/swagger";
import { RecordDailyFilterDto } from "./dto/dayRecord.request.dto";
import { RecordDailyListResponseDto } from "./dto/dayRecord.response.dto";
import { DayRecordService } from... |
c49a93f252d70b1b6a7c2a14f351c82ebd881bd6 | TypeScript | slim-gears/rxrpc-js | /src/lib/data/invocation.ts | 3.046875 | 3 | import {InvocationType} from './invocation-type';
export interface HasInvocationType {
type: InvocationType
}
export interface HasInvocationId {
invocationId: number;
}
export interface Subscription extends HasInvocationType, HasInvocationId {
type: InvocationType.Subscription;
method: string;
ar... |
f887decfef99551850d379ff0fb3b0e49e95a09f | TypeScript | Spudnik-Group/Spudnik | /src/extras/data.ts | 2.515625 | 3 | export const smiff = [
'Will enjoys playing chess.',
"As an early actor on 'The Fresh Prince of Bel-Air' Will would memorize the entire script and lip everyone's lines while filming.",
"For one of Jada Pinkett Smith's birthdays, Will Smith created a DVD message telling his wife there were clothes upstairs and a car ... |
9a6472bbcffa28c08d9e1ae8fb040a118a5fcf89 | TypeScript | MamoruDS/telegram_bot_utils | /src/utils.ts | 2.984375 | 3 | import * as _ from 'lodash'
const idFormat = {
ts_radix: 16,
prefix_length_min: 1,
prefix_length_max: 4,
suffix_length_min: 10,
suffix_length_max: 10,
phrase_1_length: 6,
phrase_2_length: 6,
group_length: 10,
}
const regStr = `((^\\w{${idFormat.prefix_length_min},${idFormat.prefix_leng... |
79aeb510cc6a9d2e580ad0938f7e1746a5319881 | TypeScript | ccollado0307/TPE-Grupo6 | /src/asistencia/asistencia.entity.ts | 2.578125 | 3 | import { Grado } from "src/grado/grado.entity";
import { Motivo } from "src/motivo/motivo.entity";
import { Personal } from "src/personal/personal.entity";
import { Column, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
import { Entity } from "typeorm/decorator/entity/Entity";
@Entity('asistencia')
ex... |
6e1ca9797113fa9f382acbb61ff0e8880430f280 | TypeScript | lyf103104/wechat_project | /zhongmian/src/services/store-url-analyzer.ts | 2.6875 | 3 | import { isArray, isString } from 'lodash';
const storeRegex = /.*?[\?\&]cdfgappstore=(\d+).*?$/;
/**
* 从二维码链接中解析门店信息
* @param url 二维码链接
*/
export default function(url: string): number | false {
const matchs = url.match(storeRegex);
if (!isArray(matchs) || !isString(matchs[1])) {
return false;
... |
195712ab1fc5a2e155a2fbd53668244aecfecbee | TypeScript | loganm/sfdx-changeset | /src/lib/sfdx.ts | 2.625 | 3 | import { SfdxError } from '@salesforce/core';
import { Dictionary, get } from '@salesforce/ts-types';
import { spawn, SpawnOptions } from 'child_process';
export const runCommand = (fullCommand: string): Promise<Dictionary> => {
const error = new Error(); // Get stack here to use for later
if (!fullCommand.includ... |
3cd7d9d8c5e1b26bf1c98af36e2848816e06c41a | TypeScript | k3ith-fowl3r/grapesjs | /src/device_manager/model/Device.ts | 3.296875 | 3 | import { Model } from '../../common';
/** @private */
export interface DeviceProperties {
id?: string;
/**
* Device name.
* @example 'Mobile'
*/
name: string;
/**
* Width to set for the editor iframe.
* @example '900px'
*/
width: string | null;
/**
* Height to set for the editor iframe... |
87cad9b0d9f53e67e811c256b2f1b6030e4ca8b8 | TypeScript | david-shortman/ngrx-strict-mode | /src/app/store/scoreboard.reducer.ts | 2.625 | 3 | import { Action, createReducer, on } from '@ngrx/store';
import * as ScoreboardPageActions from './scoreboard.actions';
export const scoreboardFeatureKey = 'game';
export interface GameState {
home: number;
away: number;
}
export const initialState: GameState = {
home: 0,
away: 0,
};
const scoreboardReducer... |
5a83faa0dd6f5e65b284454012360bad378c53c0 | TypeScript | WillCS/rest-api-test | /app/src/inventory/inventoryStore.ts | 2.828125 | 3 | import { observable } from 'mobx';
import ApiService from 'src/services/apiService';
import { InventoryModel, Item, Slot } from './inventoryModel';
const enum ResponseStatus {
Unset,
OK = 200,
NetworkError,
NotFound = 404,
Unauthorized = 401,
ServerError = 500
}
class InventoryStore {
@ob... |
aa233e457dbc03e8f526625316c7431b248acc52 | TypeScript | weizai118/spring-cloud-dataflow-ui | /ui/src/app/streams/stream/stream.component.ts | 2.53125 | 3 | import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
/**
* Component that shows the details of a Stream Definition
*
* @author Janne Valkealahti
* @author Gunnar Hillert
* @author Glenn Renfro
* @author Damien Vitrac
*/
@Component({
selector: ... |
ef75f0876ed8a70ac8559f0e07ba2bb93669b4c0 | TypeScript | highsummer/foamfile | /src/case/caseVectorField.ts | 2.84375 | 3 | import {predicate, Vector} from "./helpers";
export namespace CaseVectorField {
export const TypeSignature = "case.vectorField" as const;
export const is = predicate(TypeSignature)<Type>();
export interface Type {
type: typeof TypeSignature,
header: {
version: string,
format: string,
cl... |
c0e49ef6b7ee4257c8fb55c5ce0d8a0b484f2410 | TypeScript | alexander-shipilov/positron | /types/array/types/ArrayLast.ts | 4.28125 | 4 | /**
* Returns type of the last element in the array / tuple type `T`
*
* @remarks
*
* If `T` is not array / tuple type result type will be `never`
*
* ```ts
* type T = ArrayLast<string>
* // type T = never
* ```
*
* Also result will be `never` if `T` is empty tuple type
*
* ```ts
* type T = ArrayLast<... |
e13d85202d9c1c894f01e431655a71b6541fecd5 | TypeScript | tabuckner/tabuckner-subsink | /projects/tabuckner/subsink/src/lib/sub-sink.ts | 2.703125 | 3 | import { isFunction } from './helpers/is-function';
export function SubSink({ debug = false } = {}) {
return function(constructor: any) {
const ogOnDestroy = constructor.prototype.ngOnDestroy;
if (!isFunction(ogOnDestroy)) {
throw new Error(`${constructor.name} is using @SubSink but does not implement... |
363458c665000dc28fe19bc8bb320547f414046c | TypeScript | DiegoLing33/WBL | /client/src/UI/components/Button.ts | 2.90625 | 3 | import CoreUIElement from "../CoreUIElement";
export default class Button extends CoreUIElement<HTMLElement> {
constructor(buttonId: string) {
super(buttonId);
}
/**
* Sets on click event
* @param closure
*/
public onClick(closure: () => void) {
this.getRaw().onclick = () => closure();
return this;
... |
93ceb5cec67b204c93d5cf897dde73c3a23cddb3 | TypeScript | IT-Highmore/Angular8-Cloud-Music-App | /src/app/utils/tools.ts | 2.65625 | 3 | export function isEmptyObject(obj: Object): boolean {
return JSON.stringify(obj) === '{}';
}
|
d9a31e43492e5e40fd6d37ffb4c5c87a6a7aa47a | TypeScript | LauraPachecoValbuena/Ejercicios-React | /crud/src/reducers/myUserReducer.ts | 2.796875 | 3 | import { TAction } from "../actionsTypes";
export interface IMyUser {
token?: string;
exp?: number;
iat?: number;
id?: string;
isAdmin?: boolean;
username?: string;
}
const initialState: IMyUser = {};
export const myUserReducer = (
state: IMyUser = initialState,
action: TAction
): IMyUser => {
if (... |
76031f1554832c082fe28cdf37e1fbd8423b46f6 | TypeScript | sorensj1/TextMaker | /TextMaker.App/src/app/shared/services/text-data.service.ts | 2.65625 | 3 | import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Project } from '../models';
@Injectable({
providedIn: 'root'
})
export class TextDataService {
private baseUri = 'api/projects';
constructor(
private httpClient: HttpClient
) { }
getKeys(handler: (keys: str... |
73f006839ce0fc317eafbe1e890dc6baa34d2d50 | TypeScript | AlexandreFontanie/AsynchronousServerTechnologies | /TP3/bin/populate.ts | 2.53125 | 3 | #!/usr/bin/env ts-node
import { Metric, MetricsHandler } from '../src/metrics'
import { User, UserHandler } from '../src/users'
const dbMet = new MetricsHandler("./db/metrics");
const dbUser = new UserHandler("./db/users");
// Premier utilisateur
const met = [
new Metric(`${new Date("2013-11-04 14:00 UTC").getTim... |
b588ac83b26cc20c38bf5dfa14e6fd96e7c502cd | TypeScript | narainsagar/angular2-demos | /src/app/angular2-multi-component-form-builder/shared/form-field/shared/validator.spec.ts | 2.546875 | 3 | import {
describe,
ddescribe,
expect,
iit,
it
} from '@angular/core/testing';
import {Validator, RequiredValidator, PatternValidator, MinLengthValidator, MaxLengthValidator} from './validator';
describe('Validator', () => {
it('should create an instance', () => {
expect(new Validator('Something')).toBe... |
d62d61f8374341cb780dfad3468febb1eeb2828e | TypeScript | yi-ge/ts-doc-gen-md | /src/ts-ast-utils/jsDoc/getJSDocTagValue/getJSDocTagValue.test.ts | 2.984375 | 3 | import { tagUnindent } from "../../../es-utils/index";
import { createMockSourceFile } from "../../../test-utils/createMockSourceFile";
import { getJSDocTagValue } from "./getJSDocTagValue";
const s = createMockSourceFile(tagUnindent`
/**
* I am the tag less comment
* @customTag
* hello world
*... |
0ec75c6704b700f3c94ba10f33f11d3553ec04aa | TypeScript | cryptoless/BitGoJS | /modules/core/src/v2/coins/celoToken.ts | 2.625 | 3 | /**
* @prettier
*/
import { BitGo } from '../../bitgo';
import { Celo } from './celo';
import { CoinConstructor } from '../coinFactory';
import { coins } from '@bitgo/statics';
export interface CeloTokenConfig {
name: string;
type: string;
coin: string;
network: string;
tokenContractAddress: string;
dec... |
f4baa5c38ee2cfea1ad10d6c464aa7951183df9a | TypeScript | VasoTracker/VasoTracker | /VasoTracker_Software/VasoTracker1.2.0/lib/bokeh/server/static/js/types/core/util/bbox.d.ts | 2.890625 | 3 | import { Arrayable, Rect, Box, Interval } from "../types";
export declare function empty(): Rect;
export declare function positive_x(): Rect;
export declare function positive_y(): Rect;
export declare function union(a: Rect, b: Rect): Rect;
export declare type HorizontalPosition = {
left: number;
width: number;... |
f75b6a20ce390f4dbf67a00e86cc63216d9667a3 | TypeScript | sheenm/task-time-management | /src/utils/neverReached.ts | 2.546875 | 3 | /**
* use this function to on type-checking step forbid to execute code there
* (useful in switch)
*/
export const neverReached = (never: never) => {
throw new Error('did not set all action types in reducer')
}
|
edb0c3f11855b800b636de0801b24b0f6f28ca37 | TypeScript | BulbProject/bulb-project-api | /src/shared/entity/category/item.entity.ts | 2.59375 | 3 | import { Type } from 'class-transformer';
import { IsArray, IsOptional, IsString, ArrayMinSize, ValidateNested, IsObject } from 'class-validator';
import { Classification } from './classification.entity';
export class Item {
@IsString()
public id: string;
@IsString()
public description: string;
@IsObject(... |