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 |
|---|---|---|---|---|---|---|
a7128b12432e7927a64d7086b1f11cd4679cd926 | TypeScript | GuilhermRodovalho/trainee-ascii | /backend/src/services/DeleteVideoService.ts | 2.5625 | 3 | import { getRepository } from 'typeorm';
import path from 'path';
import fs from 'fs';
import Video from '../models/Video';
export default class DeleteVideoService {
public async execute(id: string): Promise<void> {
const videoRepository = getRepository(Video);
const video = await videoRepository.findOne({
... |
84af4bdd354361375d8506e9504ebdf1f1e455bc | TypeScript | fakenickels/es2077-nodebr | /slides/src/snippets/VariantDemoSwitch.ts | 3.140625 | 3 | let greeting = (person: Person) => {
switch (person.kind) {
case SchoolPersonEnum.Teacher:
return "Hey Professor!"
case SchoolPersonEnum.Director:
return "Hello Director."
case SchoolPersonEnum.Student:
if(person.name === "Richard") return "Still here Ricky?"
else return `Hey, ${p... |
b6a8125e77fd8b1609c3a211dc53308bc25f6e8d | TypeScript | kahole/edamagit | /src/utils/commitCache.ts | 2.65625 | 3 | import { Commit, Repository } from '../typings/git';
const commitCache: { [hash: string]: Promise<Commit> | undefined; } = {};
export function getCommit(repository: Repository, hash: string): Promise<Commit> {
let cachedResult = commitCache[hash];
if (cachedResult !== undefined) {
return cachedResult;
}
... |
a06316fb01cbb086dd5f254de971c118ef5b39e6 | TypeScript | kuehnert/react-kakuro | /webapp/src/utils/checkPuzzle.ts | 3.25 | 3 | import { CellType, IGameData, IHintCell, INumberCell } from 'models/cellModels';
export function checkPuzzle(puzzle: IGameData) {
const { cells } = puzzle;
// TODO: Which clever checks should we implement?
// * are the sums possible?
let sumHorizontal = 0;
let sumVertical = 0;
// * are the values of rows ... |
b0a7adfd64a25c8c99852851c374737551359cb6 | TypeScript | ahmadykhan555/data-structures-and-algorithms | /Code/slidingWindow.ts | 4.125 | 4 | /**
* Write a solution that finds a window that results in max sum
* Approach:
* get the sum of first three and store it somewhere
* start at index window + 1
* add index window + 1 to the temp sum and subtract index window - 1 and add window +1
* see if this results in a sum greater than the previous
* if so, u... |
ae39e356414a82e999202e6951be9eac2a501103 | TypeScript | lfcd85/trading-api-browser | /openapi/ibkrweb/client/models/SecdefInfo.ts | 2.640625 | 3 | // @ts-nocheck
/* eslint-disable */
/**
* Client Portal Web API
* Client Poral Web API
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { ... |
b5bf909e40e1f52b2bdffe218142f3121671617f | TypeScript | OmarEQMS/Tlacubazar | /angular-mysql-crud/client/src/app/models/PaymentMethodEnum.ts | 2.84375 | 3 | export class PaymentMethodEnum {
idPaymentMethodEnum?: number;
paymentMethod?: _PaymentMethodEnum.PaymentMethodEnum;
constructor(paymentMethodEnum?: PaymentMethodEnum) {
if (paymentMethodEnum != null) {
this.idPaymentMethodEnum = paymentMethodEnum.idPaymentMethodEnum,
this.paymentMethod = payment... |
3686ff4b92a864a94f4a567f5c6ee85bb6140400 | TypeScript | microsoftgraph/msgraph-sdk-javascript | /test/common/tasks/OneDriveLargeFileUploadTask.ts | 2.59375 | 3 | /**
* -------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
* See License in the project root for license information.
* ---------------------------------------------------------------... |
ca3dd066b086cf323d953c4fd4d22f8042f3a6ab | TypeScript | fork-archive-hub/deno-crdt | /logoot/internal/node.ts | 3.296875 | 3 | import { Id, IdJSON, Ordering } from "./id.ts";
export interface NodeJSON {
id?: IdJSON;
value?: string;
children: NodeJSON[];
size: number;
empty: boolean;
}
export class Node {
#id: Id | null;
#value: string | null;
#parent: Node | null = null;
#children: Node[] = [];
#size: number = 1;
#em... |
02b7eaa32961cabc85b66e1a62a77d2e5fa0be8d | TypeScript | nivinjoseph/n-domain | /src/configurable-domain-context.ts | 2.59375 | 3 | import { given } from "@nivinjoseph/n-defensive";
import { DomainContext } from "./domain-context";
export class ConfigurableDomainContext implements DomainContext
{
private _userId: string;
public get userId(): string { return this._userId; }
public set userId(value: string) { this._userId = value; }
... |
b826830ea2947fde6262984d54cd32bb1a23598c | TypeScript | pipopotamasu/vue-function-tester | /src/result.ts | 2.859375 | 3 | class Result<returnValue> {
_returnVal: returnValue;
constructor(returnVal: returnValue, context: { [key: string]: any }) {
this._returnVal = returnVal;
Object.keys(context).forEach((key) => {
// FIXME: generate getter
(this as any)[key] = context[key];
});
}
get return() {
return ... |
3aefc6dadc7a96af4a13e687e59cfc8e3b1c00c8 | TypeScript | Ruddickmg/js-wars | /front/javascript/src/browser/menu/arrows/arrow.ts | 3.0625 | 3 | import {Position} from "../../../game/map/coordinates/position";
import curry from "../../../tools/function/curry";
import capitalizeFirstLetter from "../../../tools/stringManipulation/capitalizeFirstLetter";
import pixelStringConverter, {PixelStringConversion} from "../../../tools/stringManipulation/pixelStringConvers... |
fe01835d22b6ef90501cf90e90df14fb6b3e2d08 | TypeScript | Rumec/pb138-project | /DB-server/src/dataAccess/ordersDataHandler.ts | 2.984375 | 3 | import { Order, PrismaClient } from '@prisma/client';
/**
* Gets all orders for specified user by user id
* Default ordering: by id descending
*/
export async function getByUser(db: PrismaClient, userId: number): Promise<Order[]> {
return db.order.findMany({
where: {
user_id: userId
... |
ed91c44c598798bc3afc1a2ef3c6b4aa9a1d5336 | TypeScript | labs42io/itiriri-async | /lib/utils/isAsyncIterable.ts | 2.75 | 3 | export function isAsyncIterable<T>(item: any): item is AsyncIterable<T> {
return typeof (<AsyncIterable<T>>item)[Symbol.asyncIterator] === 'function';
}
|
fb9dc8214ff2f37db44b39e0a919c03ca4984ac6 | TypeScript | vagfsantos/challenge | /angular-chat/src/app/chat.service.ts | 2.625 | 3 | import { Injectable, EventEmitter } from '@angular/core';
import { Message } from './chat/Message';
@Injectable()
export class ChatService {
// event emitted when new messages comes from the user or server
onNewMessageIsAvaiable$: EventEmitter<Message[]> = new EventEmitter();
// list of the entire chat
conve... |
d695bf819586d1f424ba7ef74d5c9568b1dc55d2 | TypeScript | fiveagency/node-seed | /server/src/shared/io/io-error.ts | 2.6875 | 3 | export class IoError extends Error {
public code: string;
public detail: string;
constructor(detail, code) {
super(detail);
this.code = code;
this.detail = detail;
Error.captureStackTrace(this, this.constructor);
}
}
export const ioErrorAdapter = {
serialize(err: Error) {
if (err instan... |
5688c2d427c7d618ffdc4668c2d4a93f99dceb63 | TypeScript | bave8672/leetcode | /src/merge-sorted-array/merge-sorted-array.ts | 3.53125 | 4 | /**
Do not return anything, modify nums1 in-place instead.
*/
function merge(nums1: number[], m: number, nums2: number[], n: number): void {
nums1.splice(m);
nums2.splice(n);
let i = 0;
for (const n of nums2) {
while (i < nums1.length && nums1[i] < n) {
i++;
}
nums1... |
0b6f0d4d45d497f39a75bb94bd7aa2b69f59f2b0 | TypeScript | williangaspar/tic-tac-toe | /dist/core/grid.d.ts | 2.671875 | 3 | import ICell from "./i/iCell";
import IGrid from "./i/iGrid";
import { ILine } from "./i/iVictory";
export default class Grid implements IGrid {
private cellGrid;
private range;
private plays;
constructor(Cell: new () => ICell);
reset(): void;
setCell(x: number, y: number, play: number): boolean... |
f5f4a2ec0a0ec79859c0e91f526e015cfdd8c0dd | TypeScript | TimJentzsch/tor-user-stats | /tests/transcription.test.ts | 2.640625 | 3 | import RComment from '../src/comment';
import Transcription from '../src/transcription';
import { imageMD, imageMDApr1, imageMDBugged, imageMDOld } from './transcription-templates';
describe('Transcription', () => {
describe('fromComment', () => {
test('should create transcription from normal transcription comme... |
ab8a7c28211c42532ec994166688d8433aa02022 | TypeScript | ricoarisandyw/garapin-education | /utils/LoadBase64Image.ts | 2.890625 | 3 | import axios from "axios";
// function LoadBase64Image(url: string) {
// return axios.get(url, { responseType: 'blob' })
// .then(response => Buffer.from(response.data, 'binary').toString('base64'))
// }
type Callback = (value: string) => void
function LoadBase64Image(url: string, callback: Callback) {
... |
2481793cf3a2cc79e598c3c8cd7e3a1b8db17023 | TypeScript | Edweis/bricabrac | /app/src/constants/types.ts | 2.5625 | 3 | import { NavigationScreenProp, NavigationRoute } from 'react-navigation';
import firebase from '../firebase';
type Timestamp = firebase.firestore.Timestamp;
export type NavigationProp = NavigationScreenProp<NavigationRoute>;
export type ConceptT = string;
export type ConceptDepSetT = {
name: ConceptT;
deps: Concep... |
165e3609d190553c5bd5b924246ca3703f0c7f0b | TypeScript | Xan0C/curbl-gltf-viewer | /src/components/camera/lookAtCameraComponent.ts | 2.71875 | 3 | import { ECS, Component } from '@curbl/ecs';
import { vec3 } from 'gl-matrix';
export type LookAtCameraConfig = {
target?: vec3;
up?: vec3;
panning?: vec3;
zoom?: vec3;
};
@ECS.Component()
export class LookAtCameraComponent implements Component {
protected _target: vec3;
protected _up: vec3;
... |
67fce734a78d23d32524054b7d26631d7d192a29 | TypeScript | bernhardfritz/falldown | /src/index.ts | 2.53125 | 3 | import Constants from './constants';
import Game from './game';
import Utils from './utils';
import './assets/style.css';
(() => {
if (Utils.isMac()) {
document.getElementById('key1').textContent = '⌥';
document.getElementById('key2').textContent = '⌘';
}
if (navigator.userAgent.indexOf('Ch... |
695fc7edcc34c98cb8f446a317ca3c48af631c65 | TypeScript | rxstack/platform-callbacks | /src/validate.ts | 2.515625 | 3 | import {
OperationCallback,
OperationEvent,
OperationEventsEnum,
} from '@rxstack/platform';
import {validate as _validate, ValidatorOptions} from 'class-validator';
import * as _ from 'lodash';
import {BadRequestException} from '@rxstack/exceptions';
import {classToPlain, plainToClass} from 'class-transformer';
... |
7276efc649b6a38728db6bf6661eac28d35ffce7 | TypeScript | fanmingfei/ISEEU | /src/config.ts | 3.015625 | 3 | // 问题有之前问题的条件
// 剧情也有之前问题的条件
export enum ConfigType {
/** 旁白 */
dialogue = 'dialogue',
/** 对话 */
question = 'question',
/** 步骤 */
step = 'step',
/** 不展示 */
empty = 'empty'
}
export interface Next {
type: ConfigType,
id: string;
}
interface Condition {
id: string;
answer: string[]
}
export in... |
9e62812466c9cf79e88182788d4c716ccbc8ca3c | TypeScript | BroloPwnsU/jinx-shop-ext | /src/app/classes/notification.ts | 2.90625 | 3 | export class Notification {
message: string = '';
isError: boolean = false;
constructor (
message: string
, isError: boolean
) {
this.message = message;
this.isError = isError;
}
} |
7f0abfc8c0e023fb482b51ec836ed831a616f4b1 | TypeScript | SMazeikaite/eshop-angular-ui | /src/app/services/store.service.ts | 2.5625 | 3 | import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Product } from '../models/product.model';
import { BehaviorSubject, Observable } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class StoreService {
items$ = new BehaviorSubject<Product[]>([]);
pro... |
61d3bf420bb6d88ee21f205034996833184d92e0 | TypeScript | MedN-Dev/vue_typescript_starter_kit | /src/store/store.ts | 2.578125 | 3 | import Vue from 'vue'
import Vuex, {ActionTree, MutationTree} from 'vuex'
import * as T from '../types/common'
import {DaptinClient} from 'daptin-client'
Vue.use(Vuex);
export interface Todo {
title: String,
completed: Boolean
created_at: Date,
updated_at: Date,
}
const daptinClient = new DaptinClient("http... |
d9df30e37c0073e56ddbecd539eb55572705712e | TypeScript | rockysims/handshakeTracker | /src/app/app.model.ts | 2.71875 | 3 | interface Entry {
id: string,
data: EntryData
}
interface EntryData {
name: string,
tags: string[],
note: string,
unixTimestamp: number,
location: LatLong
}
interface LatLong {
latitude: number,
longitude: number
}
interface MapBounds {
min: LatLong,
max: LatLong
}
interface DateRange {
min: Date,
max: Dat... |
5dc1c17b4627dbbd5a08fde7056eb87ce0689e02 | TypeScript | tolgaberk/iris_data_mining | /src/iris/main.ts | 2.6875 | 3 | import { model, resetModel } from "./model";
import * as tf from "@tensorflow/tfjs";
import {
testDataTensor,
testOutputTensor,
trainDataTensor,
trainOutputTensor,
} from "./data";
import { Tensor } from "../typings";
import {
drawAccuracy,
drawBoxPlot,
drawHistograms,
drawLossGraph,
drawSplom,
draw... |
01ca4968b2d26e8d00a06ab1ffebea554a11640f | TypeScript | LuizEduOML/FiapProjetoDevOps | /Front-End/GestaoDeEstoque/src/app/home/home.component.ts | 2.53125 | 3 | import { Component, OnInit, ViewChild } from '@angular/core';
import { MatPaginator, MatTableDataSource } from '@angular/material';
interface Category {
value: string;
viewValue: string;
}
export interface Product {
id: number;
descricao: string;
categoria: string;
quantidade: number;
ultimaAtualizacao:... |
26c26d5023776b11a5835a95f76f4f897aeed7f6 | TypeScript | Carleslc/IonicAI | /src/providers/utils/strings.ts | 3.046875 | 3 | export class StringUtils {
static capitalize(s: string) {
s = s.trim();
return s ? s[0].toUpperCase() + s.slice(1) : ''
}
}
|
02c0874e2670ecc1e913f0dc2b6dc38435742070 | TypeScript | koorosh/ui | /packages/cluster-ui/src/store/analytics/analytics.reducer.ts | 2.65625 | 3 | import { createAction } from "@reduxjs/toolkit";
type Page =
| "statements"
| "statementDetails"
| "transactions"
| "transactionDetails";
type PagePayload<T> = {
page: Page;
value: T;
};
type SortingPayload = {
tableName: string;
columnName: string;
ascending?: boolean;
};
const PREFIX = "adminUI/... |
db359233db1a828de8ef759904c5c3a2d697ac59 | TypeScript | jasperstafleu/ums-node | /app/spec/Templating/JsEngine.spec.ts | 2.984375 | 3 | import JsEngine from "$stafleu/Templating/JsEngine";
describe('JsEngine', () => {
let engine: JsEngine,
fileExists: (fileName: string) => boolean,
getContent: (fileName: string, encoding: string) => string;
beforeEach(() => {
engine = new JsEngine({
existsSync: (fileName) =... |
f5d8eacdcfa5e7c88d5e13084ef3e97d76fa80c9 | TypeScript | joker1u3/tiny-entity | /sqlite/test/entityObj_test.ts | 2.796875 | 3 | import { SqliteDataContext } from '../index';
import { EntityObject } from '../../entityObject';
import { Assert } from './assert';
class Account extends EntityObject<Account> {
UserName: string;
Password: string;
toString(): string { return "Account"; }
}
class Employee extends EntityObject<Employee> {
... |
65e6c341f6098ac2295ce3d18bccde4cffc19ad0 | TypeScript | maxcamp/sfdx-core | /test/unit/config/configStoreTest.ts | 2.640625 | 3 | /*
* Copyright (c) 2018, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import { expect } from 'chai';
import { BaseConfigStore } from '../../../src/config/configSt... |
bdd47ead9b222855519a71d30b1da5e73539c7b1 | TypeScript | 1905-javareact/project1-micheledexter | /src/actions/login.actions.ts | 2.59375 | 3 | import { History } from "history";
import { Dispatch } from "redux";
import { User } from "../models/user";
import { checkPermission } from "../utilities/handle";
import { apiClient } from "../axios/user-api-client";
export const loginTypes = {
INVALID_CREDENTIALS: 'LOGIN_INVALID_CREDENTIALS',
FAILED_LOGIN: 'LOGIN... |
9cf5bc533c387c247b7cebaafde7e24b26b46632 | TypeScript | msolvaag/redux-db | /src/models/__tests__/FieldSchemaModel.spec.ts | 2.859375 | 3 | // tslint:disable:object-literal-key-quotes
import { createDatabase } from "../..";
import { TYPE_MODIFIED, TYPE_PK } from "../../constants";
import errors from "../../errors";
import Database from "../Database";
import FieldSchemaModel from "../FieldSchemaModel";
const TABLE1 = "TABLE1";
const TABLE2 = "TABLE2";
con... |
d8ae94f57333e7129d457ad3e3d2dc0f17e2df73 | TypeScript | Aareksio/zombie-net | /src/resolvers/zombieItem.resolver.ts | 2.921875 | 3 | import { Zombie } from '../entities/Zombie';
import { Arg, Int, Mutation, Resolver } from 'type-graphql';
import { EntityManager, Repository } from 'typeorm';
import { InjectManager, InjectRepository } from 'typeorm-typedi-extensions';
import { Item } from '../entities/Item';
@Resolver()
export class ZombieItemResolve... |
0df0906faac3e91fb93ad1eddd7cb97c9eb27d3e | TypeScript | rafaleal/cwbmess-delivery-mgmt-panel | /src/app/domain/enums.ts | 2.59375 | 3 | export enum ContractTypeEnum {
Billed,
Spontaneous
}
export enum CustomerTypeEnum {
Legal,
Natural
}
export enum DeliveryStatusEnum {
Registered,
Ongoing,
Completed,
Canceled
}
export enum PaymentStatusEnum {
Pending,
Paid
}
export enum PaymentTypeEnum {
Money,
Transf... |
e1f09625a2262fd10de5972162d9cb28796fc381 | TypeScript | kdharani/protractor-ui-reference | /protractor-typescript-cucumber/pages/fedex.page.ts | 2.765625 | 3 | import {browser, element, ElementArrayFinder, ElementFinder, protractor} from 'protractor';
import { logger } from '../../utils/log4jsconfig'
export class Page {
protected route = '';
protected timeout = {
SHORT: 2000,
MEDIUM: 30000,
LONG: 60000
};
protected sels: {
/*
... |
285bd5b8948e0c0e506bc5a3f5c3065bfed41005 | TypeScript | aperdizs/rdr2-animals | /src/animals/animal.controller.ts | 2.609375 | 3 | import { CreateAnimalDto } from './dto/create-animal.dto';
import { AnimalDto } from './dto/animal.dto';
import { PaginationDto } from 'common/dto/pagination.dto';
import { Controller, Req, Get, ParseIntPipe, Param, Post, Body, Put, Delete, Query } from "@nestjs/common";
import { ApiUseTags, ApiResponse, ApiBearerAuth,... |
4b56c2f724bb6a001a2729227a2e80ae1109208b | TypeScript | maurer2/kfz | /src/components/Plate.ts | 3.578125 | 4 |
interface LicencePlate {
key: string;
district: string;
state: string;
isCurrent: boolean;
country: string;
getPlate(): string;
getDistrict(): string;
getState(): string;
getLetterAtPosition(position: number): string;
startsWith(letter: string): boolean;
hasLetterAtPosition(position: number, let... |
f6d00b74d5d966d3967fca1ff4678a3853a2aa60 | TypeScript | crejb/bgg-list | /src/app/geek-list-filter-criteria/text-filter/text-filter.ts | 2.828125 | 3 | import { ListItemFilter } from '../list-item-filter';
import { GeekListItemDetail } from '../../geek-list-item-detail';
export class TextFilter implements ListItemFilter{
value : string;
constructor(value : string){
this.value = value;
}
GetText(): string {
return `${this.value}`;
}
Passes(ite... |
2224be66b4899539bdfea1000a3c8b478fe9da87 | TypeScript | abhi6711/speech-portal | /src/app/tabs/view-speech/view-speech.component.ts | 2.640625 | 3 | /******************************* Description of Component *********************************
View speech component interacts with the dataservice and when the page initializes it calls
dataservice to send the data which user wants to view. If no data is send then it will show
error message otherwise it will show the sp... |
17a6893bfb9023259bff68fbede23ce23e07635b | TypeScript | midrock/vue-mapp | /src/helpers/calc.ts | 2.8125 | 3 | import { VMCalcAxisPosition } from "./types";
export function getAxisPositionStyle(params: VMCalcAxisPosition): object {
const {
triggerDistance,
triggerSize,
windowLength,
contentSize,
offset,
backPositionName,
frontPositionName,
distanceProp,
... |
765c7d85de7b01599431bdd6d8bd6fdee161fbfc | TypeScript | Rhadow/nature_of_code | /src/elements/Vehicle.ts | 2.640625 | 3 | import * as numjs from 'numjs';
import { IVehicle } from './ElementInterface';
import { ICanvasState } from '../components/Canvas/CanvasInterfaces';
import { magnitude, normalize, getCoordinateAfterRotation, limit, mapping, findNormalPoint } from '../utils/math';
import FlowField from './FlowField';
import Path from '.... |
86b9aff5ec19f128b89d6da7ce5f35ca28eac8dd | TypeScript | palantir/redoodle | /src/Action.ts | 2.9375 | 3 | /**
* @license
* Copyright 2017 Palantir Technologies, Inc.
*
* 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... |
06bd5585498ddcdf82720fcef1e688004454ca76 | TypeScript | stephschumacher/SkyGoRemoteTest | /pages/ShopOffersPage.ts | 2.765625 | 3 | import { ClientFunction, Selector, t } from 'testcafe';
import { log, LogType } from "../common/log";
import { splitNumberPoundsPence } from "../common/helper"
export default class ShopOffersPage {
tiles: Selector;
offerPrice: Selector;
constructor () {
this.tiles = Selector("#tab-1").find("... |
802e66f1a0aee3d31920cc461d4ce546306c96c8 | TypeScript | alinz/complex | /src/core/math/util.ts | 2.65625 | 3 | const degree = Math.PI / 180
export const EPSILON = 0.000001
export function toRadian(a: number): number {
return a * degree
}
export function toDegree(radian: number): number {
return radian / degree
} |
d25b023ac04ff1b3fd69f9ca3ea89fd236a231bd | TypeScript | mamunhpath/leetcode | /src/factorial-trailing-zeroes/pro.ts | 2.921875 | 3 | // HELP:
export function trailingZeroes(n: number) {
let res = 0
let f = 1
while (f * 5 <= n) {
f *= 5
res += parseInt(n / f)
}
return res
}
|
18a9e6e2cd0ddb6704352873aba5f2a1108b2f0f | TypeScript | Swrve/swrve-smarttv-sdk | /SwrveSDK/src/utils/platforms/IPlatform.ts | 2.671875 | 3 | import { IKeyMapping } from "./IKeymapping";
import { IAsset } from "./IAsset";
export interface IPlatformName {
readonly name: string;
readonly variation: string;
}
export type DevicePropertyName = "language" | "countryCode" | "timezone" | "firmware" | "deviceHeight" | "deviceWidth";
export type NetworkStat... |
69db220bb6d6b407325a6705a85f2fbcc8884e32 | TypeScript | yusukebe/ogpParser | /src/test/e2e.spec.ts | 2.515625 | 3 | import parser, { OgpParserResult } from '../main'
import fs from 'fs'
import path from 'path'
import nock from 'nock';
const html = fs.readFileSync(path.join(__dirname, 'fixture/demo.html'))
const htmlOembed = fs.readFileSync(path.join(__dirname, 'fixture/demo_oembed.html'))
const htmlOembedXml = fs.readFileSync(path.... |
443514c19918e5281e05872213bcf8187db36554 | TypeScript | cvimbert/phaser-test | /src/app/phaser/bones/bone-node.class.ts | 2.84375 | 3 | import { ObjectContainer } from './object-container.class';
export class BoneNode extends ObjectContainer {
//rotation: number = 0;
parentNode: BoneNode;
childrenObjects: ObjectContainer[] = [];
childrenObjectsById: { [key: string]: ObjectContainer } = {};
childrenNodes: ObjectContainer[] = [];
... |
d74e30e1a6cdb3b7c63ff3e9e6f0cee918a757a7 | TypeScript | pallad-ts/config | /packages/main/src/Providers/EnvProvider.ts | 2.640625 | 3 | import {Provider} from "../Provider";
import {ValueNotAvailable} from '../ValueNotAvailable';
import {fromNullable, just, none} from "@sweet-monads/maybe";
import {left, right} from "@sweet-monads/either";
export class EnvProvider extends Provider<string> {
constructor(private key: string,
private ... |
4c6ff6cbd8b9b708acde9d2b3965c26f32e65e58 | TypeScript | green-fox-academy/JafariMahdi | /3-week/4-day/power.ts | 3.328125 | 3 | 'use strict';
function powerIt(baseNumber, power) {
if (power <= 1) {
return baseNumber;
} else {
return baseNumber * powerIt(baseNumber, power - 1)
}
}
console.log(powerIt(2, 9)); |
6f1f0eb5776f3237604a24c1c8b19da7cd77988c | TypeScript | MarinaSachse/Rawmate | /app/src/js/languageHelper.ts | 2.75 | 3 | import Strings from "./strings";
export class LanguageHelperBasic {
_activeLanguage = "de" ;
_strings: {
[propsName:string]: { [propsName: string]: string }
};
constructor(strings: {
[propsName:string]: { [propsName: string]: string }
}) {
this._strings = strings
}
... |
976fd3ea7b4ee11157c1c916fafebb731b1e8d9b | TypeScript | dhruv-99/SwabhavRef | /NodeJS/Typescript/CustomerTest.ts | 2.609375 | 3 | import {Customer , Address} from './Customer'
let c = new Customer(1 , "Dhruv", "Ballikar");
console.log(c.ID);
console.log(c.FullName);
let a = new Address(102, "Sheetal nagar", "Mira Road");
console.log(a.Address); |
2fa4ef58cff45f390c7359eabf75e32b905ef092 | TypeScript | timotej-orcic/SBZ-2018-Frontend | /sbz-app/src/app/models/display-file.ts | 2.78125 | 3 | export class DisplayFile {
id: number;
name: string;
type: string;
base64: string;
src: string;
constructor(id: number, name: string, type: string, base64: string) {
this.id = id;
this.name = name;
this.type = type;
this.base64 = base64;
this.src = this.c... |
ce032f3849ca2112a3af5337fb661bc70ed57cf4 | TypeScript | gabrielnavas/todo_backend | /src/infra/db/postgresql/repositories/user-repository.ts | 2.515625 | 3 | import {
FindOneUserByEmailRepository,
FindOneUserByIdAndTokenRepository,
InsertOneUserRepository
} from '@/data/interfaces/'
import { PGHelper } from '@/infra/db/postgresql/helpers/pg-helper'
export class UserPostgreSQLRepository
implements
InsertOneUserRepository,
FindOneUserByEmailRepository,
FindOneUserByIdA... |
e74fae2f964ebb43621c6247aaa165aa562f139e | TypeScript | SmartterHealth/healthcare-bots | /src/bots/icd2/commands/search-codes/SearchCodesCommandHandler.ts | 2.6875 | 3 | import { TurnContext } from 'botbuilder';
import * as sql from 'mssql';
import 'reflect-metadata';
import { Assert } from '../../assert';
import log from '../../logger';
import settings from '../../settings';
import { Command, CommandHandlerBase, CommandStatus, ICommandResults, Traceable } from '../CommandHandlerBase';... |
fd17e6a9fecf420b889a3a0deb4ca4923ce9bbdd | TypeScript | indraraj26/TypeORMCRUD | /src/helper/ResponseFormat.ts | 2.65625 | 3 | var response_format = {
success: '',
status: '',
data: [],
error: []
};
export function extractErrorMessages(error) {
return error.map(a => a.msg);
}
export function setResponse(status = 404, error = null, data = null) {
if (error) {
return {
...response_format,
... |
2f2ea0bf87a7d633695bed7d1f4a377741f3dd2d | TypeScript | thangnt294/ttkt-deploy | /src/middleware/member-leave-team-validation-middleware.ts | 2.640625 | 3 | import { NextFunction, Request, Response } from 'express';
import { getCurrentUserId } from '../utils/RequestUtils';
import TeamService from '../domain/team/service/team-service';
import Team, { TeamDocument } from '../domain/team/Team';
import {getVal, isEqual} from '../utils/ObjectUtils';
import ApplicationError from... |
02d4ce01ddadeea6d81d216fde8ba4f3b105eae9 | TypeScript | bubkoo/number-abbreviate | /src/index.ts | 3.515625 | 4 | import { round, commatize } from './utils'
export type UnitsType = { [key: string]: number }
export type UnitItem = { unit: string; value: number }
export type CommatizeOptions = {
/**
* Length of each divided parts. Default `3`.
*/
division?: number
/**
* Separator of each divided parts. Default `,`.... |
cf406df9b3197d727578f25a9472a2ba4cd3f4cb | TypeScript | uwinkler/prof-frisby | /src/either/Left.ts | 3.296875 | 3 | export class Left<T> {
constructor(protected x: T) {}
static of<T>(x: T) {
return new Left(x);
}
map(_func: Function) {
return Left.of(this.x);
}
chain(_func: Function) {
return Left.of(this.x);
}
fold(error: Function, _result: Function) {
return error(this.x);
}
}
|
5380644ffdc25ef5586e7a61b7899f3afd574e8d | TypeScript | Obfuscators-2021/kliveide | /packages/klive-emu/src/renderer/ide/commands/NewProjectCommand.ts | 2.84375 | 3 | import {
CommandBase,
CommandContext,
CommandResult,
TraceMessage,
TraceMessageType,
} from "../tool-area/CommandService";
import { Token, TokenType } from "../../../shared/command-parser/token-stream";
import { ideToEmuMessenger } from "../IdeToEmuMessenger";
import {
CreateKliveProjectResponse,
GetRegis... |
edbd879b018dd08348d6eae1b109d6ada3192269 | TypeScript | urantialife/react-modal-hook | /src/useModal.ts | 2.84375 | 3 | import { useContext, useEffect, useState, useCallback, useMemo } from "react";
import { ModalContext, ModalType } from "./ModalContext";
/**
* Callback types provided for descriptive type-hints
*/
type ShowModal = () => void;
type HideModal = () => void;
/**
* Utility function to generate unique number per compone... |
f0277aabf8896611a8295a23985ff81649aac11f | TypeScript | DSigmund/asm | /src/libs/database.ts | 2.625 | 3 | import moment from 'moment'
const fs = require('fs')
const path = require('path')
const { promisify } = require('util')
class Database {
private _path: string
private _channel: any
private _posts: any
private _writeFile: any
private _readFile: any
constructor (databasePath: string) {
// tslint:disable-... |
e4c01fd53dc89e44c31bfef1ecc8a5ceaf3805ac | TypeScript | wallaceturner/ravendb-nodejs-client | /src/Documents/Session/IDocumentQuery.ts | 2.75 | 3 | import { IDocumentQueryBaseSingle } from "./IDocumentQueryBaseSingle";
import { IEnumerableQuery } from "./IEnumerableQuery";
import { QueryResult } from "../Queries/QueryResult";
import { DocumentType } from "../DocumentAbstractions";
import { QueryData } from "../Queries/QueryData";
import { GroupBy } from "../Q... |
53ac00f2fb266c52d9a9efa1d3137fa13317c975 | TypeScript | UTC503-cnam/AlexandreMoro | /S02/ex7.ts | 3.671875 | 4 |
class CloneMap{
private inputArray : number[] = new Array();
Double( e : number[] ): void {
for (let i in e) {
this.inputArray[i] = e[i] * 2;
}
}
Triple( e : number[] ):void {
for (let i in e) {
this.inputArray[i] = e[i]* 3;
}
}
Square... |
e17ddd2512598dbf4b7b1f818387956423892d30 | TypeScript | folio-org/ui-calendar | /src/typings/stripes/components/lib/Button/Button.d.ts | 2.828125 | 3 | import {
AriaAttributes,
ForwardRefExoticComponent,
MouseEventHandler,
PropsWithoutRef,
ReactNode,
RefAttributes,
} from 'react';
import { LinkProps } from 'react-router-dom';
import { RequireOneOrNone } from '../../util/typeUtils';
export interface ButtonBaseProps extends AriaAttributes {
/** Changes th... |
6b2756df17188ef37c3c1df9dd087edf8883bec1 | TypeScript | allmonday/react-pg | /src/page/class/index.ts | 2.71875 | 3 | import * as React from "react";
interface WelcomeProps {
name: string
}
class Welcome extends React.Component<WelcomeProps, undefined> {
render() {
return (React.DOM.h1("Hello" + this.props.name));
}
} |
cc5193f16f94cd5a918daecaa610d22608f15b30 | TypeScript | Surlix/REyeker | /REyeker-DataAnalyses/src/NeedlemanWunsch.ts | 3.25 | 3 | let str = [];
/**
* a function to return the minium value on the left, topleft, top of the current value, used for NW algorithm
*
* @param current_x the current x value in respect to the matrix
* @param current_y the current y value in respect to the matrix
* @param sequence_a the sequence a which is c... |
33fab0c14e3157398bd96713284f3a8c5d0ebb2c | TypeScript | andyjia/leetcode-typescript | /solutions/subtree_of_another_tree.ts | 3.75 | 4 | import { BinaryTreeNode } from "../data_structures/binary_tree.ts";
// 572. Subtree of Another Tree
// https://leetcode.com/problems/subtree-of-another-tree/
export default function isSubtree<T = number>(
s: BinaryTreeNode<T> | null,
t: BinaryTreeNode<T> | null
): boolean {
return s === null
? s === t
: ... |
c5d69bd5acaf1bfb76b897b94c7ad91a484640c6 | TypeScript | innovationdigitalbr/copy-image-clipboard | /src/index.ts | 2.875 | 3 | export async function getBlobFromImageSource(
imageSource: string,
): Promise<Blob> {
const response = await fetch(`${imageSource}`)
return await response.blob()
}
export function isJpegBlob(blob: Blob): boolean {
return blob.type.includes('jpeg')
}
export function isPngBlob(blob: Blob): boolean {
return bl... |
88d2f1ec261e6d6a1ea8c6a29fe506afb6fcdc7d | TypeScript | material-motion/indefinite-observable-js | /dist/IndefiniteObservable.d.ts | 2.828125 | 3 | /** @license
* Copyright 2016 - present The Material Motion Authors. All Rights Reserved.
*
* 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/LI... |
004055342a196ceeba05c892901d878b1aece78e | TypeScript | thundercore/ThunderStorage | /backend/src/util/index.ts | 2.75 | 3 | export function isError(o): o is Error {
return (
o instanceof Error ||
(typeof o.stack === 'string' && typeof o.message === 'string')
)
}
|
872b3b3996675bc9bc707d0faf1e663284fa9599 | TypeScript | one-piece-team1/one-piece-trip | /src/interfaces/response.interface.ts | 2.765625 | 3 | export interface ResponseBase {
statusCode: number;
status: 'error' | 'success';
message: any;
[futureKey: string]: any;
}
export interface SignInResponse extends ResponseBase {
accessToken?: string;
}
type Status = 'error' | 'success';
export interface IResponseBase<T> {
status: Status;
statusCode: num... |
0acb96a28b029d4a717369f31fa7b216f957ec63 | TypeScript | iopa-io/iopa-botadapter | /packages/iopa-botadapter-schema-auth/src/httpAuthCredentials.ts | 2.53125 | 3 | import * as url from 'url'
import * as AuthenticationConstants from './authenticationConstants'
import {
HttpAuthAppCredentials as IHttpAuthAppCredentials,
HttpRequest,
HttpResponse,
} from 'iopa-botadapter-types'
/**
* HttpAuthAppCredentials auth implementation and cache
*/
export class HttpAuthAppCrede... |
833815641cd99eef294fe33d49f454f40333e2a3 | TypeScript | m-mittal/Ang5 | /ang5app1/my-app/src/app/ng-book-reedit-exercise/LinkItem-class.ts | 2.59375 | 3 | export class linkItemClass{
id: number;
voteCount: number;
Title: String;
Link: String;
voteUp(obj:linkItemClass){
this.voteCount = this.voteCount + 1;
}
voteDown(obj:linkItemClass){
this.voteCount = this.voteCount - 1;
}
}
|
ea526f70205a54cf27c8a4e35ddeb168aa614728 | TypeScript | johanste/adl | /packages/adl/test/checker/global-namespace.ts | 2.578125 | 3 | import { assert } from "console";
import { createTestHost, TestHost } from "../test-host.js";
describe("adl: global namespace", () => {
let testHost: TestHost;
beforeEach(async () => {
testHost = await createTestHost();
});
describe("it adds top level entities to the global namespace", () => {
it("ad... |
35ad932753ba6c296cb88562fc289db5596060c9 | TypeScript | hpfs74/james-frontend | /src/app/profile/reducers/settings.ts | 2.875 | 3 | import { Settings } from '../models/settings';
import * as SettingsActions from '../actions/settings';
export type Action = SettingsActions.All;
export interface State {
loading: boolean;
loaded: boolean;
settings: Settings | {};
}
export const initialState: State = {
loading: false,
loaded: false,
setti... |
b43ccd5659fe778e00c096d33e6d2641db496cd7 | TypeScript | Aden-git/open-source | /libs/forms/core/src/control-mode.types.ts | 2.53125 | 3 | import { DynControlConfig } from './control-config.types';
import { DynControlParams } from './control-params.types';
// edit|display|table|filter
export type DynControlMode = string; // Mode ID
// config overrides per mode, handled by DynFormMode
export type DynControlModes<M extends string = DynControlMode> = {
[... |
88e8111c5ba48ba3df5d415b372cff8d74ca17a6 | TypeScript | ozknemoy/staffjs | /src/shared/validators.ts | 3 | 3 | import {HandleData} from "./handle-data";
import {Sequelize} from "sequelize-typescript";
export const phoneRegExp = /\d{11,13}/;
export const innRegExp = /\d{10,10}/;
export function invalidINN(inn: string): boolean {
// разрешаю null and ''
if (inn === null || inn === '') {
return false
}
return (!inn... |
fcee38d5f75c11ce1e230e1147c1ea3883ca6545 | TypeScript | bpc1985/simple-survey | /src/survey/models/survey.ts | 2.8125 | 3 | /* tslint:disable:no-string-literal */
export interface ISurvey {
$key?: string;
completed: boolean;
createdAt: number;
name: string;
age: string;
colors: string[];
}
export class Survey implements ISurvey {
completed: boolean = false;
createdAt: number = firebase.database['ServerValue']['TIMESTAMP'];... |
7e5fce166fe50ca8490812d09b7081c17c0e2338 | TypeScript | Flouics/client | /assets/script/zero/BaseClass.ts | 2.71875 | 3 | import { objToJson, jsonToObj } from "../utils/Decorator";
import UUID from "../utils/UUID";
export default class BaseClass {
_classDbKey:string;
_class = null;
_classId: string = "";
static _instance = null;
constructor(_class?:any){
if (_class != null) {
this.... |
c655bfbf1e7ab49918e703dd5d08f5db102b8137 | TypeScript | atlassian-labs/compiled | /packages/babel-plugin/src/utils/comments.ts | 3.03125 | 3 | import type { BabelFile } from '@babel/core';
import type { NodePath } from '@babel/traverse';
import type * as t from '@babel/types';
import type { Metadata } from '../types';
/**
* Get comments for `path` in both the line before and on the current line.
*
* e.g.
* `<div css={{color: 'green'}} /> // @compiled-di... |
40386d40e69fe78d1053289924a74bea7ec0242c | TypeScript | Caramel-Pudding/Weather-Forecasting-Sample-App | /src/network/weather-api/__tests__/fetch-weather.test.ts | 2.609375 | 3 | import fetchMock from "jest-fetch-mock";
import { weatherDataStub } from "@/tests//stubs";
import { fetchWeather } from "../methods/fetch-weather";
import { city } from "../../../consts/mocked";
import { buildWeatherAPIRequestRoute } from "../utilities/link-builders";
describe("Fetch Weather", () => {
beforeEach(() ... |
4b3535d9c4ef445701b37ffbe53a6681d2b92bfa | TypeScript | Jontem/aoc2019 | /run.ts | 2.921875 | 3 | import * as fs from "fs";
import fetch from "node-fetch";
const usage = `Usage: <day>`;
const cliArgs = process.argv.slice(2);
const day = parseInt(cliArgs[0], 10);
if (!isFinite(day)) {
console.log(`Please specify which day to run`);
console.log(usage);
process.exit(1);
}
const cookie =
"todo";
interface Pa... |
0a53e23561b141ea02cae28396f512853cf04e43 | TypeScript | zulianperdana/weather_react | /src/constants/units.ts | 2.578125 | 3 | interface UnitParameter {
temperature: string;
windSpeed: string;
pressure: string;
precip: string;
totalSnow: string;
}
const metric: UnitParameter = {
temperature: 'Celcius',
windSpeed: 'Kilometers/Hour',
pressure: 'Millibar',
precip: 'Millimeters',
totalSnow: 'Centimeters',
}... |
b9aae7b4894a07c4936d904b67123f5360d81997 | TypeScript | ArcticZeroo/advent-2020-node | /days/day13/solution.ts | 2.5625 | 3 | import { config } from 'dotenv';
import { readFileSync } from 'fs';
import * as path from 'path';
import * as advent from 'advent-api';
import { InfiniteGrid } from '../../common/grid';
import * as reducers from '../../common/reducers';
import { chars, chineseRemainder, first, lcm, lines, paragraphs } from '../../commo... |
2ab9c9ea1d0aadccaabe32e3303ce5aef76536a4 | TypeScript | nxtep-io/nano-discovery | /lib/storage/RedisDiscoveryStorage.ts | 2.578125 | 3 | import * as Redis from 'redis';
import { promisify } from 'util';
import { BaseDiscoveryStorage } from './BaseDiscoveryStorage';
export interface RedisDiscoveryStorageOptions extends Redis.ClientOpts {
}
export class RedisDiscoveryStorage implements BaseDiscoveryStorage {
name = 'redis';
protected client: Redis... |
d611aab6d31b350b7fadb43389ed4c1073b47874 | TypeScript | hmcts/rpx-xui-webapp | /src/hearings/converters/hearing-length.answer.converter.ts | 2.734375 | 3 | import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { State } from '../store';
import { AnswerConverter } from './answer.converter';
export class HearingLengthAnswerConverter implements AnswerConverter {
public transformAnswer(hearingState$: Observable<State>): Observable<string> {
re... |
b2893a1b7704d594cfb513b197384d8e5fe88cf8 | TypeScript | richmolj/es-y | /src/conditions/builder.ts | 2.6875 | 3 | import omit = require('lodash.omit')
import pick = require('lodash.pick')
// Order matters! Process not then and/or LAST
const OPERATORS = [
'eq',
'prefix',
'match',
'matchPhrase',
'gt',
'gte',
'lt',
'lte',
'pastFiscalYears',
'exists',
]
// NOT before and/or
const COMBINATORS = [
'not',
'and',... |
47292e0f8bccf367a4a212eca0969ffc9c413db6 | TypeScript | dlorenso/cipher-challenge | /ts/CipherSolver.ts | 3.0625 | 3 | /**
* Copyright (c) 2018 D. Dante Lorenso <dante@lorenso.com>. All Rights Reserved.
* This source file is subject to the MIT license that is bundled with this package
* in the file LICENSE.txt. It is also available at: https://opensource.org/licenses/MIT
*
* Dante's Cipher Solver is based on work by several onli... |
1349ee4f0cf94778eb8dd284cbba8f9c499b3d99 | TypeScript | bisignam/automatajs | /src/app/automata-gui/automata-color-picker/automata-color-picker.component.ts | 2.546875 | 3 | import { Component, Output, EventEmitter, Input } from '@angular/core';
import * as THREE from 'three';
@Component({
selector: 'app-color-picker',
templateUrl: './automata-color-picker.component.html',
styleUrls: ['./automata-color-picker.component.scss'],
})
export class AutomataColorPickerComponent {
private... |
74e88d4f67edd34d578aff739c7fd1caf6ea7081 | TypeScript | Ddeak/ReactNativeTesting | /db/schema.ts | 2.53125 | 3 | const CustomerSchema = {
name: "Customer",
primaryKey: "id",
properties: {
id: { type: "string", indexed: true },
firstName: "string",
surname: "string",
phoneNumber: "string",
notes: "string",
pets: "Pet[]",
createdAt: "date",
updatedAt: "date... |
0fd48139283f94cb93323efa2b472045393a3866 | TypeScript | Yutiy/react-blog | /server/app/middleware/authHandler.ts | 2.9375 | 3 | import { Context } from 'egg';
/**
* role === 1 需要权限的路由
* @required 'all': get post put delete 均需要权限。
*/
const verifyList1 = [
{ regexp: /\/article\/output/, required: 'get', verifyTokenBy: 'url' }, // 导出文章 verifyTokenBy 从哪里验证 token
{ regexp: /\/article/, required: 'post, put, delete' }, // 普通用户 禁止修改或者删除、添加文章
... |
a52e854ccc3579077c2f93914a4da1014faa46cd | TypeScript | Study-Swap/study-swap-web | /src/utils/firebaseUtils/comments.ts | 2.5625 | 3 | // Firebase import
import firebaseApp from "firebase/app";
import firebase from "../../constants/Firebase";
// Constants import
import { collections } from "../../constants/FirebaseStrings";
import { commentModel } from "../../constants/Models";
import { commentAnalytics } from "../analyticsUtils";
// Makes code cle... |
dcefb37d88cc3a05d97003b40bf13c3740a5a920 | TypeScript | vectoritc/bpmn-studio | /src/services/date-service/date.service.ts | 3.34375 | 3 | export class DateService {
private _date: Date;
private _day: string;
private _month: string;
private _year: string;
private _hour: string;
private _minute: string;
constructor(date: Date) {
this._date = date;
}
public asFormattedDate(): string {
const formattedDate: string = `${this._day}.... |