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 |
|---|---|---|---|---|---|---|
c31a58b03dd40432b8492f7c4d1ad538f40a8f6b | TypeScript | Vivify-Ideas/cypress-testrail-reporter | /src/lib/testrail.validation.ts | 2.90625 | 3 | import { TestRailOptions } from "./testrail.interface";
const glob = require('glob');
const TestRailLogger = require('./testrail.logger');
export class TestRailValidation {
constructor(private options: TestRailOptions) {
}
public validateReporterOptions (reporterOptions) {
if (!reporterOptions) {
thr... |
f2dfd9aa68ed548bf44ba60a9c59a87c055a3c1e | TypeScript | isabella232/azure-maps-spider-clusters | /src/extensions/EventManager.ts | 2.578125 | 3 | import { SpiderClusterManager } from '../SpiderClusterManager';
import { SpiderClusterEventArg } from '../SpiderClusterEventArg';
/**
* This module partially defines the map control.
* This definition only includes the features added by using the drawing tools.
* For the base definition see:
* https://docs.microso... |
5c8b77fc00ddf35b23aa5046668ce4417a45316a | TypeScript | GamesProSeif/jr-gopnik | /src/commands/mod/ban.ts | 2.6875 | 3 | import { Argument, Command } from 'discord-akairo';
import { GuildMember, Message, MessageEmbed } from 'discord.js';
import { COLORS, MESSAGES } from '../../util/constants';
export default class BanCommand extends Command {
constructor() {
super('ban', {
aliases: ['ban'],
description: {
content: MESSAGES.... |
c201dec7053f83a365b6f001798bb17bd2c14b02 | TypeScript | SpocWeb/davinci-newton | /src/lib/math/Spacetime1.ts | 2.765625 | 3 | import { readOnly } from "../i18n/readOnly";
import { AbstractMeasure } from "./AbstractMeasure";
import { gauss } from "./gauss";
import { GeometricNumber } from "./GeometricNumber";
import { GeometricOperators } from "./GeometricOperators";
import { GradeMasked } from "./GradeMasked";
import { QQ } from "./QQ";
impor... |
7d9b317a0808426399a13a87f0cf9b1acf4eb870 | TypeScript | sen-yang/rschedule | /packages/core/src/generators/calendar-test-setup.ts | 2.609375 | 3 | import { context, dateAdapterFn, TIMEZONES, toISOStrings } from '../../../../tests/utilities';
import { DateAdapter, DateAdapterBase } from '@rschedule/core';
import {
Calendar,
CollectionsGranularity,
Dates,
ICollectionsArgs,
Rule,
Schedule,
} from '@rschedule/core/generators';
export default function ca... |
ec8a7592acc030a419e9c4a76aeffd5d5de49bef | TypeScript | pandapirate/mean-template | /server/routes/transaction.ts | 2.5625 | 3 | import * as express from 'express';
import { Request, Response } from 'express';
import { Transaction } from '../models/transaction';
const router = express.Router();
router.get('/api/todo/:name', (req: Request, res: Response) => {
const name = req.params.name;
const greeting = { greeting: `Hello, ${ name }` };... |
97a39071d7f350fd0d876f215786223852a1220f | TypeScript | adobe/griffon-toolkit | /packages/core/src/filterKit.ts | 2.671875 | 3 | /*
Copyright 2020 Adobe. All rights reserved.
This file is licensed to you 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 law or agre... |
1b7c2a63f1589ca2a7e23a0a66a131ad53ecdf69 | TypeScript | xlfsummer/mp-painter | /src/lib/painter-fill-stroke/linear-gradient.ts | 2.765625 | 3 | import { ColorStop } from "../value";
import { PainterGradientPatternOption, PainterGradientPatternStyle } from "./base";
import { PainterElement } from "../painter-element/base";
export interface PainterLinearGradientOption extends PainterGradientPatternOption{
type: "linear-gradient"
colorStops: ColorStop[],... |
44587e55cb77d67a094d1bbc4552b704f3e80cfb | TypeScript | folkies/tunepal-ng | /src/app/transcription/Transcriber.worker.ts | 2.6875 | 3 | import { expose } from 'comlink';
import Transcriber, { TranscriptionResult } from './transcriber';
import { ITranscriber, PushResult, TranscriptionInitParams } from './transcription';
export class TranscriberImpl implements ITranscriber {
private transcriber: Transcriber;
private signal: Float32Array[];
p... |
ac8629fb97727209a69155ca84c21832118b2d68 | TypeScript | stutrek/eagle-oss | /data/labelPieces.ts | 3 | 3 | import { Glass, Piece } from './types';
export function labelPieces(inputPieces: Piece[], glasses: Glass[]) {
const piecesByGlass: Record<string, Piece[]> = {};
const piecesById: Record<string, Piece> = {};
for (const piece of inputPieces) {
piecesById[piece.id] = piece;
if (piece.glass ==... |
76869f5a2d6ad1623e783f2e70a89923cbd4c5b9 | TypeScript | sy1117/bookstagram | /server/src/users/entities/user.entity.ts | 2.578125 | 3 | import { ObjectType, Field } from '@nestjs/graphql';
import {
Entity,
Column,
BeforeInsert,
BeforeUpdate,
OneToMany,
PrimaryGeneratedColumn,
} from 'typeorm';
import { IsString } from 'class-validator';
import * as bcrypt from 'bcrypt';
import { InternalServerErrorException } from '@nestjs/common';
import {... |
af572c9a061ae3b1029dbe9711e83dec968f1eb0 | TypeScript | roziscoding/vscode-reveal | /test/browserHelper.jest.ts | 2.59375 | 3 | import * as fs from 'fs'
import * as open from 'open'
import * as os from 'os'
import { DEFAULT_CHROME_PATH, getChromePath, openInBrowser } from '../src/BrowserHelper'
import { mocked } from 'ts-jest/utils'
test('TODO again ...', () => {
expect(true).toBe(true)
})
// jest.mock('os');
// jest.mock('fs');
// jest.... |
ef194a67aaa757e506dcdade5975224ca87fff48 | TypeScript | Sinclair81/Homebridge-Tasmota-TS | /src/util/accessories/SwitchAccessory.ts | 2.65625 | 3 | import { wait } from "../wait";
let Characteristic: any;
export class SwitchAccessory {
static switchType: string = "switch";
static infoModel: string = "Switch";
public switchService: any;
log: Function;
request: any;
ip: string;
relais: number;
user: string;
password: string;
updateInterval:... |
0e171ec07dc5c556cd71da86a29ab610bea40f74 | TypeScript | ryu1kn/vscode-edit-with-shell | /src/test/lib/command-reader.test.ts | 2.546875 | 3 | import * as assert from 'assert';
import {any, mockMethods, mockType, verify, when} from '../helper';
import {CommandReader} from '../../lib/command-reader';
import * as vscode from 'vscode';
import {HistoryStore} from '../../lib/history-store';
describe('CommandReader', () => {
it('allows user to pick and modif... |
538b9abcadbde8975b499b86e3116dd79d975c0c | TypeScript | einfachiota/explorer | /api/src/models/clients/hornet/IGetTrytesRequest.ts | 2.609375 | 3 | export interface IGetTrytesRequest {
/**
* The list of hashes to get.
*/
hashes: string[];
}
|
1f0ace5454d848d5e5d2dc4108eb6e97e5d81d24 | TypeScript | jinlii/form-example | /src/app/app.component.ts | 2.703125 | 3 | import { Component } from '@angular/core';
import { QuestionService } from './question.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
providers: [QuestionService]
})
export class AppComponent {
title = 'form-example';
questions: any[];... |
7fede3efd6879fea30faaf3718a337ef98727128 | TypeScript | marius15ru/HEF | /HEF-API/ClientApp/src/app/shared/enums.ts | 2.546875 | 3 | export enum DataOperation {
Undefined = 0,
Insert = 1,
Read = 2,
Update = 3,
Delete = 4,
List = 5,
ListByPlant = 6,
ListByUser = 7,
ListByJob = 8,
}
export enum Role {
'Óskilgreint' = 0,
'Verkaðili' = 1,
'Stjórnandi' = 2,
}
export enum UserStatus {
'Óskilgreint' = ... |
5356ea80bcab6b5559389f09c059d49f476a6107 | TypeScript | subgan82/calcite-app-components | /src/components/utils/dom.ts | 2.921875 | 3 | export function getElementDir(el: HTMLElement) {
return getElementProp(el, "dir", "ltr");
}
export function getElementProp(el: HTMLElement, prop, value) {
const closestWithProp = el.closest(`[${prop}]`);
return closestWithProp ? closestWithProp.getAttribute(prop) : value;
}
export interface CalciteFocusableElem... |
975db265d6ec847f4a3ad71733ee278290911f61 | TypeScript | searchfe/ts2php | /src/features/json.ts | 2.671875 | 3 | /**
* @file json
* @author cxtom(cxtom2008@gmail.com)
*/
import {
EmitHint,
CallExpression,
createLiteral,
createNodeArray,
ListFormat,
isPropertyAccessExpression,
isIdentifier,
isCallExpression
} from 'byots';
import {
createDiagnostic
} from '../utilities/error';
const method... |
87a95328d0c44619df034e72832aea6ddd6d277b | TypeScript | Viktor286/code-samples | /src/Engineering/Arrays/1502-can-make-arithmetic-progression-from-sequence.ts | 3.8125 | 4 | // https://leetcode.com/problems/can-make-arithmetic-progression-from-sequence/
// A sequence of numbers is called an arithmetic progression
// if the difference between any two consecutive elements is the same.
// Given an array of numbers arr, return true if the array can be
// rearranged to form an arithmetic progre... |
375135ecfc76cc34ea3a7adcacabd7947b718aaa | TypeScript | miguelyoobic95/ngIfModalBug | /design-system/stencil/src/utils/pipes/base.ts | 2.6875 | 3 |
export class Pipe<A, C> {
transform(value: A, options: any = {}): C {
return null;
}
}
|
c831b557aa30447d6ee39250089170241e485e82 | TypeScript | shawnrpnus/iSkill | /frontend/src/actions/roleAction.ts | 2.609375 | 3 | import axios from "axios";
import { GET_ALL_ROLES } from "./types";
export const getAllRoles = () => {
return (dispatch: any) => {
axios.get("/api/role/all").then(response => {
dispatch(getAllRolesSuccess(response.data))
console.log(response.data);
}).catch(err => {
console.log(err);
alert("Error fetc... |
1b36f0f80e2abd3d90f7c62921a686534944fc45 | TypeScript | RubenDeFreyne/Kolveniershof-web | /src/app/models/workdayTemplate.model.ts | 2.578125 | 3 | import {User} from './user.model';
import {BusUnit} from './busUnit.model';
import {ActivityUnit} from './activityUnit.model';
import {LunchUnit} from './lunchUnit.model';
export class WorkdayTemplate {
id: string;
templateName: string;
weekNumber: number;
dayNumber: number;
dayActivities: ActivityUnit[];
... |
8b1ca883a0c18dc56b19e22da616d4a02c8babf6 | TypeScript | RichardGreen-IS2/signoz | /frontend/src/lib/logs/fieldSearch.ts | 2.515625 | 3 | export const fieldSearchFilter = (
searchSpace = '',
currentValue = '',
): boolean => {
if (!currentValue || !searchSpace) {
return true;
}
return searchSpace.toLowerCase().indexOf(currentValue.toLowerCase()) !== -1;
};
|
09f2fe612d82dfe72dbbd3d476399a2448fcaf61 | TypeScript | ZacharyKamerling/rts_client | /rts_client/js/app/interaction/build_order.ts | 2.546875 | 3 | module Interaction.BuildOrder {
export class BeingIssued implements Interaction.Core.Control {
width: number;
height: number;
type: number;
imgs: string[];
constructor(width: number, height: number, type: number, imgs: string[]) {
this.width = width;
... |
ab49a4f185cf908ea260231beea15152e6e139ef | TypeScript | maroon775/node-nest-learn | /parrot-wings/src/transactions/entities/transactions.entity.ts | 2.515625 | 3 | import {
Column,
CreateDateColumn,
Entity,
JoinColumn,
ManyToOne,
OneToOne,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm';
import { UsersEntity } from '../../users/entities/users.entity';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
@Entity('transactions')
export cla... |
2d1fb8cec0b92682005a1c7f6f9bd69ac2367bc3 | TypeScript | bradenhs/fnx | /src/api/oneOf.ts | 3.046875 | 3 | // tslint:disable
import { OneOfDescriptor, descriptionTypes } from '../core'
/**
* Describes an item in the state tree that can be one of multiple types.
* https://fnx.js.org/docs/api/oneOf.html
*/
export function oneOf<A, B>(a: A, b: B): A | B
/**
* Describes an item in the state tree that can be one of multiple... |
7c642bb2d5e42313670667a4bb5858c4c395ebd7 | TypeScript | WaldiirNeto/-project_base | /src/controllers/user/user.service.ts | 2.625 | 3 | import { MessageEnum } from 'enums/message.enum';
import { Injectable, InternalServerErrorException, NotFoundException, UnprocessableEntityException } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { UserRepository } from 'repository/user.repository';
import { FindUsersQueryDto, Upda... |
38eaf97a33f695fce9437d927c9005b99f052a26 | TypeScript | scoopapa/DH | /data/mods/spookyhalloweenfuntimes/items.ts | 2.546875 | 3 | export const Items: {[itemid: string]: ModdedItemData} = {
cursedportrait: {
name: "Cursed Portrait",
spritenum: 385,
fling: {
basePower: 70,
},
onDamagingHitOrder: 1,
onDamagingHit(damage, target, source, move) {
if (!target.hp) {
if (target.hasType('Ghost')) source.addVolatile('curse');
// ... |
708f395c5f4d3d2b8de048072f18f588811291ba | TypeScript | manuelnaranjo/aws-sdk-typescript | /output/typings/aws-polly.d.ts | 2.515625 | 3 | // Type definitions for aws-sdk - Amazon Polly
// Project: https://github.com/aws/aws-sdk-js
// Definitions by: https://github.com/ingenieux/aws-sdk-typescript
// GENERATED CODE - DO NOT EDIT
// COMMENTED <reference path="./aws-sdk.d.ts" />
declare module "aws-sdk" {
/**
* apiVersion: 2016-06-10
* endpointPre... |
366675b7e09d5b589fd2d8998e7a7a871dbb4172 | TypeScript | landzcape/landzcape | /explorer/webapp/src/app/domain/layout/elastic-insert/container.ts | 3.28125 | 3 | import {Node} from './node';
export class Container {
private _parent?: Container;
constructor(
public readonly value: any,
public readonly children: Container[]) {
}
propagateParent() {
this.children.forEach(child => {
child.parent = this;
child.propagateParent();
});
}
set... |
953bf436f4fd9e51883108362c3e250d514ac4ea | TypeScript | uidu-org/guidu | /packages/data/dashlets/src/utils/index.ts | 2.5625 | 3 | import { group, max, mean, sum } from 'd3-array';
import numeral from 'numeral';
// http://tristen.ca/hcl-picker/#/hlc/14/0.53/433339/E8D489
export const colors = [
'#E8D489',
'#CCCB84',
'#B2C182',
'#9BB682',
'#87AA81',
'#769D81',
'#6A907F',
'#62827A',
'#5C7474',
'#555960',
'#58666B',
'#504B54'... |
ac5ef762c0099fc90b87c96c5629fd0ac561ed8c | TypeScript | FrederikBolding/unlock | /unlock-app/src/services/graphService.ts | 2.5625 | 3 | import ApolloClient from 'apollo-boost'
import { utils } from 'ethers'
import locksByManager from '../queries/locksByManager'
import keyHoldersByLocks from '../queries/keyholdersByLock'
export class GraphService {
public client: any
connect(uri: string) {
this.client = new ApolloClient({
uri,
})
}... |
4401462ed9317432ecfd734871dee73436efebca | TypeScript | aws-amplify/amplify-ui | /packages/ui/src/theme/tokens/fonts.ts | 2.84375 | 3 | import {
DesignTokenValues,
FontValue,
OutputVariantKey,
} from './types/designToken';
type FontVariant = 'variable' | 'static';
type BaseFonts<
Output extends OutputVariantKey = unknown,
Platform = unknown
> = {
default?: DesignTokenValues<FontVariant, FontValue, Output, Platform>;
};
// `Fonts` tokens ... |
f27b65cdadc7e0d2852be773977084bd9ec9d208 | TypeScript | cov-clear/backend | /src/presentation/transformers/SharingCodeTransformer.ts | 2.515625 | 3 | import { SharingCode } from '../../domain/model/sharingCode/SharingCode';
import { SharingCodeDTO } from '../dtos/access-sharing/SharingCodeDTO';
export class SharingCodeTransformer {
public toSharingCodeDTO(sharingCode: SharingCode): SharingCodeDTO {
return {
code: sharingCode.code,
accessDuration: ... |
0357f7e416b18f25a57f3d30f0bf2c17c1863a96 | TypeScript | Lonmee/OPlayer | /ts/mod/Mgr/AudioMgr.ts | 2.703125 | 3 | import {Cmd} from "../../data/sotry/Story";
import {IMgr} from "./Mgr";
import SoundManager = laya.media.SoundManager;
import SoundChannel = laya.media.SoundChannel;
/**
* Created by ShanFeng on 5/8/2017.
*/
enum ChannelEnum {bg, fx, vo, bfx}
export default class AudioMgr implements IMgr {
private channels: Sou... |
45a2ab0fccc7c89fabfbc9583ec6803c8dc588fe | TypeScript | jedster1111/YourTune | /frontend/src/actions/channelsActions.ts | 2.96875 | 3 | import { Action } from "redux";
import { ChannelData } from "../types";
export type ChannelsActions =
| GetChannelsLoadingAction
| GetChannelsSuccessAction
| GetChannelsErrorAction;
export enum ChannelsActionsTypes {
getChannelsLoading = "GET_CHANNELS_LOADING",
getChannelsSuccess = "GET_CHANNELS_SUCCESS",
... |
ac0084131231a6fe432a423640ed2e93b089e4de | TypeScript | loquemedalagana/webpack-toy-project | /src/components/Card/CardList.ts | 2.515625 | 3 | import {
ClosableComponent,
ClosableHeaderComponentConstructor,
CloseableComponentConstructor,
Component,
Composable,
Core,
} from '../Core';
import { Image } from '../Image';
import { Video } from '../Video';
import { Post } from '../Post';
import { PostItem } from '../../types/post';
import { CARDWRAPPER_... |
84a8f71989ae04d1b5cd11642126bd8872e4b4d8 | TypeScript | shready/bridge-hand | /src/modules/Card/__tests__/CardSet.spec.ts | 3.453125 | 3 | import { ScorerInterface } from '@/lib/ScorerInterface';
import { Card } from '../Card';
import { CardSet } from '../CardSet';
import { Face } from '../Face';
import { Suit } from '../Suit';
describe('CardSet class', () => {
let cards: Card[] = [];
let scorer: ScorerInterface;
beforeEach(() => {
cards = [
... |
8a4929f2149c51fd6c03f3cd95dea4daccb5d194 | TypeScript | interledgerjs/rafiki | /packages/rafiki-core/src/services/accounts/in-memory.ts | 2.734375 | 3 | import { AccountInfo } from '../../types'
import { Observable, Subject } from 'rxjs'
import { AccountNotFoundError } from '../../errors'
import { Errors } from 'ilp-packet'
import { AccountsService, AccountSnapshot, Transaction } from '.'
import debug from 'debug'
import { map } from 'rxjs/operators'
const { Insufficie... |
38dd5cbc42fcbe7676e5e18fdd1fc288af2e102d | TypeScript | filipkrw/dodge-game | /src/observables/userInterface.ts | 2.5625 | 3 | import { BehaviorSubject, EMPTY, fromEvent, of } from 'rxjs'
import { switchMap, mergeWith, withLatestFrom, tap } from 'rxjs/operators'
import { Score } from '../entities/Score'
import { GameState, gameState$ } from './gameState'
import { Title } from '../entities/Title'
export const Interface = (score: Score, title: ... |
62ad9e481cf2260d51258c5e1835659900334f06 | TypeScript | aneeshthunga/CalorieTracker | /src/reducers/calorieReducer.ts | 3.203125 | 3 | import { IAlterCalorieAction } from '../actions/Actions';
import { IAppState } from '../state/AppContext';
/**
* A reducer witch handles the dispatched {@link IAlterCalorieAction}s and mutates the current {@link IAppState}
* @param state - the current {@link IAppState}
* @param action - the dispatched {@link IAlter... |
2b7fe42e48bcc264f7eeca950f4aefb8044fe723 | TypeScript | DefinitelyTyped/DefinitelyTyped | /types/yuka/src/steering/behaviors/InterposeBehavior.d.ts | 3.34375 | 3 | import { MovingEntity } from "../../core/MovingEntity";
import { Vector3 } from "../../math/Vector3";
import { SteeringBehavior } from "../SteeringBehavior";
import { Vehicle } from "../Vehicle";
/**
* This steering behavior produces a force that moves a vehicle to the midpoint
* of the imaginary line connecting two... |
878e7d1255fcbe2f0e8fb5131c09bddfc199350c | TypeScript | nrfm/umbrella | /packages/color/src/oklab/oklab-rgb.ts | 2.578125 | 3 | import type { ColorOp } from "../api.js";
import { __mulV33 } from "../internal/matrix-ops.js";
const LMS_CONE = [
4.0767245293, -1.2681437731, -0.0041119885, -3.3072168827, 2.6093323231,
-0.7034763098, 0.2307590544, -0.341134429, 1.7068625689,
];
/**
* @remarks
* Reference: https://bottosson.github.io/post... |
158bda6fef8a67b579d944180f847f66ed2e7b0a | TypeScript | sintti/full_stack_2020_osa9 | /patientor_backend/src/services/patientService.ts | 2.78125 | 3 | import patientData from '../../data/patients';
import { NonSensitivePatientEntry, Patient, NewPatient } from '../types';
const getAll = (): Array<Patient> => {
return patientData;
};
const getPatient = (id: string): Patient | undefined => {
const patient: Patient | undefined = patientData.find(p => p.id === id)
... |
795c25e795ecff9e814dadda135b3f10499a49c6 | TypeScript | shawnrice/teikn | /src/Color/Color.ts | 3.21875 | 3 | import { HSLToRGB } from './HSLToRGB';
import { namedColorsByValue, NamedColorValue } from './namedColors';
import { RGBToHex } from './RGBToHex';
import { RGBToHSL } from './RGBToHSL';
import { stringToRGBA } from './stringToRGBA';
const clamp = (min: number, max: number, n: number) => Math.min(Math.max(n, min), max)... |
a44a3b3b82e6a752d97efaf40fc269dfd66abb66 | TypeScript | gabrielecanepa/exercism | /typescript/simple-cipher/simple-cipher.ts | 3.359375 | 3 | export class SimpleCipher {
private KEY_LENGTH = 100
private CHARACTERS = String.fromCharCode(...Array(123).keys()).slice(97)
key: string
shift: number
constructor(key?: string, shift?: number) {
this.key = key ?? this.generateKey()
this.shift = shift ?? this.getRandomShift()
}
encode(text: stri... |
c320db854c70441456dcca732719d7b67fb39f45 | TypeScript | janakijanu/Training13 | /uniondemo.ts | 2.53125 | 3 | let x:string|number;
x=10;
console.log(x);
x="welcome";
console.log(x);
x="HCL"
console.log(x); |
84100061aa835f3e0933b916073fa10d89006613 | TypeScript | nex2null/IdleBattle | /src/Game/BattleSystem/BattleEffects/LastStandEffect.ts | 3.21875 | 3 | import BaseEffect from './BaseEffect';
import BattleCharacter from '../BattleCharacter';
import BattleEffectEnum from '../Enums/BattleEffectEnum';
class LastStandEffect extends BaseEffect {
// Properties
turnsLeft: number;
addedHp: number;
minimumHpPercent: number | null;
// Constructor
constructor(chara... |
9c6ade0eb66fc63c3006e24247d47deda95bbf12 | TypeScript | aadebdeb/three-raymarch | /src/ObjectSpaceRaymarchStandardMaterial.ts | 2.6875 | 3 | import { Color, CubeTexture, UniformsUtils, UniformsLib, MultiplyOperation } from 'three';
import { ObjectSpaceRaymarchMaterial, ObjectSpaceRaymarchMaterialParameters } from './ObjectSpaceRaymarchMaterial';
import { RaymarchShaderChunk } from './shaders/RaymarchShaderChunk';
/**
* Parameters of {@link ObjectSpaceRaym... |
76ba38d7b4667f0e5da3d3956a1cdfc8f41f01a9 | TypeScript | fang-wenlee/typescript | /class/objectType.ts | 3.15625 | 3 |
function user( employee:{first:string; last:string; age:number}): string{
return `Hello ${employee.first} ${employee.last}`;
}
console.log(user({first: "Fang-Wen", last: "Lee", age: 30})) |
38de35e93d9f4d356b23f17ccf3e1f69d9ed873a | TypeScript | zaknafain/kings-duty | /src/app/events/time-event.ts | 3.234375 | 3 | import {
TimeEventAction,
GainPeopleAction,
MovePeopleAction,
LoosePeopleAction
} from './time-event-action';
export interface TimeEvent {
title: string;
description: string;
day: number;
eventActions: TimeEventAction[];
}
export class NewcommerArrivingEvent implements TimeEvent {
title = 'Newcommer... |
208fdff77c48dc9d10ceda384aeec80502522c58 | TypeScript | rzmay/rmps | /packages/module/src/types/dynamicValue.ts | 2.65625 | 3 | export type dynamicValue<T> =
T
| ((t: number) => dynamicValue<T>)
| [dynamicValue<T>, dynamicValue<T>];
|
4a0225095818f503cf7a7b7ad06fbbc33086b9e3 | TypeScript | IronOnet/codebases | /codebases/coursera.org/static/bundles/naptimejs/resources/promotionDetails.v1.ts | 2.609375 | 3 | import NaptimeResource from './NaptimeResource';
export type DiscountAmount = { [currencyCode: string]: number };
class PromotionDetails extends NaptimeResource {
static RESOURCE_NAME = 'promotionDetails.v1';
// These properties are always included.
id!: string;
// These properties must be requested.
promo... |
89a1c2908a8ea6a3075c27bfb38d7454edb45d6b | TypeScript | HanqingZ/Angular_Study | /video-courses/src/app/tools/pipes/duration.pipe.ts | 2.84375 | 3 | import { Pipe, PipeTransform } from "@angular/core";
@Pipe({
name: 'sortByDuration'
})
export class DurationPipe implements PipeTransform {
transform(length: number): string {
if (length >= 0 && length / 60 > 1) {
return `${Math.floor(length / 60)}h ${length % 60}min`;
} else if (length < 0) {
... |
a38be0d75e2b95992c3bcc9dd22265e58c5af8ee | TypeScript | pulumi/pulumi-awsx | /awsx-classic/codebuild/metrics.ts | 2.515625 | 3 | // Copyright 2016-2018, Pulumi Corporation.
//
// 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 applicabl... |
9a5e799afcfb037306ccd08a3f7948e93da90eb1 | TypeScript | MarcosSpessatto/Rocket.Chat | /apps/meteor/ee/app/license/server/getTagColor.ts | 2.5625 | 3 | export function getTagColor(tag: string): string {
switch (tag) {
case 'bronze':
return '#BD5A0B';
case 'silver':
return '#9EA2A8';
case 'gold':
return '#F3BE08';
default:
return '#4411DD';
}
}
|
044f510b4f914420353e071e281f94bbbeb4f9ef | TypeScript | TsapovMaksim/codmark-tz | /src/redux/ducks/images/types.ts | 2.78125 | 3 | import { Action } from 'redux';
export enum ImagesActionsType {
SET_IMAGES = 'images/SET_IMAGES',
SET_LOADING_STATE = 'images/SET_LOADING_STATE',
FETCH_IMAGES = 'images/FETCH_IMAGES',
CLEAR_IMAGES = 'images/CLEAR_IMAGES',
SET_GROUP_IMAGES = 'images/SET_GROUP_IMAGES',
}
export interface ImageInterface {
im... |
f9c48656925b9fcb0910ea0fb7d0963bef660477 | TypeScript | SunshineH2/pont | /packages/pont-engine/src/compatible/clean.ts | 2.734375 | 3 | import * as fs from 'fs';
import * as path from 'path';
import type { Manager } from './Manager';
import { main } from './scan';
import { Interface } from './standard';
/** 入口方法 */
export async function clean(manager: Manager) {
const unusedJsonPath = `./${manager.unusedJsonFileName}`;
const suffix = manager.curr... |
46c508b888b0e22fa90e154bcac0934854274f17 | TypeScript | arthur-iasbeck/book-store-app | /src/users/users.service.ts | 2.78125 | 3 | import { Injectable } from '@nestjs/common'
import { InjectRepository } from '@nestjs/typeorm'
import { BookEntity } from 'src/db/book.entity'
import { UserEntity } from 'src/db/user.entity'
import { Repository } from 'typeorm'
import { GetAndReturnBooksDto } from './dto/get-return-books.dto'
@Injectable()
export clas... |
15db6f9b022306b0e1566b23df7b225f23b722d7 | TypeScript | ngnhuuthai/nodesrv | /src/check/builder/checkComponent.ts | 3.078125 | 3 | import { CheckType } from "../enum/checkType"
export default class CheckComponent<T> {
public readonly isRequired: boolean
constructor(
public readonly checkType: CheckType,
public readonly confirm: boolean,
private readonly thing: T,
public readonly failMessage?: string) {
this.isRequired = t... |
bd2a7749ad12eb238e3b4b5a913e04e3b3bd3fb4 | TypeScript | villehietanen/test | /src/models/flight.ts | 2.75 | 3 | import * as mongoose from 'mongoose';
export interface IFlight extends mongoose.Document {
departure: string,
arrival: string,
departureDate: Date,
arrivalDate: Date
}
export const FlightSchema = new mongoose.Schema({
departure: {type: String, required: true, minlength: 3, maxlength: 3},
arriv... |
9f97ab0bd39a93a700f4bd5b257621df43e969a4 | TypeScript | EduardoAraD/Backend-mars-photos | /src/utils/timeAtualization.ts | 2.6875 | 3 | import ApiController from '../controllers/ApiController'
const main = async () => {
const data = new Date()
data.setHours(data.getHours() - 3)
console.log(`Atualizando: ${data.getHours()}:${data.getMinutes()}`)
await ApiController.getApi()
}
// milissegundos(1000) - segundos(60) - minutos(60) - horas(24)
expo... |
ffb2d1f1ac54d35fe418831473eca928ecc29893 | TypeScript | sebamomann/anmeldesystem-backend | /src/modules/enrollment/enrollmentPermission.checker.ts | 2.71875 | 3 | import {JWT_User} from '../user/user.model';
import {Enrollment} from './enrollment.entity';
export class EnrollmentPermissionChecker {
private enrollment;
constructor(enrollment: Enrollment) {
this.enrollment = enrollment;
}
/**
* Check if {@link JWT_User} is the creator of of the {@lin... |
32b47ea00ba591ef50d83a83c8353661653e29f1 | TypeScript | triviality-js/triviality | /packages/core/src/Context/ConstructContext.ts | 3.15625 | 3 | import { ServiceFactory, ServiceTag, SF } from '../ServiceFactory';
import { ServiceFunctionReferenceContainerInterface } from '../Container/ServiceFunctionReferenceContainerInterface';
/**
* Context for constructing new services.
*/
export interface ConstructContext<T> {
/**
* @typeGenerator({
* empty: tru... |
30a187ad777eac968fd062889f52e820c46927fd | TypeScript | Sora2455/JavaScript-Experiments | /src/modules/ClientClipboard.ts | 2.875 | 3 | /**Copy text into the user's cliplboard
* @param text The text to copy into the user's clipboard
* @link Solution taken from https://stackoverflow.com/a/30810322/7077589
*/
export function copyTextToClipboard(text: string): void {
if (window.isSecureContext && navigator.clipboard && navigator.clipboard.writeText... |
19459b80a82d6f917dbaf467fed99068b6c27044 | TypeScript | lucas-eugenio/GrabMdApp | /utils/useStorage.ts | 2.546875 | 3 | import AsyncStorage from '@react-native-async-storage/async-storage';
const useStorage = () => {
const save = (value: string, key: string): Promise<void> => {
return AsyncStorage.setItem(key, value);
};
const load = (key: string): Promise<string | null> => {
return AsyncStorage.getItem(key);
};
con... |
00d30adef8e4ed69352075f04c9f0d3ce847fcd5 | TypeScript | Jacks128/tytusx | /20211SVAC/G35/codigof/src/ejecucion/expresiones/arreglo.ts | 2.78125 | 3 | import { Entorno } from "../entorno";
import { Instruccion } from "../instruccion";
import { Arreglo as InstanciaArreglo } from '../arreglo';
export class Arreglo extends Instruccion {
lista_expresiones: Array<Instruccion>;
constructor(linea : string, lista_expresiones: Array<Instruccion> = null){
super(linea... |
216a08d77300e57973a4ec7ede53f2a4136dc028 | TypeScript | ViniciusFernando13/startaideia-react-forms | /src/rules/isLength.ts | 3.34375 | 3 | import isLength from "validator/lib/isLength"
import trim from "validator/lib/trim"
import { Rule } from "rules"
export default function ({ value, params }: Rule): String | null {
const str = trim(String(value))
const { exact } = params
if (str.length === 0) return null
if (exact && str.length === exact) {
... |
72a61141a52cea5366a3428c7283868d3ab7d721 | TypeScript | ruanvalente/nestjs-playground | /src/user/services/user.service.ts | 2.515625 | 3 | import { Injectable, HttpException, HttpStatus } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { User } from '../entity/user.entity';
import { UserDTO } from './../dto/user';
import { UserRepository } from '../repository/user.repository';
@Injectable()
export class UserService {
... |
bdf1c6e26be085128780398fba7373ef0e7ecd89 | TypeScript | rohith231/backendM | /user/user.service.ts | 2.609375 | 3 | import { Injectable, Inject } from "@nestjs/common";
import { User } from "./user.entity";
import { AuthService } from "../auth/auth.service";
import * as _ from "lodash";
import { Repository } from "typeorm";
@Injectable()
export class UserService {
constructor(
@Inject("USER_REPOSITORY")
private userReposi... |
f23f5e73a95ccdef4b014eb3a78d1d821e1bc2f4 | TypeScript | Jacob273/JG.TechLearning.Angular.AuctionApp | /typescript-starter/src/B-typescript/as-module/Car.ts | 3.078125 | 3 |
export class Car {
private name: string;
constructor() {
this.name = 'My superCar'
}
changeCarName(name: string) {
this.name = name;
}
shoutMyName() {
console.log(this.name)
}
}
|
9b509510d6a708ea1578074e670edf15ffc2f60c | TypeScript | cethack/FOO | /src/core/components/cetselect/selectItem.service.ts | 3.03125 | 3 | export class SelectItem {
_id: string;
_text: string;
_displayText: string;
static idPropertyName: string = 'id';
static textPropertyName: string = 'text';
constructor(source: any) {
if (typeof source === 'string') {
this.id = this.text = this.displayText = source;
}
if (typeof source =... |
abbf58c5236eb33156f4e30ee3dd40c5582d7ee9 | TypeScript | codeartisticninja/1gam17_april | /src/script/_classes/lib/WebStory/Teller.ts | 2.78125 | 3 | "use strict";
import WebStory = require("./WebStory");
/**
* Teller class
*
* @date 21-mar-2017
*/
var tellers:Teller[] = [];
class Teller {
public interval:number;
constructor(public story:WebStory, public element:HTMLElement) {
this.hurry = this.hurry.bind(this);
this.interval = this.story.impat... |
e69ef561fc5eb72150a5613141fbe5deb1e20b06 | TypeScript | stevejay/because-npm-api | /src/node-service/mapper.test.ts | 2.90625 | 3 | import * as mapper from "./mapper";
const INDEXED_REACT_NODE = {
id: "react",
link: "//react",
score: 0,
isNew: false
};
const UNINDEXED_REACT_NODE = {
id: "react",
link: "//react",
score: 0,
isNew: true
};
const INDEXED_REDUX_NODE = {
id: "redux",
link: "//redux",
score: 1,
isNew: false
};
... |
054a83ae1b7e97bc92b1a02e2bc1575157ef71c1 | TypeScript | ejrbuss/dnd-initiative-tracker | /src/Actor.ts | 2.84375 | 3 | import { Util } from './util';
import { Template } from './Template';
import { Lang } from './Lang';
let uidCounter = 0;
export interface Actor {
template: Template;
uid: number;
name: string;
initiative: number;
description: string;
note: string;
npc: {
autokill: boolean;
... |
9e1c9365f5220f4fb54caa23d9819453767d8439 | TypeScript | sepp2k/IffyPiffy | /runtime/runtime.ts | 3.203125 | 3 | interface IffyPiffyObject {
$init(): this;
$needsInit: boolean;
$objectName: string;
$onInherit?(child: IffyPiffyObject): void;
}
interface IffyPiffyVerb extends IffyPiffyObject {
syntax: (string|IffyPiffyThing)[];
defaultAction(): void;
}
interface IffyPiffyThing extends IffyPiffyObject {
... |
ab32e070eb9e7233ee93537ada1234f90cc9e384 | TypeScript | Weakky/woopwoop | /plugin/types.ts | 2.53125 | 3 | import { ArgDefinition } from 'gqliteral/dist/types'
interface GenTypesShape {
fields: Record<string, any>
aliases: Record<string, any>
objects: Record<string, any>
}
export interface ObjectField {
name: string
args?: string[] | false
alias?: string
}
export type AnonymousField = string | ObjectField
ex... |
3e2eac357ef9e965911479ca996a98dc314b0381 | TypeScript | acamposdev/crm-alpha-front | /src/app/services/cases.service.ts | 2.515625 | 3 |
import { throwError as observableThrowError, Observable , Subject } from 'rxjs';
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { map, catchError } from 'rxjs/operators';
import { END_POINT } from '../config/config';
import { Case } from '../models/case';
impo... |
55fbc3532ae06679be71884b31f4a9f66a50fba0 | TypeScript | AndyLnd/jumpnjuice | /src/utils/objects.ts | 3.109375 | 3 | import { pipe } from './common'
// tslint:disable:no-object-mutation no-any readonly-array no-unbound-method prefer-for-of no-let typedef
export interface PlainObject {
readonly [prop: string]: any
}
export type Diff<
T extends string | number | symbol,
U extends string | number | symbol
> = ({ [P in T]: P } &... |
3a3e46046f80052cf23d638147126a04ba375d10 | TypeScript | apurvaraman/AssemblyScript | /dist/assemblyscript-loader.d.ts | 2.8125 | 3 | // Generated by dts-bundle v0.7.3
// Dependencies for this module:
// ../../long
declare module 'assemblyscript-loader' {
import * as Long from "long";
/** Options to set up the environment created by {@link load}. */
export interface ILoadOptions {
/** Memory instance to import, if applicable. */
... |
46c084e53442d3af20d59462db8807187b4a4bdb | TypeScript | anetegithub/geranium | /storage/interfaces/IStorage.ts | 2.578125 | 3 | import { InterfaceUsingException } from "../../exceptions/coherence/InterfaceUsingException";
import { Constructor } from "../../structures/Constructor";
import { IInjected } from "../../coherence/interfaces/IInjected";
import { ICoherenceContainer } from "../../coherence/interfaces/ICoherenceContainer";
import { IEnt... |
a747c55a594673e9be380e1a212dd200a4ac1049 | TypeScript | socramjunio2/http-aws-api-node | /http-aws-api-node/src/http/json/serializers/impl/date-serializer.ts | 3.1875 | 3 | import * as moment from "moment-timezone";
const TZ = "America/Sao_Paulo";
const TZ_UTC = process.env.TZ || "America/Sao_Paulo";
export class DateSerializer {
/**
* converte um Date para uma string
* @param source Date a ser convertida
* @param pattern mascara a ser utilizada, default: "YYYY-MM-DDTHH:mm:ss... |
eef043fe86bb75ecd60a138bd545461125f72861 | TypeScript | javascript-ninja-123/event-bus-example | /ticket/src/nats-wrapper.ts | 2.671875 | 3 | import nats, {Stan} from "node-nats-streaming"
export class NatsWrapper {
private static instance: NatsWrapper
private static _client?: Stan
private constructor(){}
public connect(clusterId: string, clientId: string, url: string): Promise<void>{
NatsWrapper._client = nats.connect(clusterId,cl... |
386a5134469c78afbbf3b5c9f4df05cbc2fe6832 | TypeScript | jamesblunt1973/davajoo-dashboard-web | /src/app/shared/components/counter/counter.component.ts | 2.515625 | 3 | import { Component, OnChanges, Input, OnInit } from '@angular/core';
@Component({
selector: 'app-counter',
templateUrl: './counter.component.html',
styleUrls: ['./counter.component.scss']
})
export class CounterComponent implements OnInit, OnChanges {
@Input() number = 0;
digits: Array<string> = [];
... |
dbfac5f21fc5a825f12788ee55140b0bf2fd056d | TypeScript | DuffyWang926/sharingHomes | /src/features/header/reducer.ts | 2.75 | 3 | import { combineReducers } from 'redux';
import { ActionType } from 'typesafe-actions';
import * as header from './actions';
import { CHANGETAB, LOGIN_SUCCESS } from './constants';
export type HeaderAction = ActionType<typeof header>;
export interface user {
name:string
}
export type HeaderState = {
readonly tab... |
4b9ffdc9b09598288d2ac8932247d38856cf5706 | TypeScript | lifeart/els-addon-typed-templates | /app/components/component.ts | 2.75 | 3 | import Component from '@glimmer/component';
type Args = {
userId: string,
userEmail: string
}
export default class MyComponent extends Component {
args!: Args;
name = 1;
noob = 2;
items = [1, 2, 3];
userName
= 3;
names() {
}
item = {
name: 'boo',
... |
de7dda82266576e25a73235ecf614ad026fe5333 | TypeScript | tkpea/PhotoFilterTest | /src/library/imageFilter/offsetFilters.ts | 2.75 | 3 |
const extremeOffsetBlue = (imgData: ImageData) => {
for (let i = 0; i < imgData.data.length; i += 4) {
const offset = 35
imgData.data[i + 2] =
imgData.data[i + 4 * offset * offset] === undefined
? 0
: imgData.data[i + 4 * offset]
}
return imgData
}
const extraOffsetBlue = (imgData:... |
89f682dad03d5b0a1da84b4e3c7491635615bce2 | TypeScript | xiadom/rabb | /src/gl-utils/MiscUtils.ts | 2.90625 | 3 | type MiscIndexObject = {
indices: number[];
position: number[];
texcoord: number[]
}
export function mapIndices2d(object: MiscIndexObject, prop: string) {
return Array.prototype.reduce.call(object.indices, (acc, id) =>
acc.concat([
object[prop][3 * id],
object[prop][3 * id + 1],
])
, [])
... |
726d70dff27cdcc1c498978b874ae0b97e5a09d6 | TypeScript | clizreynolds/ionic-todo | /src/pages/step-counter/step-counter.ts | 2.8125 | 3 | import { Component, ChangeDetectorRef } from '@angular/core';
import { Pedometer } from '@ionic-native/pedometer';
import { Platform } from 'ionic-angular';
/**
* Page to display the step counter data and sprite
*
* @export
* @class StepCounterPage
*/
@Component({
selector: 'step-counter',
te... |
68d3140fc1db4411ba35db55cdc7fb2b007ea062 | TypeScript | Deltanic/mathrix | /src/convert.ts | 2.734375 | 3 | import { AxisOrder } from './enums';
import Vector3 from './primitives/Vector3';
import Quaternion from './primitives/Quaternion';
import Matrix4 from './primitives/Matrix4';
// -----------------------------------------------------------------------------
export function convertVector3ToQuaternion(vec3: Vector3, axi... |
dd387838943d77f6bcbd339bb573e91d84a1139e | TypeScript | screendriver/verify-github-webhook-secret | /test/integration/verify.test.ts | 2.53125 | 3 | import test from "ava";
import http from "node:http";
import micro from "micro";
import listen from "test-listen";
import got from "got";
import type { Headers } from "got";
import { verifySecret } from "../../src/index.js";
interface TestVerifySecretOptions {
readonly secret: string;
readonly requestBodyJson: unkno... |
5ff407354c20717874d0356430401b43686f75d7 | TypeScript | luna8418/d-emails | /src/routes/email.ts | 2.59375 | 3 | import { Request, Response } from 'express'
import { Email, EmailItem } from '../types'
import { logger } from '../shared'
import * as emailService from '../services/emailService'
export const sendEmail = async (req: Request, res: Response) => {
const email: Email = req.body
logger.info(`Email received -> ${JS... |
3ed02cb6fc472bc7437128bcbfea32bfc2bc71e4 | TypeScript | rolznz/infinitris2 | /core/src/player/NetworkPlayer.ts | 2.671875 | 3 | import { PlayerStatus } from '@models/IPlayer';
import ISimulation from '@models/ISimulation';
import Player from './Player';
export default class NetworkPlayer extends Player {
private _socketId: number;
private _isBot: boolean;
constructor(
socketId: number,
simulation: ISimulation,
playerId: numbe... |
3a22bff01fde04bb2da739fc810c7845203dcb4d | TypeScript | 4andrewtanakashi/projetoPraticoModelagem | /src/domain/services/search-city.service.ts | 2.90625 | 3 | import { City } from '../entities/city';
import { CityNotFoundError } from '../errors/city-not-found.error';
import { CityRepository } from './protocols/city-repository';
export class SearchCityService {
constructor(private readonly cityRepo: CityRepository) {}
async search(query: string): Promise<City[]> {
i... |
a2c8cf02d5d519a602f17e95c17fdb9c1feebd6a | TypeScript | Schr3da/ws-multiplayer-demo | /client/src/shared/utils/NetworkUtils.ts | 2.78125 | 3 | export interface IRestData<T> {
status: number;
data: T;
}
declare const __FIXED_PORT_9000__;
export const post = <T, K>(url: string, data: T): Promise<K | null> => {
const config: any = {
method: "POST",
mode: "cors",
cache: "no-cache",
credentials: "same-origin",
headers: {
"Content-... |
b93db09020aa5ecd96674b0c3a3561b08f16dc30 | TypeScript | siminot/log2990-06 | /client/src/app/carApp/peripheriques/UtilisateurPeripherique.spec.ts | 2.625 | 3 | import { UtilisateurPeripherique } from "./UtilisateurPeripherique";
import { GestionnaireClavier } from "../clavier/gestionnaireClavier";
import { EvenementClavier, TypeEvenementClavier, FonctionTouche } from "../clavier/evenementClavier";
describe("UtilisateurPeripherique", () => {
let utilisateur: UtilisateurP... |
96ef393d62192d1ffa8ca4368807b28a1817350b | TypeScript | nhducit/moai | /core/src/tree/utils/remove.ts | 3.4375 | 3 | import { TreeNode } from "../tree";
import { isTreeLeaf } from "./leaf";
interface Params {
tree: TreeNode;
deleteId: string;
}
/**
* Remove a node from the tree.
*
* This is a naive implementation that simply traverses all nodes O(n) to
* check for "deleteId". If your "id"s can represent the path, use the
* o... |
68a14c13a0bd84f9b5395b0c5f7aee67bf5272c0 | TypeScript | tumachine/image-encrypt | /src/app/utils.ts | 2.5625 | 3 | // https://stackoverflow.com/questions/15900485/correct-way-to-convert-size-in-bytes-to-kb-mb-gb-in-javascript
import { Renderer2 } from '@angular/core';
export function formatBytes(bytes: number, decimals = 2): string {
if (bytes === 0) return '0 Bytes';
const k = 1024;
const dm = decimals < 0 ? 0 : decimals;
... |
2636b222b204079a70aa7bdfa4e7eddf4379685c | TypeScript | freddy674727/TP2.github.io | /src/TP2/relation.ts | 2.6875 | 3 | import { DroitProduit } from "./DroitProduit";
const faker = require('faker');
const fs = require('fs');
function relationGen(){
var tableau = [];
for(var index = 0; index < 5 ;index++){
var id = index;
var dateDebut = faker.date.past();
var dateFin = faker.date.future();
... |