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 |
|---|---|---|---|---|---|---|
f414dc64818afe4380450f321d1f7a5872268a2c | TypeScript | ricozacharias/ng-pokemon-trainer | /src/app/models/pokemon.model.ts | 2.5625 | 3 | export interface Pokemon {
name: string;
url: string;
id: string;
selected: boolean;
}
export interface PokemonRequest {
count: number;
next: string;
previous: string;
results: Pokemon[];
} |
b1035f033f65ab5980553d768de58d9adc17d024 | TypeScript | TRIPTYK/nfw-cli | /src/test/05_AddEndpointCommand.test.ts | 2.625 | 3 | import { expect } from "chai";
import { join } from "path";
import { execInProject as exec , testInput } from "./global"
describe("AddEndpointCommand", function() {
this.timeout("10s");
let command = null;
const method = "PUT";
it("Adds an endpoint", () => {
command = exec(`nfw add-endpoint ${testInput} ${tes... |
9b52b491c907cf8ac34f7f3e110420cb47aba981 | TypeScript | jquense/docpocalypse | /packages/code-live/src/transform/index.ts | 2.609375 | 3 | /* eslint-disable no-restricted-syntax */
import { Parser } from 'acorn';
import acornJsx from 'acorn-jsx';
import MagicString from 'magic-string';
import { Node, NormalVisitor, Plugin, VisitorMap } from './types';
const parser = Parser.extend(acornJsx());
type NormalVisitorMap = Record<string, NormalVisitor[]>;
co... |
2c3ba85c012aa203313c21c6193299cceb0ca7ee | TypeScript | jstarmx/sunflower-lab | /packages/greenhouse/src/lib/types/components/Input.d.ts | 2.84375 | 3 | import { SvelteComponentTyped } from 'svelte';
export interface InputProps {
/**
* Content for the <label> element that wraps the input element
*/
label: string;
/**
* Placeholder for the input element
*/
placeholder: string;
/**
* Bound value of the input element
*/
value: string;
/**
... |
5606b1fb70fcffbaadb4f11eef8e9eb55db2be0a | TypeScript | hardrese7/rectangles-map | /src/models/rectangle/RectangleGeoJSON.ts | 2.53125 | 3 | import ShapeGeoJSON from 'src/models/shape/ShapeGeoJSON';
import {
calculateRectangleCoordinates,
getRotatedRectangle,
} from 'src/utils/geometry';
import Rectangle from './Rectangle';
export default class RectangleGeoJSON extends ShapeGeoJSON {
constructor({
center_lng,
center_lat,
length,
width... |
67e2dcfa810c4a0e759b067f012d4ee6ec024dd0 | TypeScript | N1cc3/war-game | /src/game/Game.test.ts | 2.984375 | 3 | import Hex from '../hexgrid/Hex'
import Game, { Player, Unit, UnitType } from './Game'
describe('Game', () => {
test('lastTickTime updates on simulate', () => {
const startTime = new Date('2020-01-01T00:00:00.000Z')
const game = new Game(startTime, 15 * 60 * 1000)
game.simulate()
expect(game.lastTi... |
b2e93a7540f4c4ada2091c12bea93559bcfab209 | TypeScript | maxfontani/moji-warz | /packages/client/src/game/sprites/effects.ts | 3 | 3 | import { DisplayObject, Sprite } from 'pixi.js';
const FLASH_DURATION = 200;
const BLINK_DURATION = 300;
const BLINK_COUNT = 5;
export const flash = (sprite: Sprite, tintColor: number, baseColor: number) => {
sprite.tint = tintColor;
setTimeout(() => {
sprite.tint = baseColor;
}, FLASH_DURATION);... |
8c72337de4228c643c8a6022e7e84ac75f3552cd | TypeScript | kidstech/word-river | /client/src/testing/user-service-mock.ts | 2.609375 | 3 | /* eslint-disable max-len */
import { HttpParams } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable, of } from 'rxjs';
import { map } from 'rxjs/operators';
import { Learner } from 'src/app/datatypes/learner';
import { User } from 'src/app/datatypes/user';
@Injectable()
exp... |
216107bf9d35ae0ca83964086751b5c2d7f91d14 | TypeScript | HaidelBert/haidelbert | /register-of-assets/src/entity/asset.ts | 2.515625 | 3 | import {BaseEntity, Column, Entity, JoinColumn, OneToMany, PrimaryColumn, PrimaryGeneratedColumn} from "typeorm";
import {AssetDepreciation} from "./assetDepreciation";
import {bigint, date} from "../helpers/dbHelpers";
@Entity({ name: "assets" })
export class Asset{
@PrimaryColumn("bigint", { transformer: [bigint... |
f074cb958b0a25dd5cd7650b3bae203b31a99197 | TypeScript | holomekc/ioBroker.bshb | /src/log-level.ts | 2.921875 | 3 | /**
* This enum defines all log levels with an ordinal ordered by lower is finer log level.
* This helps to decide if a log should be present
*
* @author Christopher Holomek
* @since 01.12.2019
*/
export enum LogLevel {
silly,
debug,
info,
warn,
error
} |
d95fe222a47299f4312ec25fc2c821f34265e6ff | TypeScript | imckl/ts-leetcode | /src/202012/202012151454-longest-increasing-subsequence.ts | 3.453125 | 3 | export function lengthOfLIS(nums: number[]): number {
if (nums.length === 0) {
return 0;
}
if (nums.length === 1) {
return 1;
}
let longestSeq = [];
for (let i = 0; i < nums.length; i++) {
let max = nums[i];
const seq = [nums[i]];
for (let j = i + 1; j ... |
b206a8010d8b30d2718f6ccafcfcdee5a18bd15d | TypeScript | josiah-dunham/npm-ts-boilerplate | /src/main.ts | 3.140625 | 3 | import { logr } from './helpers/utils'
logr("it works!")
const myFn = (optional?: string) => {
logr('optional')
logr(optional)
const things = ["one", "two"]
if(!optional) {
logr('doing something with things because no optional')
}
else {
logr('doing nothing')
}
}
myFn() |
bc628eea0bac41abedd62026aafd4847deddfec6 | TypeScript | decentraland/agora | /src/Translation/Translation.router.ts | 2.640625 | 3 | import { server } from 'decentraland-server'
import * as express from 'express'
import { Translation, TranslationData } from './Translation'
import { Router } from '../lib'
export class TranslationRouter extends Router {
mount() {
/**
* Returns the translations for a given locale
* @param {string} lo... |
7fc789c5a97ee5484ac9aafd377ed105359e2ebd | TypeScript | devrsi0n/typescript-algorithms | /packages/algs4/src/StdRandom/StdRandom.test.ts | 3.078125 | 3 | import StdRandom from './index';
test('random method return range [0, 1)', () => {
expect(typeof StdRandom.random()).toBe('number');
expect(StdRandom.random()).toBeGreaterThanOrEqual(0);
expect(StdRandom.random()).toBeLessThan(1);
});
test('setSeed method', () => {
StdRandom.setSeed(1);
expect(StdRandom.ran... |
54ba69cb1dd711b5582823031c0ace3893f4effa | TypeScript | LTMezzari/MockableNodeAPI | /src/application/handler/DefaultHandler.ts | 2.5625 | 3 | import IRouteAuthenticator from '../authenticator/IRouteAuthenticator';
import IRoute from '../../domain/model/route/IRoute';
import IRouteRepository from '../../domain/repository/IRouteRepository';
import IRouteHandler from './IRouteHandler';
import Configuration from '../../configurator/Configuration';
import IRouteV... |
607a2f209b338a41a2326db22b7f8393484700a8 | TypeScript | Th3CracKed/PillTracker-DashBoard | /src/v1/models/order.model.ts | 2.515625 | 3 | import * as mongoose from 'mongoose';
import { Schema } from 'jsonschema';
import { ObjectId } from 'mongodb';
const ProductOrderSchema = new mongoose.Schema(
{
quantity: {
type: Number,
required: true,
default: 1
},
product: { type: ObjectId, ref: 'Product' }
}
);
interface ProductO... |
6617913ee7697c60f98368e23647a73f23f18065 | TypeScript | mattduggan/boggle | /scripts/packDictionary.ts | 2.53125 | 3 | import { createReadStream, writeFileSync } from 'fs';
import { resolve } from 'path';
import { createInterface } from 'readline';
const { Trie } = require('dawg-lookup');
var trie = new Trie();
// TODO add 16 and 17 letter words, sorted
// TODO filter Q words where Q is not followed by U
createInterface({
input:... |
c0aff29d930c6e7b4bae27534a4c038ea205e00b | TypeScript | cnickert-umich/lambda-eats | /serverless-backend/src/food/FoodDao.ts | 2.609375 | 3 | 'use strict';
import { DynamoDB } from 'aws-sdk'
import * as uuid from 'uuid'
import { FOOD_TABLE_NAME } from '../Constants';
import { FoodDO } from './_types/FoodDO';
import { NewFood } from './_types/NewFood';
import { UpdateFood } from './_types/UpdateFood';
const dynamoDb = new DynamoDB.DocumentClient()
export d... |
54004837684cf7fd0dc9f455238b6569ccedf493 | TypeScript | harshadakunde/TrainingManagement | /Angular/src/app/technology/technology.ts | 2.96875 | 3 | export class Technology {
constructor(public technology_id: number, public technology_name: string,public active: number
) {
}
toString(): string {
console.log("in tostring");
return `${this.technology_id} ${this.technology_name} ${this.active} `;
}
} |
58b9390331d73d4817cc8b3d6968005e7f3ea049 | TypeScript | richardcrng/included-m | /src/lib/why-what-error/WhyWhatError.ts | 3.34375 | 3 | interface WhyWhat {
/**
* **What** operation/update failed
*/
what: string;
/**
* **Why** the operation/update failed
*/
why: string;
}
class WhyWhatError extends Error {
message: string;
/**
* **What** operation/update failed
*/
what: string;
/**
* **Why** the operation/update ... |
8ad61d0c13db882ab51f27475e485e22819b225c | TypeScript | louischan-oursky/skygear-next-SDK-JS | /packages/skygear-core/src/container.ts | 2.5625 | 3 | import {
JSONObject,
User,
Identity,
AuthResponse,
SSOLoginOptions,
} from "./types";
import { ContainerStorage } from "./storage";
import { BaseAPIClient } from "./client";
import {
encodeUser,
encodeIdentity,
decodeUser,
decodeIdentity,
} from "./encoding";
function keyAccessToken(name: string): st... |
162f7bad2502d6fc3211fae0b2f4b899d8f7d9a6 | TypeScript | rabobank-blockchain/ula-vc-data-management | /test/unit/model/address-model.test.ts | 2.671875 | 3 | /*
* Copyright 2020 Coöperatieve Rabobank U.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
80e6fa3051e73796098e1227c3a8e9afdc25bf9e | TypeScript | nais/deploy-frontend | /packages/frontend/src/ui/userInfoReducer.ts | 2.890625 | 3 | import { USERINFO_REQUEST_SUCCESS, USERINFO_REQUEST_FAILED } from '../config/actionTypes'
const userInfoReducer = (
state = {
userName: '',
},
action
) => {
switch (action.type) {
case USERINFO_REQUEST_SUCCESS:
return {
...state,
userName: `${action.value.givenName} ${action.value... |
01843e360bc110eb1e5ca29a6371b6f56d29682f | TypeScript | labs42io/itiriri-async | /test/iterators/intersect.test.ts | 2.75 | 3 | import { expect } from 'chai';
import { intersect } from '../../lib/iterators/intersect';
import { toArray } from '../helpers/toArray';
import { fromArray } from '../helpers/asyncGenerators';
describe('iterators/intersect', () => {
describe('When called on empty sources', () => {
it('Should return empty source',... |
a75a30916e1335a624ec6473dc9a098ab3d02890 | TypeScript | 4ian/GDevelop | /Extensions/DraggableBehavior/draggableruntimebehavior.ts | 2.828125 | 3 | /*
GDevelop - Draggable Behavior Extension
Copyright (c) 2013-2021 Florian Rival (Florian.Rival@gmail.com)
*/
namespace gdjs {
/**
* The DraggableRuntimeBehavior represents a behavior allowing objects to be
* moved using the mouse.
*/
export class DraggableRuntimeBehavior extends gdjs.RuntimeBehavior {
... |
8e898fb61017b28ef818c6b073460ecc2be4c871 | TypeScript | si-saude/saude-app | /src/app/model/avaliacao-fisica-atividade-fisica.ts | 2.546875 | 3 | import { AvaliacaoFisica } from './avaliacao-fisica';
import { AtividadeFisica } from './atividade-fisica';
export class AvaliacaoFisicaAtividadeFisica {
private id: number;
private avaliacaoFisica: AvaliacaoFisica;
private atividadeFisica: AtividadeFisica;
private domingo: boolean;
private... |
90f0142fe45447749b36c622d6e6688ce892baae | TypeScript | mateusdeitos/rocketseat-ignite-autenticacao-next | /services/api.ts | 2.65625 | 3 | import axios, { AxiosError } from "axios";
import { parseCookies, setCookie } from 'nookies';
import { signOut } from "../contexts/AuthContext";
import { AuthTokenError } from "../errors/AuthTokenError";
let isRefreshing = false;
let failedRequestsQueue = [];
// Ao fazer dessa forma, funciona client side e server sid... |
242d65f936ae27f88be908b5a5c256ec8559f988 | TypeScript | Ambial/AngularTodo | /src/app/services/task.service.ts | 2.515625 | 3 | import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from "@angular/common/http";
import { Observable } from "rxjs";
import { Task } from "../Task";
const httpOptions = {
headers: new HttpHeaders({
'Content-Type':'application/json'
})
}
@Injectable({
providedIn: 'root'
})
export cla... |
25886ccc09b0d45a684eeb765d8ddac59aab6b73 | TypeScript | gabs-work/random-users-from-country | /src/server.ts | 2.5625 | 3 | import axios from 'axios'
import { Request, Response, Application } from 'express'
import { AsyncAttempt } from 'attempt-ts'
import config from './config.json'
import sameCountryService from './same-country'
import nationalizeService from './nationalize'
import randomUserService from './random-user'
import express =... |
03ce2acd446957f0ba39faaea89b31fe3bf71135 | TypeScript | wailorman/ball-fixtures | /src/utils.ts | 2.984375 | 3 | import { pad } from 'lodash';
import { Fixtures } from './types';
export function generateUUID(...args: (string | number)[]): string {
// 5095072f-5308-40a5-b994-e9b05230a4dd
// 8| 13| 18| 23| 36|
const ONE_GROUP_LENGTH = 8;
const TWO_GROUPS_LENGTH = 13;
const THREE_GROUPS_LENGTH = 18;
... |
49636a8c3308b1b2569b8889dbddbaa19b669736 | TypeScript | angular-empowerment-club/webinar-folgen | /apps/folge-4/src/app/stock-risk-filter/stock-risk-filter.component.ts | 2.53125 | 3 | import { Component, EventEmitter, Output, OnInit } from '@angular/core';
import { StockQuoteRisk } from '../models';
@Component({
selector: 'aec-stock-risk-filter',
templateUrl: './stock-risk-filter.component.html',
styleUrls: ['./stock-risk-filter.component.css']
})
export class StockRiskFilterComponent implem... |
4cb12843b4c775e0c83767633c9ec25a7d4fb541 | TypeScript | Diaa-Ghonim/article-app-server | /src/infrastructure/db/entities/user/index.ts | 2.734375 | 3 | import { Entity, ObjectIdColumn, Column, ObjectID, OneToMany } from 'typeorm';
import User from '../../../../core/domain/entities/User';
/**
* here we can name Entity inside it between paranthese
* and also can add constructor to Entity class
*
*/
@Entity()
export class EntityUser {
@ObjectIdColumn()
id: Objec... |
8ff2c94c88c70c4046e8ba59c77ac0a7e3d610dc | TypeScript | Svaly/angularTraining | /src/app/shared-controls/status-flow-radio-button/radio-button-allowed-values-transitions-graph.spec.ts | 2.71875 | 3 | import { RadioButtonAllowedValuesTransitionsGraph } from './radio-button-allowed-values-transitions-graph';
describe('RadioButtonAllowedValuesTransitionsGraph', () => {
it('should create an instance', () => {
expect(new RadioButtonAllowedValuesTransitionsGraph()).toBeTruthy();
});
it('should create an insta... |
93e9b7b88ba409e822cff2c6aa24317e3b03e0ef | TypeScript | devyonghee/mybloglab | /front/src/features/root-actions.ts | 2.578125 | 3 | import { Action } from 'redux';
type TypeConstant = string;
export interface AppAction<T extends TypeConstant, P> extends Action<T> {
type: T;
payload: P;
}
|
4c8263db028c3a2000d3b1cfe22bd96ddf7b6c4e | TypeScript | neko-gg/gfl-combat-simulator | /src/app/model/EquipStats.ts | 2.875 | 3 | export class EquipStat {
min: number;
max: number;
upgrade: number;
}
export default class EquipStats {
damage: EquipStat | undefined;
rof: EquipStat | undefined;
accuracy: EquipStat | undefined;
evasion: EquipStat | undefined;
armor: EquipStat | undefined;
movementSpeed: EquipStat ... |
2730675b1d2f9d1c9948cb11489833f7075fdcec | TypeScript | Happy-Ferret/nesemu | /src/nes/apu.ts | 2.75 | 3 | // APU: Audio Processing Unit
import {Address, Byte} from './types'
export enum PadBit {
A = 0,
B = 1,
SELECT = 2,
START = 3,
U = 4,
D = 5,
L = 6,
R = 7,
}
export enum PadValue {
A = 1 << PadBit.A,
B = 1 << PadBit.B,
SELECT = 1 << PadBit.SELECT,
START = 1 << PadBit.START,
U = 1 << PadBit.U,... |
fd929a988742b605f9b65ad1f8de84ed1bc45169 | TypeScript | combinatorist/grist-core | /app/client/models/SearchModel.ts | 2.546875 | 3 | // tslint:disable:no-console
// TODO: Add documentation and clean up log statements.
import {GristDoc} from 'app/client/components/GristDoc';
import {ViewFieldRec, ViewSectionRec} from 'app/client/models/DocModel';
import {delay} from 'app/common/delay';
import {waitObs} from 'app/common/gutil';
import {TableData} fro... |
a7770b51f16fc1506616f3048631f160dd60f665 | TypeScript | shrestharosy/nest-official-course | /src/common/dto/pagination-query.dto.ts | 2.59375 | 3 | import { Type } from 'class-transformer';
import { IsOptional, IsPositive } from 'class-validator';
export class PaginationQueryDto {
// tranform query param of type string to number
// alternative is to add transformOptions: enableImplicitConversion: true,} in global validation pipe options
@Type(() => Number)... |
8c6989cc07881248dd70d4e488b4195e3f4e8e2f | TypeScript | TiliaKS/TypeScript | /src/app.ts | 2.765625 | 3 | import {Category} from './enums';
import {Book, Logger} from './intefaces';
import {logSearchResults} from './functions';
showHello('greeting', 'TypeScript');
function showHello(divName: string, name: string) {
const elt = document.getElementById(divName);
elt.innerText = `Hello from ${name}`;
}
//==========... |
6eb12ba156bfa57413d89b168e793a517d1c9fdc | TypeScript | nickagrawal/fiservassignment | /src/services/parserService_v1.ts | 2.796875 | 3 | import { Respose } from "./../model/response";
export class ParserService
{
static parse(req: any): any {
if(req && typeof req === 'string' && req.length > 18){
const res = new Respose();
res.firstName =req.substring(0,8);
res.lastName =req.substring(8,18);
... |
07626708637c41f7c83cbbaf93cde16582e862bf | TypeScript | DimiDeKerf/typescript-course | /exercises/04_walker/exercise/src/walker.ts | 3.625 | 4 | class Walker {
name;
numberOfLegs;
color;
// TODO: convert to constructor assignment
constructor(
name,
numberOfLegs,
color?, // Color can either by gray or black.
) {
this.name = name;
this.numberOfLegs = numberOfLegs;
this.color = color || 'gray... |
f57f2550943b253f6873a4c089f12e37f36d4ede | TypeScript | x-way/cal-heatmap | /src/DataFetcher.ts | 2.859375 | 3 | import {
json, csv, dsv, text,
} from 'd3-fetch';
import type { DataOptions, DataRecord } from './options/Options';
import type { Timestamp } from './index';
import type CalHeatmap from './CalHeatmap';
export default class DataFetcher {
calendar: CalHeatmap;
constructor(calendar: CalHeatmap) {
this.calenda... |
231e785a97587fccf9a11cdb50559d98679b0a91 | TypeScript | DenisDenis2015/library | /ui-library-angular/library/src/app/store/reducer/booksReducer.ts | 2.71875 | 3 | import {createFeatureSelector, createSelector} from '@ngrx/store';
import {BooksState} from '../../model/AppState';
import * as fromActions from '../action/booksAction';
import {BookModel, IBookModel} from '../../model/book-model';
import {GenreModel, IGenreModel} from '../../model/genre-model';
export const i... |
a5640aa402a83f269fbca08007d20d60bb98340e | TypeScript | Dennisschu/Screeps | /src/creeps/base.ts | 2.921875 | 3 | export default class {
private body_: BodyPartConstant[];
private name_: string;
private role_: string;
private memory_: CreepMemory;
public constructor(Name: string, Role: string, Body: BodyPartConstant[], Memory: CreepMemory) {
this.name_ = Name;
this.role_ = Role;
this.body_ = Body;
this.m... |
ecb4d5e46d8b79614fed3428b632c278eb73e101 | TypeScript | postor/hearthstone-gameserver | /src/Game.ts | 2.953125 | 3 | import { EventEmitter } from 'events'
import Player from './Player'
import DeadQueueItem from './utils/DeadQueueItem'
import gameStart from './acts/gameStart'
import { getWaitPromise } from './utils/getWaitPromise'
const defaultConfig = {
players: [
{
hero: 'Mage',
cards: [
'ArcaneExplosion',... |
5f3049185abf14dd95f5ca45c2937ce4a6eeb5b9 | TypeScript | SudoDotDog/Sudoo-Time | /src/duration.ts | 3.25 | 3 | /**
* @author WMXPY
* @namespace Time
* @description Duration
*/
import { TIME_CHANGE } from "@sudoo/magic";
const floorIfNeeded = (value: number, floor?: boolean): number => {
if (typeof floor !== 'boolean') {
return value;
}
if (floor) {
return Math.floor(value);
}
return ... |
85f8270b88b1e1eb395f5167d6c440a388f7ac28 | TypeScript | ejnkns/gdocs-database | /utils/contentTypes.ts | 3.046875 | 3 | export enum ContentTypes {
Title,
Para,
Link,
Image,
Video,
Pdf,
Html,
Break
}
export class ContentObject {
contentType: ContentTypes; // denotes a 'type' for the content data; needed for strings
data: string | Link | Para;
constructor(contentType: ContentTypes, data: strin... |
e205d5da54dbf61993f562173ab750dfcc22f484 | TypeScript | jedrzejowski/spbd-project | /src/gui/lib/geometryToString.ts | 2.953125 | 3 | import GeoJSON from "geojson";
export default function (geometry: GeoJSON.Geometry): string {
switch (geometry.type) {
case "Point": {
const [lng, lat] = geometry.coordinates;
return `Punkt[${lat > 0 ? "N" : "S"}${lat} ${lng > 0 ? "E" : "W"}${lng}]`
}
default:
... |
00a2bc2d3a8b18571c8790eec55f7ec876969b67 | TypeScript | no-stack-dub-sack/apexdox-vs-code | /src/common/models/EnumModel.ts | 2.59375 | 3 | import ApexDox from '../../engine/ApexDox';
import { ModelType, TopLevelModel } from './TopLevelModel';
import { Option } from '../..';
class EnumModel extends TopLevelModel {
private _values: string[] = [];
public constructor(comments: string[], nameLine: string, lineNum: number, sourceUrl: Option<string>, ... |
ca14ef1475838c97b774cc77bc9ffc4f80d073bf | TypeScript | CSID-DGU/2019-1-OSSP2-infiniteDevelopment-6 | /plass-ide-frontend/src/app/console/tab/tab.component.ts | 2.734375 | 3 | import {
Component,
Input,
} from '@angular/core';
import { File } from 'src/app/types';
@Component({
selector: 'tab-component',
templateUrl: './tab.component.html',
styleUrls: ['./tab.component.scss'],
})
export class TabComponent {
@Input() upload = (file: File, data: string, isTemp: boolean... |
1e7492f2f5d7f00af28efc2523275c66b00f4646 | TypeScript | rgrannell1/inkling | /test/fd.ts | 2.828125 | 3 |
import tap from 'tap'
import * as fd from '../src/fd.js'
const testStderr = async () => {
const stream = fd.stubStderr()
stream.write('test')
const text = await new Promise(resolve => {
stream.on('data', (data:string) => {
resolve(data)
})
})
tap.equal(text, 'test')
}
const testStdin = asy... |
59f2981d5e7cd01673559ef3aa89815cb3c6453e | TypeScript | LienardEdwin/livementor_test | /store/index.ts | 2.5625 | 3 | import { vuexfireMutations } from 'vuexfire'
import { INotification } from '~/models/notification'
export interface IState {
locale: string
notification?: INotification
locales: Array<string>
conversations?: Map<string, any>
users?: Map<string, any>
authUser?: string
}
export const state = ():IState => ({... |
68734156da98d1e4ae76c6bf5c3dae95e0049691 | TypeScript | jhlagado/hilo | /src/evaluate.ts | 3.046875 | 3 | import { grammar } from './grammar';
import { semantics } from './semantics';
import {
Expression,
Lambda,
Definition,
Application,
Identifier
} from './elements';
export type EvalExpression = Expression | Closure | undefined;
class Closure {
name?: string;
lambda: Lambda;
context: any;... |
16f8af63564a47db42e28076df12fd3fb78d9770 | TypeScript | tanianegrete/proyecto2 | /CodenotchTemas/proyectosTipeScript/vector.ts | 3.234375 | 3 |
class Vector{
//Declaracion de atributos:
private elements:Number[];
public n:number;//longitud de vector
public k:number;//maximo valor de elementos vector
//Implementacion de Metodo constructor:
constructor(elements:Number[],n:number,k:number){
this.n=n;
this.k=k;
}
public Vectores(){
... |
a54a4373cfcce80dafebffea2057b17de2bc52ba | TypeScript | ketavchotaliya/stack-operations | /src/components/stack-operations/operators/Pop.ts | 2.828125 | 3 | import { Stack } from '../stack';
class Pop {
/**
* Validate stack length.
* @return true/false in Boolean value.
*/
public validateInput() {
const stack = Stack.getStack();
if (!stack.length) {
return false;
}
return true;
}
/**
* Remove top element of stack.
* @return t... |
52da8641f837f0d804c85ee79971ecde72b6acfe | TypeScript | zamotany/logkitty | /src/ios/IosParser.ts | 2.8125 | 3 | import DayJS from 'dayjs';
import { IParser, Entry } from '../types';
import { Priority, PriorityNames } from './constants';
export default class IosParser implements IParser {
static timeRegex: RegExp = /\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\.[\d+]+/m;
static headerRegex: RegExp = /^\s+[a-z0-9]+\s+(\w+)\s+[a-z0-9]... |
9cbdb8008dc07768d1a99d41fb6e3b035bb85c5f | TypeScript | ma125120/code | /clock.ts | 3 | 3 | import { ANGLE, ANGLE1, sin, cos, angle } from "./math";
import { BaseCanvas } from "./canvas";
type AngleItem = {
angle: number;
text: number | string;
level: number;
isReverse: boolean;
sin: number;
cos: number;
};
const secondScales: AngleItem[] = new Array(60).fill(0).map((v, i) => {
const num = i +... |
82bdb8cf3e87f316c4fc8616f814a4cab1a7ce23 | TypeScript | wpflying/05_utils | /src/utils/object/extractProperty.ts | 3.125 | 3 | /**
* 函数生成器:生成获取对象的属性值的函数
* @param propertyName 需要获取的属性名
*/
export default function extract<T extends object, P extends keyof T>(propertyName: P) {
return (obj: T) => obj[propertyName];
}
|
7a88d4a4e032dc57afb017863bc454dacdfa116d | TypeScript | puleri/euchre-webapp | /src/mockstate.ts | 2.6875 | 3 | import {
dealCards,
EmptyTripleStack,
EmptyStack,
sortCards,
EmptyDoubleStack,
} from "./interfaces/cards";
import {
PlayPhaseState,
PlayPhaseTag,
JoinPhaseState,
PassPhaseState,
ScorePhaseState,
JoinPhaseTag,
PassPhaseTag,
ScorePhaseTag,
DealPhaseState,
DealP... |
b9aae22b4f63ac27c72582283f1e68416a8f8430 | TypeScript | shiiinji/leetcode | /deno/11.container-with-most-water/test.ts | 2.703125 | 3 | import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
import { maxArea } from './index.ts'
Deno.test("maxArea() ex1", () => {
assertEquals(maxArea([1,8,6,2,5,4,8,3,7]), 49, "Accepted");
});
Deno.test("maxArea() ex2", () => {
assertEquals(maxArea([1,1]), 1, "Accepted");
});
Deno.test("maxArea(... |
55d46ebdc6f5b5a6bfb12a03970573ad9ade1597 | TypeScript | valerk0/react_reddit | /src/store/posts/actions.ts | 2.65625 | 3 | import axios from "axios";
import { Action, ActionCreator } from "redux";
import { ThunkAction } from "redux-thunk";
import { IRootState } from "../reducer";
export interface IPostData {
title?: string;
previewLink?: string;
author?: string;
timeCode?: number;
score?: number;
num_comments?: number;
id?: ... |
5cdbad997446ebe4f3028df58eedff0ed532f2ae | TypeScript | mohdovais/react-playground | /packages/combobox/combobox.store.ts | 2.890625 | 3 | import { extend } from '../utils/object';
export const ACTION_TYPE_COLLAPSE = 0;
export const ACTION_TYPE_EXPAND = 1;
export const ACTION_TYPE_TOGGLE = 2;
export const ACTION_TYPE_KEY_ARROW_DOWN = 3;
export const ACTION_TYPE_KEY_ARROW_UP = 4;
export const ACTION_TYPE_KEY_ENTER = 5;
export const ACTION_TYPE_SELECT = 6;... |
f98703f6c2c7bdcb6a089929e4e67a635e8d9059 | TypeScript | albireox/boson | /src/renderer/tools/stringToColour.ts | 2.953125 | 3 | /*
* @Author: José Sánchez-Gallego (gallegoj@uw.edu)
* @Date: 2022-12-18
* @Filename: stringToColour.ts
* @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
*/
export default function stringToColour(myString: string) {
let hash = 0;
for (let i = 0; i < myString.length; i += 1) {
... |
0bc8d71f1002a933024e058e71774ddf80ff94f6 | TypeScript | belohnung/Dename | /src/records/types.ts | 2.53125 | 3 | export type DNSRecordType =
| "A"
| "AAAA"
| "CNAME"
| "MX"
| "NS"
| "SOA"
| "SRV"
| "TXT";
export interface IRecord {
type: DNSRecordType;
target: any;
}
|
5975a763343ba99056daa68d72ec823d5764c02a | TypeScript | IronOnet/codebases | /codebases/outlook.live.com/src/modules/owa-datetime/src/formatters/formatDate.ts | 3 | 3 | import {
getDate,
getDay,
getHours,
getMilliseconds,
getMinutes,
getMonth,
getSeconds,
getYear,
getTimestamp,
} from '../owaDate/getFields';
import type { OwaDate } from '../schema';
import formatDateStrings from './formatDateStrings';
/** Formats a date according to an OWA-style fo... |
90358b8b0ad43cdac1f2c102c75f1e8f6d914ea2 | TypeScript | jsamezquita/prueba | /src/app/estados-web/estados-web.service.ts | 2.5625 | 3 | import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {EstadoWeb} from './estadoWeb';
import {Observable} from 'rxjs';
import {AppConstants} from '../appConstants'
import {States} from "./states";
const API_URL = AppConstants.baseURL;
const estadosWeb = 'estadosWeb';
@Injec... |
a7445caa86851ed48fcc7f69252858ec644e2284 | TypeScript | zcorky/zodash | /packages/event/src/index.ts | 3.265625 | 3 | import { once } from '@zodash/once';
export type Arguments<T> = [T] extends [(...args: infer U) => any]
? U
: [T] extends [void]
? []
: [T];
export type Listener = any; // T extends any ? (...args: any[]) => void : T;
export interface IEvent<Events = any> {
on<E extends keyof Events>(event: E, listener: Ev... |
a8cd44b3296ee18e62c717fc8ad30f35579de84b | TypeScript | ChlodAlejandro/watchlist-webhooks-backend | /src/util/URLUtils.ts | 3.09375 | 3 | import express from "express";
/**
* URL utilities for easy URL handling.
*/
export default class URLUtils {
/**
* Gets the root path URL (path at `/`) with a trailing slash.
* @param req The Express request.
*/
static rootURL(req : express.Request) : string {
return `${req.protocol}:... |
a3305c1b90666cea995051f7b8b158cec45f905c | TypeScript | danielmoreno510/banking-products | /src/app/redux/selectors/auth.selector.ts | 2.515625 | 3 | import { createSelector } from '@ngrx/store';
export interface Authentication {
authentication: boolean;
}
export interface AuthState {
auth: Authentication;
}
export const selectAuth = (state: AuthState) => state.auth;
export const selectAuthenticate = createSelector(
selectAuth,
(state: Authentication) =>... |
bc5f9bbc50502a8242b1b97c1adb34650ad26d7a | TypeScript | kldzj/nextjs-api-common-middleware | /__tests__/handlers/auth-bearer.test.ts | 2.671875 | 3 | import jwt from 'jsonwebtoken';
import { createMocks } from 'node-mocks-http';
import { createExport } from '../../src';
import { defaultHandler } from '../setup';
const JWT_SECRET = 'test';
const TOKEN = jwt.sign({ uid: 1 }, JWT_SECRET);
const UNAUTHORIZED_CODE = 401;
const UNAUTHORIZED_TEXT = 'UNAUTHORIZED';
descri... |
4f7c9ef2c01ac5292f768f10419692d898bcaf65 | TypeScript | jymfony/jymfony | /src/Component/Logger/types/Handler/SocketHandler.d.ts | 2.59375 | 3 | declare namespace Jymfony.Component.Logger.Handler {
import FormatterInterface = Jymfony.Component.Logger.Formatter.FormatterInterface;
export class SocketHandler extends AbstractProcessingHandler {
private _connectionString: string;
private _connection: Promise<void>;
private _socket: ... |
59e096a3ade88bb570f3530ae357f153557c3281 | TypeScript | franckLdx/StarWarsClients | /material-mobx/src/api/Starship.ts | 2.53125 | 3 | import { GraphQLClient } from 'graphql-request';
import { IStarship } from 'src/model/Starship';
import { IFetcher } from '.';
import { Mapper } from './FetchResource';
import { getRessourceFragment, movieRessourceFragment } from './Tools';
const fragment = `
{id,name,model,starship_class,manufacturer,cost_in_credits,... |
0b2b54947b19a18196af9e34d79beb7d2d2c5457 | TypeScript | Scorpionsc/sh2 | /src/api/sugarCollector/hooks/useGetRequest.ts | 2.8125 | 3 | import {useCallback, useEffect, useState} from 'react';
import {ApiResponse} from '../interfaces/apiResponse';
const useGetRequest = <T>(path: string): ApiResponse<T> => {
const [isLoading, setIsLoading] = useState<boolean>(false);
const [data, setData] = useState<T | null>(null);
const [error, setError] = useS... |
045a207d4130ac062f33c31c81a61b4d319a81cc | TypeScript | kartikpatel28199/task-analyser-runnable | /src/task/task.entity.ts | 2.53125 | 3 | import { Exclude } from 'class-transformer';
import { Status } from 'src/status/status.entity';
import { User } from 'src/user/user.entity';
import {
Column,
Entity,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
} from 'typeorm';
@Entity()
export class Task {
@PrimaryGeneratedColumn('uuid')
id: string;
... |
6f27b920cadf1f7e23fca7ea54551c63bd40cf04 | TypeScript | Esilthir/DTA_javascript | /TP_cours_1/exercice12.ts | 3.453125 | 3 | // Pas fini
(function () {
// Let's get started!
console.log("Let's get started!");
// "this" works differently in different circumstances.
// In this class "this" works in a way you might now expect.
class employee {
userId: string;
displayUserId() {
setTimeout(function... |
a8c7e439b90d62ef9b736b4ef280568458795aa5 | TypeScript | rxweb/rxweb | /client-side/angular/packages/reactive-forms/util/date-provider.ts | 2.75 | 3 | import { ReactiveFormConfig } from "./reactive-form-config";
import {ApplicationUtil } from './app-util'
const ISO_DATE_REGEX = /^(\d{4}-\d{1,2}-\d{1,2})$/;
export class DateProvider{
isDate(value: any): Boolean {
return value instanceof Date && !isNaN(value.valueOf());
}
private getRegex(dateFormat:strin... |
6ae153d7c5331066246ca0e46a335dfbdb5b630e | TypeScript | KuuuPER/ParentsProject | /ParentsSite/SantexFrontend/src/app/core/home/manufactures/store/reducers/manufactures.reducers.ts | 2.625 | 3 | import * as Actions from '../manufactures.actions';
import { ManufactureModel } from '../../src/ManufactureModel';
import * as fromApp from '../../../../../store/app.reducers';
import { PageInfo } from '../../../src/PageInfo';
import { INameId } from '../../../src/INameId';
export interface FeatureState extends fromA... |
bdb43d08aa773c1815d3368e54f3407f4b59490b | TypeScript | PACKED-vzw/CultURIze | /test/common/Objects/User.test.ts | 2.703125 | 3 | import { expect } from "chai";
import { User } from "../../../src/common/Objects/User";
describe("UserObject", () => {
it("user construction", () => {
const user = new User("token", "user", "URL");
expect(user.userName).to.eql("user");
expect(user.avatarURL).to.eql("URL");
expect(us... |
033cb6e24ee61185eedc62e4e010766755a9c869 | TypeScript | Armor-cn/magnus | /libs/server/__tests__/entities/entities/permission/permission.entity.ts | 2.640625 | 3 | import { Column, CreateDateColumn, Entity, Index, JoinTable, ManyToMany, ManyToOne, PrimaryColumn, UpdateDateColumn, PrimaryGeneratedColumn, OneToMany } from 'typeorm';
import { AddonEntity } from './addon.entity';
import { RoleEntity } from './role.entity';
import { UserEntity } from './user.entity';
/**
* 应用权限表
*/... |
9b684f070a802cfb653be93ca9d4b6178f231477 | TypeScript | briggs-milburn/project-lazy | /src/pages/bills/bills.ts | 2.515625 | 3 | import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, ToastController } from 'ionic-angular';
import { FormGroup, Validators, FormBuilder } from '@angular/forms';
import { HttpClient, HttpHeaders } from '@angular/common/http';
/**
* Generated class for the BillsPage page.
*
* See... |
64509cda312a86479ba51844fc586cec053457a3 | TypeScript | LahcenHaouch/bounding-boxes | /src/App/types.ts | 2.53125 | 3 | export interface Category {
id: string;
name: string;
color: string;
items?: Array<Item>;
}
export interface Item {
id: string;
name: string;
x: string;
y: string;
width: string;
height: string;
display: boolean;
}
export interface ImageObjectDetection {
jsonResponse: {
OBJECT_DETECTION_JO... |
28a9a2a95afbfed80a26564e3421007896e00544 | TypeScript | kovlento/blog-api | /src/posts/posts.controller.ts | 2.671875 | 3 | import { Controller, Get, Post, Body, Query, Put, Param, Delete } from '@nestjs/common';
import { ApiUseTags, ApiOperation, ApiModelProperty } from '@nestjs/swagger';
import { IsNotEmpty } from 'class-validator'
import { InjectModel } from 'nestjs-typegoose';
import {Post as PostSchema} from './post.model'
import { Mod... |
9ac6212c6256d297486af55be59cce1f131ff800 | TypeScript | TimCN/async-module-import | /src/index.ts | 2.671875 | 3 | declare global {
var webpackModuleFiles: any;
var __webpack_require__: any;
}
/**
*
* 加载远程模块
* @param {string} moduleUrl module的路径
* @returns {Promise<boolean>} 动态加载module成功
*/
function loadModule(moduleUrl: string): Promise<boolean> {
return new Promise(function (resolve) {
// TODO: handler timeout
... |
4152a55085f835ca3709a5ace041c46c78608b85 | TypeScript | ytchang05/N-lang | /js/src/type-checker/display-lines.ts | 2.84375 | 3 | import { ParseOptions, parse } from '../grammar/parse'
import { Block } from '../grammar/ast'
export interface FileLinesOptions {}
export class FileLines {
name: string
lines: string[]
lineNumWidth: number
constructor (file: string, name: string = '<file>', _: FileLinesOptions = {}) {
this.name = name
... |
571e81f065b4a220ab4857f7a0f3af9c68175a2f | TypeScript | kaulart/archref | /ArchRefClient/ArchRefClient/src/app/shared/dataservices/metrics/property.service.ts | 2.765625 | 3 | import { Logger } from '../../../../logger/logger';
import { Property } from '../../datamodels/metrics/property';
import { Injectable } from '@angular/core';
import { Http, Response, Headers, RequestOptions } from '@angular/http';
import { Observable } from 'rxjs';
/****************************************************... |
0d9b500bc2f00493f0a6b54aacedb68634bad1af | TypeScript | a7650/uniapp-chat | /types.d.ts | 2.796875 | 3 | export type ContentType = 'text' | 'voice' | 'image'
export type ID = string
export type TextContent = string
export type ImageContent = string
export type VoiceContent = string
export interface MessageInstance<
T = ContentType,
S = TextContent | ImageContent | VoiceContent
> {
readonly id: ID
senderAvatarUrl:... |
4a3b4a9e19f972ad74bd180bf6a41405632aa308 | TypeScript | mertsincan/primevue | /src/components/menubar/Menubar.d.ts | 2.515625 | 3 | import { VNode } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
import { MenuItem } from '../menuitem';
export interface MenubarProps {
/**
* An array of menuitems.
*/
model?: MenuItem[] | undefined;
/**
* Whether to apply 'router-link-active-exact' c... |
468fbf5b79e70a96d6f8a84f5061be4feec776d9 | TypeScript | ipf-klee/cartwheel | /src/main/websites_handler.ts | 2.6875 | 3 | const fs = require('fs');
import * as URL from 'url';
import { app, IpcMainEvent } from "electron";
import { WebsiteMetadata } from '../common/website';
export default {
configurations: `${ app.getPath('userData') }/websites.json`,
read(): Array<WebsiteMetadata> {
return JSON.parse(fs.readFileSync(th... |
5e08c1e67963f8dbd0c0638152b0d6239e901267 | TypeScript | fabinwen/angular2-study | /src/app/shared/user.service.ts | 2.5625 | 3 | /**
* Created by fabin on 2016-10-28.
*/
import { Injectable } from '@angular/core';
import {Headers, Http, URLSearchParams, Response} from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/of';
import 'rxjs/add/operator/do';
import 'rxjs/add/operator/delay';
import {Respons... |
c64c9a86a1754e1577a298d7e17593edb2ae19d8 | TypeScript | muratkeremozcan/testing-angular-apps | /chapter06/src/app/contacts/shared/services/preferences-async.service.spec.ts | 2.6875 | 3 | // listing 6.11 6.12
// import asynchronous testing methods
import { TestBed, fakeAsync, flushMicrotasks, inject } from '@angular/core/testing';
import { BrowserStorageAsync } from "./browser-storage.service";
import { PreferencesAsyncService } from './preferences-async.service';
// when testing async services, the m... |
a88b55884807f1a77b027a6d6fe827a1bb9929ea | TypeScript | wmoai/kaimono | /src/reducers/modal.ts | 2.9375 | 3 | import { ReactNode } from 'react';
import { OPEN, open, CANCEL, cancel, CONFIRM, confirm } from '../actions/modal';
export interface State {
isOpen: boolean;
contents?: ReactNode;
onConfirm?: () => void;
}
const initialState: State = {
isOpen: false
};
type Actions =
| ReturnType<typeof open>
| ReturnTyp... |
05f1a67be58b7acf2cf5ebf9e0c7efb417011235 | TypeScript | ccarazasc/angular | /dev-infra/utils/console.ts | 3.03125 | 3 | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import chalk from 'chalk';
import {prompt} from 'inquirer';
/** Reexport of chalk colors for convenient access. */
... |
73aabd6aeb50ef78680dbb3758fe97f7af1b1af5 | TypeScript | dvlyon/evolution | /src/lib/constants.ts | 2.890625 | 3 | import { PipeType } from '../lib/types'
export interface IPipes {
value: PipeType
check: boolean[]
rotation: number
}
export const pipes: IPipes[] = [
{
value: '━',
check: [false, true, false, true],
rotation: 0,
},
{
value: '┃',
check: [true, false, true, false],
rotation: 0,
},... |
cadac934ccd98d9cd2b792b2be073083957c7cb6 | TypeScript | wizdmio/wizdm | /connect/src/lib/database/document/batch.ts | 2.84375 | 3 | import { WriteBatch, DocumentRef, DocumentData } from './types';
import { DatabaseApplication } from '../database-application';
export class DatabaseBatch {
constructor(readonly db: DatabaseApplication, readonly btc: WriteBatch) { }
/**
* Creates / destructively re-writes the document content.
* Adds the '... |
ef0b4f9c83594ba71eddbfe5070d97412499bee6 | TypeScript | paytm/paytm-pg-node-sdk | /src/com/paytm/pg/response/NativePaymentStatusResponse.ts | 2.640625 | 3 | /**
* Copyright (C) 2019 Paytm.
*/
import * as _SecureResponse from "./interfaces/SecureResponse";
/* class: NativePaymentStatusResponse */
export class NativePaymentStatusResponse implements _SecureResponse.SecureResponse {
/**
* @var SecureResponseHeader
*/
public head;
/**
* @var Nat... |
5283063293a11ef69b72815e9eb5fca1b822e1bb | TypeScript | DaveYognaught/pokeclicker | /src/modules/underground/UndergroundItemNameType.ts | 2.875 | 3 | /*
To update this type when adding new items:
Open the game, and run the following code in the browser console
copy(`type UndergroundItemNameType
= ${[...new Set(Object.values(UndergroundItems.list).map(i => i.name))].map(i => `'${i.replace(/'/g, "\\'")}'`).join('\n | ')};`);
Replace the everything in this fi... |
97376f133c71d0a94155ed1b58b4b8b6ccf3a5f0 | TypeScript | ottoBitPd/colletta | /code/src/ts/presenter/ProfilePresenter.ts | 2.65625 | 3 | import {PagePresenter} from "./PagePresenter"
import {Client} from "../model/Client/Client";
import {UserKind} from "../view/PageView";
var session = require('express-session');
/**
*
*/
class ProfilePresenter extends PagePresenter{
constructor(view : any){
super(view);
this.client = (new Client... |
d9d9383e256d02b3aa3671cb4f16b459479f10db | TypeScript | neoskop/adamant | /src/utils/defer.ts | 3.078125 | 3 | export type Deffered<T> = Promise<T> & { resolve(v: T): void; reject(e: any): void };
export function defer<T>(): Deffered<T> {
let resolve: any,
reject: any,
promise = new Promise<T>((res, rej) => {
resolve = res;
reject = rej;
});
return Object.assign(promise,... |
9357abc4d1bf6bec18f54f1ca284f5c2b16553a5 | TypeScript | just-anohaker/smartdb-ts | /dist/Common.d.ts | 2.90625 | 3 | export declare type MaybeUndefined<T> = T | undefined;
export declare type Nullable<T> = T | null | undefined;
export interface ObjectLiteral {
[key: string]: any;
}
export declare type JsonObject = ObjectLiteral;
export declare type Entity = ObjectLiteral;
export declare type Property<T> = keyof T & string;
export... |
4653bf6a99ca5fc1b357979702f5d4e450bf6852 | TypeScript | bynaki/ts-webapi.boilerplate | /playground/play01.ts | 3.203125 | 3 | const arr = []
arr[1] = function() {
console.log('Hello')
}
console.log(arr[0])
console.log(arr[1])
console.log(arr[2])
function say(...args) {
args.forEach((i, idx) => {
i()
})
}
say(...arr.filter(i => i)) |