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 |
|---|---|---|---|---|---|---|
d5a201584a264a292d8e33b7b2fd8692094bc195 | TypeScript | ericmorand/matsumoto | /lib/output.ts | 2.515625 | 3 | import {TransformFactory} from "./vendor/Transform";
import {outputFile} from "fs-extra";
import {Artifact} from "./vendor/Artifact";
import {State} from "./vendor/State";
type Symbolism = {
error: symbol
};
export const write: TransformFactory<Symbolism> = (symbolism) => () => (input) => {
return Promise.res... |
0ee3d83054a9989aa3bacac49b26f6ddb7407fea | TypeScript | g3rardogo/typescript-course | /types-typescript/src/type-enum.ts | 3.796875 | 4 | //Orientacion para fotos
//JS
/*
const landscape = 0;
const portrait = 1;
const sqaure = 2;
*/
//TS
enum PhotoOrientation {
Landscape, //0
Portrait, //1
Square, //2
}
const landscape: PhotoOrientation = PhotoOrientation.Landscape;
console.log("Landscape: ", landscape);
//Ver estado o cadena
console.log("Land... |
ab6bbc756ed2d70cdae6735289c82c3bd12445a2 | TypeScript | rozakbuhari/bold | /src/components/Calendar/util.test.ts | 2.890625 | 3 | import { createMonthMatrix, createWeekArray, getFirstDayOfMonth, getLastDayOfMonth, isSameDay } from './util'
describe('getFirstDayOfMonth', () => {
it('should return the first day of a month', () => {
expect(getFirstDayOfMonth(new Date('2018-10-25'))).toEqual(new Date('2018-10-01'))
expect(getFirstDayOfMont... |
b2de00a46a8766f862bf149546d8e197322087cf | TypeScript | MikeDupree/storefront-data-hooks | /src/api/customers/signup.types.ts | 3.234375 | 3 | type AddressType = 'residential' | 'commercial'
/**
* The `address` object for the `customer` object's `addresses` array.
*/
type CustomerAddress = {
/**
* The first name of the customer address.
*/
first_name: string
/**
* The last name of the customer address.
*/
last_name: string
/**
* Th... |
6b34d172101de53e5ff6c3d55539e884f6b419de | TypeScript | chloekek/game | /src/three.d.ts | 2.671875 | 3 | declare namespace THREE {
class Euler {
x: number;
y: number;
z: number;
}
class Vector3 {
x: number;
y: number;
z: number;
set(x: number, y: number, z: number): this;
}
class Object3D {
readonly rotation: Euler;
readonly pos... |
deb95c4813025cd57c053979ea84d7c928dc1589 | TypeScript | almookie/ironman-idlescape-chrome-extension | /src/lib/Extension.ts | 2.734375 | 3 | import { CraftingCalculator } from './calculators/crafting/Crafting';
import { ItemRecipes, ItemData, ItemDataCraftable, ItemIDs } from './utilities/ItemRaw';
import { Inventory, SubInventory, InventoryItem as Item } from './player/Inventory';
import { Player } from './player/Player';
import * as Raw from './utilit... |
1531951991f42169210979ba717bd86bcf66adf3 | TypeScript | sedwards2009/extraterm | /packages/extraterm-event-emitter/src/main.ts | 3.375 | 3 | /*
* Copyright 2020 Simon Edwards <simon@simonzone.com>
*
* This source code is licensed under the MIT license which is detailed in the LICENSE.txt file.
*/
/**
* A resource which can later be freed by calling `dispose()`.
*/
export interface Disposable {
dispose(): void;
}
/**
* Function which represents a ... |
41d6f79b7f50a6a661072f5d65b8c7b519872b87 | TypeScript | srehwald/fancysortalgos | /src/models/bogosort.ts | 3.0625 | 3 | import { Algorithm } from "./algorithm";
import * as _ from "lodash";
export class Bogosort extends Algorithm {
constructor() {
super("Bogosort");
}
async sort(data: number[], callback: (data: number[]) => void): Promise<void> {
while (!Bogosort.isSorted(data)) {
// shuffle dat... |
ee1010d9ec9c36877e614fed4bbb639d5096ecb3 | TypeScript | renearias/audio-sync | /src/app/audio-player.ts | 2.671875 | 3 | import { Spectrogram } from './spectrogram';
import {FFT} from './fft';
export class AudioPlayer {
context: AudioContext = new AudioContext();
soundBuffer: AudioBuffer;
source: AudioBufferSourceNode;
spectro: Spectrogram;
constructor() {
// this.spectro = new Spectrogram(document.getElementById('canvas'... |
f7f06236a5f33842ca89e1c5130302c2fef98cef | TypeScript | devg1120/angular-gs-component-ng_v11-1 | /gs-component-lib/projects/spreadsheet/src/lib/columns.directive.ts | 2.578125 | 3 | import { Directive, ViewContainerRef, ContentChildren } from '@angular/core';
import { ComplexBase, ArrayBase, setValue } from '@syncfusion/ej2-angular-base';
let input: string[] = ['customWidth', 'format', 'hidden', 'index', 'isLocked', 'validation', 'width'];
let outputs: string[] = [];
/**
* `e-column` directive... |
c6e2482c81f1c60f9e36b0dc9fbd8053990e24cb | TypeScript | nguyer/aws-sdk-js-v3 | /clients/node/client-ec2-node/types/_IpRange.ts | 2.875 | 3 | /**
* <p>Describes an IPv4 range.</p>
*/
export interface _IpRange {
/**
* <p>The IPv4 CIDR range. You can either specify a CIDR range or a source security group, not both. To specify a single IPv4 address, use the /32 prefix length.</p>
*/
CidrIp?: string;
/**
* <p>A description for the security grou... |
567a3727009fef515a4e3023844779d2b7eb70c1 | TypeScript | RohanMutyal/TSCode | /TSVideo/ClassEmployee.ts | 3.46875 | 3 | class employee
{
empid:number;
empname:string;
constructor(eid:number,ename:string)
{
this.empid=eid;
this.empname=ename;
}
display():void
{
console.log("Employee Id = "+this.empid);
console.log("Employee Name = "+this.empname);
}
}
let emp=new employee... |
ae1daa4ffbb29b4a28b0955899a8e84845afc556 | TypeScript | Tyav/backend-post-app | /helpers/upload.ts | 2.734375 | 3 | import { IRequest } from '../app/types/express';
import aws from 'aws-sdk';
import multer from 'multer';
import multerS3 from 'multer-s3';
import stringGen from 'otp-generator';
export const s3 = new aws.S3({
endpoint: 'https://s3.us-west-2.amazonaws.com',
region: 'us-west-2',
});
// function getPreviousAvatar(... |
2b265e1a4a60ab50f323173349cdf5137064756c | TypeScript | gdccwxx/env-tools | /src/webview/is-weibo.ts | 2.640625 | 3 | import { userAgent, parameterChecker, JSType, errorBuilder } from '../common/utils';
/**
* is weibo webview
* @param ua `navigator.userAgent`
* @returns isWeiBo env
*/
export const isWeiBo = (ua: string = userAgent): boolean => {
if (!parameterChecker(ua, JSType.string)) {
errorBuilder('isWeiBo: ua should no... |
1e8d87fdb3d8a60e26e2efbd9f06dff2090e4cef | TypeScript | lenamax2355/quix | /quix-frontend/client/src/lib/sql-autocomplete/sql-context-evaluator/tree-analyzer.ts | 2.625 | 3 | import { QueryDetails, TableInfo, TableType } from './types';
import { createNewTableInfoObj } from './utils';
export const getTableInfoFromRelationNode = (relationNode: any): TableInfo[] => {
if (relationNode.relation) {
// when use 'JOIN' keyword -> analyze all relations
return relationNode
.relation... |
5b9d734b698aeaf77d1d12cec6f1c4977a78f5c4 | TypeScript | fvf98/car-catalog | /client/src/redux/reducers/car.ts | 2.921875 | 3 | import { FETCH_ALL_CARS, CREATE_CAR, UPDATE_CAR, DELETE_CAR, SET_EDITING_CAR, FETCH_FILTER_CARS } from '../../constants/actionTypes';
import { CarModel, initialCarModel } from '../../models/Car.model';
import { CarState } from '../../models/CarState.mode';
const initialState = { carList: [], editing: initialCarModel }... |
78bb0ddc9e9e08eff9a9835adf65af4626a135b0 | TypeScript | Clenic-webmaster/clenic-new-be | /src/api/testHelper/testHelper.ts | 2.546875 | 3 | import { OrderBy } from "aws-sdk/clients/cloudwatchlogs";
export class Order{
idOrder?: string;
idClenic?: string;
idEngineer?: string;
}
export function assignEngineerToOrder(ing:string, orden:string): Order {
if (ing=="3423" && orden=="2334") {
const objOrder:Order={
idOrder:"2334",
i... |
1150c260f25f29a4101a91062466f17a3120dead | TypeScript | alejack9/MedicalExaminationsManager | /_backend/src/models/Allegato.ts | 3.40625 | 3 | export default class Allegato {
constructor(private _nome: string, private _path: string) {}
public get nome() {
return this._nome;
}
public set nome(n: string) {
this._nome = n;
}
public get path() {
return this._path;
}
public set path(p: string) {
this._path = p;
}
public equal... |
29c67686ad0ff103bd06270e2056a69431a8fc4c | TypeScript | berezovskyi/new-queue | /public/src/models/Queue.ts | 2.84375 | 3 | import QueueEntry from './QueueEntry';
import Assistant from './Assistant';
import Teacher from './Teacher';
export default class Queue {
private _id: number;
public get id() { return this._id; }
private _name: string;
public get name() { return this._name; }
private _info: string;
public get info() { r... |
94a4cd447079de083f1924617dacab606434ff8d | TypeScript | spatools/promizr | /tests/whilst.spec.ts | 3.03125 | 3 | import whilst from "../lib/whilst";
import timeout from "./helpers/timeout";
const LIST = [15, 1, 8];
describe("promizr.whilst()", () => {
test("should call provided method while given test pass", async () => {
const spy = jest.fn();
let i = 0;
const test = jest.fn(() => LIST[i] % 2 ===... |
e8d4dda9a919eb783777f42c7cfd178e83f35d69 | TypeScript | green-fox-academy/adamcsigas | /Foundation/week-3/day-5/matreview/folder.ts | 3.0625 | 3 | 'use strict';
let folderStructure = [
'readme.md',
[
'1.ts',
'2.ts',
[
'readme.md'
]
]
]
function countFiles(folder) {
let count: number = 0;
for (let i: number = 0; i < folder.length; i++) {
if (typeof folder[i] === 'string') {
cou... |
346379e8ad2fda178514c1be59f4dc9ab64e9aa5 | TypeScript | donll8999/snyk | /src/lib/errors/failed-to-run-test-error.ts | 2.640625 | 3 | import { CustomError } from './custom-error';
export class FailedToRunTestError extends CustomError {
private static ERROR_MESSAGE = 'Failed to run a test';
constructor(userMessage, errorCode?) {
const code = errorCode || 500;
super(userMessage || FailedToRunTestError.ERROR_MESSAGE);
this.code = error... |
b47b87a80480c96c8b1cb2eba815fe7866aa71c9 | TypeScript | vtimofeev/fastmvc.js | /src/ft/virtual.document.ts | 3.015625 | 3 |
namespace ft {
export class VirtualClassList {
classes:{[id:string]:boolean} = {};
toggle(name:string, v:boolean) {
if(!v) delete this.classes[name];
else this.classes[name] = v;
}
}
export class VirtualElement {
public nodeType:number;
pr... |
4eaf7bd47e59806669ef0376cb84d42ac12a3b81 | TypeScript | ryoctrl/mirin_panel | /models/exhibitions.interface.ts | 2.6875 | 3 | export interface IYears {
/**
* パネル展示会の年度
* ex. 2020
*/
years: string;
/**
* 年度中の展示会
*/
exhibitions: IExhibition[];
}
export interface IExhibition {
id: number;
/**
* 展示会タイトル
* ex. Spring Autumn
*/
title: string;
/**
* 展示会に含まれる画像
*/
images: IImage[];
/**
* 公開済みの展... |
e9a6b83c2d075a2460f4c8a9b507fc5a662efd09 | TypeScript | Novvum/depsauce-graphql | /src/models/LibrariesIOModel/RequestService.ts | 2.578125 | 3 | import axios, { AxiosRequestConfig } from 'axios'
import { URL } from 'url'
import { ExceptionMapper, InvalidResponseError } from './APIException'
import {
ClientOptions,
FilterOptions,
HttpMethod,
HttpStatus,
LibrariesIOHeaders,
LibrariesIOResult,
RequestOptions,
} from './interfaces/'
export class Req... |
5590bfec96ccdeb58b853507b9bd6f4e655c8acd | TypeScript | ryanstapleton/typescript-practice | /conditional-operators.ts | 4 | 4 | let x : number = 100;
// in JS:
// == only checks for equivalent value, ignores data type
// === Checks not only for value, but verifies that the data type is the same
// No need for === in TS since == enforces datatype already
if(x == 100) {
console.log('== Condition passed');
}
if(x === 100) {
console.log('===... |
312033e32d732963d01d85a324688e0bd2bad3d7 | TypeScript | tyminko/aba-cadabra-back | /functions/src/lib/menu.ts | 2.625 | 3 | import * as functions from 'firebase-functions'
import { db } from './db'
import * as admin from 'firebase-admin'
import {DocumentSnapshot} from "firebase-functions/lib/providers/firestore"
type menuDoc = admin.firestore.DocumentData
const fieldValue = admin.firestore.FieldValue
export const syncToProgrammes = funct... |
62f0f8838d710db6ed8bfdb4a05ee2bce61c288f | TypeScript | VisualPerspective/ndvi-viewer | /src/js/models/Point.ts | 3.078125 | 3 | import { observable, computed, action } from 'mobx'
import * as _ from 'lodash'
import BoundingBox from '@app/models/BoundingBox'
class Point {
@observable _x: number
@observable _y: number
@observable boundingBoxConstraint: BoundingBox
constructor (x: number, y: number) {
this.set(x, y)
}
@computed ... |
9dd6bb4805bbbb3f59cd60d88d0c6b71279ebda6 | TypeScript | idealamz/react-native-mask-input | /src/MaskInput.types.ts | 2.890625 | 3 | import type { TextInputProps } from 'react-native';
import type { Mask } from './formatWithMask.types';
export type MaskInputProps = Omit<TextInputProps, 'onChangeText'> & {
/**
* Mask
*/
mask?: Mask;
/**
* Required value for the controlled text input.
*/
value: string;
/**
* Callback that ... |
ba7ca98a8f346718abdda088d39db24c2b0f6af7 | TypeScript | ConnorDY/collective-shield | /api/utils.ts | 2.828125 | 3 | import express from 'express';
import { IUser } from './interfaces';
export function getIp(req: express.Request) {
console.log(req.headers['x-forwarded-for']);
return (
((req.headers['x-forwarded-for'] as string) || '').split(',').pop() ||
req.connection.remoteAddress ||
req.socket.remoteAddress
);
... |
aef80f9d1cfd98f6174954dd779f3075cc31898e | TypeScript | helenmiller16/labkey-ui-components | /packages/components/src/internal/components/permissions/models.ts | 2.59375 | 3 | /*
* Copyright (c) 2015-2018 LabKey Corporation. All rights reserved. No portion of this work may be reproduced in
* any form or by any electronic or mechanical means without written permission from LabKey Corporation.
*/
import { Record, List, Map } from 'immutable';
export class Principal extends Record({
use... |
b4eafa81b07b288ddaf60e950e62bde2637bd0ce | TypeScript | hpAsus/tsproject | /app/src/ts-summer/components/dashboard/actionButton/actionButton.service.ts | 2.609375 | 3 | import {Injectable} from 'wk-ng/decorators/injectable';
import * as pick from 'lodash/pick';
import * as defaults from 'lodash/defaults';
import * as keys from 'lodash/keys';
@Injectable()
export class ActionButtonService {
private actionDefaults: IActionButton.IActionItem = {
title: 'ACTION_TITLE',
... |
f2baae68f7120b3889b47b143b49fd8cf592cf9f | TypeScript | Eli01071987/Sudoku | /src/gamevariants.ts | 2.59375 | 3 | export interface IVariant {
filling: string,
answer: string,
variant: number;
}
export class VariantService {
private static storageKey = 'playedGames';
private gameVariants: IVariant[] = [
{
filling: '050000000001005260600091003006980000703156804000073500900610008068400100000... |
960afc8c4590c9fbacc2035b1407e61c07cc07b2 | TypeScript | BinaryStudioAcademy/bsa-2021-infostack | /frontend/src/store/notifications/slice.ts | 2.625 | 3 | import { createSlice, PayloadAction } from '@reduxjs/toolkit';
import { ReducerName } from 'common/enums/app/reducer-name.enum';
import { INotification } from 'common/interfaces/notification';
import { ActionType } from './common';
type State = {
notifications: INotification[];
count: number;
isExpanded: boolean... |
5328047ad345c9ebf7e1a35af9e936f6ff1bed16 | TypeScript | tjoskar/mobx-react-util | /src/lifecycle.util.ts | 2.90625 | 3 | import React from 'react';
import { Component } from './types/component';
type Hooks<P, S> = {
componentDidMount?: (props: P) => S;
componentWillUnmount?: (props: P, lifeState: S) => void;
};
export function lifecycle<P, S = void>(hooks: Hooks<P, S>) {
return (Component: Component<P>) => {
return class Life... |
7a4d89f4c490ff68c02faedbcc599675b6d55ff6 | TypeScript | cothis/JestSample | /server/test/services/user.service.spec.ts | 2.671875 | 3 | import { userService, userRepository } from '../../src/di';
describe('유저 서비스 테스트입니다.', () => {
beforeAll(() => {
console.log('테스트 시작합니당');
});
afterEach(() => {
// 각 테스트 후 repository를 초기화 합니다.
userRepository.clear();
});
it('데이터를 생성하면 아이디가 부여되야 합니다.', () => {
//given
const user = { name... |
f93477ad62c9c7b56866d3a03ce3251521cc0a87 | TypeScript | orkestral/venom | /src/api/helpers/file-to-base64.ts | 2.9375 | 3 | const mimeTypes = require('mime-types');
import * as fs from 'fs';
/**
* Converts given file into base64 string
* @param path file path
* @param mime Optional, will retrieve file mime automatically if not defined (Example: 'image/png')
*/
export async function fileToBase64(path: string, mime?: string) {
if (fs.e... |
7e74ebb77803d315d77d160c624d29c4d1d850a1 | TypeScript | deverebor/JavaScript-e-TypeScript-FullStack | /Aulas - TypeScript/src/aula-11/index.ts | 3.515625 | 4 | // Union Types
export function addOrConcat(x: number | string, y: number | string) {
if(typeof x === 'number' && typeof y === 'number') return x + y;
return `${x}${y}`;
};
console.log(addOrConcat(2, 2));
console.log(addOrConcat('2', '2'));
console.log(addOrConcat(2, '2'));
console.log(addOrConcat('2', 2));
consol... |
7ee96148362cdbd1a5a80ee69c37d85ed97f2666 | TypeScript | shaltaev/icons-to-sprite | /src/IconRegistry.ts | 2.859375 | 3 | type iconType = import('./Icon').iconType
export type iconExtractTryType = [undefined, iconType] | [Error, undefined]
type symbolTryType = [undefined, string] | [Error, undefined]
export type extractorSyncType = (
group: string,
name: string
) => iconExtractTryType
export type extractorType = (
group: st... |
c76e477868d9bb2ae5904a528da22e879ecce871 | TypeScript | GearFramework/Gear | /Demo/Resources/Js/gear.d.ts | 2.8125 | 3 | interface AnyObjectInterface {
[key: string]: any
}
/**
* Интерфейс приложения
*
* @package Gear Framework
* @author Kukushkin Denis
* @copyright 2016 Kukushkin Denis
* @license http://www.spdx.org/licenses/MIT MIT License
* @since 0.0.1
* @version 0.0.1
*/
interface ApplicationInterface extends ObjectInt... |
2ef4fea1f83cdf8e36c14e29a2fdffdf558d6dac | TypeScript | pmislinfreefr/amplifyMFT | /src/app/services/partner/interface_partner.ts | 2.59375 | 3 | // == Interface for one partner
export interface IPartner {
part_name: string; // name of the partner
part_description: string; // description
contact_email: string;
contact_firstname: string;
contact_lastname: string;
contact_jobtitle: string;
contact_phone: string;
part_bId: string;
communicationPro... |
a08a910081fbc95be3554694439843edc46349e3 | TypeScript | camelFace7122/twitter-clone | /src/utils/dateHelpers.ts | 2.59375 | 3 | import { format } from 'date-fns'
import formatDistance from 'date-fns/formatDistance'
import ruLang from 'date-fns/locale/ru'
export const getTimeFrom = (date: Date): string => {
return formatDistance(
new Date(date),
new Date(),
{ locale: ruLang }
)
}
export const formatDate = ... |
2e17fef60855957e6baab9fee8591147798a101a | TypeScript | Engineer2B/ts-common-tools | /src/Utility/Request.ts | 2.828125 | 3 | // tslint:disable: no-magic-numbers
import * as http from 'http';
import * as https from 'https';
import * as qs from 'qs';
import { RequestTypeE } from '../Enum/RequestType';
import { Logger } from './Logger';
import * as crypto from 'crypto';
export type Response = {
Data: string;
Headers: string[];
};
export type... |
de97985015616232c8198206451abb12eee15c53 | TypeScript | edsolater/05_utils | /utils/containers/Maybe.ts | 3.546875 | 4 | // import { maxBy } from "lodash"
// var Maybe = function (x) {
// this.__value = x
// }
// Maybe.of = function (x) {
// return new Maybe(x)
// }
// Maybe.prototype.isNothing = function () {
// return this.__value === null || this.__value === undefined
// }
// Maybe.prototype.map = function (f) {
// return ... |
47e7ba39171160364e609b856f4a8c873094ddd0 | TypeScript | jenkins-infra/evergreen | /distribution/client/src/lib/periodic.ts | 3.171875 | 3 | /*
* The Periodic module is responsible for holding onto periodic tasks which
* must be executed regularly
*
*/
import * as logger from 'winston'
import cron from 'cron';
export default class Periodic {
protected readonly jobs : any;
protected readonly offset : number;
/*
* Requires the feathersjs app i... |
2c86f95a003cf361f06e077849345c0746d9e611 | TypeScript | ColdSIce/reDeska | /src/app/services/flow.service.ts | 2.71875 | 3 | import { Injectable } from '@angular/core';
import { Flow } from '../model/flow';
import { FlowType } from '../model/flowType';
import { Category } from '../model/category';
@Injectable()
export class FlowService{
flows:Flow[];
constructor(){
this.flows = [
new Flow(1, new Category("Работа... |
eebe458d4fa0c0c0f133f82caaedaee4f9f3e106 | TypeScript | mouse484/Ecstar | /src/lang/index.ts | 2.625 | 3 | /* Langage Base English US */
export class LangBase {
LOADING(type: string): string {
return `Loading ${type}...`;
}
BOT_READY = 'Ready to Go!';
COMMAND_DIR_FILE_WARN =
"Files cannot be placed directly under 'commands' folder";
NON_EXISTENT_COMMAND(commandName: string): string {
return `Non-ex... |
ded35d31ac318f9e73db08cb91a237059ddad8ba | TypeScript | Continuesd/web6yixuan | /client/router/router-config.ts | 2.640625 | 3 | /*const routes: Routes = [
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' },
{ path: 'dashboard', component: DashboardComponent },
{ path: 'detail/:id', component: HeroDetailComponent },
{ path: 'heroes', component: HeroesComponent }
];*/
import {APage} from "../page/demo/A/a.page";
import {IndexPag... |
2d1b930c3fd7dd0affc5ddca86f2a71b1453da49 | TypeScript | Domnyk/vinci | /src/app/components/common/form-checkbox/form-checkbox.component.ts | 2.625 | 3 | import { Component, HostBinding, Input, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
@Component({
selector: 'app-form-checkbox',
templateUrl: './form-checkbox.component.html',
styleUrls: ['./form-checkbox.component.css']
})
export class FormCheckboxComponent implements OnInit {
... |
3a95ea6bec79ae1c0ba0b4668a4bbca485d051f0 | TypeScript | ktp-forked-repos/constraintjs | /types/index.d.ts | 2.515625 | 3 | /** Declaration file generated by dts-gen */
export = constraintjs;
declare function constraintjs(node:Node): constraintjs.Binding;
declare function constraintjs(value:Function, options?:constraintjs.ConstraintOptions): constraintjs.Constraint;
declare function constraintjs(value:any[], options?:constraintjs.Ar... |
d50a9dc111511be15702985ec83d521a2479b3b8 | TypeScript | samuelneff/go-fish-typescript | /src/GamePlay.ts | 2.9375 | 3 | /// <reference path="Card.ts" />
/// <reference path="ComputerPlayer.ts" />
/// <reference path="Deck.ts" />
/// <reference path="HumanPlayer.ts" />
/// <reference path="jquery.d.ts" />
/// <reference path="Player.ts" />
/// <reference path="Rank.ts" />
/// <reference path="Suit.ts" />
class GamePlay {
... |
1e3a5f9a838a25dee54a604d5045e5627e508bfd | TypeScript | RafaGomez/graph_challenge | /src/app/auth/services/auth.service.ts | 2.671875 | 3 | import { User } from './../models/User';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/of';
import { Subject } from 'rxjs/Subject';
@Injectable()
export class AuthService {
private userLogged: User = null;
/** Fires an event everytime a user... |
1d46b60976a968a26862e2b50f77e3f67d4cbce3 | TypeScript | MikeParkGit/JavaFullStackFinal | /Frontend/mediapp-frontend/src/app/dto/FiltroConsultaDTO.ts | 2.515625 | 3 | export class FiltroConsultaDTO {
dni:string;
nombreCompleto: string;
fechaConsulta: string;
constructor (dni:string, nombreCompleto: string, fechaConsulta: string){
this.dni = dni;
this.nombreCompleto = nombreCompleto;
this.fechaConsulta = fechaConsulta;
}
toString () ... |
9990af5ea27263b79d0c979d0506971d1bb75bd5 | TypeScript | TOGoS/TTSGCG | /src/main/ts/GCodeGenerator.ts | 2.671875 | 3 | import * as aabb from './aabb';
import { AABB3D } from './aabb';
import * as vectormath from './vectormath';
import { TransformationMatrix3D, Vector3D, zeroVector } from './vectormath';
import Cut, { ConicPocket, Pause } from './Cut';
import { CornerStyleName, circlePath } from './pathutils';
import * as ration... |
678901ba64dcd13f4549937980903ac1347b45a6 | TypeScript | burmanm/custom-policies-ui-frontend | /src/schemas/CreatePolicy/Actions/ActionEmailSchema.ts | 2.5625 | 3 | import * as Yup from 'yup';
import { ActionType } from '../../../types/Policy/Actions';
export const ActionEmailSchema = Yup.object().shape({
type: Yup.mixed<ActionType.EMAIL>(),
to: Yup.string().email('The email address is invalid').required('Specify what email address of the receiver').trim(),
subject: Y... |
16aba17d528e1b6faee63ee4c6e488501a97a83d | TypeScript | Hadron67/tscc-compiler | /src/grammar/ptable-gen.ts | 2.671875 | 3 | import { BitSet } from '../util/bitset';
import { Grammar } from './grammar';
import { console } from '../util/common';
import { OutputStream } from '../util/io';
import { Item,Action,ItemSet } from './item-set';
import { List } from '../util/list';
import { ParseTable } from './ptable';
import { TokenDef, Assoc, conve... |
35d9b2793a7c00821ebbba445aae6363a7f69314 | TypeScript | knewjade/mobliss | /src/tetfu.ts | 2.921875 | 3 | import {mino as _mino} from 'mino';
import {field as _field} from 'field';
declare function escape(s:string): string;
/*
テト譜について
左上(23段目最左)がindex === 0
右下(せり上がりライン最右)がindex === fldblks-1 === 239
*/
export namespace tetfu {
type Field = _field.Field;
type Type = _mino.Type;
type Rotate = _mino.Rotate;
type Pos... |
e028f9410069a3267d3f370d328db080722cdfa6 | TypeScript | concord-consortium/text-decorator | /test/decorate-html.test.ts | 2.859375 | 3 | import { decorateHtml, IDecorateHtmlOptions, addEventListeners, removeEventListeners } from "../src/text-decorator";
import parse5, { DefaultTreeDocumentFragment as DocumentFragment,
DefaultTreeElement as Element,
DefaultTreeTextNode as TextNode } from 'parse5';
import { dispatchSimu... |
f8a2f66c96a5c26a050fd2e0b9ef2aa4ad4e40c7 | TypeScript | rom-ger/ts-template | /src/modules/old/models/Todo.ts | 3 | 3 | interface ITodoDTO {
userId: number;
id: number;
title: string;
completed: boolean;
}
interface ITodo {
id?: number;
userId?: number;
title: string;
}
class Todo implements ITodo {
id?: number;
userId?: number;
title: string;
constructor(dto: ITodoDTO) {
this.id = ... |
a24a405c293dc1470488760b269e9deb64f6b3ed | TypeScript | andrewprofile/cqrs-sample | /typescript/src/SharedKernel/Infrastructure/CommandBus/SimpleCommandBus.ts | 2.78125 | 3 | import {Handler} from "../../Application/Command/Handler/Handler";
import {Command} from "../../Application/Command/Command";
import {CommandBus} from "../../Application/CommandBus/CommandBus";
export class SimpleCommandBus implements CommandBus {
private handlers: { [key: string]: Handler; } = {};
registerHa... |
c662c06a9d7b4d68c56cb3fc0f44f9bc2f10ff22 | TypeScript | dennis-school/net_bicycles | /web_server/src/user_client/index.ts | 3.109375 | 3 | import { setInterval } from 'timers';
// Bicycle location information that is relevant to the user
// Structure obtained from the server
class BicycleLocation {
name: string;
longitude: number;
latitude: number;
numAvailable: number;
numEmpty: number;
public constructor( name: string, longitude: number, l... |
47f27477c632b52171f52783b4553dc4d8e80fbe | TypeScript | TarVK/CYK-BNF-CFG-AST-creator | /build/BNF.d.ts | 2.96875 | 3 | import { Interpreter } from "./Interpreter";
import { ITokenizer } from "./_types/Tokenizer/ITokenizer";
import { ICFG } from "./_types/CFG/ICFG";
import { CFG } from "./CFG";
import { Tokenizer } from "./Tokenizer";
import { ICNFerror } from "./_types/CNF/ICNFerror";
import { ITokenizeError } from "./_types/Tokenizer/... |
ae60e7558cced33d11e988cf997a6853fed771fe | TypeScript | arashrq/ShapeShifter | /src/app/scripts/common/UiUtil.ts | 2.53125 | 3 | // TODO: figure out why travis fails when JQuery is uncommented
export function waitForElementWidth($el/*: JQuery*/, timeout = 1000) {
const start = Number(new Date());
return new Promise<number>((resolve, reject) => {
const tryResolve_ = () => {
if (Number(new Date()) - start > timeout) {
reject(... |
631a2dfd7fdee79885ab614ae43a4f4fe84e69e6 | TypeScript | Ni55aN/ni55an.github.io | /src/components/Logo/gradient.ts | 2.59375 | 3 |
export function lightness(k: number) {
return 'rgba(255,255,255,' + k + ')';
};
export function overlayGradient(ctx: CanvasRenderingContext2D, width: number, height: number) {
const gradient = ctx.createLinearGradient(0, 0, width, height);
gradient.addColorStop(0, lightness(0));
gradient.addColorStop(0.5, lig... |
159dd1206836681d867d9c0924ccfc160e1a5b6f | TypeScript | bluelovers/cheerio-create-text-node | /test/demo.test.ts | 2.53125 | 3 | /**
* Created by user on 2017/8/27/027.
*/
import { createTextNode, use } from '../src/index';
import cheerio, { Cheerio, CheerioAPI } from 'cheerio';
import { basename, extname } from 'path';
describe(basename(__filename, extname(__filename)), () =>
{
let $: CheerioAPI;
beforeEach(() =>
{
$ = cheerio.load('... |
0aa3675df0aecb8442d40a8b4f5761d309d4a561 | TypeScript | XelNaga6000/homework-angular | /src/app/core/@ngrx/products/products.state.ts | 2.765625 | 3 | import { createEntityAdapter, EntityState, EntityAdapter } from '@ngrx/entity';
import { IProduct } from 'src/app/products/models/product.model';
export interface ProductsState extends EntityState<IProduct> {
readonly loading: boolean;
readonly loaded: boolean;
readonly error: Error | string;
}
function select... |
3cc001cbf20a1dead23c73d963b6716ebf76045b | TypeScript | jmsalazar84/react-quiz | /src/services/Questions/QuizBuilder.ts | 2.828125 | 3 | import { ValidContinentFilter } from '@common/filters';
import { QuizQuestion } from '@common/interfaces';
import { randomIntFromInterval } from '@utils/randomIntFromInterval';
import { Continent, Country } from '../../types';
import { WhatContinentIsCountryIn } from './WhatContinentIsCountryIn';
import { WhichCountryI... |
757ec79684b1873a90b18a61564e32477e2b472a | TypeScript | MrZhouZh/awesome-validator | /test/rules/variable-width.ts | 3.09375 | 3 | import { assert } from 'chai';
import { AbstractRule } from '../../src/rules/abstract-rule';
import { VariableWidth } from '../../src/rules/variable-width';
describe('VariableWidth', () => {
let variableWidth: VariableWidth;
beforeEach(() => {
variableWidth = new VariableWidth();
});
it('is... |
43f95a25558f1f593700511f79a4cb52f35e17b6 | TypeScript | typeorm/typeorm | /src/metadata/RelationMetadata.ts | 2.6875 | 3 | import { RelationType } from "./types/RelationTypes"
import { EntityMetadata } from "./EntityMetadata"
import { ForeignKeyMetadata } from "./ForeignKeyMetadata"
import { ObjectLiteral } from "../common/ObjectLiteral"
import { ColumnMetadata } from "./ColumnMetadata"
import { EmbeddedMetadata } from "./EmbeddedMetadata"... |
e53ab779c6d1f08a738a67ded6d963386a19ff74 | TypeScript | alber0905/A2R | /other/labs/AST/src/index.ts | 2.703125 | 3 | /* eslint no-console: "off" */
import fs from 'fs';
import ts from 'typescript';
import path from 'path';
const normalizedPath = path.resolve('./samples');
interface JSDocContainer {
jsDoc?: ts.JSDoc[];
jsDocCache?: ts.JSDocTag[];
}
async function processFilesPath(pathToProcess: string): Promise<void> {
functi... |
f4f2b604ce2b5376a9fce57a6df8b1542021c723 | TypeScript | hudson21/100-algorithms-challenge | /addTwoDigits/addTwoDigits.ts | 3.78125 | 4 | function addTwoDigits(n: any): number {
const numbers = n.toString().split('');
return numbers.reduce((acc: string, num: string) => {
return parseInt(acc) + parseInt(num);
})
}
//Another Approach
function addTwoDigits2(n: any): number {
const numbers = n.toString().split('');
retu... |
cb60b20e5331e8161fa924a1404ecd9c62245687 | TypeScript | tristanhamel/git-viz | /src/app/reducers/user.reducer.ts | 2.90625 | 3 | import * as actions from '../constants/ActionTypes';
export interface IUser {
userName: string;
token: string;
isLoading: boolean;
error: false;
userInfo: {};
}
const initialState: IUser = {
userName: 'tristanhamel',
token: null,
isLoading: false,
error: false,
userInfo: null
};
export const user... |
1a3d1ec475cdfbd44b1e8c36e5c1c5311a4b05d7 | TypeScript | Devidian/OmegaUtils | /types/Factory.ts | 2.640625 | 3 | type Factory<T> = new (item?: T) => T;
type FactoryList<T> = Record<string, Factory<T>>;
|
2fc886c4170409ca4ea4954c17b3d32cc8e9b080 | TypeScript | ci010/VoxeLauncher | /src/universal/store/modules/launch.d.ts | 2.546875 | 3 | import { Module, Context } from "../store";
export type C = Context<State, {}, Mutations, Actions>;
export interface Actions {
launch(context: C, profileId?: string): Promise<boolean>;
}
type Status = 'ready' | 'checkingProblems' | 'launching' | 'launched' | 'minecraftReady';
export interface State {
status: ... |
951f5f50effafba33a7b48fe4f8aac2e0f211e62 | TypeScript | Chimmis/EfCrudExampleApp | /ClientApp/src/store/BookListStore.ts | 3.0625 | 3 | import { Action, Reducer } from 'redux';
import { AppThunkAction } from '.';
import { Book } from '../shared/shared-types/Book'
export interface BookListState {
loading: boolean;
loaded: boolean;
books: Book[];
}
const loadBooksActionType = '[Books] Load Books'
const loadBooksActionSuccessType = '[Books] ... |
db391241ba77c6fb4f0cc09206b04c37ddf6c800 | TypeScript | JakeSidSmith/watfish | /tests/mocks/ws.ts | 2.84375 | 3 | import { Data } from 'ws';
interface Events {
[i: string]: undefined | ((data: any) => any);
}
jest.mock('ws', () => {
let webSocketServerEvents: Events = {};
let webSocketEvents: Events = {};
class Server {
public static _trigger (event: string, data: any) {
const callback = webSocketServerEvents[... |
dfb56ed597b8f48da2115fbfdffd1e6b294e90bb | TypeScript | togoog/range-slider | /demo/components/config-form/control-max.ts | 2.625 | 3 | import { html } from 'lit-html';
import { assoc } from 'ramda';
import { Config, ElementAttributes } from '../../types';
import { getRandomId, valueFormatter } from '../../helpers';
const defaultAttributes = {
type: 'number',
valueFormatter,
valueParser: parseFloat,
};
function controlMax(
{ options, onUpdat... |
c9d07994bf78402631b4b8bbc6119038a443fe6c | TypeScript | AimWhy/web-highlighter | /src/util/event.emitter.ts | 3.21875 | 3 | /**
* tiny event emitter
* modify from mitt
*/
type EventHandler = (...data: unknown[]) => void;
type EventMap = Record<string, EventHandler>;
type HandlersMap<T extends EventMap> = {
[K in keyof T]: T[K][];
};
class EventEmitter<U extends EventMap = EventMap> {
private handlersMap: HandlersMap<U> = Objec... |
32b098b9773e0010833a0aa62cc5890ce58d1178 | TypeScript | suite/euchre-ts | /src/index.ts | 2.953125 | 3 | import { Player } from "./player";
import { GameState } from "./gamestate";
import { Deck } from "./deck";
import { Game } from "./game";
import { Team } from "./team";
const deck = new Deck();
deck.shuffle();
const teamOne = new Team("Team One");
const teamTwo = new Team("Team Two");
const players: Array<Player> = ... |
9be45e572548aea8cedb99e690177f9664cfd5f1 | TypeScript | dsouzarohan/pc-frontend | /src/app/states/auth/auth.actions.ts | 2.640625 | 3 | import {Action} from '@ngrx/store';
import {UserAuthInformation, UserLoginCredentials} from '../../models/user.models';
// SIGN_UP = 'SIGN_UP',
// SIGN_IN = 'SIGN_IN',
// LOG_OUT = 'LOG_OUT',
export enum AuthActionTypes {
IS_LOGGING_IN = 'IS_LOGGING_IN',
TRY_LOG_IN = 'TRY_LOG_IN',
ON_LOG_IN_SUCCESS = 'ON_LOG_IN... |
29ebabfb322aa86c777864b37577522017666a32 | TypeScript | Bitcoinera/redux-todo-app | /src/app/todo/models/todo.model.ts | 3.0625 | 3 | export class Todo {
public id: number;
public text: string;
public done: boolean;
constructor( text ) {
this.id = Math.floor(Math.random() * (100 - 1)) + 1;
this.text = text.charAt(0).toUpperCase() + text.slice(1);
this.done = false;
}
} |
a9a9b6dc9ae40b6fdbc2750df855ec667dc7cd6b | TypeScript | iti-marvinroger/simple-regex | /src/index.test.ts | 3.078125 | 3 | import { matchRegex } from './'
type Dataset = [string, string, boolean][]
const testDataset = (dataset: Dataset) => {
expect.assertions(dataset.length)
for (const data of dataset) {
expect(matchRegex(data[0], data[1])).toBe(data[2])
}
}
test('matches without special character', () => {
tes... |
b598bd3acc841e3e3588430912e6ed2de748dd33 | TypeScript | benismailhamza/UTC503 | /Tests_TypeScript/ScopeVariables.ts | 3.671875 | 4 | function fn() {
var firstName = "Alexandre";
console.log(firstName);
}
// console.log(firsName);
// Cannot find name 'firsName'.
// Une variable déclarée avec le motclé
// var a une portée équivalente au bloc fonction dans lequel elle a été définie.
var firstName = "Alexandre";
var firstName = "toto";
conso... |
ddc533009c0a3841aa3c15bff14bbd16c6a53a47 | TypeScript | asusguy94/Porn-Organizer | /src/components/search/helper.ts | 3.21875 | 3 | export type HiddenStar = {
titleSearch: string
breast: string | null
haircolor: string
ethnicity: string
website: string
}
export type HiddenVideo = {
category: (string | null)[]
attribute: string[]
location: string[]
titleSearch: string
website: string
}
export type StarSearch = {
id: number
... |
dadafd6fcfdb37965ebbf70b81770a2c213ee4f6 | TypeScript | MisaelAugusto/recycle-it-web | /server/src/modules/collect-points/services/FilterCollectPointsService.ts | 2.765625 | 3 | import { injectable, inject } from 'tsyringe';
import CollectPoint from '../infra/typeorm/entities/CollectPoint';
import CollectPointsRepository from '../infra/typeorm/repositories/CollectPointsRepository';
interface Request {
name: string;
city: string;
state: string;
items: string;
}
@injectable()
class Fi... |
e397a5797511244b81ec0b3cb52049d2c24057e3 | TypeScript | lifeomic/delta | /src/sqs.ts | 2.734375 | 3 | import { LoggerInterface } from '@lifeomic/logging';
import { v4 as uuid } from 'uuid';
import { SQSEvent, Context as AWSContext } from 'aws-lambda';
import {
BaseContext,
processWithOrdering,
withHealthCheckHandling,
} from './utils';
export type SQSMessageHandlerConfig<Message, Context> = {
/**
* A logger... |
ec53f293749cc5d76cea239c069474acfb1fddfd | TypeScript | tiwari247/displaying-data | /src/app/hero.ts | 2.5625 | 3 | export class Hero {
constructor(public id:number, public name:string, public isHuman:boolean){
}
}
|
e6e521a846d497dbc4ddcb6fd69ae8238b879fe3 | TypeScript | spinnaker/deck | /packages/titus/src/validation/ApplicationNameValidator.ts | 2.8125 | 3 | import type { IApplicationNameValidator } from '@spinnaker/core';
import { ApplicationNameValidator, FirewallLabels } from '@spinnaker/core';
class TitusApplicationNameValidator implements IApplicationNameValidator {
private validateSpecialCharacters(name: string, errors: string[]): void {
const pattern = /^[a-z... |
df0dc990b86aa17b273aa6548ffdbb238961f95d | TypeScript | edwpow256/313pixelbuilders | /pixeled-brewing-co/src/app/games/games.component.ts | 2.53125 | 3 | import { Component, OnInit } from '@angular/core';
import {Game} from '../games/games.module';
@Component({
selector: 'app-games',
templateUrl: './games.component.html',
styleUrls: ['./games.component.scss']
})
export class GamesComponent implements OnInit {
games : Game[] = [
{name : "Super Chexx Bubble ... |
d12a6a2645f76384d62cd6efe3d5b661fec6b4ad | TypeScript | Rossh87/warbler_ts_combined | /songbyrd_api_server/src/middlewares/passport/strategies/googleStrat.ts | 2.546875 | 3 | import {Profile as PassportProfile} from 'passport';
import {
Strategy as GoogleStrat,
GoogleVerify
} from 'passport-google-oauth20';
// Get mongoose model
import User from '../../../models/user';
// Get helper function to modify profile object before saving to DB
import {replacePropName} from './stratUtils';... |
c5eaa55dee4078a6df33552f001b957796def375 | TypeScript | dkuida/logger-wrapper | /src/loggerConfig.ts | 2.671875 | 3 | export enum LogLevel {
fatal = 'fatal',
error = 'error',
warn = 'warn',
info = 'info',
verbose = 'verbose',
debug = 'debug',
silly = 'silly'
}
interface LoggerCommonProps {
level: LogLevel;
handleExceptions?: boolean;
}
interface FileLoggerConfig extends LoggerCommonProps{
... |
fc2fade8e3ea073a8adfcd07fa657c4deea22143 | TypeScript | narutubaderddin/gipam_front | /src/app/auth/authentication.service.ts | 2.65625 | 3 | import { Injectable } from '@angular/core';
import { Observable, of, throwError } from 'rxjs';
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { catchError, map } from 'rxjs/operators';
import { User } from '@core/Models/User';
import { JwtService } from '@app/auth/jwt.service';
import { Lo... |
b190c03aa99aa138e309aa7d0810710d39ec7084 | TypeScript | facundon/yt-mp3-downloader-client | /src/services/apiRequest.ts | 2.578125 | 3 | import axios, { AxiosRequestConfig, AxiosResponse } from "axios"
export type APIRoutes =
| "/login"
| "/logout"
| "/register"
| "/user"
| "/user/favorites"
| "/api/youtube"
| "/api/converter"
| string
export default async function apiRequest(
method: AxiosRequestConfig["method"],
route: ... |
efcf255312a972118061b6796aeaa841a3ef5d4a | TypeScript | Princeton-CDH/mep-django | /srcmedia/ts/lib/form.ts | 2.828125 | 3 | import { Subject, Observable } from 'rxjs'
import { distinctUntilChanged, map } from 'rxjs/operators'
import { Component, ajax, acceptJson } from './common'
class RxForm extends Component {
element: HTMLFormElement
target: string
constructor(element: HTMLFormElement) {
super(element)
if (... |
8c55bb0f3e754508a608595b28f7fbc57fd9e088 | TypeScript | isaacgyamfi/transitter-api | /src/api/v1/services/station.ts | 2.609375 | 3 | import { Station } from '../models/Station';
import { IStation } from '../interfaces/place';
import { Place } from '../models/Place';
export const saveNewStation = async (data: IStation): Promise<any> => {
console.log(data);
try {
const place = await Place.findOne({ name: data.address });
return await Stat... |
b12f240e51088829c3b791bd04fdbef15a0855ed | TypeScript | nguyer/aws-sdk-js-v3 | /clients/node/client-cloudformation-node/types/_PropertyDifference.ts | 2.9375 | 3 | /**
* <p>Information about a resource property whose actual value differs from its expected value, as defined in the stack template and any values specified as template parameters. These will be present only for resources whose <code>StackResourceDriftStatus</code> is <code>MODIFIED</code>. For more information, see <... |
122c44417897fc3f2964b53362e7689c46ac0056 | TypeScript | cotype/serverless | /src/cached.ts | 2.6875 | 3 | export default function cached<T>(factory: () => T) {
const c: { (): T; cache?: T } = () => {
if (!c.cache) {
c.cache = factory();
}
return c.cache;
};
return c;
}
|
5c059abcbab5783bcf9c0a6a0f471d8b2cda4e9b | TypeScript | suwua/angular-example | /angular-service/src/app/share/service/hero.data.service.ts | 2.703125 | 3 | import { Injectable } from '@angular/core';
import {Hero} from "./hero";
import {HEROS} from "./hero.data";
@Injectable()
export class HeroService {
getHeros(): Promise<Hero[]> {
//获取数据的服务往往都是异步的,所以我们使用了Promise去封装我们获取到的数据,来模拟异步请求,还要注意,既然用异步的方式,那么User[]也应该是Promise类型的
return Promise.resolve(HEROS);
}
//我... |
c32c705997f85439a82f5377215e632a22a1bcbc | TypeScript | vscncls/reddit-api | /src/__tests__/redditApi.integration.test.ts | 2.578125 | 3 | import { RedditClient } from "../RedditClient";
describe("Reddit Client fetches data sucessfully", () => {
it("Returns current hot posts from specified subreddit", async () => {
const redditClient = new RedditClient();
const posts = await redditClient.fetchPosts("artificial");
expect(posts).toBeTruthy(... |
3a10651727a510aba39e226c7a1c186425f7b38c | TypeScript | pgnDataBase/pgnDB | /webclient/src/app/chessboard-viewer/game-viewer/variant-depth-display-calculator.spec.ts | 2.671875 | 3 | import {Move} from '../../model/Move';
import {VariantDepthDisplayCalculator} from './variant-depth-display-calculator';
function createTestMoveList(): Move[] {
let result = [];
let m1 = new Move(); m1.variantId = null; m1.variantType = null; result.push(m1);
let m2 = new Move(); m2.variantId = 1; m2.variantType... |