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 |
|---|---|---|---|---|---|---|
6b3357476515d008cc215d15b458702398bb90c1 | TypeScript | d0rianb/RunAndGun | /src/grid.ts | 3.515625 | 4 | interface NeihboorObject {
top?: Cell
right?: Cell
bottom?: Cell
left?: Cell
}
class Grid {
rows: number
cols: number
cells: Array<Cell>
constructor(cols: number, rows: number) {
this.rows = rows
this.cols = cols
this.cells = []
this.createCells()
... |
7d7a2fbd4dd124e76e291d051e6d1d1b30e46df9 | TypeScript | just-do-halee/rusultts | /src/rusultts.ts | 3.8125 | 4 | // (c) 2021 just-do-halee(=Hwakyeom Kim)
/**
* kind of internal subject(ok or err)
*/
export type ResultObject<T> = {
readonly error?: Error;
readonly value: T;
};
/**
* international interface
*/
export interface IResult<T, E> {
readonly isOk: boolean;
readonly isErr: boolean;
// Returning internal val... |
a0124133d2e1a9dc930abfc4c9dff0a5f8e24713 | TypeScript | oliwheeler/lage | /src/logger/TaskLogger.ts | 2.71875 | 3 | import { Logger } from "./Logger";
import { TaskData } from "./LogEntry";
export class TaskLogger {
logger: Logger;
constructor(private pkg: string, private task: string) {
this.logger = new Logger();
}
info(msg: string, data?: TaskData) {
this.logger.info(msg, { package: this.pkg, task: this.task, .... |
3bcfe5f1277c2ebb789a13dfdac409788254ac24 | TypeScript | keptn-contrib/notification-service | /src/subscribers/subscriber.service.ts | 2.5625 | 3 | import { Injectable, Inject } from '@nestjs/common';
import { ISubscription } from './subscriber.type';
import { Logger } from 'winston';
import { Slack } from './subscription/slack';
import { Teams } from './subscription/teams';
import { WebexTeams } from './subscription/webexTeams';
import { InjectConfig, ConfigServ... |
e62b447b3c0f34e7818288b351d55b293f5f5a48 | TypeScript | data-driven-forms/react-forms | /packages/react-form-renderer/src/data-types/data-types.d.ts | 2.703125 | 3 | export type DataType = 'integer'|'float'|'number'|'boolean'|'string';
interface IdataTypes {
INTEGER: 'integer';
FLOAT: 'float';
NUMBER: 'number';
BOOLEAN: 'boolean';
STRING: 'string';
}
declare const dataTypes: IdataTypes;
export default dataTypes;
|
b6a0ef0d12960440db9720463ea80290697a0029 | TypeScript | DevOstium/paginacao-ng-bootstrap | /src/app/pages/usuarios/usuarioADs/pipe/fitrarPorNome.pipe.ts | 2.65625 | 3 | import { Pipe, PipeTransform } from '@angular/core';
import { Usuario } from '../../domain/usuario.model';
@Pipe({name : 'filtroPorNome'})
export class FiltroPorNome implements PipeTransform {
transform(usuariosAD: Usuario[], nomeUsuario : string) {
nomeUsuario = this.removerAcentos(nomeUsuario.... |
16ade24a78625451e0702e49de8c3b47dee2a40b | TypeScript | IHateWait/HateWait-Web | /src/lib/utils/businessHourModule.ts | 2.96875 | 3 | import React from 'react';
function businessHourModule(
same: boolean,
monBreak: string,
tueBreak: string,
wedBreak: string,
thuBreak: string,
friBreak: string,
satBreak: string,
sunBreak: string,
startTime: string,
endTime: string,
monStartTime: string,
monEndTime: st... |
d68f94dbdfc857c07bd65cd10dabff7ec37a00b1 | TypeScript | DavidKk/goaseasy | /@goaseasy/workweixin-robot/types/robot.ts | 2.6875 | 3 | export interface Settings {
apikey: string
}
export type MessageType = 'text' | 'markdown' | 'news'
export type SendMessageParams<T extends MessageType> = T extends 'text'
? {
msgtype: T
text: {
mentioned_list?: string[]
mentioned_mobile_list?: string[]
content: string
}
... |
18b7b8af9901f3ce09f26a9108c8004b8879bd18 | TypeScript | NanoWorkspace/core | /src/app/Embed.ts | 2.703125 | 3 | import Discord from "discord.js"
import bot from "../globals/bot"
import Logger from "./Logger"
Logger.load("file", __filename)
export interface EmbedTemplates {
default: Discord.MessageEmbedOptions
success: Discord.MessageEmbedOptions
error: Discord.MessageEmbedOptions
log: Discord.MessageEmbedOptions
[k: ... |
79b33ebc7363f1a2c6e045f047907b8cdae08d56 | TypeScript | luania/Canvas-TypeScript | /6-FrictionForce/script/Ball.ts | 3 | 3 | import { PVector } from "./PVector";
export class Ball {
color: string = "rgba(0, 0, 0, 0.5)";
position: PVector = new PVector(10, 10);
speed: PVector = new PVector(0, 0);
acceleration: PVector = new PVector(0, 0);
size: number = 1;
mass: number = 1;
step() {
this.speed.add(this.ac... |
c81f3538a87de20a34ec99b316a723e342efd18b | TypeScript | Pintec10/Angular_math-speed-game | /src/app/answer-highlight.directive.ts | 2.59375 | 3 | import { Directive, ElementRef } from '@angular/core';
import { NgControl } from '@angular/forms';
import { map, filter } from 'rxjs/operators';
@Directive({
selector: '[appAnswerHighlight]'
})
export class AnswerHighlightDirective {
constructor(
private el: ElementRef, //by dependency injection, gives a re... |
c712f6fbbe352c50039c65848d2ad6c5a01aaa3b | TypeScript | mixrich/scripts | /src/utils/duration/duration.ts | 3.3125 | 3 | export function duration(timeInSeconds: number): string {
const seconds = timeInSeconds % 60;
const res: string[] = [];
if (seconds) {
res.push(`${seconds}sec`);
}
const minutes = Math.floor(timeInSeconds / 60) % 60;
if (minutes) {
res.push(`${minutes}min`);
}
const ho... |
52930b227e3ac0767561f545801e24975a07f64d | TypeScript | suconghou/code-snippet | /js/fnv1a.ts | 3.390625 | 3 | // modified from https://github.com/sindresorhus/fnv1a
const base62Map = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
// fnv1a 64 to base62
export default (str: string) => {
return base62(Number(fnv1a64(str)));
}
export const base62 = (num: number): string => {
const arr: Array<string> = ... |
132b16d29181e5ef5018e0f2ad6a39232cd56556 | TypeScript | mareksl/ts-backend-playground | /src/models/contact.model.ts | 3.140625 | 3 | import { Document, Schema, Model, model, SchemaDefinition } from 'mongoose';
import validator from 'validator';
export interface IContact extends Document {
type: string;
firstName?: string;
lastName?: string;
title?: string;
email?: string;
phone?: string;
link?: string;
}
// HACK
interface ContactSchem... |
b9cc5da69fd3e1913217fcd9be4dbafd2d69e7ee | TypeScript | kouz75/jovo-framework | /jovo-platforms/jovo-platform-twilioautopilot/test/AutopilotResponse.test.ts | 2.5625 | 3 | import { AutopilotResponse } from '../src/core/AutopilotResponse';
process.env.NODE_ENV = 'UNIT_TEST';
describe('test hasSessionEnded()', () => {
let response: AutopilotResponse;
beforeEach(() => {
response = new AutopilotResponse();
});
test('action contains Listen action', () => {
response.actions ... |
b0a3fcb3a53bb339c617fc6d2abe349c356c3a94 | TypeScript | TrendingTechnology/sunrise-1 | /src/interfaces/Deref.test.ts | 3.328125 | 3 | import { isDereferencable, deref } from './Deref'
describe('Deref', () => {
test('isDereferencable should check if the value satisfyes the Dereferencable interface', () => {
const x = { deref: () => 1 }
const y = 1
const z = { a: 1 }
expect(isDereferencable(x)).toBe(true)
ex... |
0f0e76794c84711f31e6440c0f9e348884531fc5 | TypeScript | ngnijland/adventofcode2020 | /src/day9/index.ts | 3.359375 | 3 | import fs from "fs";
import assert from "assert";
import path from "path";
function validatePart(numbers: number[], sum: number): boolean {
for (let i = 0; i < numbers.length; i++) {
for (let j = i + 1; j < numbers.length; j++) {
const a = numbers[i];
const b = numbers[j];
if (a !== b && a + b... |
ffb3422a39ceec536438fbe5d7edad676bdbef1c | TypeScript | Andret0701/GY521 | /CurrentBestmain.ts | 2.875 | 3 |
//let offSets: number[] = [2791,593,1065,122,-29,1] // GY-521
let offSets: number[] = [-2694,593,485,75,15,21] // MPU-6050
let selfCal: boolean = microbit_GY521.calibrate_Sensors(offSets); // required to increase accuracy of readings
if (!selfCal) {
basic.showLeds(`
# . . # .
# . # # #
# . . # .
# . # # #
#... |
0af800c75964d7830fedd8d742ac6f124962cd43 | TypeScript | beenotung/shopping-cart-demo | /src/helpers.ts | 2.859375 | 3 | export type Product = {
id: number
name: string
}
export type SelectedProduct={
product:Product
quantity:number
}
const AllProducts: Product[] = [
{ id: 1, name: 'Apple' },
{ id: 2, name: 'Banana' },
{ id: 3, name: 'Cherry' },
]
export function getProducts(): Promise<Product[]> {
return new Promise(re... |
f2bf40c58c72e63180c4ed03a7c590f0046c5e15 | TypeScript | jamescryer/kata | /src/004 array compare constant time/constanttime.test.ts | 3.265625 | 3 | import constanttime from './constanttime';
describe('hello', () => {
test('arrays are the same', () => {
const a = [121, 144, 19, 161, 19, 144, 19, 11];
const b = [121, 144, 19, 161, 19, 144, 19, 11];
expect(constanttime(a, b)).toEqual(true);
});
test('arrays are the similar but n... |
0ea466a52a910ebf7a4b36d8caf37e1454c0330e | TypeScript | cborac/node-discord | /lib/structures/message/MessageReaction.d.ts | 2.625 | 3 | import { Message } from './Message';
import Collection from '../../Collection';
import { ReactionUsersController } from '../../controllers/reaction';
import { Snowflake } from '../../types';
import { Emoji } from '../Emoji';
import { BaseStruct, GatewayStruct } from '../base';
import { Member } from '../member/Member';... |
fbc50447d46ec64d270d3b1c662e96d3b2627a31 | TypeScript | rodriguesl3/timesheet | /src/store/Login/reducer.ts | 2.734375 | 3 | import { Reducer } from 'redux';
import { LoginState, LOGIN_INITIAL_STATE, LoginTypes } from './types';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const loginReducer: Reducer<LoginState> = (state: LoginState = LOGIN_INITIAL_STATE, action: any) => {
switch (action.type) {
case LoginTypes.LOGIN... |
fa3de6a98ffc4d9cbbe584d660ca60f803bbdeb0 | TypeScript | danielwerg/r6api.js | /src/methods/findById.ts | 2.5625 | 3 | import { getToken } from '../auth';
import fetch from '../fetch';
import { PlatformAllExtended, UUID, IOptionsDocs } from '../typings';
import { getURL, getAvatars } from '../utils';
export interface IProfile {
profileId: UUID;
userId: UUID;
idOnPlatform: UUID | string;
platformType: PlatformAllExtended;
nam... |
27996a0e3d9e9a865a1bb08bcc70c60469d8c280 | TypeScript | zacharysnewman/minesweeper-console-typescript | /src/Typescript/tsTools.ts | 3.3125 | 3 | import { Tile } from "../State/Tile";
export const tileArrayEquals = (a: Tile[], b: Tile[]): Boolean =>
Array.isArray(a) &&
Array.isArray(b) &&
a.length === b.length &&
a.every((aTile, atTileIndex) => aTile.equals(b[atTileIndex]));
// export const tileArrayToTileMap = (tileArray: Tile[]): Tile[] => {
// // l... |
39ff9e3f906b5ae606d76d39856e46fb6da9cc47 | TypeScript | jiameng123/entities | /src/decode.ts | 2.828125 | 3 | import htmlDecodeTree from "./generated/decode-data-html";
import xmlDecodeTree from "./generated/decode-data-xml";
import decodeCodePoint from "./decode_codepoint";
// Re-export for use by eg. htmlparser2
export { htmlDecodeTree, xmlDecodeTree };
const enum CharCodes {
NUM = 35, // "#"
SEMI = 59, // ";"
... |
64184bbbbddea2eae6ff947c68f033046b374ea3 | TypeScript | kristinka-skl/Programming-Language-Benchmarks | /bench/algorithm/json-serde/1.ts | 2.703125 | 3 | import { createHash } from "https://deno.land/std/hash/mod.ts";
function printHash(data: any) {
const str = JSON.stringify(data);
const hasher = createHash('md5');
hasher.update(str);
console.log(hasher.toString());
}
async function main() {
let fileName = Deno.args[0] || "sample";
let n = +De... |
0212b32878bfceab8d4730c0df6c574ae0be9ab4 | TypeScript | fabiansdp/itfest-frontend-7.0 | /api/checkout.ts | 2.640625 | 3 | import { AxiosInstance } from "axios";
import { MerchStoreItem } from "interfaces/merch-store";
import { ApiError, ApiResponse } from "interfaces/api";
import {
CheckoutErrorStatus,
} from "interfaces/checkout";
export async function checkout(
axios: AxiosInstance,
items: Array<MerchStoreItem>,
line?: string,
... |
2f8e90cec8c459a853841bad5306446dcd43df4d | TypeScript | Heverton/newza-frontend | /src/app/menuitem.ts | 2.84375 | 3 | export class MenuItem {
nome: string;
descricao: string;
url: string;
icone: string;
constructor(nome, descricao, url, icone){
this.nome = nome;
this.descricao = descricao;
this.url = url;
this.icone = icone;
}
} |
a322ce005332e4da24c641ab10ca9989f571171f | TypeScript | guoyu07/egret-target-bricks | /template/PublicBrickEngineGame/Res/script/core/render/spriteSheetCache.ts | 2.765625 | 3 | // class SheetSprite
// {
// __nativeObj : BK.Sprite;
// contentSprite : BK.Sprite;
// size : BK.Size = {width:0,height:0};
// textureInfo:BK.SheetTextureInfo;
// currTexturePath : string;
// //sprite format
// flipU:number = 0 ;
// flipV:number = 1;
// stretchX:number = 1;
// ... |
c505c5f810719b887708a7926ee2d21ea62811bd | TypeScript | kemokemo/ts-worker-sample | /01-simple_worker/src/dom/main-thread.ts | 2.65625 | 3 | // Copy from the awesome book 'https://www.oreilly.co.jp/books/9784873119045/'
// This is my learning code. :-) kemokemo
var worker = new Worker("worker-thread.js");
worker.onmessage = (e) => processCommandFromWorkerThread(e.data);
window.onload = () => {
let postButton = document.getElementById("post-to-worker")... |
70ff2949165b16c9667dd661ee47a51b0ca4f3f3 | TypeScript | saefullohmaslul/Nodejs-DDD-Pattern | /src/database/seeds/user.seed.ts | 2.546875 | 3 | import faker from 'faker'
import { getRepository } from 'typeorm'
import { UserEntity } from 'database/entities'
import { log } from 'app/library/debug/debugger.lib'
export const userSeeder = () => {
return new Promise(async (res, rej) => {
const createdData: UserEntity[] = []
try {
const userRepositor... |
d079989f9d1d455616f13a8b44bd0f629b2602d9 | TypeScript | dpschen/languagetools | /packages/template-ast-types/src/stringify.ts | 2.796875 | 3 | import type {
AttributeNode,
DirectiveNode,
ElementNode,
Node,
RootNode,
SimpleExpressionNode,
TextNode,
} from '@vue/compiler-core'
import {
isAttributeNode,
isDirectiveNode,
isElementNode,
isInterpolationNode,
isRootNode,
isSimpleExpressionNode,
isTextNode,
isCommentNode,
} from './asser... |
145da03d77e676669a1e30391e6a826f6a9bda96 | TypeScript | ninadingole/sls-typescript-api | /src/app.ts | 2.546875 | 3 | import express from 'express';
import compression from 'compression';
import bodyParser from 'body-parser';
import HomeController from './controller/home.controller';
import BaseController from './core/base.interface';
export default class App {
public express: express.Application;
constructor(controllers: ... |
06fca884c3d93f9d125e7e6549ff73d17f2556e0 | TypeScript | deathandmayhem/jolly-roger | /tests/unit/imports/lib/calendarTimeFormat.ts | 2.671875 | 3 | import { assert } from 'chai';
import { calendarTimeFormat } from '../../../../imports/lib/calendarTimeFormat';
describe('calendarTimeFormat', function () {
it('formats dates today correctly', function () {
const now = new Date(2021, 7, 6, 19, 26);
assert.match(calendarTimeFormat(now, now), /Today at 7:26\sP... |
2294fc2aa702077b267733cc1f8400a7ec3b0da1 | TypeScript | eduardosm7/microhangry | /preference-service/src/config/database.ts | 2.90625 | 3 | import { createConnection, getRepository, Repository, ObjectType, EntitySchema } from 'typeorm';
/**
* @namespace Config
* @class DatabaseConfig
*/
export default class DatabaseConfig {
public static connectionName: string = `default`;
public static async connect() {
for (let i = 0; i < 5; i++) {
... |
e72a37ffd2ef052daa3f80418e3a9a20fe81ba75 | TypeScript | efureev/mu | /src/object/select.ts | 3.5 | 4 | /**
* Get value by deep key in object(array)
*
* @example
* const obj = {
key : 0,
label: 'Root',
items: {
one: {
key : 1,
label : 'One',
val : 111,
items : {
two: {
... |
c07e59e315aa3a2d1ff44bf48de7af93ab316fc0 | TypeScript | markglattback/finer-dev-test | /pages/api/createPerson.ts | 2.625 | 3 | import knex from 'knex';
import knexConfig from '../../config/knex';
import { FormFields, Gender } from "../../components/Form/types"
import validator from 'validator';
import createTable from '../../lib/createTable';
export default async (req, res) => {
const { body }: { body: FormFields } = req;
let sanitised:... |
205d2813eef961ea90cdff074acbb24c61a6ac50 | TypeScript | laijunlinfz/bookmarksync | /src/utils/treeUtils.ts | 2.828125 | 3 | /**
* 对比本地和服务器书签数据,找出需要更改的数据
*/
let delList: string[] = [];
let updateList: any[] = [];
let createList: any[] = [];
let createCloudList: any[] = [];
const checkDelList = (itemLocal: any, cloudList: any[] = [], recentBookmark: any[] = []): void => {
const { id = '' } = itemLocal || {};
// console.log(... |
ef5b723826c1505799beef02260b3ee53e9d0f78 | TypeScript | ra81/XioPorted | /XioTest/7_PageParserFunctions.ts | 2.75 | 3 | //
// Сюда все функции которые парсят данные со страниц
//
/**
* Пробуем оцифровать данные но если они выходят как Number.POSITIVE_INFINITY или 0, валит ошибку
* @param value строка являющая собой число больше 0
*/
function numberfyOrError(value: string) {
let n = numberfy(value);
if (n === Number... |
6a72dd5433d9ecb4ce6fbab06525a24f6c07876f | TypeScript | keesey/simple-digraph | /src/isProperSubsetOf.ts | 2.703125 | 3 | import { VertexSet } from "./VertexSet";
export const isProperSubsetOf = (a: VertexSet, b: VertexSet): boolean => {
if (a.size >= b.size) {
return false;
}
return [...a].every((v) => b.has(v));
};
export default isProperSubsetOf;
|
d634ad19206213575578e207a1289602a77ee12b | TypeScript | lodz-university-of-technology-masi/Magenta | /web/src/app/metrics-processor/services/distance-calculator.service.ts | 2.875 | 3 | import {Injectable} from '@angular/core';
import {MousePosition} from "../../models/mouse-position";
@Injectable({
providedIn: 'root'
})
export class DistanceCalculatorService {
private positions: MousePosition[];
private isProcessing: boolean = false;
private scrollDistance: number = 0;
constructor() {
... |
166effdc6125fbc5902db0892de45f072f7ce04a | TypeScript | paolodenti/factoryjs | /index.ts | 3.0625 | 3 | import MyCounter from "./myCounter";
const main = async () => {
const c = MyCounter({ name: "some counter ..." });
c.setVal(3);
c.add();
c.sub(6);
console.log(`${c.getName()}: ${c.getVal()}`);
c.add(50);
setTimeout(c.log, 2000);
};
main().catch(err => {
console.log(err);
});
|
3c80b4ae8ef4934522d8ead61fe88ec6dba25d18 | TypeScript | WooodHead/nest-mikro-crud | /src/utils/walk-path.func.ts | 3 | 3 | export function walkPath(
obj: Record<string, unknown>,
path: string,
callback?: (obj: Record<string, any>, key: string) => unknown
) {
/**The keys to approach the target object */
const keys = path.split(".");
/**The key to the value of the target object */
const key = keys.pop()!;
// approach the targ... |
280c6fd3eea5243fb549f348e00e5bafa204ac64 | TypeScript | dhruvisompura/HappyIslandDesigner | /app/ui/loadingScreen.ts | 2.546875 | 3 | let element;
// this is a hack until React gets added
function createElement() {
let div = document.createElement("div");
div.id = 'bobContainer';
let img = document.createElement("img");
img.src = "static/gif/bob-loading.gif";
img.id = "bob";
let p = document.createElement("p");
p.style.fontFamily = "... |
606adf8d425d2e74beec2493c9594b371a21aeab | TypeScript | jelbaz-ledger/ui | /packages/native/src/components/Text/getTextStyle.ts | 3.015625 | 3 | export type TextTypes =
| "h1"
| "h2"
| "h3"
| "highlight"
| "emphasis"
| "body"
| "cta"
| "link"
| "tiny"
| "subTitle"
| "navigation"
| "tag";
export default function getTextStyle({
type,
bracket,
}: {
type: TextTypes;
bracket?: boolean;
}): {
fontFamily: string;
fontSize: number;
... |
b6d3ea4c0ec2716a702918581267c4029a8bf631 | TypeScript | justinlubin/ts-game | /systems/Input.ts | 2.5625 | 3 | class Input implements FixedSystem {
readonly requirements =
new Set<Component>([Component.PHYSICS, Component.USER_CONTROL]);
update(w: World, dt: number): void {
w.forall(this.requirements, e => {
let xVel = 0;
if (w.model.keys.has(Key.RIGHT)) {
xVel += w.physics[e].walkSpeed;
}
... |
b44228faa7c79d0e8ef51700cf4b3141c4c04977 | TypeScript | njaegergrassl/Haushaltsbuch | /src/providers/category/category.ts | 2.640625 | 3 | import { Injectable } from '@angular/core';
import firebase from 'firebase/app';
import {CategoryEntry} from "../../models/category-entry";
// this class is handling the categoriex in the firebase database
@Injectable()
export class CategoryProvider {
public categoryListRef: firebase.database.Reference;
// this ... |
614f419a954ad4b37682db45a381dda508ae1a9c | TypeScript | khteh/Node.JSRestAPI | /src/webapi.core/Domain/Entities/Student.ts | 2.78125 | 3 | import { Entity, Column, ManyToMany, JoinTable } from "typeorm"
import { EntityBase } from "./EntityBase"
import { Teacher } from "./Teacher"
@Entity()
export class Student extends EntityBase {
@Column({ length: 256 })
public firstName: string
@Column({ length: 256 })
public lastName: string
@Colu... |
b94d753610d1077b24fa02fa4e5d557e9b677bba | TypeScript | RahulKwani/BasicApp | /src/app/components/user-form/user-form.component.ts | 2.609375 | 3 | import { Component } from '@angular/core';
import { FormControl,FormArray, FormGroup, FormBuilder, Validators } from '@angular/forms';
import { FormsModule } from '@angular/forms';
import * as cloneDeep from 'lodash/cloneDeep';
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ '... |
b33d66e7885d3d8bfd229b62a43ceeaf38043fba | TypeScript | doug-martin/nestjs-query | /packages/query-graphql/src/types/subscription-filter-input.type.ts | 2.703125 | 3 | import { Filter, Class } from '@nestjs-query/core';
import { Field, InputType } from '@nestjs/graphql';
import { ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';
import { SubscriptionFilterType } from './query';
export interface SubscriptionFilterInputType<DTO> {
filter?: Filter<DTO... |
bd7368429c5b5f4395ba688a86f58507810148d7 | TypeScript | TarunKhandelwal/application | /event_practice/src/main/emitter/event_emitter.ts | 2.796875 | 3 | import * as events from 'events';
import {EventType} from '../common/event_type';
export class CommonEventEmitter{
private eventEmitter: events.EventEmitter;
private static instance: CommonEventEmitter;
private constructor(){
this.eventEmitter = new events.EventEmitter();
}
public registe... |
49bb4b4f16e79887b1acce004e19f4ad8b11fd6a | TypeScript | rajarshidatta007/novopay-assignment | /src/main/webapp/app/shared/model/wallet.model.ts | 2.578125 | 3 | export interface IWallet {
id?: number;
balance?: number;
owenerId?: number;
passbookId?: number;
}
export class Wallet implements IWallet {
constructor(public id?: number, public balance?: number, public owenerId?: number, public passbookId?: number) {}
}
|
fe214a840f97d34a236e1e69a1478ff48759766a | TypeScript | kuzzleio/kourou | /test/commands/instance/list.test.ts | 2.515625 | 3 | import { expect, test } from "@oclif/test";
import { execSync } from "child_process";
const TEST_TIMEOUT = 50000;
const PRINT_STDOUT = false;
const checkStackDetails = (
stdout: string,
line: number,
expectedValues: any
) => {
const splittedOutput: string[] = stdout.split("\n");
const stackLine: string[] =... |
1bd9a8e11669ecb3ac480ff98a9a20a3aea47649 | TypeScript | classroomMisiones/proyecto-fs-grupo5-g5m | /PILMoney/src/app/Modelos/localidad.model.ts | 2.5625 | 3 | export class Localidad {
public Id_localidad : number
public Nombre : string
public Id_provincia : number
constructor(
// _Id_localidad : number,
// _Nombre : string,
// _Id_provincia : number
)
{
this.Id_localidad = 0;
this.Nombre = "";
this.Id_provincia = 0;
// this.Id_lo... |
2f8eec62ac3860e73cd8eef2be468107b3ac4678 | TypeScript | looker-open-source/components | /packages/components/lib/DataTable/getNextFocus.d.ts | 2.75 | 3 | /**
* Returns the next focusable inside an element in a given direction
* @param direction 1 for forward -1 for reverse
* @param element the container element
*/
export declare const getNextFocus: (direction: 1 | -1, element: HTMLElement, vertical?: boolean | undefined) => HTMLElement | null;
|
af3f6f156590cdaac9bd692ec2c13b6de45642b2 | TypeScript | My42/RRS-skeleton | /test/commandLines.test.ts | 2.734375 | 3 | import * as chai from "chai";
import * as chaiAsPromised from "chai-as-promised";
import exec, { cp, yarn, mkdir } from '../src/CommandLines';
import { readFile as _readFile, unlink,readdir as _readdir } from 'fs';
import { remove } from 'fs-extra';
import { promisify } from 'util';
import YarnCommands from "../src/enu... |
a1f6e57149841020d8098851c1d6073d901ba7f8 | TypeScript | karol7531/Link-Collection-App | /Main/ClientApp/src/Infrastructure/CustomReactHooks.ts | 2.9375 | 3 | import Cookies from "js-cookie";
import { useState } from "react";
export function useCookie<T>(
cookieName: string,
defaultValue: T
): [T, (newValue: T) => void] {
let value = Cookies.getJSON(cookieName) as T;
if (value === undefined) {
Cookies.set(cookieName, JSON.stringify(defaultValue));
value = de... |
3c8194e547fa8d970b86cc5f0c2a33945c82597e | TypeScript | AdanDuM/INE5421 | /src/SyntaxTree.ts | 3.640625 | 4 | export type SingleExprOperator = {
type: 'star' | 'plus' | 'optional';
value: DoubleExprOperator | SingleExprOperator | string;
};
export type DoubleExprOperator = {
type: 'concat' | 'or';
left: DoubleExprOperator | SingleExprOperator | string;
right: DoubleExprOperator | SingleExprOperator | string;
};
expor... |
6c989e03923051523dd000fd3b6f33ca4d8a0556 | TypeScript | Jocelyn10/vue-app-netlify | /src/assets/rules.ts | 3.203125 | 3 | export const Rules = {
required: (value: string) => !!value || "Required",
alphabeticOnly: (value: string) => {
if (value) {
const pattern = /^([a-zA-Z ' ` ~ ñ á é ü ô č]*)$/;
return pattern.test(value) || "Must contain only letters";
}
return true;
},
email: (value: string) => {
i... |
a211c2261715cbcef3ec486f7c7ca9494edbd904 | TypeScript | clctianya/SFramework_LayaAir | /manager/timer/timer-interval.ts | 2.828125 | 3 | /**
* @author Sun
* @time 2019-08-10 20:02
* @project SFramework_LayaAir
* @description 定时执行
*
*/
export class TimerInterval {
private m_interval_time: number;//毫秒
private m_now_time: number;
constructor() {
this.m_now_time = 0;
}
/**
* 初始化定时器
* @param interval 触发间隔... |
6cedc0bad5c708b7b1a90feba053514922f0b2d0 | TypeScript | iLunts/vstroyke-invoice | /src/app/pipes/summ-to-string.pipe.ts | 2.609375 | 3 | import {
Pipe,
PipeTransform
} from '@angular/core';
@Pipe({
name: 'summToString'
})
export class SummToStringPipe implements PipeTransform {
// money: any;
// price: any;
// rub: any;
// kop: any;
// litera = '';
// sotny = '';
// desatky = '';
// edinicy = '';
// minus = '';
// k = 0;
// ... |
979f39376caaf15f02917027fa8e479ab6989f83 | TypeScript | wolfcoder/tutorial-social-login-vue | /packages/server/src/controller/auth/dialogs-controller.ts | 2.515625 | 3 | import {
FacebookDialogProvider,
GitHubDialogProvider,
GoogleDialogProvider,
oAuthDialogEndPoint,
} from "@plumier/social-login"
import Tokens from "csrf"
import { authorize, bind, response } from "plumier"
//this controller provide social media auth endpoint that will be opened by a browser dialog
//c... |
9268c85bb92fb6a5861359c2afbd9fa87e964753 | TypeScript | jbagaresgaray/dev-test-nodejs | /src/api/auth/validator/authenticate.ts | 2.515625 | 3 | import { NextFunction, Request, Response } from 'express'
import { body as checkBody, validationResult } from 'express-validator/check'
import HttpStatus from 'http-status-codes'
import isEmpty from 'lodash/isEmpty'
const validateLogin = (req: Request, res: Response, next: NextFunction) => {
const auth = req.headers... |
1b7b09e72a8062067bb8c067bed0e188f26dbdfc | TypeScript | web-scrobbler/web-scrobbler | /src/core/object/pipeline/coverartarchive/coverartarchive.ts | 2.78125 | 3 | import Song from '@/core/object/song';
import { MusicBrainzSearch } from './coverartarchive.types';
import { debugLog } from '@/core/content/util';
/**
* Fetch coverart from MusicBrainz archive.
* @param song - Song instance
*/
export async function process(song: Song): Promise<void> {
if (song.parsed.trackArt) {
... |
004bf3efa9179aba8ec59b30e3896c9e8459a457 | TypeScript | itziarZG/FirstStepsWithAngular | /Module1 Exercices/typescript-importer/src/classes/xmen.class.ts | 2.703125 | 3 | export class Xmen {
constructor(public nombre: string, public clave: string) {}
imprimir() {
console.log(`${this.nombre} es ${this.clave}`);
}
}
|
2169401f7a25618ac6b0b330c6cedc900853d79d | TypeScript | ansteh/sec-data | /cockpit/src/app/market/lib/commit.ts | 3 | 3 | import * as _ from 'lodash';
const POSITION = { trade: null, count: 0, invested: 0, net: 0, balance: 0, avgPricePerShare: 0, history: [] };
const PROPERTIES = _.keys(POSITION);
const getAvgPrice = (series) => {
return _
.chain(series)
.map('price')
.mean()
.round(2)
.value()
};
export const lon... |
67977cf73d82a771b8dd70105df95ef0c20422df | TypeScript | roblox-ts/roblox-ts | /src/Project/functions/cleanup.ts | 2.65625 | 3 | import fs from "fs-extra";
import path from "path";
import { tryRemoveOutput } from "Project/functions/tryRemoveOutput";
import { PathTranslator } from "Shared/classes/PathTranslator";
function cleanupDirRecursively(pathTranslator: PathTranslator, dir: string) {
if (fs.pathExistsSync(dir)) {
for (const name of fs.r... |
8863acccab23ac3bda94a4a6bd98956266f6667c | TypeScript | blmhemu/rustor | /sapper/src/components/Metadata.ts | 2.765625 | 3 | import { writable } from 'svelte/store';
export type Metadata = { name: string; is_dir: boolean; path: string };
function createSelected() {
const { subscribe, set, update } = writable(new Set<Metadata>());
let add = (item: Metadata) => update(f => { f.add(item); return f });
let reset = () => set(new Se... |
168fadc5afdf1588f8c117f4cddf82a794fee052 | TypeScript | KhiaLech/InterfaceProgramming_2019_Sem2 | /Week 3 Exersise/index.ts | 2.828125 | 3 | import axios from 'axios';
var url = "";
interface PostInterface {
userId: number;
id:number;
title:string;
body:string;
}
axios.get<PostInterface[]>('http://jsonplaceholder.typicode.com/posts')
.then(function(response){
let data = response.data;
for(var i = 0; i<data.length;i++){
let... |
076e96c194b7b279a4f09fab57e145199624d6ea | TypeScript | AdrianPrzychodzien/fit_Calculator | /src/redux/circum/circum.reducer.ts | 2.71875 | 3 | import { CircumActionTypes } from './circum.types';
import { addNewMeasurement } from '../utils';
import {
CircumReducer,
SetBodyFatCircumAction,
SetCircumferencesAction
} from '../../interfaces/interfaces';
const INITIAL_STATE = {
waist: 0,
hips: 0,
neck: 0,
circumferences: []
};
type CircumReducerActi... |
8016ec34e8d48cb05fbeba98e2b35374bdf72df0 | TypeScript | serenity-js/serenity-js | /packages/core/src/events/RetryableSceneDetected.ts | 2.75 | 3 | import type { JSONObject } from 'tiny-types';
import { ensure, isDefined } from 'tiny-types';
import { CorrelationId } from '../model';
import { Timestamp } from '../screenplay';
import { DomainEvent } from './DomainEvent';
/**
* Indicates that the test runner will retry running the test scenario upon failure.
*
*... |
df091b0b9796386cdb69bdafa30485db3bdff8ad | TypeScript | ofk8vb/Typescript-Oldschool-Web-Framework | /src/models/Model.ts | 3.46875 | 3 | import { AxiosPromise, AxiosResponse } from 'axios';
interface ModelAttributes<T> {
set(value: T): void;
getAll(): T;
get<K extends keyof T>(key: K): T[K];
}
interface Sync<T> {
fetch(id: number): AxiosPromise;
save(data: T): AxiosPromise;
}
interface Events {
// () => void means callback function
on(e... |
87ab55a2d64a47bc4c08a5b672fa54f897747fc0 | TypeScript | JakeDame/Employee-Search-Application | /Employee Search Application/ClientApp/src/app/models/employee.ts | 2.515625 | 3 | import * as moment from 'moment';
export interface Employee {
firstName: string;
lastName: string;
jobTitle: string;
age: moment.Moment;
startDate: moment.Moment;
endDate: moment.Moment;
}
|
92ca7173c963a79c98f2b0a92f1cfb77fadbf773 | TypeScript | ezolla/linear-style | /src/core/app-themes.ts | 2.640625 | 3 | export const appThemeNames = ["dark"] as const;
export type AppTheme = {
colors: {
background: string;
text: string;
lighterBackground: string;
};
};
export const appThemes: Record<typeof appThemeNames[number], AppTheme> = {
dark: {
colors: {
background: "#121212",
text: "#cccccc",
... |
e85af85afe110600f619f16da09fe3d57bfcf0d4 | TypeScript | littlebitselectronics/pxt | /pxtblocks/fields/field_utils.ts | 2.71875 | 3 | namespace pxtblockly {
export namespace svg {
export function hasClass(el: SVGElement, cls: string): boolean {
return pxt.BrowserUtils.containsClass(el, cls);
}
export function addClass(el: SVGElement, cls: string) {
pxt.BrowserUtils.addClass(el, cls);
}
... |
401c4598a74f53ed70f8b9827c3220f7adcf5b98 | TypeScript | dakom/pure3d-typescript | /src/lib/exports/common/array/Array.ts | 2.6875 | 3 | import {mat4, quat} from "gl-matrix";
export const createVec2 = () => new Float64Array(2);
export const createVec4 = () => new Float64Array(4);
export const createVec3 = () => new Float64Array(3);
export const createMat4 = () => {
const data = new Float64Array(16);
mat4.identity(data);
return data;
}
e... |
a1babf2327a9498ef8a4956dd4cda265cb2bf515 | TypeScript | teytattze/nestjs-microservices | /libs/shared/src/utils/objects.util.ts | 2.859375 | 3 | export const deleteObjectField = <T = Record<string, any>>(
value: T | T[],
field: keyof T,
) => {
if (Array.isArray(value)) {
return value.map((obj) => {
delete obj[field];
return obj;
});
}
delete value[field];
return value;
};
|
b9eaef05fe8f9aa05e18699ac5e1d414b234af35 | TypeScript | pnp/sp-dev-fx-webparts | /samples/react-multilist-grid/src/webparts/spfxReactGrid/reducers/SiteReducer.ts | 2.828125 | 3 | import {
GOT_WEBS,
GET_LISTSFORWEB_SUCCESS,
GET_FIELDSFORLIST_SUCCESS
} from "../constants";
import * as _ from "lodash";
import { Site } from "../model/Site";
const INITIAL_STATE: Array<Site> = [];
function gotWebs(state: Array<Site> = INITIAL_STATE, action: any = { type: "" }): Array<Site> {
let site... |
ee13398ad4edb4f1f74cfda52f803733ba58ecb0 | TypeScript | Vheissu/ssr-engine | /src/transformers/title.ts | 2.71875 | 3 | import {replaceString} from './utils';
import {RenderOptions, TransformerContext} from '../interfaces';
/**
* Copy style content of the title from the aurelia instance DOM to the rendered HTML
* @param {string} html
* @param {TransformerContext} transformerCtx
* @param {RenderOptions} options
* @returns {string}
... |
89fb35aa90ea378179bfda7c214e29ad1b70ad7b | TypeScript | nehctuk/Casino-TypeScript | /ts/CardGames.ts | 2.96875 | 3 | abstract class CardGames {
protected player: Player;
protected deck: Deck;
public CardGames(aPlayer: Player) {
this.deck = new Deck();
this.deck.shuffle();
}
public getPlayer(): Player {
return this.player;
}
public setPlayer(player: Player): void {
this.pl... |
bfdf22797698de2d55b19bfc4945c681a8107d18 | TypeScript | nbarrett/ng-ekwg | /server/serenity-js/screenplay/tasks/ramblers/common/requestParameterExtractor.ts | 2.71875 | 3 | import { PerformsActivities, Task } from "@serenity-js/core";
import { Log } from "../../common/log";
import { WalkRequestParameters } from "../../../../models/walkRequestParameters";
const ramblersDeleteWalks = "RAMBLERS_DELETE_WALKS";
const ramblersWalkCount = "RAMBLERS_WALKCOUNT";
const ramblersFileName = "RAMBLERS... |
d7bc5269639999d37dd7ce22f456e04265498ec3 | TypeScript | gmfe/gm-pc | /packages/react/src/component/grid/types.ts | 2.953125 | 3 | import { HTMLAttributes } from 'react'
interface GutterSize {
/** 需要提供最小尺寸,小的时候才不会乱。暂时这么解决 */
sm: number
md?: number
lg?: number
xl?: number
}
type Gutter = number | GutterSize
interface RowProps extends HTMLAttributes<HTMLDivElement> {
/* 栅栏间隔,可以写成像素值或支持响应式的对象写法,默认为10 */
gutter?: Gutter
}
type ColSiz... |
c3dd6e507d3f069d1e50fcd47ed93df54e47e0bb | TypeScript | kvjnf/kvjnf-portfolio | /src/styled.d.ts | 2.546875 | 3 | // import original module declarations
import 'styled-components';
import { MediaQueryCallBack, PartialRecord } from './components/utils/types';
type Colors = PartialRecord<'black'|'gray', string>;
type Media = Record<'sm'|'md'|'lg'|'xl', MediaQueryCallBack>
interface FontFamiliesDefault{
fontFamily: string;
font... |
b99996ca7efbb26d86328cf401cf3d295f37b9d5 | TypeScript | binygal/norbert | /src/common/input/devices/KeyboardDevice.ts | 2.921875 | 3 | import { Direction, IInputDevice } from '../InputTypes';
export default function KeyboardDevice(): IInputDevice {
let hasSpaceClicked = false;
let latestDirection: 'left' | 'right' = 'left';
const keydownCallback = (e: KeyboardEvent) => {
const { key } = e;
if (key === ' ') {
hasSpaceClicked = true... |
78ea0b5152dc5379063ce77fdae84e51a3cc8c0b | TypeScript | carmendrl/HelpMe | /client/e2e/profQuestionFunctions.e2e-spec.ts | 2.53125 | 3 | import { ProfQuestionFunctionsPage } from './profQuestionFunctions.po';
xdescribe('Professor Question Functions', () => {
let page: ProfQuestionFunctionsPage;
beforeEach(() => {
page = new ProfQuestionFunctionsPage();
});
//must log in and out in every file?
var child_process = require('child_process');... |
0403ed0160888ad8a5185041ed393c7b400ee8cf | TypeScript | karlhulme/mantella | /workspaces/mantella-engine/src/execution/executeOperation.ts | 2.625 | 3 | import { pause } from 'piggle'
import { OperationContext, OperationDefinition, OperationRecord } from 'mantella-interfaces'
import { validateOperationInput } from './validateOperationInput'
import { executeStep } from './executeStep'
import { determineOperationStatusFromError } from './determineOperationStatusFromError... |
f86d8d17f3c1e706e5fe79acc831faf5cbe84991 | TypeScript | MaoParadise/andoProyect | /server/src/controllers/stateMediaControllers.ts | 2.546875 | 3 | import { Request, Response } from 'express';
import pool from '../database';
import { json } from 'body-parser';
class StateMediaController{
public async listStateMedia(req: Request ,res: Response){
const statemedia = await pool.query('SELECT * from statemedia');
res.json(statemedia);
... |
0a41d1f9e81bc7cdc793f2bab3883be9f785b62b | TypeScript | Thei1186/AT-Forum | /AT-Forum-functions/functions/src/users/user.service.ts | 2.671875 | 3 | import {UserRepository} from "./user.repository";
import {User} from "../models/user";
export class UserService {
constructor(private userRepository: UserRepository) {
}
deleteUser(uid: string): Promise<void> {
if (!uid.length) {
const error = new TypeError('Id has to be defined')
... |
a2ba7cb6be1ed35a45ba58dd4c595107c62db949 | TypeScript | odnodn/dockview | /packages/splitview/src/gridview/gridview.ts | 2.65625 | 3 | import {
ISplitviewStyles,
LayoutPriority,
Orientation,
Sizing,
} from '../splitview/core/splitview';
import { Position } from '../dnd/droptarget';
import { tail } from '../array';
import { LeafNode } from './leafNode';
import { BranchNode } from './branchNode';
import { Node } from './types';
import { ... |
585bea82277d7cd4d3e8da6b27d4c97b7efb7ab2 | TypeScript | beyondOurself/typescript | /类的访问类型.ts | 3.671875 | 4 | /*
* @Author: canlong.shen
* @Date: 2021-04-12 15:26:23
* @LastEditors: your name
* @LastEditTime: 2021-04-21 22:21:11
* @Description: file content
*/
// 类的内部和外部都能使用
class Person {
public name: string;
public sayHello() {
console.log(this.name + ' say heloo')
console.log(this.hobby)
}... |
889ee48aa95ae04c2bfce4d552535dfacb2fa0b0 | TypeScript | egova-safety/flagwind | /packages/core/src/commands/Decorators.ts | 2.96875 | 3 | namespace flagwind
{
/**
* 标注当前类型是一个可通过命令执行器执行的命令。
* @param {string} path
*/
export function command(path: string)
{
if(!path)
{
throw new InvalidOperationException("The command path is empty.");
}
return function(commandType: Function)
... |
cc92cbed5f63882ae1c45ddb17a5799c4a3360c2 | TypeScript | Fija1/snake_var | /dev/level.ts | 2.84375 | 3 | /// <reference path="snake.ts" />
class Level {
private scoreDiv: HTMLElement;
private score: number = 0;
private snake: Snake;
private block: Block;
private redBlocks: Array<RedBlock>;
private timer: number;
private message: string;
public div: HTMLElement;
private gameObjects: Array... |
9a36875bb8090916a48d4f21a5c8765fc3196dff | TypeScript | kenkz447/react-restful | /dist/src/utilities/ResourceType.d.ts | 2.53125 | 3 | /**
* ResourceType
* Defines the general data structure for a set of Resources.
*/
import { Record } from './RecordTable';
import { Store } from './Store';
export interface SchemaField {
field: string;
type: 'PK' | 'FK' | 'MANY';
resourceType?: string;
}
interface ResourceTypeProps {
name: string;
... |
a451cff0ac8282826c2d443613b5c33ca1a9c7ba | TypeScript | hungnhse1997/blouse-api | /src/services/favorited-doctor-service.ts | 2.59375 | 3 | import { Request, Response } from "express";
import { FavoritedDoctor } from "../models/favorited-doctor";
import { Constant } from "../utils/constant";
class FavoritedDoctorService{
static getFavoritedDoctorbyPatientId = async (req: Request, res: Response) => {
let favoritedDoctor = await FavoritedDoctor.... |
ab95325eef44cba58734b5829d59144e3e7173eb | TypeScript | akhilome/nopw | /src/controllers/Auth.ts | 2.5625 | 3 | import jwt from 'jsonwebtoken';
import { Request, Response, NextFunction } from 'express';
import responses from '../utils/responses';
import UserService from '../services/User';
import { Profile } from 'passport';
import logger from '../logging';
const { JWT_PRIVATE_KEY = '' } = process.env;
class AuthController {
... |
2ffce1438d865c1e1dd4478c46c2a90982a56160 | TypeScript | jrwalt4/arga | /src/core/Util/EventEmitter.ts | 3.375 | 3 | export class EventEmitter<TEventArgs> {
private _listeners: Array<(eventArgs: TEventArgs) => void>
subscribe(listener: (eventArgs: TEventArgs) => void): () => void {
if (typeof listener === "function") {
(this._listeners || (this._listeners = [])).push(listener);
let listenersArray = this._listeners... |
8b211cee91d5648e2ddbd53161775d755910e1a9 | TypeScript | GotoJP/AtCoder | /ABC-042/D.ts | 3.234375 | 3 | import * as fs from 'fs';
const input = fs.readFileSync("/dev/stdin", "utf8").split(' ');
// D-いろはちゃんとマス目
// 不正解
const height = +input[0];
const width = +input[1];
// 下からA個以内左からB個以内のマスは進入禁止
const A = +input[2];
const B = +input[3];
let result = 0;
for (let i = B; i < width; i++) {
result += combi(height - A -... |
0c5c249a47c7e1581d93b04243adf069cb644271 | TypeScript | steveruizok/nextjs-content-starter | /lib/getSearchResults.ts | 2.734375 | 3 | import searchPosts from "./post-list.json"
import { PostLite } from "../types"
/**
* Returns frontmatter for posts with titles that match a search string.
* @param search
*/
export function getSearchResults(search: string): PostLite[] {
const postsData = searchPosts.filter(({ terms }) => terms.includes(search))
... |
a1dfcddae612cd92bc18bf1c5a23035175b36200 | TypeScript | chouhanaditya/Demo-application-using-Aurelia-and-ASP.NET-Core | /ClientApp/app/services/toDoService.ts | 2.984375 | 3 |
import toDo from "../models/todo";
export class ToDoService{
todoList: toDo[]= [
new toDo(1,'Email Jane.',false),
new toDo(2,'Checkin your code on Github',true),
new toDo(3,'Pickup your laundry.',false)];
getToDoList()
{
return this.todoList.slice();
}
addToDo... |
2cddf090a5834fb5fbc04aafcff22c0622cda89f | TypeScript | AlphaJon/WhileInterpret | /old/tokenparser.ts | 3.125 | 3 | /*class TokenParser {
static parse(code: string) {
let tokens = this.tokenize(code.trim());
if (tokens.filter(value => value === "(").length
!== tokens.filter(value => value === ")").length){
throw new Error("Bracket mismatch");
}
if (tokens.filter(va... |