blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 120 | path stringlengths 5 328 | src_encoding stringclasses 19
values | length_bytes int64 23 6.41M | score float64 2.52 5.16 | int_score int64 3 5 | detected_licenses listlengths 0 99 | license_type stringclasses 2
values | text stringlengths 23 6.04M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
e08f2afb8147258a95225f7c6c40f4d97911c339 | TypeScript | banterfm/graphql-crunch | /src/utils/set/counted_ordered_set.ts | UTF-8 | 894 | 3.09375 | 3 | [] | no_license | import { hash } from "./hash";
import { eq } from "./eq";
import { JSON } from "../../JSON";
export type CountedOrderedSet = ReturnType<typeof CountedOrderedSet>;
export function CountedOrderedSet() {
const index: { [key: number]: [JSON, number][] } = {};
const values: JSON[] = [];
const counts: number[] = [];
... | true |
a3b7fdaa914a9cf5b05a6bb2ba353a16bfae2c77 | TypeScript | zhangkaiwenshuai/cloudbase-js-sdk | /packages/types/analytics.d.ts | UTF-8 | 3,088 | 2.59375 | 3 | [] | no_license | // report 接口传参结构
export interface IReportData {
report_type: string, // 上报场景 如电商 mall,游戏 game
report_data: {
action_time?: number, // 非必填 行为发生时,客户端的时间点,单位s
action_type: string, // 必填 行为类型 如 访问 visit_store,分享 share,加入购物车 add_to_cart等
click_id?: string, // 非必填 广告平台会在URL增加click_id
... | true |
ad65c5ec8fde8b86f763b00a005e409cc696a2fe | TypeScript | Daitnu/Daitnu-S2 | /web/src/library/validate/index.ts | UTF-8 | 1,760 | 2.890625 | 3 | [
"MIT"
] | permissive | import { IsLoginParam } from '~/@types/validate';
export const ID = 'id' as const;
export const PASSWORD = 'password' as const;
export const PASSWORD_CHECK = 'passwordCheck' as const;
export const NAME = 'name' as const;
export const SUB_EMAIL = 'subEmail' as const;
const LENGTH = {
[ID]: {
MIN: 5,
MAX: 20,... | true |
f088e425efc693d6445a5406cc6e6192dcc53ea5 | TypeScript | cnfreitax/proofy | /src/shared/utils/errors/not-found.ts | UTF-8 | 159 | 2.609375 | 3 | [] | no_license | export class NotFound extends Error {
constructor(stack: string) {
super('Exam not found');
this.name = 'ServerError';
this.stack = stack;
}
}
| true |
2ebbd3c4f2c3944d591f02e24737c1308d52729f | TypeScript | JayZang/ggo | /frontend/src/api/iam/setUserLoginable.ts | UTF-8 | 507 | 2.53125 | 3 | [] | no_license | import axios from 'axios'
const URL = '/api/iam/users/:id/loginable'
export function setUserLoginable(id: string | number, loginable: boolean) {
const httpMethod = loginable ? axios.post : axios.delete
return httpMethod<{
id: number | string
account_id: string
line_id: string | null
... | true |
c5e8734ce199644e3e600af9778af3a527310144 | TypeScript | Khuram-Haseeb1150/spotfire-mods | /catalog/animated-bubble-chart/src/Grid.ts | UTF-8 | 6,734 | 3.640625 | 4 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | export interface Totals {
pixelTotals: number;
fractionTotals: number;
}
export interface Description {
value: number;
unit: string;
visible: boolean;
}
/**
* Creates a grid layout with fixed and flexible columns and rows
* If the fixed distances don't fit into the available space they will be pr... | true |
b4475b65fbf26b879664a8e6b39c9977e1c778cc | TypeScript | Yakir-Ben-Hillel/Expensify-App | /src/redux/reducers/filtersReducer.ts | UTF-8 | 911 | 2.890625 | 3 | [] | no_license | import { IFilter } from '../@types/state-interfaces';
import { FilterActionTypes } from '../@types/types';
const filtersReducerDefaultState: IFilter = {
text: '',
sortBy: 'date',
startDate: undefined,
endDate: undefined
};
const filtersReducer = (
state = filtersReducerDefaultState,
action: FilterActionTy... | true |
18500e320b23ebe7f60e93324fda8b65d2722074 | TypeScript | gabrieldeoa/design-patterns-ts | /src/builder/person/index.ts | UTF-8 | 274 | 2.84375 | 3 | [] | no_license | import PersonBuilder from "./PersonBuilder";
const builder = new PersonBuilder();
const person = builder
.addPersonalInfo("Jão", "1998-09-16")
.addAddressInfo("Rua Teste", "Cidade Teste", 69)
.addMedicalRecordInfo(1.70, 60.0, "A+")
.build();
console.log(person); | true |
314eccbea7454c388920da7ea7e1cf4049700805 | TypeScript | counterfactual/dapps-bots | /packages/playground/src/data/firebase.ts | UTF-8 | 4,003 | 2.84375 | 3 | [
"MIT"
] | permissive | // This is a copy of what was implemented on the Node's integration tests
// to provider support for a Firebase layer.
// TODO: IMPORT THIS FROM THE NODE!
import { Node } from "@counterfactual/types";
export interface FirebaseAppConfiguration {
databaseURL: string;
projectId: string;
apiKey: string;
authDomain... | true |
df58d7fce7c39dad257f92a56523805b89925e47 | TypeScript | tjb295/PortfolioSite | /src/app/auth/auth-interceptor.ts | UTF-8 | 1,048 | 2.984375 | 3 | [] | no_license | /*This file will check any outgoing http requests and attach the token
from the AuthService to verify the user is logged on with an actual token */
import { HttpInterceptor, HttpRequest, HttpHandler } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { AuthService } from './auth.service';... | true |
7e607af28ca86aa3645e5136cdf37ce81c7495c0 | TypeScript | eladfeld/TradingSystem | /dev/Server/test/acceptence/common.ts | UTF-8 | 2,239 | 2.5625 | 3 | [] | no_license | import PaymentInfo from "../../src/DomainLayer/purchase/PaymentInfo";
import { Store } from "../../src/DomainLayer/store/Store";
import { Subscriber } from "../../src/DomainLayer/user/Subscriber";
import { isOk } from "../../src/Result";
import { Service } from "../../src/ServiceLayer/Service";
//this function perform... | true |
c9eeba2d0532085f3c37479c606468e0bfa28ee0 | TypeScript | yudi-azvd/moviehub-server | /src/repositories/UsersRepository.ts | UTF-8 | 2,209 | 2.78125 | 3 | [] | no_license | import { Repository, getRepository, getManager } from 'typeorm';
import { AxiosInstance, AxiosResponse } from 'axios';
import createAxiosInstance from '../api';
import UserHasFavoriteMovie from '../models/UserHasFavoriteMovie';
import Movie, { APIMovie } from '../models/Movie';
import User from '../models/User';
cla... | true |
e4f3caf314646cc19558b45ab514097736799c43 | TypeScript | camichang/Projeto-Angular- | /Interface/index.ts | UTF-8 | 2,244 | 3.40625 | 3 | [
"MIT"
] | permissive | interface userProps {
firstName: string
lastName: string
username: string
email: string
password: number
cpf: string
contato: number
isAdmin: boolean
}
class User implements userProps {
firstName!: string
lastName!: string
username!: string
email!: string
password!: ... | true |
52f1b9ecd02bb9a09515bb5222ef83330689907d | TypeScript | pd4d10/qrcode-helper | /background.ts | UTF-8 | 1,348 | 2.59375 | 3 | [
"MIT"
] | permissive | function openCodePopup(text: string) {
chrome.windows.create({
url: chrome.runtime.getURL(
"tabs/popup.html?code=" + encodeURIComponent(text)
),
type: "popup",
width: 480,
height: 480,
// state: 'docked',
});
}
// generate current url
chrome.action.onClicked.addListener((tab) => {
c... | true |
7dd859f1882d4b4025806ccafd996d71bd636bf7 | TypeScript | dylanrenwick/NuStack | /test/AST/OperationASTNode.spec.ts | UTF-8 | 3,670 | 3.359375 | 3 | [] | no_license | import { expect } from "chai";
import { ExpressionASTNode, ITypeDef } from "../../src/AST/ExpressionASTNode";
import { OperationASTNode, OperationType } from "../../src/AST/OperationASTNode";
class TestNode extends OperationASTNode {
get childNodes(): ExpressionASTNode[] { return null; }
get expressionValue():... | true |
7f6917de37c990dd796d1a454db9c6667ff6b682 | TypeScript | microsoft/FluidFramework | /experimental/PropertyDDS/packages/property-common/src/test/guidUtils.spec.ts | UTF-8 | 9,029 | 2.625 | 3 | [
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | /*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
/* eslint max-nested-callbacks: 0 */
/* eslint-disable unicorn/no-unsafe-regex */
/**
* @fileoverview In this file, we will test the functions exported by guid_utils.js
*/
import { expect } from... | true |
3c2b6f2ff8f025c12cb57341082abad33b9ac31d | TypeScript | yiruiruan/CommuniHub | /backendold/src/volunteer.ts | UTF-8 | 808 | 2.75 | 3 | [] | no_license | // db = connect('127.0.0.1:27017/userDB');
export class Volunteer {
static counter = 0;
email: string;
name: string;
id: number;
date: string;
startTime: string;
endTime: string;
typeOfWork: string[];
constructor(event: string) {
let obj = JSON.parse(event);
t... | true |
089abe205ac2226a4038a8473ab26dc95d6dad2a | TypeScript | adwidianjaya/bnsp-2020 | /src/kompetensi-02/index.ts | UTF-8 | 2,659 | 3.546875 | 4 | [] | no_license | import Stack from "./stack";
import Queue from "./queue";
import LinkedList from "./linked-list";
// ######################################################################
// ################################################## Stack Demonstration
console.log("\nStack Demonstration:");
console.log("--------------------... | true |
4ae9d4f62ad4b2b46b380062d8a8261cca1d0459 | TypeScript | tcgdex/cards-database | /data/Sun & Moon/Dragon Majesty/4.ts | UTF-8 | 1,249 | 2.578125 | 3 | [
"MIT"
] | permissive | import { Card } from '../../../interfaces'
import Set from '../Dragon Majesty'
const card: Card = {
name: {
en: "Torchic",
fr: "Poussifeu",
es: "Torchic",
it: "Torchic",
pt: "Torchic",
de: "Flemmli"
},
illustrator: "Kouki Saitou",
rarity: "Common",
category: "Pokemon",
set: Set,
dexId: [
255,
],... | true |
29a74f2e5daba1a7bf8a084b1379c1e844c72bfb | TypeScript | MattiasMartens/big-m | /dist/exports/streams.d.ts | UTF-8 | 14,261 | 3.09375 | 3 | [] | no_license | import { Reconciler, BumperFn as Bumper } from "./maps";
import { Possible } from "../support";
import { BiMap } from ".";
import { CanonMap } from "./canon";
/**
* Minimum-necessary-spec version of ReadableStream from Martin Poelstra's ts-stream library <https://github.com/poelstra/ts-stream>.
*/
declare type Readab... | true |
9240e68e84f9da65130fe067e60c7602a747cba5 | TypeScript | fengjinlong/addActivity | /my/src/common/js/util.ts | UTF-8 | 283 | 2.96875 | 3 | [] | no_license | // // 节流函数
// export function debounce (func:any, delay:number) {
// let timer:number
// return function (args:any) {
// if (timer) {
// clearTimeout(timer)
// }
// timer = setTimeout(() => {
// func.apply(this, args)
// }, delay)
// }
// }
| true |
d6a96e6f1bd99094e7e77fb8d0cdb1fc35da5ced | TypeScript | hakudev/nitro-emu | /src/app/messages/outgoing/user/messenger/MessengerInitComposer.ts | UTF-8 | 694 | 2.546875 | 3 | [] | no_license | import { MessengerCategory } from '../../../../../core';
import { IMessageComposer } from '../../../../../networking';
import { MessengerComposerUtilities } from './MessengerComposerUtilities';
export class MessengerInitComposer implements IMessageComposer
{
private _data: any[];
constructor(maxFriends: numbe... | true |
8223639738ee5921bd70bfc63c6fe3d5e03e2e08 | TypeScript | marioalbornoz/BackGraficos | /models/server.ts | UTF-8 | 1,226 | 2.515625 | 3 | [] | no_license | import express, { Application } from 'express';
import reservasRoutes from '../routes/reservas.routes';
import cors from 'cors';
import db from '../db/connection';
class Server {
private app: Application;
private port: string;
private apiPaths = {
reservas: '/api/reservas'
}
constructor... | true |
77c68360a85ba0594f2b4f403f276f334bdf6124 | TypeScript | OpenMaths/w-common | /src/Grid/Column.ts | UTF-8 | 646 | 2.59375 | 3 | [] | no_license | import {ISingleChildNode} from './Node'
import {CreateColumnEvent} from './GraphEvent'
import Container from './Container'
import ContentHolder from './ContentHolder'
export default class Column implements ISingleChildNode<Container|ContentHolder|null> {
readonly nodeId:string;
readonly parentId:string;
ch... | true |
3386561b100524ca56cefe8b9d387fd44b56caf8 | TypeScript | jalescardoso/ionic2-cordova-plugin-googlemaps-v2 | /ionic-native/src/plugins/admob.ts | UTF-8 | 6,247 | 2.921875 | 3 | [
"MIT"
] | permissive | import { Cordova, Plugin } from './plugin';
import { Observable } from 'rxjs/Observable';
export type AdMobAdSize = 'SMART_BANNER' | 'BANNER' | 'MEDIUM_RECTANGLE' | 'FULL_BANNER' | 'LEADERBOARD' | 'SKYSCRAPER' | 'CUSTOM';
export interface AdMobOptions {
/**
* Banner ad ID
*/
adId?: string;
/**
* Bann... | true |
51167dd131cb9e63543c44c4d75441c360dc4f15 | TypeScript | uplift-klinker/react-cheatsheet | /src/todos/state/todos-reducer.spec.ts | UTF-8 | 1,946 | 2.578125 | 3 | [
"MIT"
] | permissive | import {ModelFactory, StateGenerator} from '../../../testing';
import {TodosActions} from './todos-actions';
import {todosReducer} from './todos-reducer';
describe('todosReducer', () => {
test('when todos loaded successfully then has todos in state', () => {
const todos = ModelFactory.createMany(ModelFacto... | true |
93cc0a50f82ad7f719bd6ca952882478762392c1 | TypeScript | ariovistus/fasting-troubadour | /src/numeric-input-behavior.ts | UTF-8 | 746 | 2.96875 | 3 | [] | no_license | import { InputBehaviorBase } from "./input-behavior-base";
import { BindingContext } from "./binding-context";
export class NumericInputBindingBehavior extends InputBehaviorBase {
onPaste(pasteEvent, context: BindingContext) {
setTimeout(() => {
this.valueFixup(context, this.isValidChar... | true |
90128ce3904cc1caac4e938912714b419e00225b | TypeScript | CGQAQ/danmaku | /src/lib/types/danmaku.ts | UTF-8 | 3,726 | 3.046875 | 3 | [] | no_license | /* eslint-disable */
// 来自 https://zhangshuqiao.org/2018-03/Bilibili%E5%BC%B9%E5%B9%95%E6%96%87%E4%BB%B6%E7%9A%84%E8%A7%A3%E6%9E%90/
export interface IBilibiliDanmaku {
time: number; // 弹幕出现的时间,以秒为单位
mode: number; // 弹幕的模式:1~3 滚动弹幕 4 底端弹幕 5 顶端弹幕 6 逆向弹幕 7 精准定位 8 高级弹幕
fontSize: number; // 字号:12 非常小 16 特小 18 ... | true |
5bf8380afe48416f311047c6aab99420423229b5 | TypeScript | kznrluk/Learning | /typescript/miniGame.ts | UTF-8 | 2,083 | 3.59375 | 4 | [] | no_license | // アクション一覧
enum Actions {
attack,
defence,
}
// ゲーム中に使用されるセーブデータ
type saveData = {
actionType : Actions,
chara : number,
param : any
/**
* MEMO actionTypeによって型を変えたい。
* attackならsaveParamAttack等。
*/
}
// キャラクタステータス
type Status = {
hp : number,
mp? : number
}
// キャラクタクラス
c... | true |
6fa5647e8f904cd8e1f2f48572c0b53b5ee45d18 | TypeScript | lulzzz/panel-slider | /src/transform.ts | UTF-8 | 1,401 | 3.265625 | 3 | [
"MIT"
] | permissive | // Determine style names (if prefix required)
function toLower (s: any) {
return !!s && typeof s === 'string' ? s.toLowerCase() : ''
}
export const prefix = (function () {
const t = 'translate3d(100px,20px,0px)' // the transform we'll use to test
const el = document.createElement('div') // Make a test element
//... | true |
4cbd102b509d4a83afd2161fa3371428c9b11f44 | TypeScript | JPrasad21/attendance-tracker-server | /src/users/users.service.ts | UTF-8 | 3,504 | 2.53125 | 3 | [] | no_license | import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model, Types } from 'mongoose';
import { AttendanceService } from 'src/attendance/attendance.service';
import { Class, ClassDocument } from 'src/class/schema/class.schema';
import { hashing } from 'src/utils/utils';
im... | true |
b8114b035e83a8e228b29950048f665225d7f285 | TypeScript | patoigz/rendergun | /src/util.ts | UTF-8 | 1,882 | 2.734375 | 3 | [
"MIT"
] | permissive | import { NextFunction, Request, Response } from "express";
import puppeteer from "puppeteer";
// tslint:disable-next-line:max-line-length
const isURLRegExp = new RegExp("^(?:(?:http|https)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\... | true |
6fa6ca8849a7033bf5c096878e3d2f5fb6a8b518 | TypeScript | RauliL/pulina | /frontend/utils.ts | UTF-8 | 439 | 2.671875 | 3 | [
"MIT"
] | permissive | import { defaultTo, isEmpty, sortBy, values } from 'lodash';
import { Channel } from './types/channel';
import { State } from './types/store';
export const getCurrentChannel = (state: State): Channel | undefined => {
const channels = sortBy(values(state.channels), 'name');
if (isEmpty(channels)) {
return;
... | true |
603921f249a7f27dfd041f987ce765bf6f4c3834 | TypeScript | Casakari/cloud-reports | /src/analyzers/aws/ebs/volume_snapshots_regularity.ts | UTF-8 | 3,622 | 2.578125 | 3 | [
"MIT"
] | permissive | import * as Moment from 'moment';
import { BaseAnalyzer } from '../../base'
import { CheckAnalysisResult, ResourceAnalysisResult, Dictionary, SeverityStatus, CheckAnalysisType } from '../../../types';
import { ResourceUtil } from '../../../utils';
export class VolumeSnapshotsRegularityAnalyzer extends BaseAnalyzer {
... | true |
10cf492095e6217724e05c945513daa297dd7493 | TypeScript | rayng86/pomodoro-clock | /src/validate.ts | UTF-8 | 273 | 2.953125 | 3 | [] | no_license | const validate = (value: string) => {
let error = null;
let val = Number(value);
if (!val) {
error = 'Please fill out with a number';
} else if (val < 0) {
error = 'Please fill with positive integers only';
}
return error;
};
export default validate; | true |
4c4eca73bd627cf62d89d2daf5763bea46c19af6 | TypeScript | SvenC56/teamspeak-channelcreator | /src/config/app/config.service.ts | UTF-8 | 1,120 | 2.84375 | 3 | [
"MIT"
] | permissive | import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
/**
* Service dealing with app config based operations.
*
* @export
* @class AppConfigService
*/
@Injectable()
export class AppConfigService {
constructor(private configService: ConfigService) {}
/**
* return appl... | true |
d34c0e80700f877ac852c86648196c1e4a29d6b4 | TypeScript | talDanino/repos | /angular2/NorthwindWorkers/src/app/employee.ts | UTF-8 | 276 | 2.53125 | 3 | [] | no_license | export class Employee{
public constructor(
public employeeID:number,
public firstName:string,
public lastName:string,
public title:string,
public country:string,
public city:string,
public birthDate:string
){}
} | true |
049a5b4f6f71cc4e6a9f2e030b014efb496cff87 | TypeScript | Mephiztopheles/jsfx | /elements/form/Input.ts | UTF-8 | 672 | 2.75 | 3 | [] | no_license | import StringProperty from "../../properties/properties/StringProperty.js";
import FormElement from "./FormElement.js";
import JSFXProperty from "../../JSFXProperty.js";
export default abstract class Input<V> extends FormElement {
protected element: HTMLInputElement;
@JSFXProperty( "value" )
protec... | true |
91ea146a25158e71ac0d799059f6043e3c447b4b | TypeScript | kli2m/nodejs2021 | /src/resources/tasks/task.model.ts | UTF-8 | 2,032 | 3.09375 | 3 | [] | no_license | import { v4 as uuid } from 'uuid';
/**
* Class Task
*
* @class Task
* @property {string} id - id
* @property {string} title - title
* @property {number} order - order
* @property {string} description - description
* @property {string|null} userId - userId
* @property {string|null} boardId - boardId
* @pro... | true |
52cb05d62b2fb9cdccfe0010fbd98650750da92c | TypeScript | myvictorlife/look-after | /src/app/utilities/cookie-utilities.ts | UTF-8 | 2,574 | 2.796875 | 3 | [] | no_license | import { Injectable, Inject } from '@angular/core';
import { CookieService } from 'ngx-cookie-service';
@Injectable()
export class CookieUtilities {
constructor(@Inject(CookieService) private Cookie) {}
// Returns the value of given cookie name.
public getCookie(name: string) : string {
let val... | true |
793f2b769a89255189e68d2b194d9ec7bb986152 | TypeScript | takefumi-yoshii/vuex-modules-pubsub | /src/stores/modules/subscriber1.ts | UTF-8 | 1,096 | 2.515625 | 3 | [] | no_license | import {
fromState,
fromMutations,
Injects,
StateFactory
} from 'vuex-aggregate'
// ______________________________________________________
//
// @ State
const namespace = 'subscriber1'
interface State {
name: string
counterCount: number
doneTodos: boolean
}
const state = {
name: '',
counterCount: 0... | true |
328ed3db40e5d21265de2f8619c99aa23db16b5c | TypeScript | kevinoneill/wee-concurrent | /tests/semaphore.test.ts | UTF-8 | 2,063 | 2.734375 | 3 | [
"MIT"
] | permissive | import { Semaphore } from "../src";
import { pause, range } from "./helpers";
import { expect } from "chai";
describe("Semaphore operations", () => {
const concurrency = 2;
let semaphore: Semaphore;
let running: number;
let executions: number;
beforeEach(() => {
semaphore = new Semaphore(concurrency);... | true |
75d51289b2ccc491f06e6a06bb113b15f2688770 | TypeScript | doodlewind/skia-rs | /index.d.ts | UTF-8 | 8,191 | 2.71875 | 3 | [
"MIT"
] | permissive | export interface DOMMatrix2DInit {
a: number
b: number
c: number
d: number
e: number
f: number
}
interface DOMMatrixReadOnly {
readonly a: number
readonly b: number
readonly c: number
readonly d: number
readonly e: number
readonly f: number
readonly is2D: boolean
readonly isIdentity: boolea... | true |
f0e4c1f254ce82cf62775b9e04980efd66eeaa73 | TypeScript | tdawes/board-at-home | /games/coup/src/engine/reveal.ts | UTF-8 | 755 | 2.71875 | 3 | [] | no_license | import { State, Card } from "../api";
export default (state: State, playerId: string, target: string, card: Card) => {
if (
!state.requiredUserInputs[playerId].some(
event => event.type === "reveal-card" && event.target === target,
)
) {
throw new Error("Player does not have to reveal a card.");
... | true |
b6df23ad5dacd38d1e5da6f6ea302d045d0954b4 | TypeScript | Verion91/discord-dice-ui | /src/components/ModifierModal/ModifierModalTypes.ts | UTF-8 | 294 | 2.53125 | 3 | [] | no_license | interface DiceSelectedType {
diceAmount: number;
diceType: string;
}
export interface ModifierModalPropTypes {
closeModifierModal: () => void;
requestRoll: ( obj : { diceType: string, diceAmount: number, modifier: number }) => void;
diceSelected: DiceSelectedType;
showModal: boolean;
}
| true |
836fd80aa7282e83d357daa7a4f9b8d70399d6e8 | TypeScript | ziminny/folhacpa_api | /src/services/questionDateResponseQuestion/InsertDateResponse_dateResponseQuestion_feedbackService.ts | UTF-8 | 2,087 | 2.578125 | 3 | [] | no_license | import { getManager, getRepository } from "typeorm";
import AppError from "../../errors/AppError";
import DateResponseQuestion from "../../models/dateResponseQuestion";
import Feedback from "../../models/feedback";
import QuestionDateResponseQuestion from "../../models/questionDateResponseQuestion";
interface Request ... | true |
059328ead08409213effb9a489f45badf3d6a4e4 | TypeScript | cybernetics/bueno | /src/action.ts | UTF-8 | 732 | 3.046875 | 3 | [] | no_license | import { isPromise } from "./utils"
export type Action<A> =
Promise<A> | A
export function chain<A, B>(
a : A | Promise<A>,
f : (a : A) => B | Promise<B>
) : B | Promise<B> {
if (isPromise(a)) {
return (a as Promise<A>).then(f)
}
return f(a as A)
}
export function all<A>(
as : (A | Promise<A>)[]
) ... | true |
dcd7bbcaad6a4e31c782698e8fee5fd56039e463 | TypeScript | macbury/detox | /app/javascript/store/models/Group.ts | UTF-8 | 1,300 | 2.671875 | 3 | [] | no_license | import { computed, observable, flow, action } from "mobx"
import { Model } from "../core/Model"
import ChannelsRepository from "../repositories/ChannelsRepository"
import { Channel } from "./Channel"
export class Group extends Model {
@observable
public name : string
@observable
public icon : string
@observa... | true |
2094b27dae5de2906e11e2676e7e44322bc0b175 | TypeScript | biscuitandrye/playground | /res/ts/2048/game2048Utils.ts | UTF-8 | 1,197 | 2.9375 | 3 | [] | no_license | class Game2048Utils {
/*
* These are the randomly generated numbers
* and the probability of one or the other.
*/
public static GEN_NUM_1: number = 2;
public static GEN_NUM_2: number = 4;
public static GEN_NUM_1_PROB: number = 0.9;
public static isGameOver(board: Game2048Board): boo... | true |
9541f8b13f5f147144e4dc2b19fddd106781325f | TypeScript | 5calls/5calls | /src/common/models/external.ts | UTF-8 | 1,768 | 2.609375 | 3 | [
"MIT"
] | permissive | export interface ActBlue {
__initialized: boolean; // indicates that the actblue script is loaded and ready to go
requestContribution(
config: RequestActBlueContributionConfig
): Promise<ActBlueContribution>;
addEventListener(eventName: string, completion: ActBlueCompletionCallback);
}
export type ActBlueC... | true |
01f5672b37d68cf3212f1e7168f0cf4835313d5a | TypeScript | aryelgois/lexorder | /src/LexOrder.spec.ts | UTF-8 | 14,889 | 3.09375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | import LexOrder from './LexOrder'
import type { SymbolConverter } from './types'
const mockedSymbols = '01234567'
// constructor
const symbolsLowerLimit = ['0', '1']
const symbolsTooFew = ['one']
const symbolsUndefinedZero = [...'0123']
delete symbolsUndefinedZero[0]
const symbolsUndefinedFirst = [...'0123']
delet... | true |
cfd3b1cdd4145e2ff38183e8dde7a972862ddd39 | TypeScript | ceefour/webiny-js | /packages/api-security/src/authenticator/SecurityIdentity.ts | UTF-8 | 297 | 2.765625 | 3 | [
"MIT"
] | permissive | type SecurityIdentityData = {
id: string;
type: string;
displayName: string;
[key: string]: any;
};
export class SecurityIdentity {
id: string;
type: string;
displayName: string;
constructor(data: SecurityIdentityData) {
Object.assign(this, data);
}
}
| true |
164bdc2b56157c6f04a89b7ef3c1705ee498f3dc | TypeScript | giantswarm/happa | /src/model/clients/FetchAdapter.ts | UTF-8 | 2,048 | 2.96875 | 3 | [
"Apache-2.0"
] | permissive | import { GenericResponse } from 'model/clients/GenericResponse';
import {
HttpClientImpl,
HttpRequestMethods,
IHttpClient,
} from 'model/clients/HttpClient';
/**
* This is an adapter for using an HttpClient with the same
* interface as the global `fetch` function.
*/
class FetchAdapter<T extends IHttpClient =... | true |
1def3db84cdf9176b9098cfd2c9b6d4b332136fd | TypeScript | Tenpi/Kisaragi | /commands/config/leave.ts | UTF-8 | 11,458 | 2.609375 | 3 | [
"GPL-3.0-only"
] | permissive | import {GuildChannel, Message, MessageAttachment} from "discord.js"
import {Command} from "../../structures/Command"
import {Permission} from "../../structures/Permission"
import {Embeds} from "./../../structures/Embeds"
import {Functions} from "./../../structures/Functions"
import {Images} from "./../../structures/Ima... | true |
2e0a6876f7106502866807b6b1223833f4dfb971 | TypeScript | Flipkart/recyclerlistview | /src/core/dependencies/DataProvider.ts | UTF-8 | 3,004 | 3.21875 | 3 | [
"Apache-2.0"
] | permissive | import { ObjectUtil } from "ts-object-utils";
/***
* You can create a new instance or inherit and override default methods
* Allows access to data and size. Clone with rows creates a new data provider and let listview know where to calculate row layout from.
*/
export abstract class BaseDataProvider {
public ro... | true |
83a1ad5d84678a5e82cd7badc84874d06982c63b | TypeScript | patwritescode/graphql-for-legacy-meetup | /infrastructure/services/ProductService.ts | UTF-8 | 1,374 | 2.5625 | 3 | [] | no_license | import {
IProductService,
ProductDetail,
ProductInventory,
IProductInventoryLoader,
IProductInventoryLoaderType,
IProductDetailLoaderType,
IProductDetailLoader,
IProductReviewsLoaderType,
IProductReviewsLoader,
ProductReview
} from "../../core";
import { injectable, inject } from... | true |
f1434ea29037a42953b0c4db215a5a0f99d2d603 | TypeScript | florida/data_structures | /src/FunctionalLinkedList.ts | UTF-8 | 2,528 | 4.125 | 4 | [
"ISC"
] | permissive | type LinkedListNode<T> = {
value: T;
next: LinkedListNode<T> | null;
};
// Create a new node
function createNode<T>(value: T): LinkedListNode<T> {
return { value, next: null };
}
// Append a node to the end of the list
function append<T>(head: LinkedListNode<T> | null, value: T): LinkedListNode<T> {
const ne... | true |
01e8cdf6fa3f9940647ebdeb2341e9c1808e823e | TypeScript | MarceloJrdaLuz/jw | /back/src/utils/encrypt.ts | UTF-8 | 1,153 | 2.9375 | 3 | [] | no_license | import * as crypto from 'crypto';
const md5 = (str: string) => crypto.createHash('md5').update(str).digest('hex');
const algorithm = 'aes-256-cbc';
const encrypt = (str?: string) => {
if (!str) return undefined;
const secret = process.env.SECRET_KEY;
const iv = Buffer.from(crypto.randomBytes(16));
const cip... | true |
f19083c41dcc6c7ad19f56caa080bcda495f3d9f | TypeScript | mddr/taiga-ui | /projects/core/utils/mask/test/masked-number-string-to-number.spec.ts | UTF-8 | 1,004 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | import {CHAR_NO_BREAK_SPACE} from '@taiga-ui/cdk';
import {maskedNumberStringToNumber} from '../masked-number-string-to-number';
describe('Converts the text value of a number obtained from a mask into a number', () => {
it('the separator works correctly', () => {
expect(
maskedNumberStringToNum... | true |
4fb2cf3dea22eefd143cc01fd2183835bbda5c38 | TypeScript | NativeScript/ns-ng-animation-examples | /app/hero/hero.service.ts | UTF-8 | 1,454 | 3 | 3 | [
"Apache-2.0"
] | permissive | import { Injectable } from "@angular/core";
class Hero {
constructor(
public name: string,
public state = "inactive"
) { }
toggleState() {
this.state = (this.state === "active" ? "inactive" : "active");
}
}
let ALL_HEROES = [
"Windstorm",
"RubberMan",
"... | true |
fc11cdce1e57e9b4dc83588dba532084656d4241 | TypeScript | javelinco/s3_upload | /api/src/helpers/format-time-length.ts | UTF-8 | 620 | 3.1875 | 3 | [] | no_license | export function formatTimeLength(msInput: string): string {
let resultString = '';
let ms = parseInt(msInput, 10);
if (isNaN(ms)) {
throw new Error(`Error parsing '${msInput}': not a number`);
}
if (ms < 0) {
ms = -ms;
}
const s = Math.floor((ms / 1000) % 60);
const m = Math.floor((ms / 1000 / ... | true |
316091847f1b0198cc40de7df1ef6de31090850a | TypeScript | icivann/ivann | /tests/unit/app/parser/ParsedFunction.spec.ts | UTF-8 | 735 | 2.734375 | 3 | [
"MIT"
] | permissive | import ParsedFunction from '@/app/parser/ParsedFunction';
describe('parsedFunction', () => {
it('stringifies a function with args correctly', () => {
const parsedFunction = new ParsedFunction(
'func',
' line1\n line2\n',
['arg1', 'arg2'],
);
const expected = 'def func(arg1, arg2):\n'... | true |
3a866adbf9ec544709851ad5609876ed49e81eb3 | TypeScript | apem789/mtv | /src/utils/throttle.util.ts | UTF-8 | 700 | 3.5 | 4 | [] | no_license | /**
* 节流类-规定时间内重复执行同一个函数,但是按照一定的时间段生效函数的行为
* @param 场景: 输入检查等
*/
export class ThrottleUtil {
/**
* 基于时间戳的节流
* @param func 需要包装的函数
* @param delay 延迟时间,单位ms
* @param triggeNow 函数是否默认执行一次,默认: false
*/
use(func: Function, delay: number) {
console.log('123132')
let previous = Date.now()
con... | true |
3a50c08e2ffb3fe3bd0a47efec412c7873b01710 | TypeScript | locusnine/serverless-template | /src/search/SearchEngine.ts | UTF-8 | 255 | 2.578125 | 3 | [] | no_license | export class SearchEngine{
getResults(){
var results = [];
for(var i=0; i<3; i++){
results.push({
id: i + 1,
value: `Result-${i + 1}`
})
}
return results;
}
} | true |
cf0da1406d9786c84441943d4ef2fa9e7bdb8241 | TypeScript | ruisunon/machinat | /packages/stream/src/operators/bufferDebounceTime.ts | UTF-8 | 1,480 | 2.734375 | 3 | [
"MIT"
] | permissive | import { ServiceScope } from '@machinat/core/service';
import Stream from '../stream';
import { OperatorFunction } from '../types';
type DebouncingCache<T> = {
scope: ServiceScope;
buffer: T[];
timeoutId: NodeJS.Timeout;
};
/** @category Operator */
const bufferDebounceTime = <T>(t: number): OperatorFunction<T,... | true |
fe1ddcfe13be0e975d6e3e9a2376a6af0cc28000 | TypeScript | rkichenama/clio | /src/client.ts | UTF-8 | 1,728 | 2.640625 | 3 | [
"MIT"
] | permissive | /* istanbul ignore file */
import { AxiosResponse } from 'axios';
import Axios from './axios';
// const pullLimitsFromHeaders = (response: AxiosResponse<ApiSuccess>) => {
// console.log(response)
// const { limit, remaining, reset: resetAt } = [
// 'x-ratelimit-limit',
// 'x-ratelimit-remaining',
... | true |
5cba6c2f2ec638dda5268e9271d38ed116509284 | TypeScript | SiulOrutra96/Umvel-app | /src/app/auth/auth.service.ts | UTF-8 | 779 | 2.53125 | 3 | [] | no_license | import { Injectable } from '@angular/core';
import { AngularFireAuth } from '@angular/fire/auth';
import { Router } from '@angular/router';
@Injectable({
providedIn: 'root'
})
export class AuthService {
constructor(public auth: AngularFireAuth, private router: Router) { }
// Logs in to firebase
login(email: ... | true |
befbc71ecc68dc42bc475ebe4f1bf7b56c18740f | TypeScript | rodrigooler/mixmax-starwars-slash-command | /functions/_shared/util/Request.ts | UTF-8 | 801 | 2.765625 | 3 | [] | no_license | import * as ax from 'axios';
// strange behavior with axios
// tslint:disable-next-line:no-duplicate-imports
import { AxiosPromise } from 'axios';
import { constants } from './Constants';
const {
default: { get },
} = ax;
const errorTimeout = (reject, urlRequest: string) =>
reject(new Error(`timeout at [${urlRequ... | true |
ab87efae975fc0531246b12411bee8c1160138f7 | TypeScript | liaoziyang/ban-notifier | /backend/src/user/user.entity.ts | UTF-8 | 1,415 | 2.8125 | 3 | [
"MIT"
] | permissive | import { Entity, PrimaryGeneratedColumn, Column, BaseEntity, ManyToMany, Unique } from 'typeorm';
import Match from '../match/match.entity';
import * as bcrypt from 'bcrypt';
/**
* Database entity
*/
@Entity()
@Unique(['username'])
export default class User extends BaseEntity {
/**
* Primary key
*/
... | true |
f5bfef961b301ca149c57d07094e9355b84e6815 | TypeScript | opengovsg/GoGovSG | /src/server/util/time.ts | UTF-8 | 1,333 | 3.53125 | 4 | [
"MIT"
] | permissive | import moment from 'moment'
import 'moment-timezone'
export type Time = {
/**
* Number representing a day of the week.
*
* 0: Sunday.
* 1: Monday.
* 2: Tuesday.
* 3: Wednesday.
* 4: Thursday.
* 5: Friday.
* 6: Saturday.
*/
weekday: number
/**
* Number representing the hours into ... | true |
aa427d253189fa1a9d7d2ac5a363dabc3017f222 | TypeScript | sakho3600/domifa | /packages/frontend/src/app/modules/usagers/interfaces/rdv.ts | UTF-8 | 1,208 | 2.96875 | 3 | [
"Apache-2.0"
] | permissive | export class Rdv {
public dateRdv: Date;
public jourRdv: {
day: number;
month: number;
year: number;
};
public heureRdv: {
hour: number;
minute: number;
};
public userId: string;
public userName: string;
public isNow: string;
constructor(rdv?: any) {
const today = new Date();... | true |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 26