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 |
|---|---|---|---|---|---|---|
abb2f75b862ccbe560e89aa5b6c928148774d75c | TypeScript | nabil-bourziz/ng-ib-2020 | /demonstration/src/app/todo/todo-form-reactive/todo-form-reactive.component.ts | 2.625 | 3 | import { Component, EventEmitter, Output } from '@angular/core';
import { AbstractControl, FormBuilder, Validators } from '@angular/forms';
import { Todo } from '../models';
@Component({
selector: 'app-todo-form-reactive',
templateUrl: './todo-form-reactive.component.html',
styleUrls: ['./todo-form-reactive.com... |
c1c015a501984f941310502d136e9fa8e0a4efe3 | TypeScript | feirm/app | /src/class/account.ts | 2.6875 | 3 | import { DB } from "./db";
import { EncryptedAccount, SignedAuthenticationToken, AuthenticationToken, EncryptedKey, EncryptedAccountV2 } from "@/models/account";
import { ArgonType, hash } from "argon2-browser";
import { ModeOfOperation, utils } from "aes-js";
import { SignKeyPair, sign } from "tweetnacl";
import buffe... |
f38bd5dc46437d0e34e302556a8ce5dbaf07b996 | TypeScript | Cicko/ore-ui | /packages/@react-facet/core/src/facet/createFacet.spec.ts | 2.734375 | 3 | import 'react'
import { defaultEqualityCheck } from '../equalityChecks'
import { NO_VALUE } from '../types'
import { createFacet } from './createFacet'
describe('equalityChecks', () => {
describe('with defaultEqualityCheck', () => {
it('fires for object values, since it can be mutated', () => {
const updat... |
b43071bdd062bcbed25471a546029f0ba33e3efc | TypeScript | fireb1001/neonest | /src/types/tag.type.ts | 2.578125 | 3 | export type Tag = {
id: string;
name: string;
related: Array<any>;
};
export class TagDto {
id: string;
name: string;
constructor(data) {
Object.assign(this, data);
}
}
|
1b8b58aa1a14fe08a2adb8b9aaafe630cfed3b82 | TypeScript | infuerno/okta-auth-js | /lib/idx/remediators/AuthenticatorVerificationData.ts | 2.6875 | 3 | import { Base, RemediationValues } from './Base';
export interface AuthenticatorVerificationDataValues extends RemediationValues {
authenticators?: string[];
}
export class AuthenticatorVerificationData extends Base {
values: AuthenticatorVerificationDataValues;
map = {
'authenticator': ['authenticator']
... |
b99d4709d97142a94b6434c097f1afa9a03fccce | TypeScript | imcj/EventLogging | /eventlogging.js/src/TrackingEvent/ExceptionEvent.ts | 2.625 | 3 | import TrackingEvent from "./TrackingEvent";
export default class ExceptionTrackingEvent extends TrackingEvent {
message: Event | string;
url: string;
lineNumber: number;
columnNumber: number;
error: Error;
stack: string;
public constructor(message: Event | string,
ur... |
253cdb79f6e01393a50ca3899c9a6daf4dc782fb | TypeScript | Blurlingite/jotto-redux | /src/actions/index.ts | 3.578125 | 4 | import axios from "axios";
import { getLetterMatchCount } from "../helpers";
import { ThunkDispatch } from "redux-thunk";
import { AppState } from "../App";
export const actionTypes = {
CORRECT_GUESS: "CORRECT_GUESS",
GUESS_WORD: "GUESS_WORD",
SET_SECRET_WORD: "SET_SECRET_WORD",
};
// type guessedWordType = { ... |
e97a2fa5e0f96c6fb297f94c490ecdb8e845eb51 | TypeScript | codsen/codsen | /packages/string-character-is-astral-surrogate/src/main.ts | 3.578125 | 4 | // high surrogate goes first, low goes second
function isHighSurrogate(something: string | undefined): boolean {
// [\uD800-\uDBFF]
if (typeof something === "string") {
if (something.length === 0) {
return false;
}
// \uD800 charCode is 55296
// \uDBFF charCode is 56319
return something.c... |
e2b8abf5317dd3335b1af05a2ecc6b8072dd8cfb | TypeScript | stephaniaoz/otherProyects | /typescriptPrueba/coche.ts | 3.734375 | 4 | class Coche{
public color: string;
public modelo: string;
public velocidad: number;
constructor(modelo:any = null){
this.color = "Blanco";
this.velocidad = 0;
if(modelo == null){
this.modelo = "BMW Generico";
}else{
this.modelo = modelo;
}
}
public getColor(){
return this.color;
}
publ... |
f342bbfe241c92ca7c5c2a24363f7ee4d0109145 | TypeScript | xDeaa/myExpress | /lib/router/index.ts | 2.796875 | 3 | import {IncomingMessage, ServerResponse} from 'http';
import { parse } from 'querystring';
interface Route {
method: string,
url: string,
callback: Function,
regex: RegExp | null
}
export default class Router {
public readonly routes: Route[] = [];
newRoute(route:Route) {
if (route.met... |
32a4def6da11befd9d812e548225508fe04ddb0c | TypeScript | ingamartinez/store-cart | /src/app/Models/product.model.ts | 2.546875 | 3 | import { Image } from './image.model';
import { Price } from './price.model';
export class Product{
availableForPickup: boolean;
code: number;
description: string;
images: Image[];
manufacturer: string;
name: string;
price: Price;
constructor(availableForPickup: boolean,
code: number,
... |
65e1f217d3de4bb8270baad0f1192ed9b26d4cdc | TypeScript | diegoshakan/typescript_poo | /Atividade2/exe1.ts | 3.34375 | 3 | let nomes: string[] = ['Bruno', 'Elaine', 'José', 'Matheus', 'Maria', 'Alana', 'Erika',
'Alison', 'Lucas', 'Rickson', 'Beatriz', 'Alberto', 'Renata', 'Sayonara'];
console.log('Inicialmente, há', nomes.length, 'nomes na lista.');
//Nº 1.a - Insira dois nomes na lista.
nomes.push('Eduardo', 'Mônica');
//Nº 1.b - Obte... |
31ff4fdeadf3aa8a997b321f06f21a17d3a447d9 | TypeScript | javii42/LAB_4 | /SalaDeJuegos/src/app/clases/juego.ts | 2.671875 | 3 | export abstract class Juego {
public nombre = 'Sin Nombre';
public jugador: string;
public gano = false;
constructor(nombre?: string, gano?: boolean,jugador?:string) {
if (nombre)
this.nombre = nombre;
if (gano)
this.gano = gano;
if(jugador)
this.jugador=jugador;
else
t... |
017aaa87c7e6d7f9d482ca8e6a37d4e45b7e6c28 | TypeScript | StanixGames/nature-game | /src/utils/QuadTree.ts | 3.046875 | 3 | import Rect from './Rect';
import Node from './Node';
class QuadTree {
public root: Node;
constructor(bounds: Rect, maxDepth: number, maxChildren: number) {
this.root = new Node(bounds, 0, maxDepth, maxChildren);
}
public clear(): void {
this.root.clear();
}
public insert(itemO... |
5667ead737e83ccdc7bd3253c14dded575ce8295 | TypeScript | S-YC/WebFront | /src/store/modules/login/loginR.ts | 2.640625 | 3 | import {
AsyncThunk,
createAsyncThunk,
createSlice,
PayloadAction,
} from "@reduxjs/toolkit";
import { AxiosResponse } from "axios";
import { RootState } from "..";
import Http, { IRes } from "../../net/Http";
// 이름 설정
const name = "login";
/**
* 저장될 유저 정보 인터페이스 설정
*/
export interface ILogin {
reqId: strin... |
d9c68173590c5a43afe0d13decf97e21de4bb0d7 | TypeScript | DreamLarva/learn-typescript | /文章/有泛型的类的继承的一个问题.ts | 3.8125 | 4 | import * as CSS from "csstype";
/*
interface StylesObject<P extends object = {}> extends Styles {
// ^~~~~~~~~~~^ error
foo: (props: P) => void;
}
type Styles<P extends object = {}> = {
foo: (props: P) => void;
};
*/
/*
报错
'{}' is assignable to the constraint of type 'P' (a), but 'P' could be instantia... |
ea0e5254169904e60597d47c1159e518d43aa739 | TypeScript | PeanutQAQ/swr | /src/utils/resolve-args.ts | 2.578125 | 3 | import { useContext } from 'react'
import { defaultConfig } from './config'
import { SWRConfigContext } from './config-context'
import { mergeConfigs } from './merge-config'
import { normalize } from './normalize-args'
import { mergeObjects } from './helper'
// It's tricky to pass generic types as parameters, so we j... |
f87c4797546526cb320b5d25f103e4b3dd2b22c9 | TypeScript | AxiataADA/superset-ui | /packages/superset-ui-core/test/time-format/factories/createMultiFormatter.test.ts | 2.71875 | 3 | import createMultiFormatter from '@superset-ui/core/src/time-format/factories/createMultiFormatter';
describe('createMultiFormatter()', () => {
describe('creates a multi-step formatter', () => {
const formatter = createMultiFormatter({
id: 'my_format',
useLocalTime: true,
});
it('formats mill... |
be73076cb609a8c3f00b5c174d901ea73a2b0d15 | TypeScript | pmviva/ng-dragon-slayer | /src/app/modules/game/store/game.state.ts | 2.75 | 3 | import { Game } from '@game/models/game.model';
import { GameConstants } from '@game/models/game-constants.model';
/**
* Defines the game state interface.
*/
export interface GameState {
/**
* Defines the game of the game state.
*/
game: Game;
}
/**
* Defines the initial game state.
*/
export const init... |
9fe9e2e47a7c2b3d83430ac141372f05c765d287 | TypeScript | Nemet360/slicer-ui | /cli/utils/initializeColors.ts | 2.984375 | 3 |
const skinColor = { r : 255/255, g : 224/255, b : 189/255 };
const greyMatterColor = { r : 0.925, g : 0.5, b : 0.5 };
export const initializeColors = (length, datatypeCode ) => {
const rgb = [];
const color = datatypeCode==4 ? skinColor : greyMatterColor;
for(let i = 0; i < length; i++){
rgb... |
311a33e0292d6887be09e1ad64cf489fb798cb5b | TypeScript | who0sy/pyright | /server/src/analyzer/symbol.ts | 3.09375 | 3 | /*
* symbol.ts
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT license.
* Author: Eric Traut
*
* Represents an association between a name and the type
* (or multiple types) that the symbol is associated with
* in the program.
*/
import { DiagnosticTextRange } from '../common/diagnostic';
import StringM... |
66c33af511e0036853a212a2ddb860ba2283b55e | TypeScript | hrozan/utfpr-final-paper | /legacy/server/src/config/index.ts | 2.625 | 3 | import Debug from "debug"
const debug = Debug("app:config")
export enum Env {
dev,
prod,
test,
}
export type Index = {
port: number
databaseName?: string
databaseUri: string
jwtKey: string
env: Env
brokerCredential: string
}
const getEnvVar = (envVar: unknown) : string=> {
if (envVar !== undef... |
f37371d244ffc59bfb7b620522b4b6e629c4fa8d | TypeScript | Ewo-team/ewo-next | /src/engine/Characters/CharacterTools.ts | 2.5625 | 3 | /**
* @module Engine.Characters
* Characters
* @preferred
*/
import { capitalizeFirstLetter } from '@engine/Helpers';
import { IStateServer } from '@engine/reducers';
import { GradeTemplate, Plans, Races } from '@engine/resources';
import {
Character,
CharacterDatabase,
CharacterFrontend,
CharacterLimitedF... |
d7b116c16c0283edbc243b62f897304b910749bf | TypeScript | project-300/npm-common-types | /src/functions/map.ts | 2.640625 | 3 | import { Coords, Place } from '../interfaces';
export function GetMidpoint(a: Place, b: Place): Coords {
return {
latitude: (a.latitude + b.latitude) / 2,
longitude: (a.longitude + b.longitude) / 2
}
};
|
ee9fe8ae80c8494ef6d288ae4996d277c3e4aad6 | TypeScript | qianbin/express-toolbox | /src/index.ts | 2.734375 | 3 | import { RequestHandler, Router } from 'express'
import Http = require('http')
/**
*
* @export
* @class HttpError
*/
export class HttpError extends Error {
constructor(public readonly status: number, message?: string) {
super(message || Http.STATUS_CODES[status])
this.name = Http.STATUS_CODE... |
e77614642c7008bdc5bc459cd2191007aee43f03 | TypeScript | cdnjs/cdnjs | /ajax/libs/tom-select/1.1.2/types/contrib/microevent.d.ts | 3.015625 | 3 | /**
* MicroEvent - to make any js object an event emitter
*
* - pure javascript - server compatible, browser compatible
* - dont rely on the browser doms
* - super simple - you get it immediatly, no mistery, no magic involved
*
* @author Jerome Etienne (https://github.com/jeromeetienne)
*/
export default class ... |
d3f35b651f147b574cdb1dc3f2da8f24a9bb0076 | TypeScript | vps2124/AllAngularConcept | /src/app/calculator.service.ts | 2.796875 | 3 | import { Injectable } from '@angular/core';
@Injectable()
export class CalculatorService {
constructor() {
console.log("Calculator Service created....");
}
add(a:number,b:number):number
{
return a+b;
}
sub(a:number,b:number):number
{
return a-b;
}
mul(a:number,b:number):number... |
2b2271ff743057362bc914e546646d3cebaa8731 | TypeScript | typeioc/typeioc | /src/exceptions/argument-error.ts | 3.125 | 3 | import { ApplicationError } from './application-error.js'
import { setPrototypeOf } from './common.js'
/**
* Represents argument error. It is thrown when the argument value does not
* comply with the method specification
* @public
*/
export class ArgumentError extends ApplicationError {
/**
* @i... |
fc95993a5ded834f802657c68c3d79e12fdbfe6d | TypeScript | YasminElbahar/Eia2Aufgaben | /Endaufgabe_EIA2/scripts/Team.ts | 3.375 | 3 | abstract class Team {
protected color: string;
protected formation: string;
protected teamList: Array<Player>;
protected targetGoal: Point2D;
constructor(color: string, formation: string) {
this.color = color;
this.formation = formation;
this.teamList = this.generateTeamList... |
7791dea1811108fcc6fee0500965ebc6d8a39f38 | TypeScript | redwoodjs/redwood | /packages/structure/src/x/path.ts | 2.90625 | 3 | import { existsSync } from 'fs'
import { basename, normalize, sep } from 'path'
export function directoryNameResolver(dirName: string): string | undefined {
dirName = normalize(dirName)
const parts = dirName.split(sep)
const pp = parts[parts.length - 1]
parts.push(pp)
const extensions = ['.js', '.jsx', '.ts'... |
1512c5b0ed2e137322589cdb8608b19c63f07179 | TypeScript | AdinoWayne/VuMucDiThu | /code/medium/86-partition-list.ts | 3.6875 | 4 | /**
* Definition for singly-linked list.
* class ListNode {
* val: number
* next: ListNode | null
* constructor(val?: number, next?: ListNode | null) {
* this.val = (val===undefined ? 0 : val)
* this.next = (next===undefined ? null : next)
* }
* }
*/
function partition(head: L... |
7de0238fa27ef3410d9d8480752835cdc9df6d8b | TypeScript | YahorAlve/angular_udemi | /observables-start/src/app/user/user.component.ts | 2.71875 | 3 | import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Params } from '@angular/router';
import { UserService } from '../user.service';
@Component({
selector: 'app-user',
templateUrl: './user.component.html',
styleUrls: ['./user.component.css']
})
export class UserComponent implements OnInit ... |
f64905d7ab13e72ab9f1cb351110697a0bd40da6 | TypeScript | albert-team/spiderman | /src/modules/dup-filter/dup-filter.interface.ts | 3.40625 | 3 | /**
* Duplicate filter
*/
export interface DuplicateFilter<T> {
/**
* Add an item to the filter
*/
add(item: T): void
/**
* Check if an item already exists in the filter
*/
exists(item: T): boolean
}
|
4dc40d36543fd980b435f5b30986c730dd6e0a86 | TypeScript | CS506-Oversight/autorack-front | /src/state/ingredient/data.ts | 3.015625 | 3 | import {NamedData} from '../base/data';
export enum MeasureType {
VOLUME,
MASS,
}
export type Measure = {
name: string,
type: MeasureType,
// `L` for volume; `g` for mass
equivalentMetric: number,
}
export enum VolumeMeasure {
ML = 'ml',
TBSP = 'tbsp',
CUP = 'cup',
FL_OZ = 'fl. oz',
}
export con... |
c58853b3303af048ba9852da3224c9ea59826760 | TypeScript | rafaelThi/loan_books_back_end | /src/Repositories/TokenUserRepository.ts | 2.734375 | 3 | import { EntityRepository, Repository } from 'typeorm';
import TokenUser from '../models/TokenUser';
@EntityRepository(TokenUser)
class UserTokenRepository extends Repository<TokenUser> {
public async findByToken(token: string): Promise<TokenUser | undefined> {
const userToken = await this.findOne({
where:... |
9f09481b8578e7d01deca4f4e20c1653a0bd6e6c | TypeScript | prabutdr/typescript-refresh | /mapped-types.ts | 3.328125 | 3 |
type ReadonlyNew<T> = {
readonly [K in keyof T]: T[K] | null;
};
type PartialNew<T> = {
[K in keyof T]?: T[K];
}
interface MappedTypeObj {
name: string,
age: number,
weight?: number
}
type ReadonlyNewMappedTypeObj = ReadonlyNew<MappedTypeObj>;
type PartialNewMappedTypeObj = PartialNew<MappedTypeObj>;
typ... |
2c30ef08c1a130ec45449a950611d8f1937a1075 | TypeScript | sueddeutsche/editron | /src/utils/createProxy.ts | 2.59375 | 3 | import { Foxy, Options, handler } from "@technik-sde/foxy";
const defaultOptions = {
handlers: [
handler.unsplash,
handler.image,
handler.video
]
};
export default function createProxy(options: Options|Foxy = {}): Foxy {
if (options.constructor.name === "Foxy") {
return o... |
927849963c7bd1d9d869e413c0c248da3b044aed | TypeScript | lucbories/mathlang | /src/tests/unit/vmachine/bitarray.test.ts | 2.875 | 3 |
/// <reference path="../../../../node_modules/assemblyscript/std/portable/index.d.ts" />
import * as mocha from 'mocha';
import * as chai from 'chai';
const expect = chai.expect;
import BitArray from '../../../vmachine/assemblyscript/assembly/runtime/bitarray';
describe('VM BitArray', () => {
const MEMORY_BYTES:i... |
f918c42470ca12daa654e2ee8ffba5df91a8693c | TypeScript | foray1010/Popup-my-Bookmarks | /src/popup/components/keyBindings/KeyBindingsContext.ts | 2.640625 | 3 | import constate from 'constate'
import * as React from 'react'
import useListener from 'use-typed-event-listener'
import type { WindowId } from '../../constants/windows.js'
import type { KeyBindingEventCallback, KeyDefinition } from './types.js'
function useActiveWindowState() {
const [activeWindowQueue, setActiveW... |
49374403747f9ac0ed5a08bc464cfef0e850fa47 | TypeScript | arshad-m/angular-basic | /src/app/services/basic.service.ts | 2.59375 | 3 | import { Injectable } from '@angular/core';
/* if we comment out @Injectable we need to specify under Providers array so that it might be available in all module class
NullInjectorError: No provider for BasicService! */
@Injectable({
// will be availble for all components of applications
// we can provide for par... |
3675016b8c4a28cf380e291b7961da2368ec14e7 | TypeScript | blaart/cloud-sdk-js | /packages/openapi-generator/src/parser/parameters.spec.ts | 2.71875 | 3 | import { createRefs } from '../../test/test-util';
import {
filterDuplicateParams,
parseParameters,
renameEquallyNamedParams
} from './parameters';
describe('parseParameters', () => {
it('returns empty array if there are no parameters', async () => {
expect(parseParameters({}, await createRefs())).toEqual(... |
93d7e3a1a9fccf9933089ae59b5826b91bbe4205 | TypeScript | gabrielvv/ng7-toystore-base | /src/app/store/toys/toys.reducer.ts | 2.921875 | 3 | import { Action } from "redux";
import { TOY } from './toys.actions'
import { Toy } from '../../models/toy'
import { ActionSequence } from "protractor";
/**
* toysReducer
*
* state :
* { toys: toys array }
*/
export function toysReducer(state : ToyState = defaultToysState, action: any) {
switch(action.type) {... |
589c142a51fe5a99a0558cd69b08b399ebb7b00f | TypeScript | manfredsteyer/2017_08_30 | /src/app/model/flights/flights.state.ts | 2.59375 | 3 | import { Flight } from '../../entities/flight';
export interface FlightsState {
flights: Flight[];
statistics: FlightsStatistics;
}
export interface FlightsStatistics {
countDelayed: number;
countInTime: number;
}
export const initFlightsState: FlightsState = {
flights: [],
statistics: {
... |
06917c89f8b4fa922dd845d4b75efb679cf4ee9c | TypeScript | Zorbing/node-lgsdk | /src/lcd/ffi-lib.ts | 2.609375 | 3 | import * as ffi from 'ffi';
import * as ref from 'ref';
import * as ArrayType from 'ref-array';
import * as wchar_t from 'ref-wchar';
import { libPath } from '../path';
import { LOGI_LCD, BITMAP_LENGTH_COLOR, BITMAP_LENGTH_MONO } from './constants';
const byte = ref.types.uchar;
const byteArray = ArrayType<number>(b... |
142b06f5141e08399c1ec4d78f792ae1704487d6 | TypeScript | zmoog/dickbott | /scripts/dialogflow/FulfillmentHandler.ts | 2.546875 | 3 | import { FulfillmentRequest, FulfillmentResponse } from "../dialogflow/Types";
import { IntentDispatcher } from "../core/dispatcher/IntentDispatcher";
import { inject, injectable } from "inversify";
import { assignIn } from "lodash";
@injectable()
export class FulfillmentHandler {
constructor( @inject("IntentDisp... |
418c14680cd4c697dec8c064c793a7472f9ffb9f | TypeScript | IflameI/react-spotify-clone | /src/redux/actions/browse.ts | 2.671875 | 3 | import { Dispatch } from 'redux';
import { browseActionType, browseActions } from '../../types/browse';
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
export const setLoaded = (payload: boolean): browseActions => {
return {
type: browseActionType.SET_LOADED,
payload,
};
};
export ... |
ec8c4392461ee9a8c5a98139444b216f131a889c | TypeScript | BitskiCo/bitski-node | /tests/provider-manager.test.ts | 2.609375 | 3 | import { ProviderManager } from '../src/index';
test('it successfully creates a provider', () => {
expect.assertions(2);
const manager = new ProviderManager('foo', 'bar');
const provider = manager.getProvider({networkName: 'rinkeby', disableBlockTracking: true});
expect(provider).toBeDefined();
expect(provid... |
767558254698de218e61c4c6c059d68977139eee | TypeScript | pocketfi/web | /src/reducers/transactionReducer.ts | 2.5625 | 3 | import {
FOUND_TRANSACTIONS,
FOUND_TRANSACTIONS_BY_CATEGORY,
PLACES_RECEIVED,
REQUEST_ERROR,
TRANSACTION_CREATED,
TRANSACTION_DELETED,
TRANSACTION_FAIL,
TRANSACTION_MESSAGE,
TRANSACTION_SUCCESS,
TRANSACTION_UPDATED,
TransactionActionTypes,
TRANSACTIONS_RECEIVED
} from '../actions/types/Transacti... |
17ddb119945966f5f0d1451c4530c01491013093 | TypeScript | ShravikaReddyPollapalli/capstone | /six.ts | 3.65625 | 4 | class Test {
color: string;
constructor(color:string){
this.color = color;
}
display():void {
console.log(this.color);
}
}
class Test1 extends Test {
price : number;
constructor(price:number,color:string){
super(color);
this.price = price;
... |
8a8ddf06a50de8398bd678ab3e6ea34b5701117b | TypeScript | thinceller/channel-name-list | /src/app/modules/ChannelModule.ts | 2.53125 | 3 | import Axios from 'axios';
import { Action, Dispatch } from 'redux';
import { ThunkDispatch } from 'redux-thunk';
import { db } from '../firebase';
import FluxAction, { MyThunkDispatch } from './FluxAction';
import { Channel } from '../models';
import config from '../config';
import { State, uiModule } from '../module... |
6e1c4daba935208104461ef8e38117005978f81f | TypeScript | soumyo123-prog/angular-intro | /src/app/components/recipie/recipie.model.ts | 2.890625 | 3 | export class Recipie {
name: string;
description: string;
imageUrl: string;
constructor(name: string, description: string, imageUrl: string) {
this.name = name;
this.description = description;
this.imageUrl = imageUrl;
}
} |
02f59798dfc355b5f3c9425a65b7e05bb3ec51bf | TypeScript | pspeter3/ethereal-vtt | /src/core/VirtualTableTop.ts | 2.625 | 3 | import { Application, Graphics } from "pixi.js";
import { Viewport } from "pixi-viewport";
/**
* VirtualTableTop contains the logic for the virtual table top.
*/
export class VirtualTableTop {
private app: Application;
private viewport: Viewport;
/**
* Construct the VirtualTableTop.
* @param c... |
a302e5c8d1633b5d22dd6e1bc78129e426db6536 | TypeScript | nguyer/aws-sdk-js-v3 | /clients/browser/client-dynamodb-browser/types/_GlobalSecondaryIndexInfo.ts | 2.796875 | 3 | import {
_KeySchemaElement,
_UnmarshalledKeySchemaElement
} from "./_KeySchemaElement";
import { _Projection, _UnmarshalledProjection } from "./_Projection";
import {
_ProvisionedThroughput,
_UnmarshalledProvisionedThroughput
} from "./_ProvisionedThroughput";
/**
* <p>Represents the properties of a global se... |
958c0cc7d1885c4bfb75711848bd242de820744a | TypeScript | chrisnrick/botbuilder-js | /libraries/botbuilder-dialogs-adaptive/src/input/confirmInput.ts | 2.609375 | 3 | /**
* @module botbuilder-dialogs-adaptive
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import * as Recognizers from '@microsoft/recognizers-text-choice';
import { Activity } from 'botbuilder-core';
import { DialogContext, Choice, ListStyle, ChoiceFactoryOp... |
de41b477663472cffb16007db143913d68f53433 | TypeScript | rakesh4ui347/TYPESCRIPT | /08_ES6_Destructing/08_app.ts | 4.09375 | 4 | /*
---------------------------------------------------------------------------------
6. Destructing
---------------------------------------------------------------------------------
This is one of the powerful feature in ES6, where in instead of adding a single value
to a variable from an array, we can do it all by on... |
3553dde3c74ef4b620a10bdb51caf50600b6e583 | TypeScript | andreslopezma/Spotify-App-Angular | /src/app/services/spotify.service.ts | 2.5625 | 3 | import { Injectable } from '@angular/core';
import { map } from 'rxjs/operators';
// el HttpClient nos deja hacer peticiones por htpp
// HttpHeaders nos permite modificar los Headres de la peticion
import { HttpClient, HttpHeaders, HttpHeaderResponse } from '@angular/common/http';
@Injectable({
providedIn: 'root'
... |
ddaeda098d70df63033d81dc7a0d8556ce10632d | TypeScript | InmediaGR/vue3-tailwind2 | /src/composable/useSize.ts | 2.671875 | 3 |
import { computed, ref } from 'vue'
export type ISize = "xs" | "sm" | "md" | "lg"
const useSize = (props: { size: ISize, full: boolean, circle: boolean }) => {
let sizes = {
xs: 'h-4 w-8 text-sm',
sm: 'px-3 h-6 ',
md: 'px-4 h-8 ',
lg: 'px-8 h-12 text-xl',
full: " w-full",... |
530637135ffb445fa4f5295dc3df0ec3e454cc47 | TypeScript | medusajs/medusa | /packages/admin-ui/src/node/utils/validate-args.ts | 2.59375 | 3 | import { CustomWebpackConfigArgs } from "../types"
import { logger } from "./logger"
function validateArgs(args: CustomWebpackConfigArgs) {
const { options } = args
if (options.path) {
if (!options.path.startsWith("/")) {
logger.panic(
"'path' in the options of `@medusajs/admin` must start with ... |
fb595b7bf9dadd95afc739ee4aa19dc8ecce2e2e | TypeScript | slipkinem/jsTest | /validator/validator.ts | 2.671875 | 3 | /**
* Created by slipkinem on 1/22/2018 at 2:46 PM.
* Copyright © 2016, PuKang Health Maintenance Co.
*/
window.onload = main
// window.validate = {}
const assert = (condition: boolean, message: string) => {
if (!condition) {
console.error('[data-validator]' + message)
}
}
const $ = (el: string) => document... |
d0d9dc283ac1e77a8269c762cfd30f6a5c9bc123 | TypeScript | Zubs/TypeScriptIntro | /docs/src/classes/invoice.ts | 3 | 3 | // Import Interface
import { HasFormatter } from "../interfaces/hasFormatter.js"
// Create the Invoice class
export class Invoice implements HasFormatter {
// Map properties to inputs
constructor(private client: string, private details: string, private amount: number) {}
format (): string {
return `${ this.cli... |
e7ad13465caaa8e16dcabbdf9d36360b381b7c66 | TypeScript | leonmaks/module5_homework | /src/task_04.ts | 3.3125 | 3 | // Задание 4
// Записать в переменную случайное целое число в диапазоне [0; 100]. Используйте объект Math.
const task_04 = () => {
const randInt = (max: number): number => (
Math.floor(Math.random() * max)
)
console.log(randInt(100))
console.log(randInt(100))
console.log(randInt(100))
console.log(ran... |
afd42f988d7034ac3a74c0812cfd4c960ec732c8 | TypeScript | nancyyhong/IxJS | /src/iterable/pipe/takelast.ts | 2.609375 | 3 | import { MonoTypeOperatorFunction } from '../../interfaces';
import { IterableX } from '../../iterable/iterablex';
import { TakeLastIterable } from '../takelast';
export function takeLast<TSource>(count: number): MonoTypeOperatorFunction<TSource> {
return function takeLastOperatorFunction(source: Iterable<TSource>):... |
9d58294f008bef5fdd83400a44493f63b5eeb18c | TypeScript | project-MyTin/Back-end_IceBear | /src/data/usecases/db-add-routine.ts | 2.71875 | 3 | import { AddRoutine } from "../../domain/usecases";
import { AddRoutineRepository, LoadMotionRepository } from "../protocols/repository";
export class DbAddRoutine implements AddRoutine {
constructor(
private readonly motionRepository: LoadMotionRepository,
private readonly routineRepository: AddRo... |
bc503460219c79ae8515bce1ace1efdafa89c6fd | TypeScript | vinod0354/goalshaper-web-live | /src/app/pipes/searchPipe.ts | 2.703125 | 3 | import { Injectable, Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'searchpipe'
})
@Injectable()
export class SearchPipe implements PipeTransform {
// transform(items: any[], field: string, value: string): any[] {
// if (!items) return [];
// if (field == 'all') {
// //return items.filter((item) ... |
8313c385703fbcac9f0a17cdfc7a45d263d30f2a | TypeScript | unbyte/icarus | /src/provider/common/atom.ts | 2.640625 | 3 | import { Node, Options, unescapeEntity } from 'xml'
import {
CardMsgHeaderTemplate,
CardMsgModule,
createCardMessage,
Message,
useButton,
useField,
useMDText,
useModuleContent,
useText,
} from '../../bot/msg.ts'
import { TaskMeta } from '../../bot/task.ts'
import { createCommonProvider, Option, Store ... |
ffa66711fbe74582df205626b375d558fa0fda57 | TypeScript | ashok1863/Angular-login-and-authentication | /src/app/Login/authentication.service.ts | 2.5625 | 3 | import { Injectable } from '@angular/core';
import { Http, Headers, Response, RequestOptions } from '@angular/http';
import { Router } from '@angular/router';
import { Observable } from 'rxjs';
import { Token } from './token';
import 'rxjs/add/operator/map'
@Injectable()
export class AuthenticationService {
... |
10d6c9438931c288fcac1a105bc9c7aed552825e | TypeScript | 6ebeng/real-estate-crm | /src/components/AccountListTable/types.ts | 2.796875 | 3 | interface TableProps {
accountSummaries: AccountSummary[];
onSelectRow: (accountEmail: string) => void;
displayPage: number;
onClickNext: () => void;
onClickPrev: () => void;
}
interface TableRowProps {
email: string;
lastLogin: string;
onClick: () => void;
}
interface AccountSummary {
accountEmail:... |
90216615ff63d54f7319ca80c53e6b9589b9c293 | TypeScript | mattmccray/tilt | /src/helpers/urlFor.ts | 2.5625 | 3 | import { useSite } from "../core/hooks.js";
import { Page } from "../core/types.js";
export function urlFor(page: Page | string, fullURL = false): string {
let path = typeof page === 'string' ? page : page.filepath
const { url = '' } = useSite()
path = path.endsWith('index.html')
? '/' + path.replace('index... |
bc2452aedc98ef70796ad2baa49e6322df6fd758 | TypeScript | mykytagit516/angular-monitoring | /src/app/services/event.service.ts | 2.78125 | 3 | import { EventEmitter,
Injectable,
OnDestroy
} from '@angular/core';
export interface IEventListenr extends OnDestroy {
ngOnDestroy(): void;
}
@Injectable()
export class EventService {
private listeners = <any>{};
private subject = new EventEmitter();
private eventObserver = this.subject.asObservable();... |
f0bb7880ee05c91af0915f767f30ad160f74cf36 | TypeScript | drjkelly/week-1-duck-and-car | /main.ts | 2.71875 | 3 | sprites.onOverlap(SpriteKind.Player, SpriteKind.Enemy, function (sprite, otherSprite) {
Car.destroy(effects.spray, 200)
info.changeLifeBy(-1)
})
let Car: Sprite = null
let Duck = sprites.create(img`
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . b 5 5 b . . .
... |
b8473a66a2421dc8db50c5cf08ef077bf51881bd | TypeScript | alxrdev/apply-api | /tests/unit/modules/jobs/useCases/CreateJobeUseCase.spec.ts | 2.734375 | 3 | import { AppError } from '@errors/index'
import { CreateJobDTO } from '@modules/jobs/dtos'
import { Job } from '@modules/jobs/entities'
import FakeJobRepository from '@modules/jobs/repositories/fake/FakeJobRepository'
import IJobRepository from '@modules/jobs/repositories/IJobRepository'
import { CreateJobUseCase } fro... |
708e29b12fca16e458b1eacde4b3816eedaa9ef5 | TypeScript | marcoshenriquedesousa/fight-guide | /src/controller/personagem.ts | 2.578125 | 3 | import { BaseControlador } from "./base";
import { Request } from 'express'
import { Personagem } from "../entity/personagem";
export class PersonagemController extends BaseControlador<Personagem> {
constructor() {
super(Personagem)
}
async salvarPersonagem(requisicao: Request){
const _per... |
69c27d077386eb3879c9299cd91b26f0ec96db34 | TypeScript | ibednorz/dzial-iii-szachy | /src/tests/queensCanAttackHorizontally.test.ts | 3.171875 | 3 | import { QueensAttack } from "../queensAttack";
describe("(5 points) - Returning possibility of a horizontal attack by queens", () => {
[
{
queens: new QueensAttack({ white: [1, 7], black: [1, 5] }),
},
{
queens: new QueensAttack({ white: [3, 2], black: [3, 6] }),
},
{
queens: n... |
d084a4a8e3c59a1914824dde33ba0298e9e8ef98 | TypeScript | lml-dom/lml-js | /src/output/string-output/html-output.ts | 2.984375 | 3 | import { TEXT_BLOCK_ELEMENTS } from '../../const';
import { DOMNode } from '../../dom-node';
import { OutputConfig } from '../../output-config';
import { StringOutput } from '../string-output';
/**
* Parses DOMNode[] to HTML string
*/
export class HTMLOutput extends StringOutput {
constructor(nodes: DOMNode[], con... |
392533bb83dd3f712154dde0c1f68055c73cce6a | TypeScript | yudhistira-arya/typescript-knowledge-sharing | /05_01_rxjs/timer-operator.ts | 2.59375 | 3 | import {timer} from "rxjs";
export function simpleTimer() {
// first emit after 100ms delay then emit every 200ms after that.
const observable = timer(99, 200);
observable.subscribe(value => {
console.log(`first-subscriber: ${value}`);
});
} |
a5445bb88e42f90fc282fa8b6291cf3c103a96e9 | TypeScript | im-cuttlefish/react-leaper | /src/internal/UnmountedLeaper.ts | 2.640625 | 3 | import { useEffect, useState, ReactElement } from "react";
import { Motion, Style } from "../types";
export interface Props {
remove: Motion;
initial: Style;
noticeAnimationEnd: () => void;
children: (style: Style) => ReactElement;
}
export const UnmountedLeaper = (props: Props) => {
const [style, setStyle]... |
86f0bd058a811fb84899f26ba3e030bdd3a6f016 | TypeScript | nmyers322/identity-secret-react | /src/app/stores/IdStore.ts | 2.671875 | 3 | import { observable, action } from 'mobx';
import { IdModel } from 'app/models/IdModel';
export class IdStore {
constructor() {
this.ids = [];
}
@observable public ids: Array<IdModel>;
@action
addId = (id: string) : void => {
this.ids.push(new IdModel(id));
}
@action
... |
c6629e7cccbdf60778a2f8925a2df79c7d468365 | TypeScript | melnaeem/SOLID | /O/correct.ts | 3.890625 | 4 | interface IQuestion extends IQuestionWithDescription{
printChoices: Function;
}
interface IQuestionWithDescription {
description: string;
printDescription: Function;
}
class QuestionWithDescription implements IQuestionWithDescription {
description: string;
constructor(description: string) {
this.descri... |
fda6c7ee11e82890b489b2efa2eb0214efbc64cd | TypeScript | blteblte/scroll-date | /src/app/helpers.ts | 3.140625 | 3 | // export function getDateElalSearchFormat(date: Date): string {
// const dd = date.getDate()
// const mIx = date.getMonth()
// const yyyy = date.getFullYear()
// const mArr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Dec']
// return `${dd}/${mArr[mIx]}/${yyyy}`
// }
... |
866d0aec334fe78ac8c39f08f2b2c2000b747bc9 | TypeScript | phani-rajbn/Angular11Training | /src/app/Pipes/emp-filter.pipe.ts | 3.234375 | 3 | import { Pipe, PipeTransform } from '@angular/core';
import { Employee } from '../Entities/employee';
@Pipe({
name: 'empfilter'
})
//filter is a method in js that can be used on arrays to filter the elements based on the criteria based as lambda expression.
export class EmpFilterPipe implements PipeTransform {
tra... |
d2d4f3044881381f229abae410e30e64c896c59a | TypeScript | future4code/Isabela-Silveira | /semana18/aula52/services-backend/src/service/adressManager.ts | 2.75 | 3 | import axios from "axios";
import { adress } from "../types/types";
export async function getAddressMyCep(cep: string): Promise<adress> {
try {
const result = await axios.get(`https://viacep.com.br/ws/${cep}/json/`)
const myAddress: adress = {
street: result.data.logradouro,
neighbourhoo... |
0e367c5548507e857195b5254a3dfce26379636c | TypeScript | DWitteveen/Tic-Tac-Toe-BE-only | /src/game/gameEdit.ts | 3.859375 | 4 | //board in default state
export const defaultBoard = [
['o', 'o', 'o'],
['o', 'o', 'o'],
['o', 'o', 'o']
]
//array for given colors
export const colorsList = ["red", "blue", "green", "yellow", "magenta"]
//a function that returns the number of changes between boards (movecounter)
//use to check if if there are ma... |
e9dde93795cbc7c5f59ff952763a3b34de568b79 | TypeScript | framer/motion | /packages/framer-motion/src/animation/generators/__tests__/spring.test.ts | 2.515625 | 3 | import { ValueAnimationOptions } from "../../types"
import { spring } from "../spring"
import { animateSync } from "../../animators/js/__tests__/utils"
describe("spring", () => {
test("Runs animations with default values ", () => {
expect(animateSync(spring({ keyframes: [0, 1] }), 200)).toEqual([
... |
ce2d4352095d3072d5eccf4bb96bfbdd67af2c07 | TypeScript | houkanshan/LD40 | /src/index.ts | 2.609375 | 3 | import './style'
import * as $ from 'jquery'
import './libs/turn'
import PubSub from 'pubsub-js'
import Menu from './menu'
import Order from './order'
import Friend from './friend'
import Player from './player'
import Waiter from './waiter'
import { delay } from './utils'
import chooseConversation from './dialogText'
i... |
8daf4d4e6906bc16d7e2f2ee0500ae7a959e3190 | TypeScript | CrispusDH/protractor-lite | /lib/core/by/locator.ts | 3.25 | 3 | import { By as wdBy, ByHash, WebDriver, WebElement } from 'selenium-webdriver';
/**
* Selenium webdriver's location strategy.
*/
export type WebDriverLocator = wdBy | ByHash | Function;
/**
* Protractor's location strategy.
*/
export interface ProtractorLocator {
findElementsOverride: (driver: WebDriver|WebElem... |
05a486143818378ce743176d27778f7341145243 | TypeScript | vvj-rares/renderfarm.js-client | /src/lib/Scene.ts | 2.53125 | 3 | "use strict";
import { Object3D as threejsObject3D } from "three";
import { PerspectiveCamera as threejsPerspectiveCamera } from "three";
import { IObject3D } from "./interface/IObject3D";
import { IScene } from "./interface/IScene";
import { Camera } from "./Camera";
const axios = require("axios");
//this... |
f9bab3aa2529c1132310c71e1f9184cccb7d9a26 | TypeScript | webdev0415/Estack-backend | /src/auth/local.strategy.ts | 2.71875 | 3 | import { Strategy } from 'passport-local';
import { PassportStrategy } from '@nestjs/passport';
import { Injectable } from '@nestjs/common';
import { AuthService } from './auth.service';
import { PublicUserDto } from '../users/dto/public-user.dto';
/** passport local strategy - for email and password check */
@Inject... |
c37700ae79fed9f70cea4aaac8a1449a28e198b6 | TypeScript | thaivan1437/Staff-Manager | /helpers/date.ts | 2.90625 | 3 | export const convertDateFormat = (dateObject: Date) => {
let dateNow = new Date();
if (dateObject) {
dateNow = dateObject;
}
let month = `${(dateNow.getMonth() + 1)}`;
let day = `${dateNow.getDate()}`;
const year = dateNow.getFullYear();
if (month.length < 2) {
month = `0${month}`;
}
if (day... |
4a931aad41e8543ea5f38c979be26627351ac205 | TypeScript | swollio/swollio-backend | /src/workflows/athlete/getAthleteWorkout.ts | 2.953125 | 3 | import db from "../../utilities/database"
interface ExerciseAssignment {
assignment_id: number
exercise_id: number
name: string
weight_scheme: string
rep_count: number[]
}
/**
* Gets the list of exercise assignments for the workout with given id
* @param workoutId The id of the workout we want t... |
dd9f50733c4f0cfb5344bbff6951db995fe45eb8 | TypeScript | kborkowska/front-gog-solution | /src/store/selectors.ts | 2.640625 | 3 | import { StoreState } from "../common/interfaces";
import { StateEntities, OwnershipState } from "../common/consts";
export const entitySelector = (entity: StateEntities) => (state: StoreState) =>
state.get(entity);
export const idSelector = (entity: StateEntities) => (
state: StoreState,
id: string
) => state.... |
bb54d45f5f414debc73dfa7748bda92f5fa59512 | TypeScript | naile/bolaget-frontend | /app/src/services/Change.ts | 2.765625 | 3 | export class Change {
public static Make(dto: any): Change {
return new Change(dto.name, dto.oldValue, dto.newValue);
}
constructor(public name: string, public oldValue: string, public newValue: string) { }
}
|
46abc8f3b98c0359a837e492af0e7c38e358c956 | TypeScript | Smile-shop/JQZ | /wx-mall/src/filters/format-unit.ts | 3.125 | 3 | // 头部添加单位
export function padStartUnit(data: number | string, unit: string): string | number {
if (data != null) {
if (unit) {
return unit.concat(String(data));
}
return data;
}
return '';
}
// 尾部添加单位
export function padEndUnit(data: number | string, unit: string): string | number {
if (dat... |
2872d65d6fdb6aaca087716b1c259ff9871e3179 | TypeScript | pablo-01/Tech-Reads | /client/src/app/_forms/input-text/input-text.component.ts | 2.59375 | 3 | import { Component, Input, OnInit, Self } from '@angular/core';
import { ControlValueAccessor, NgControl } from '@angular/forms';
////
// Control value accesor, interface, allows a bridhe between DOM and angular forms
// Accessing the form controls from registration component
////
@Component({
selector: 'app-... |
e8e6ae534fbde36cde0d2ec89fb2244e26ba42e6 | TypeScript | zakdim/angular4-book-examples | /01-ts-es6/03-ts-destructing/func-destr.ts | 2.984375 | 3 | 'use strict';
function f(options) {
console.log(options.x);
}
f({x:1}); // 1
function f2({x}) {
console.log(x); // refer to x directly
}
f2({x:1}); // 1
// With default values
function f3({x=0}) {
console.log(x); // refer to x directly
}
f3({}); // 1
|
96242e359e44be5a6ed1fe0bfc7e5f9bdbd95f89 | TypeScript | Nairobi-Crew/ARCND | /src/Store/reducers/oauth/oauth.ts | 2.90625 | 3 | import { EOAuthState } from './types';
export interface IOAuthReducer {
serviceID: string
redirectUrl: string
state: EOAuthState
}
export const defaultOAuthReducer: IOAuthReducer = {
serviceID: '',
redirectUrl: '',
state: EOAuthState.UNKNOWN,
};
export type OAuthAction = {
type: string
payload?: stri... |
5283a6e3be04af441b93ef72a5a0e501f54e302e | TypeScript | bretkikehara/karma-webdriverio-launcher | /src/driver-manager.ts | 2.53125 | 3 | import { parseRemoteConfig, ReporterConfig, parseReporterConfig } from './config';
import { parseCommand } from './commands';
// NOTE: need to use requires b/c webdriverio typescripts definitions are broken.
var { remote } = require('webdriverio');
const errDriverManagerNotAvailable = new Error('driver manager not av... |
9619554d3f77deb2e250a717ad70c41fe1f1188b | TypeScript | gijoona/sm-backend | /src/category/category.service.ts | 2.53125 | 3 | import { Injectable } from "@nestjs/common";
import { InjectModel } from "@nestjs/sequelize";
import { Category } from "./models/category.model";
@Injectable()
export class CategoryService {
constructor(@InjectModel(Category) private categoryModel: typeof Category) {}
async findAll(): Promise<Category[]> {
re... |
220513ddd56a025334a9bc7c825400401ce0147e | TypeScript | azlam-abdulsalam/sfpowerscripts | /packages/sfp-cli/src/types/SfpProjectConfig.ts | 2.96875 | 3 | import { WorkItem } from './WorkItem';
export class SfpProjectConfig {
name?: string;
defaultBranch?: string;
defaultDevHub?: string;
defaultPool?: string;
workItems?: any;
repoProvider?: string;
public getWorkItemGivenBranch(branch: string): WorkItem {
if (this.workItems) {
... |
34a3d7e89439fad77c47ba141c1ae665745c5be4 | TypeScript | artziom/PongPongWebGL | /src/scripts/Entity.ts | 3.375 | 3 | import * as PIXI from "pixi.js";
import {Vector2D} from "./utils/Vector2D";
export class Entity {
private readonly container: PIXI.Container;
private readonly name: string;
private readonly speed: number;
private readonly isMoving: {
up: boolean;
down: boolean;
left: boolean;
... |
bf7d9bcab6abdd72e21a4d453cf443d40c299ba1 | TypeScript | ahrjarrett/monorail | /dist/sharedHelpers/fp-ts-ext/Record.d.ts | 3.28125 | 3 | import { Ord } from 'fp-ts/lib/Ord';
/**
* Retrieves the keys of an object while retaining keyof type information
*/
export declare const keys: <A extends Record<string, unknown>, K extends keyof A>(x: A) => K[];
export declare const values: <A extends Record<string, unknown>, V extends A[keyof A]>(x: A) => V[];
/**
... |