Datasets:

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
995eef1cacb70226671b326f5d600cef2d219d00
TypeScript
blink1073/phosphor-tabs
/test/src/tabpanel.ts
2.515625
3
/*----------------------------------------------------------------------------- | Copyright (c) 2014-2015, PhosphorJS Contributors | | Distributed under the terms of the BSD 3-Clause License. | | The full license is in the file LICENSE, distributed with this software. |--------------------------------------------------...
032f4b666e8f05427f7f9bced3d633e028f6bd0e
TypeScript
ManiaciaChao/lab-asm
/lab4/task2/utils/obfuscator.ts
3
3
import { processByLine } from "./utils"; const shuffle = (src: Array<any>) => { const res = Array.from(src); for (let i = res.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [res[i], res[j]] = [res[j], res[i]]; } return res; }; const regex = { blank: /^\s*$/, label: /^.+:\...
1e4530dd60dd8e60c277bc7c42f32aad2cd3aa6e
TypeScript
koreanwglasses/musaic
/src/core/TriGrid.ts
3.234375
3
import { Point, Color } from './Pixel'; import { Grid } from './Grid'; import { HashMap } from './HashMap'; export class TriGrid implements Grid { private width: number; private height: number; private pixels: HashMap<Point, Color>; private allPoints: Array<Point>; private static readonly h = Mat...
dbe1be7df61a97912140cef88de6cd1dd67bb81f
TypeScript
elfrog/json-express
/src/build-type.ts
2.75
3
import parse from './type-parser'; interface BuildTypeRecord { [key: string]: BuildType; } class BuildType { type: string; record: BuildTypeRecord = null; children: BuildType[] = null; optional: boolean = false; constructor(value: string) { const parsed = parse(value, {}) as BuildType; this.typ...
777a0c0faa30efa03b2209db8af7309c30bcfed6
TypeScript
thevtm/walidate
/src/message/standard-validator-error-message.ts
2.609375
3
import { ValidationErrorMessageFn } from "./validator-error-message"; export function stdErrorMsgFn(sufixFn: ValidationErrorMessageFn): ValidationErrorMessageFn { return (args) => { const { propertyPath } = args; const sufix = sufixFn(args); return propertyPath != null ? `Invalid property "${prope...
567dbb7c09dafbffd4a8e75dfbf81c7cbd15e022
TypeScript
tmdgusya/effective-typescript
/ch02/07/05.ts
3.21875
3
type AB_0705 = 'A' | 'B' type AB12_0705 = 'A' | 'B' | 12 // OK, {"A", "B"} is a subset of {"A", "B"}: const ab: AB_0705 = Math.random() < 0.5 ? 'A' : 'B' const ab12: AB12_0705 = ab // OK, {"A", "B"} is a subset of {"A", "B", 12} declare let twelve_0705: AB12_0705 const back_0705: AB_0705 = twelve_0705 // ~~~~ Type 'AB...
2f777e23f88e567de0096b82c13f0ee783633c08
TypeScript
yzw7489757/ceval
/src/utils/regExp.ts
2.6875
3
/** * @desc : desc * @author : ziwen * @date : 2020-6-2 10:55:30 */ import system from '../systemMap'; import { contains } from './index'; const BLACK_LIST_OPERATORS = [] const supportOperator = Array.from(new Set( [].concat( Object.keys(system.unaryOps).filter(item => !/\b\w+\b/.test(item)), Objec...
bb891c98d4d6256e63b45dae7878953a5b2687e0
TypeScript
arthurTemporim/Rocket.Chat.js.SDK
/src/config/messageInterfaces.ts
2.53125
3
/** @todo contribute these to @types/rocketchat and require */ export interface IMessage { rid: string | null // room ID _id?: string // generated by Random.id() t?: string // type e.g. rm msg?: string // text content alias?: string // ?? emoji?: string // emoji code avatar?: string // url groupable?: ...
c904cbde0ec62df6f5c1cc05a465522c2e7fb4bf
TypeScript
mikaelhadler/akpoho-invoicing-software
/frontend/src/store/auth/state.ts
2.609375
3
import { UserCompany, UserProfileSummary, UserSummary } from '../types'; export type LoginData = { username: string; password: string; remember_me: boolean; }; export type CurrentCompany = { name: string; id: string; }; export interface AuthStateInterface { token: string; authFormMessage: { message...
e0c6e0d2c43a9d705700218abf79e6ed8617667f
TypeScript
kivilahtio/skicker-video-player
/test/helpers/testutils.ts
2.8125
3
import * as $ from "jquery"; import { LoggerManager } from "skicker-logger-manager"; import { VideoPlayer } from "../../src/VideoPlayer"; import * as dom from "./dom"; import { IVideoAPIOptions, VideoAPI, VideoPlayerStatus } from "../../src/VideoAPI"; const logger = LoggerManager.getLogger("Skicker.testutils"); /**...
5c387943f0389ca68323c36fb6dec33e6396b3fc
TypeScript
ALuizGomes/Prova_POOII
/numero_1.ts
3.859375
4
// 1- Crie uma classe com os atributos produto, preço, quantidade, os métodos // getters e setters. Crie validação para não aceitar nome em branco, preco e // quantidade com valor 0 (zero). Considerando que são oferecidos descontos pelo // número de quantidade comprada, seguindo a tabela abaixo: // a) Até 10 unidades:...
02ffeb3913bac1ce1fa206bad4f9d96a2aeeb692
TypeScript
MaRu999/ReactCards
/src/game/Card.ts
3.578125
4
export default class Card { value: number; numberLiteral: string; suite: string; color: string; constructor(value: number, suiteString: string) { this.value = value; this.numberLiteral = Card.getLiteral(value); this.suite = suiteString; if (this.suite === "♥" || thi...
b82f4f5f1745ea5a933bf4e8925b6f6e21161941
TypeScript
zeromq/zeromq.js
/src/util.ts
3.609375
4
// A union type of possible socket method names to leave available from the native Socket.prototype type SocketMethods = "send" | "receive" | "join" | "leave" /** * This function is used to remove the given methods from the given socket_prototype * to make the relevant socket types have only their relevant methods. ...
6ee16ca8ac44a63887c8abf759632ddda5159c56
TypeScript
YiZhang-Paul/Focused_UI
/src/core/utilities/time-utility/time-utility.spec.ts
3.078125
3
import { TimeUtility } from './time-utility'; describe('time utility unit test', () => { describe('isLeapYear', () => { test('should return false for non leap years', () => { const years = [1700, 1800, 1900, 2100]; for (const year of years) { expect(TimeUtility.isL...
b8d2fb837800f6cb51c8cf49b715b1508b0a0932
TypeScript
cjosue15/time-track
/src/utils/utils.ts
2.671875
3
import { Menu, MenuEnum, TitleEnum } from '../models/menu.constant'; export const transformTitleToClassName = (text: string): string => { return text.toLowerCase().replaceAll(' ', '-'); }; export const capitalizeFirstLetter = (text: string): string => { return text.charAt(0).toUpperCase() + text.slice(1); }; ...
c37df1e85223441f9221beeff09ad816505376fe
TypeScript
xXD4rkC0d3rXx/task-manager
/client/src/states/selectors.ts
2.515625
3
import { createSelector } from '@reduxjs/toolkit' import { AppState } from './store' export const getGroupedTasks = createSelector( (state: AppState) => state.tasks, (state: AppState) => state.columns, (state: AppState) => state.tags, (tasks, columns, tags) => { const selectedTags = tags.items.filter((tag...
d2eade5165e8d1f60827fcde3ebcbc774d163171
TypeScript
Xzya/easy-models
/__tests__/Example.spec.ts
2.90625
3
import { Model, KeyPaths, ValueTransformer } from "../lib"; describe("Example model using GitHub issues", () => { enum GHIssueState { Open = 0, Closed, } class GHUser extends Model { public readonly username: string; public readonly url: string; public readonly html...
c196752aa3ee854a8b9dee980a5b00c83a20fff5
TypeScript
fhnaseer/printer-management
/src/app/models.ts
2.6875
3
export class Printer { id: number; name: string; available: string; reserved: boolean; } export class SensorData { timestamp: number; values: Values[]; } export class Values { value: number; unit: string; name: string; } export const MockedPrinters: Printer[] = [ { id: 1, name...
d423b07840f595256b5576c69cce6bd068287341
TypeScript
yuriity/color-scheme-editor
/src/app/core/models/theme-color-rule.spec.ts
2.71875
3
import * as tinycolor from 'tinycolor2'; import { ThemeColorRule } from './theme-color-rule'; describe('ThemeColorRule', () => { describe('constructor', () => { describe('"name" initialization', () => { it('should take "tokenColor.name" if it modified', () => { const tokenColor = { name: 'test_nam...
2d8ed16f4c67de85391e8d6d6c217079949c35d5
TypeScript
Dipakgavhale/FrontEnd
/Typescript/Basic/Array/Array_methods/Insert_Delete_Replace_Splice.ts
4.03125
4
/* splice method Insert splice(start: number, deleteCount: number, ...items: T[]): T[]; you want to add element in array then you call this method and pass the start index position, deleteCount is zero,then items. ex arr.splice(1,0,10) you can add multipale element but its add in sequencely like ind...
a147786092b1a3d7b474928680a4f035a645dd8e
TypeScript
PBL-SPS/Student-Companion-APP
/redux/reducers/contactsSlice.ts
2.890625
3
import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { Contact } from "../../screens/ContactScreen"; // Define a type for the slice state interface ContactsState { contacts: Contact[]; } // Define the initial state using that type const initialState: ContactsState = { contacts: [], }; export con...
1e7b70d4e78ce42f5a7d39206b5ed56a823f1f5d
TypeScript
htuna07/food-delivery
/src/app/service/user.service.ts
2.75
3
import { Injectable } from "@angular/core"; import { of, Observable } from "rxjs"; @Injectable({ providedIn: "root", }) export class UserService { users: any[] = [ { _id: "1", name: "Kayne", surname: " Scott", phone: "123123", email: "kayne20", password: "12345", }, ...
fa81f14bf613fac54ee4352be3affb950128bbc0
TypeScript
nionis99/JSCore
/02_oop_part_1/code/src/Bow.ts
3.125
3
import Weapon from "./Weapon"; export default class Bow extends Weapon { constructor(value: number, weight: number, baseDamage: number, baseDurability: number) { super("bow", value, weight, baseDamage, baseDurability); } polish() { const polishedDurabilityModifier = this.getDurabilityModif...
b95218078a6f6dabc191ad0cc5d27e943b1d191c
TypeScript
AndreaNovelli1999/registrazione
/src/providers/auth-service/auth-service.ts
2.8125
3
import { Injectable } from '@angular/core'; //utilizzo md5 per eseguire hash della password import * as md5 from "md5"; import {Observable} from 'rxjs/Observable'; //utilizzo classe storage per salvare e controllare la password dal login import { Storage } from '@ionic/storage'; import 'rxjs/add/operator/map'; export ...
1efeafff541b69a9360e9203c50da5e3e1ad8a95
TypeScript
sobiemir/resistor
/src/app/toolbox/base/builder-operations.ts
2.546875
3
import { Renderer2 } from '@angular/core'; import { Point2D } from 'src/app/math/point2d'; import { DiagramService } from 'src/app/pages/diagram/diagram.service'; export abstract class BuilderOperations { protected static _snapToGrid = true; protected static _snapToGridSize = 10; public constructor( protect...
c678b61f44e2a78823ef5750c1c2d5e58f4ba350
TypeScript
ByDSA/datune
/packages/strings/src/strings/scales/chromatic/spec/Cases.ts
2.609375
3
/* eslint-disable camelcase */ import { LangId } from "lang"; import { AEOLIAN_b1, COMMON, MAJOR, MINOR, Scale } from "scales/chromatic"; import stringify from ".."; type Case = [LangId, Scale, string]; export function getManualCases(): Case[] { return [ [LangId.ES, MAJOR, "Mayor"], [LangId.ES, MINO...
fdb274dece44a4b8f8a0976a9a463258928bc167
TypeScript
niilante/egret-core
/src/extension/gui/managers/IPopUpManager.ts
2.71875
3
////////////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2014-present, Egret Technology. // All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // /...
e6d5ea79f1ffeaa0969ba5340162b7c003d74949
TypeScript
IronOnet/codebases
/codebases/bestbuy.ca/src(1)/client/utils/imageUtils/index.ts
2.6875
3
import {objectFlattener} from "../../utils/flatteners"; import {ResponsiveImageType, ImageResType} from "models"; import {IBrowser as ScreenSize} from "redux-responsive"; import {ProductVideo} from "models"; /** * getIncorrectlyMappedImageProps. * * Note: this function will return the incorrect image size and should...
7bab5a87aa5dcd5d089b2b9ad3c8a9231a4b5480
TypeScript
jaredwolff/nativescript-sse-fail
/app/main-view-model.ts
2.609375
3
import { Observable } from "tns-core-modules/data/observable"; import { ObservableArray } from 'tns-core-modules/data/observable-array'; import { SSE } from 'nativescript-sse'; export class HelloWorldModel extends Observable { private _list: ObservableArray<any>; private _sse: any; private _counter: num...
77b199f571460bfb5da00ec177ad31f37686490f
TypeScript
LuizValdiero/lf-web
/src/app/services/lexical-analyzer.service.ts
2.578125
3
import { Injectable } from '@angular/core'; import { AF, compute, copyAf, determineAf, joinAf, renameAf, StateAF } from '../models/automato'; import { LA, TokenAF, TokenDefinition, validTokenDefinition } from '../models/er'; import { ConvertErToAfService } from './convert-er-to-af.service'; @Injectable({ providedIn:...
6441362611827b2f88eaab2c5268e076266ebf65
TypeScript
mongodb-js/mongosh
/packages/async-rewriter2/src/error-codes.ts
2.78125
3
// Note: Codes are shared with the old async rewriter for now, hence starting at 10012 /** * @mongoshErrors */ enum AsyncRewriterErrors { /** * Signals the use of a Mongosh API call in a place where it is not supported. * This occurs inside of constructors and (non-async) generator functions. * * Examp...
fb48dec24abe60a9790183126880dbaa4583b7e4
TypeScript
Oyelowo/coding_practice
/sol/anchor/tic-tac-toe/tests/tic-tac-toe.ts
2.5625
3
import * as anchor from "@project-serum/anchor"; import { Program } from "@project-serum/anchor"; import { TicTacToe } from "../target/types/tic_tac_toe"; import { expect } from "chai"; describe("tic-tac-toe", () => { // Configure the client to use the local cluster. anchor.setProvider(anchor.Provider.env()); c...
f6b2176d1fde427d5428f4b0dcf1f6e18f62db3f
TypeScript
VirtoCommerce/vc-cms-page-designer
/cms-designer/src/app/modules/theme/state/theme.reducer.spec.ts
2.5625
3
import { BlockSchema, ColorControlDescriptor } from 'src/app/modules/shared/models'; import * as fromTheme from './theme.reducer'; import * as themeActions from './theme.actions'; describe('Theme reducer', () => { describe('undefined action', () => { it('should return the default state', () => { ...
542bd8303d2f71ba6db04fd683e1ee4072a74b83
TypeScript
panthe/saga-login-firebase-rest
/src/utils/fetch/types.ts
2.71875
3
export enum EHTTPMethodsTypes { GET= 'GET', POST= 'POST', PUT= 'PUT', PATCH= 'PATCH', DELETE= 'DELETE' } export interface FetchParams { url: string; params?: string; } //TODO: Substitute the generics Types in the fetch Functions export interface IHttpResponse<T> extends Response { parsedBody?: T; }
93f533e5394cfcd49b3b11944f00c69457854f30
TypeScript
kennysama/reactAtomic
/src/helpers/order-items.ts
2.6875
3
import { TOrderItemCode, TPartsNumber, ISubCategory } from '../types/order-items'; import { getSubCategories } from '../lookups/sub-categories'; import { getOrderCatalog } from '../lookups/order-items'; export function getOrderItem( category: string, pieces: string[], isDouble = false, brand: string = '', ): T...
585a72f5328f14c7c99a111ddb6489295c1e4c1d
TypeScript
bekeeeee/clean-code-architecture-TS
/src/web/lib/abstract-application.ts
2.609375
3
import { Container, interfaces } from 'inversify' export enum MorganMode { DEV = 'dev', COMMON = 'common', TINY = 'tiny', SHORT = 'short', COMBINED = 'combined', } export interface IAbstractApplicationOptions { containerOpts: interfaces.ContainerOptions morgan: { mode: MorganMode } } export abstr...
8985d5289505cafc63a5ccdd15f9134e22de07f8
TypeScript
emil14/reaflow
/src/helpers/crudHelpers.ts
2.9375
3
import { EdgeData, NodeData, PortData } from '../types'; /** * Helper function for upserting a node in a edge. */ export function upsertNode( nodes: NodeData[], edges: EdgeData[], edge: EdgeData, newNode: NodeData ) { const oldEdgeIndex = edges.findIndex(e => e.id === edge.id); const edgeBeforeNewNode = ...
7b5a225c46c4caf1fb9a312be6516c31b3837334
TypeScript
umairmustafa753/restaurant-managment-system
/client/store/Reducers/menu.ts
2.6875
3
import ActionTypes from "../Actions/ActionTypes"; const INITIAL_STATE = { menu: [] }; const menuList = (state = INITIAL_STATE, action) => { switch (action.type) { case ActionTypes.GET_MENU: { return { ...state, menu: action.payload }; } default: return state; } }; ...
ce4a070ce51784e707b8e45710296e7941da5391
TypeScript
donaldducky/advent-of-code
/2020/src/day1/day1.ts
3.375
3
import * as fs from 'fs'; import * as path from 'path'; const nums = fs .readFileSync(path.join(__dirname, 'input.txt'), 'utf8') .toString() .trim() .split('\n') .map(i => parseInt(i, 10)); console.log('Part 1:', part1(nums)); console.log('Part 2:', part2(nums)); function part1(nums) { const numMap = num...
799cdcab4f0fb8515adfb5f27cf027c1acf1d557
TypeScript
itsrainingmani/yass
/src/string.extensions.ts
3.796875
4
interface String { center(maxLength: number, fillString?: string): string; } String.prototype.center = function (maxLength: number, fillString?: string): string { fillString = fillString || " "; // If fillString is undefined, use space as default return this.length >= maxLength ? this.toString() : this.padStart((th...
807731697383dbbd193f5fcfc6e1eee8ca665ff5
TypeScript
JKCamus/Q-S
/算法/review/796.旋转字符串.ts
3.171875
3
/* * @lc app=leetcode.cn id=796 lang=typescript * * [796] 旋转字符串 */ // @lc code=start function rotateString(s: string, goal: string): boolean { if (s.length !== goal.length) return false let SGoal = s + s if (SGoal.includes(goal)) { return true } else { return false } }; // @lc code=end
02942fb3b159cbd7c9a5d280d53a45d3e4d07629
TypeScript
esentri/js-transformer-functions
/test/StringTo.test.ts
2.96875
3
import {ArrayBufferEqual} from './helper/ArrayBufferFunctions' import {StringToArrayBuffer, StringToBase64, StringToHexString, StringWithBinaryDataToBase64} from '../src/transformer-functions' import {ArrayBufferHelloWorld, Uint8ArrayHelloWorld} from './testData/ArrayBuffers' import {BinaryString, HelloWorldString} fro...
92e61cc2821f7f44f385bf0aac0db5d560614782
TypeScript
redmagebr/redpgBeta
/app/Kinds/Classes/SheetInstance.ts
2.71875
3
class SheetInstance { public id : number = 0; public gameid : number = 0; public folder : string = ""; public name : string = ""; public values : Object = {}; public lastValues : string = "{}"; public creator : number = null; public creatorNickname : string = "???#???"; public styl...
d1e70badbffd7b25de5fda868d7de8d38a09a190
TypeScript
MateuszMaslanka1/Organizations
/src/app/core/organizations-dialog/check-elements.service.ts
2.828125
3
import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root' }) export class CheckElementsService { constructor() { } alphabeticallyGoupedNames = {}; lenghtOfColumn(alphabet) { return Math.ceil(alphabet.length / 4); } sortElement(nameList: string[]) { nameList.sort(); return...
1e58409254d2869eefefeb3e964ce3ba942a346f
TypeScript
toucheqt/Remote-API-Web-Reference-for-Java-Enterprise-Applications
/restty-app/frontend/src/main/frontend/src/app/model/endpoint.ts
2.609375
3
import { Log } from './log'; import { Parameter } from './parameter'; import { Response } from './response'; /** * Entity that contains information about endpoints. * @author Ondrej Krpec */ export class Endpoint { id: number; path: string; method: string; description: string; lastRun: string; lastRunS...
424c987e8b58a2bb8e15875dcf5112acfb8a3aab
TypeScript
Rohan-Deshamudre/Smart-traffic-management-system
/frontend-web/src/helper/auth.ts
2.859375
3
const jwt = require('jwt-decode'); export module Auth { export var role: string = ''; export function saveToken(token) { sessionStorage.setItem('token', token) } export function getToken(): string { return sessionStorage.getItem('token') } export function eraseToken(): void ...
708006ebc0ce7b44abef7e8e452de23157a3f16a
TypeScript
solidity-by-example/solidity-by-example.github.io
/src/pages/function-selector/index.html.ts
2.8125
3
// metadata export const version = "0.8.20" export const title = "Function Selector" export const description = "Example of how function selectors are computed" export const keywords = ["function", "functions", "selector", "selectors"] export const codes = [ { fileName: "FunctionSelector.sol", cod...
abb0432662b55d37bcc0ab6ca4cc45630b9e1089
TypeScript
RaduMatees/EmployeesWorkManager
/Frontend/src/api/ApiClient.ts
2.5625
3
import axios, { AxiosInstance } from 'axios' import { TypeRegister, TypeLogin } from '@/interfaces/type-auth' export default class ApiClient { public restClient: AxiosInstance private static _instance: ApiClient constructor() { this.restClient = axios.create({ baseURL: `http://localhost:5000`, h...
1fc347d119b791c6e0d2a9ef51da1a08db42cc50
TypeScript
jdforsythe/bloch
/src/chain/chain.ts
3.015625
3
import { getGenesisBlock, hashBlock } from './block'; import { getCurrentBalance } from './wallet'; import { Blockchain, Block, SignedTransaction } from './interface'; /** * Genesis of the blockchain */ export function getInitialBlockchain(address: string): Blockchain { const chain: Blockchain = { blocks: [ge...
fcb70f721f11bf8b1a9d606167bf950e45e44115
TypeScript
freewind-demos/typescript-jest-test-async-callback-demo
/add.ts
2.78125
3
export default function asyncAdd(a: number, b: number, callback: (result: number) => void): void { new Promise<number>(resolve => { resolve(a + b); }).then(result => callback(result)); };
c15c461239c1b6bc7eeeb4733ca16200a10ecc30
TypeScript
dmlaziuk/ylf-di-workshop
/example5/locator.ts
2.671875
3
export class Locator { private static dictionary: Map<string, any> = new Map(); static getService<T>(token: string): T { return this.dictionary.get(token); } static register(token, instance) { this.dictionary.set(token, instance); } }
88751bc266978ec9bc81a241ac99377c0a949f9c
TypeScript
tetious/LarkyPrintWeb
/custom_typings/eventSource.d.ts
2.78125
3
interface EventSourceMap { "error": Event; "message": MessageEvent; "open": Event; } interface EventSourceConfig { withCredentials?: boolean; } interface EventSource extends EventTarget { readonly readyState: number; readonly url: string; readonly withCredentials: boolean; readonly CONNECTING: number;...
3699947a36e4aa5dba4b8a2d8786a2f916c327f5
TypeScript
Dave9819/few100-lab-DAH
/src/utils.ts
2.765625
3
export interface IBillData { billBeforeTip: number, tipPercentageTxt: string, tipPercentage: number, tipAmount: number, totalBill: number } export const formatter = new Intl.NumberFormat('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }); export function getSelectionStart(el...
6424214373a9a46e7162ba46c36cbf32d64aa411
TypeScript
ChristineH122/ITSecurity3
/webserver/src/entity/Sensor.ts
2.5625
3
import {Entity, Column, PrimaryGeneratedColumn} from 'typeorm'; @Entity({name: "Sensor"}) export class Sensor { @PrimaryGeneratedColumn({name: "Id"}) public id: number; @Column({name: "Name"}) public name: string; @Column({name: "Value"}) public value: string; }
bdfc88d4f1e3de5fac7c7dc7b41fb8225f9f143f
TypeScript
seba-ban/simple-movie-api
/src/routes/movies.ts
2.578125
3
import express, { Request, Response, NextFunction } from 'express'; import { Op } from 'sequelize'; import { celebrate, Joi, Segments, isCelebrateError } from 'celebrate'; import { Movie } from '../models/Movie'; import { fetchMovieDetails } from '../helpers/movieApi'; import { authenticate } from '../middlewares/authe...
d87a0cbbe8a373a6a76dbbd66a477dc29fe5062c
TypeScript
noahlange/superjucks
/packages/superjucks/src/tests/nodes/Import.ts
2.625
3
import test from 'ava'; import { lex } from '../../Lexer'; import * as Nodes from '../../nodes/index'; import { parse } from '../../Parser'; import { parse as p } from '../helpers/parse'; test('should throw on unnamed wildcards', t => { t.throws(() => p("{% import * from 'bar.sjk' %}")); }); test('should throw on i...
e0e0db62961189d25cf6c42a7ae55fba6c85a4bd
TypeScript
sanwu/Wonder.js
/converter/common/Vector2.ts
3.4375
3
export = class Vector2 { public static create(x, y):Vector2 ; public static create():Vector2 ; public static create():Vector2 { var m = null; if (arguments.length === 0) { m = new this(); } else { m = new this(arguments[0], arguments[1]); } ...
2d0f0068f48de5a4fe8ae089180ff904b86b9d5b
TypeScript
cmprog/web-sandbox
/Beez/Hive.ts
2.5625
3
import { Property } from '../Framework/Property.js'; import { FixedUpdatable } from '../Framework/Updatable.js'; import { TickCountdownGenerator } from '../Framework/Generators.js'; import { Collection } from '../Framework/Collection.js'; import { TemplateComponent, TemplateContext } from '../Framework/Bindings.js'; im...
c35f9baa2048975152cca7c440accfc52848fe4e
TypeScript
future4code/Joao-Meira
/logic-exercises/src/exercicio6.ts
2.703125
3
export function revertString(string : string) { return string.split("").reverse().join(""); } console.log(revertString("escola"));
43e7ac460e1beed0aae4bceb5eedf389a934541e
TypeScript
nivinjoseph/n-defensive
/test/general.test.ts
3.15625
3
import { ArgumentNullException } from "@nivinjoseph/n-exception"; import * as assert from "assert"; import { given } from "../src/index"; suite("General", () => { // let arg: any; // let argName: any; let exceptionHappened: boolean; let exceptionType: string; let reason: any; setup(() => ...
3e53d184e97cb06c5783676cf31acc8b10411b5c
TypeScript
joyned/hiremeweb-angular
/src/app/services/alert-message/alert-message.service.ts
2.5625
3
import { Injectable } from '@angular/core'; import { Subject } from 'rxjs'; @Injectable({ providedIn: 'any' }) export class AlertMessageService { constructor() { } private loaderSubject = new Subject<MessageState>(); loaderState = this.loaderSubject.asObservable(); public infoMessage(message: string, deta...
e7b68afa1c207ef1df81530ec06baa0d21c889ff
TypeScript
githbq/hbq-koa2-base
/src/common/ftpHelper.ts
2.578125
3
import * as FtpHelper from 'ftp-helper' import ioHelper from './ioHelper' let { pathTool } = ioHelper function getPrefix() { let prefix = appUtils.isDev() ? '/' : '/' return prefix } /** * ftp操作辅助 */ export default { FtpHelper, async uploaDistFiles() { return await this.uploadFil...
553e78994f5153996b9bc7dc6439206671639efd
TypeScript
PastaBolo/strovo
/strovo-api/src/users/users.service.ts
2.546875
3
import { Injectable, Inject } from '@nestjs/common'; import { Model } from 'mongoose'; import { User } from './user'; @Injectable() export class UsersService { constructor(@Inject('UsersModelToken') private readonly UserModel: Model<User>) { } async findAll(): Promise<User[]> { const users = await this.UserM...
90e766c2dde45c443c1f5fc45efbd61ca1bd7536
TypeScript
sony/mapray-js
/packages/mapray/src/animation/ComboVectorCurve.ts
3.140625
3
import Time from "./Time"; import Curve from "./Curve"; import Interval from "./Interval"; import Invariance from "./Invariance"; import Type from "./Type"; import ConstantCurve from "./ConstantCurve"; import TypeMismatchError from "./TypeMismatchError"; import AnimUtil from "./AnimUtil"; /** * 複合ベクトル関数 * * 複数の数値関...
b5af0ad369e99b873e0bc6680707c1d67912b8bb
TypeScript
thetlwinoo/gateway-portal
/src/main/webapp/app/shared/model/customers.model.ts
2.53125
3
import { Moment } from 'moment'; export interface ICustomers { id?: number; customerName?: string; creditLimit?: number; accountOpenedDate?: Moment; standardDiscountPercentage?: number; isStatementSent?: boolean; isOnCreditHold?: boolean; paymentDays?: number; phoneNumber?: string; ...
d450049ba488ef3b6e583ec2f233fb91476bd3dc
TypeScript
void-aurora/toolkit
/packages/just/src/utils/async.ts
3.171875
3
/** * Run async functions at the same time in specified limit number. * @param actions the list of async functions. * @param limit the limit number of actions can be run at the same time. */ export async function asyncParallel<T>( actions: readonly (() => Promise<T>)[], limit: number = 8, ): Promise<T[]> { if...
b9a2dfdd992e98b51df1b80930b303237433bf47
TypeScript
thundercore/ThunderStorage
/backend/src/modules/DataSaver/services/dataSaver.repository.ts
2.5625
3
import { Injectable } from '@nestjs/common' import { InjectRepository } from '@nestjs/typeorm' import { Repository } from 'typeorm' import { MetadataEntity } from '../entities/Metadata.entity' import { ContentType } from '../constants/ContentType' import { ContentEncoding } from '../constants/ContentEncoding' import { ...
e73a0024316f081290c9400b5c5e8ca1c26c8925
TypeScript
CodeMan99/wotblitz.js
/request.ts
2.734375
3
import fetch, {Response} from 'node-fetch'; import * as querystring from 'querystring'; import * as util from 'util'; type Region = | '.com' | '.asia' | '.eu' | '.ru' type Language = // "en" — English | 'en' // "ru" — Русский | 'ru' // "pl" — Polski | 'pl' // "de" — Deutsch | 'de' // "fr" — Français | '...
cbc057fcf2e3a15295e92258a36e93e632e6d025
TypeScript
ctagayun/ConsolidatedRepoGit2
/_00_Angular2-Kurata-Routing-With-Notes(VG)/APM12-Start-Advance-Routing-Lazy-Loading(Module12)old/src/app/user/auth-guard.service.ts
2.65625
3
import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, RouterStateSnapshot, Router, Route, CanActivate, CanActivateChild, CanLoad } from '@angular/router'; import { AuthService } from './auth.service'; @Injectable() export  class AuthGuard implements CanActivate, CanActivateChild, CanLo...
b72c898ca28206418fd9da21ebec4fb9c05bed76
TypeScript
isnack/passaro-urbano
/src/app/carrinho.service.ts
2.734375
3
import { of } from 'rxjs'; import { ItemCarrinho } from './shared/itemCarrinho.model'; import { Oferta } from './shared/oferta.model'; export class CarrinhoService { private itens: ItemCarrinho[] = []; public getItens(): ItemCarrinho[] { return this.itens; } public adicionarItemCarrinho(oferta: Oferta): ...
f4dece683d601f6ff52856e1c2a38f5c443076fd
TypeScript
jhoijune/algorithm
/src/Programmers/connectIslands.ts
3.296875
3
import {} from 'module'; class DisjointSet<T> { private _parent: Map<T, T> = new Map(); makeGroup(element: T): T { this._parent.set(element, element); return element; } find(element: T): T { let curr: T = element; while (this._parent.get(curr)! !== curr) { curr = this._parent.get(curr)!...
eae32ab009242aa3eecc20fb40d9ef7da31b1fe5
TypeScript
madanlimbu/hubspot-unopinionated-api
/src/api/file/query.ts
2.671875
3
import { Query, RequestParam } from '../Interface'; /***************** Request Type *****************/ export interface FileByIdRequest extends RequestParam { pathParams: { fileId: number | string; }; } export interface FileSignedUrlRequest extends RequestParam { pathParams: { fileId: number | string; ...
1bb775cefc7075df1bddd5a57883456917b740f6
TypeScript
ysraelmoreno/probable-fortnight
/src/modules/courses/repositories/fakes/FakeCoursesRepository.ts
2.671875
3
import { uuid } from 'uuidv4' import Course from '@modules/courses/infra/typeorm/entities/Course' import ICreateCourseDTO from '@modules/courses/dtos/ICreateCourseDTO' import IFindCourseByNameAndTeacherDTO from '@modules/courses/dtos/IFindCourseByNameAndTeacherDTO' import ICourseRepository from '@modules/courses/repos...
61ad5e7848c9d0e894fa9e14b8a0568f816f22c9
TypeScript
demo-source/wasaby-controls
/tests/ControlsUnit/display/Abstract.test.ts
2.9375
3
import { assert } from 'chai'; import { Abstract as Display, Collection, CollectionItem, Enum as EnumDisplay, Flags as FlagsDisplay } from 'Controls/display'; import { List, Enum as EnumType, Flags as FlagsType } from 'Types/collection'; describe('Controls/_display/Abstract', () => { ...
954d421ddd5a79a7b9ea27be1ea04c011d9dd476
TypeScript
arifmedamine/cyberBlogApp
/src/issues/issues.service.ts
2.53125
3
import { Injectable, NotFoundException } from '@nestjs/common'; import { PrismaService } from 'src/core/prisma/prisma.service'; import { CreateIssueInput } from './dto/create-issue.input'; import { UpdateIssueInput } from './dto/update-issue.input'; @Injectable() export class IssuesService { constructor(private rea...
6a35d3ce0742de76466690dd1b97b93ddd3adc47
TypeScript
Jxck/jxck.io
/labs.jxck.io/react/chat/src/model/store.ts
2.9375
3
import { createStore } from "redux"; // Actions type LoginAction = { type: "LOGIN"; username: string }; type LogoutAction = { type: "LOGOUT" }; type InputMessageAction = { type: "INPUT_MESSAGE"; message: string }; type onWebSocketOpenAction = { type: "ON_WS_OPEN" }; type onWebSocketMessageAction = { type: "ON_WS_MESSA...
e1eaa2710f233f6b78ba128b3afdb3efd1032861
TypeScript
agnoam/maxathon_server
/src/config/mongo.config.ts
2.59375
3
import mongoose, { Mongoose } from 'mongoose'; import configData from './mongo-data.config.json'; export module DBDriver { export async function connect(): Promise<boolean> { try { const connected = await this.connectDB(configData.uri); console.log("Connected to mongo database successfully"); ...
b667c21d539a34d5eb820cf1ea3f5f42b22d8bf7
TypeScript
dfe-analytical-services/explore-education-statistics
/src/explore-education-statistics-common/src/utils/number/formatPretty.ts
3.546875
4
import countDecimalPlaces from '@common/utils/number/countDecimalPlaces'; import clamp from 'lodash/clamp'; export const defaultMaxDecimalPlaces = 2; /** * Return a formatted {@param value} in a pretty format * i.e. 10,000,000.000. * * {@param unit} can be used to add a unit to the * formatted value. We will try...
9ce6a29e8213326eb88ae5a38156172d7e2e930e
TypeScript
arraycto/i2Bank
/src/hooks/validateMoney.ts
2.890625
3
export default function (money: string, event: KeyboardEvent) { const reg = /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/; if (event.key==='.' && reg.test(money+'.00')){ money += '.'; }else if (event.key === 'Backspace' && money.length > 0) { money = money.slice(0, -1); }else...
9a7b854fb74bbb2fcfc3839f4b9ccfd7a1e34224
TypeScript
webnicer/clueless
/src/players/types.ts
2.546875
3
export type PlayerPiecesType = { [pieceId: string]: boolean }; export type PlayerType = { id: string; name: string; isProtected: boolean; pieces: PlayerPiecesType; };
d651ccf7640cde3b2f953139843cdb168e26d9e4
TypeScript
milesj/emojibase
/packages/core/src/fromUnicodeToHexcode.ts
3.234375
3
import { SEQUENCE_REMOVAL_PATTERN } from './constants'; import { Hexcode, Unicode } from './types'; /** * This function will convert a literal emoji Unicode character into a dash separated * hexadecimal codepoint. Unless `false` is passed as the 2nd argument, zero width * joiner's and variation selectors are remove...
52dab39af21996b5e36ce2e460706991292ec052
TypeScript
ZhcZack/data-structure-and-algorithm-in-javascript
/src/data-structure/hash.ts
3.625
4
import { randomNumber } from "../algorithm/util"; interface HashTable { insert(value: number): void remove(value: number): void search(value: number): boolean } type Hashable = string | number export class ZHash implements HashTable { private tables: Hashable[][] constructor() { this.tab...
6eee76c77fd41dc0e0f5460ee6cd023ee0123017
TypeScript
ShotaroOkada/fileupload_express_api
/src/controller/storage/postStorageController.ts
2.578125
3
import { Request, Response, NextFunction } from "express"; import { bucket, db } from "../../firebase"; import fs from 'fs'; // storageに画像をアップロードする export function postStorageController(req: Request, res: Response, next: NextFunction) { const files: Express.Multer.File[] = req.files['Files']; const STORAGE_ROO...
279662798a7880d4fb8b0cd9631ab0abbe512acd
TypeScript
dappcenter/decrybe
/src/store/DisputeCreateStore.ts
2.640625
3
import { observable, action, computed} from "mobx" import {RootStore} from './RootStore' class DisputeCreateStore { @observable title: String = ""; @observable task: String = "" @observable briefDescription: String = "" @observable description: String = "" constructor(public root: RootStore) { this.root = root...
c99de1c5259b37b93f3eeb6a4b1071089704fecd
TypeScript
Snosky/mame-hi-extractor
/src/Extractor/shinobi.ts
2.6875
3
import AbstractExtractor from "../AbstractExtractor"; import Extractor from "../Decorator/Extractor"; @Extractor({ name: 'shinobi' }) export default class Shinobi extends AbstractExtractor { protected charset = { 0x22: '.', 0x23: '\'', 0x25: '/', 0x26: '(', 0x27: ')', ...
51d609fcbf963ebc7ad82eb59f147fea6e0e489f
TypeScript
aichouramine/survey-generator-angular
/src/app/question/question-base.ts
2.6875
3
export class QuestionBase<T> { value: T; key: string; label: string; required: boolean; order: number; activePage: number; activePageOnClick: number; controlType: string; showIf: any; longValuesLabels?: boolean; header?: string; maxLength: number; content?: string; constructor(options: { ...
29ce39de87c9b6b8d71d5c443b717faaa95b9572
TypeScript
rodwyn/es6-store
/app/scripts/components/Window.ts
3.015625
3
interface Window { isMobile: () => boolean; redirect: (url: string) => void; onResize: (callback: () => void, time: number) => void; } window.isMobile = () => 768 > Math.max( 0 || document.documentElement.clientWidth, window.innerWidth ); window.redirect = (url: string) => { window.location.href = url; }; ...
87a00e3262e829499356db30379738a4b712fd9c
TypeScript
nickcaplan/cards-app
/src/main/webapp/app/shared/model/card.model.ts
2.640625
3
import { Moment } from 'moment'; export interface ICard { id?: number; cardNumber?: number; bankName?: string; expiryDate?: Moment; } export class Card implements ICard { constructor(public id?: number, public cardNumber?: number, public bankName?: string, public expiryDate?: Moment) {} }
00d91ec8b686ad8d40b45028b109a1f41bdde778
TypeScript
vonsky104/react-test-interview
/src/store/actions.ts
2.671875
3
import { FETCH_BANDS, RAISE_ERROR, SortedByBandType, REMOVE_ERRORS, PREPARE_ACCORDIONS_STATE, OPEN_ACCORDION, CLOSE_ACCORDION, OPEN_ALL_ACCORDIONS, CLOSE_ALL_ACCORDIONS } from './action_types'; import { Dispatch } from "redux"; import { axios } from "../config/axios-control"; import { generateId...
2afb56964e14ffad747f69e3f345a5421d8cf2c3
TypeScript
mxjp/rvx
/test/disposable.ts
2.9375
3
import test from "ava"; import { Disposable } from "../src"; test("create empty", t => { const disposable = new Disposable(); disposable.dispose(); t.pass(); }); test("create with logic", t => { const disposable = new Disposable(() => t.pass()); disposable.dispose(); }); test("add logic", t => { const disposab...
1c58856ca8916c636d85a23042589248a00864b2
TypeScript
sniller27/ng6-proj
/src/app/app.component.ts
2.578125
3
import { Component } from '@angular/core'; import {NgForm} from '@angular/forms'; //httpclient module for making requests import { DataService } from './data.service'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent { /...
ed140fe0b1d964f24497ff116fd6938e06c29d72
TypeScript
andersfischernielsen/rosdistro-dependency-analysis
/fetch.ts
2.671875
3
import monk from 'monk'; import fs from 'fs'; import { safeLoad, safeDump } from 'js-yaml'; import { Issue, GHComment } from './Issue'; type Fraction = { owner: string; repository: string; bugs: number; dependencyIssues: number; concurrencyIssues: number; memoryIssues: number; dependencyFraction: number;...
a5a403992f2ce0edece01db35730496759089214
TypeScript
Lhhpw0204/teris-game
/src/core/Teris.ts
2.84375
3
import { Shape, Point } from "./types" import { getRandom } from "./viewer/util" import { SquareGroup } from "./SquareGroup" export class TShape extends SquareGroup{ constructor(_centerPoint: Point, _color: string){ super([{ x: -1, y: 0}, { x: 0, y: 0}, { x: 1, y: 0}, { x: 0, y: -1}], _centerPoint, _color...
a472fa21fee48352d59cff42515961b7edd43cda
TypeScript
MikaStark/json-api
/projects/json-api/src/lib/interfaces/json-api-links.ts
3.296875
3
import { JsonApiMeta } from './json-api-meta'; /** * ### Links * * Where specified, a `links` member can be used to represent links. * The value of this member **MUST** be an object (a “links object”). * * Within this object, a link **MUST** be represented as either: * * a string containing the link’s ...
296bce57102ef02b3a759ddabe9c64d89c2f25a0
TypeScript
levi9-summer-workshop/Team-1
/online-survey-creator-client/src/app/question/question.model.ts
2.703125
3
import { Answer } from "../answer/answer.model"; export class Question { public id: number; public text: string; public surveyAnswers: Answer[]; public questionType: string; constructor (id: number, text?: string, surveyAnswers?: Answer[], questionType?: string) { this.text = text; ...
1f53ae481a33b7e3a12f2b45f01a101f8c2852c4
TypeScript
jattapol456/madoobaan-backend
/src/types/index.d.ts
2.59375
3
import * as admin from 'firebase-admin' type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & { [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>> }[Keys] type RequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & ...
a1363ca252276b3e2228f857ee0958ddfc7a0193
TypeScript
angularcity/hd-handson
/src/app/product/store/product.reducer.ts
3.015625
3
import { Product } from "./product.model"; import { ProductActions, ProductActionTypes } from "./product.action"; export interface ProductState { products: Product[]; homeDepotProducts: Product[]; availableProductIDs: {}; currentProductID: number | string; currentAvailableProduct: Product; } const INITIAL_ST...
210ce833b11fa268d95da71040c1ac5bbdbb9e4e
TypeScript
sciety/api-prototype
/update/src/rdf.ts
2.625
3
import { concatAll } from 'fp-ts/Monoid' import * as Ord from 'fp-ts/Ord' import { DataFactory } from 'n3' import { BaseQuad, BlankNode, Literal, NamedNode, Quad, Term, Variable } from 'rdf-js' import { rdf, xsd } from './namespace' import * as S from './string' export const { namedNode, literal, quad } = DataFactory ...
bb345130a698dbbe5f2f50976eeab018210c5bce
TypeScript
robinsondotnet/vuex-plugin-firemodel
/dist/cjs/auth/api/auth.d.ts
2.875
3
/** * These functions are really just wrappers around the available actions * which Firemodel provides but are type-safe and often are a more easily * used means to achieve **Firebase** _auth_ functions */ import { ActionCodeSettings, UserCredential, IdTokenResult, AuthCredential } from "@firebase/auth-types"; impo...
8355e3afbeb2636bc1862945e2149ad9691148a1
TypeScript
poppa/bitsy-ts
/src/lib/token.ts
3.53125
4
export const enum Type { Symbol, Operator, Equal, Number, LeftParen, RightParen, Keyword, Comment, } export const typeMap = [ 'Symbol', 'Operator', 'Equal', 'Number', 'LeftParen', 'RightParen', 'Keyword', 'Comment', ] export interface Token { readonly line: number readonly column: ...