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 |
|---|---|---|---|---|---|---|
ef3a8c80e67fbf81d98865dc02dc50bda6d00dfa | TypeScript | chrisnrick/botbuilder-js | /libraries/botbuilder-azure/src/cosmosDbPartitionedStorage.ts | 2.609375 | 3 | /**
* @module botbuilder-azure
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { Storage, StoreItems } from 'botbuilder';
import { Container, CosmosClient, CosmosClientOptions } from '@azure/cosmos';
import { CosmosDbKeyEscape } from './cosmosDbKeyEsc... |
83afcbba561ef5f400e340109d72878a80614c45 | TypeScript | anish2690/genesis | /packages/genesis-remote/src/format.ts | 2.640625 | 3 | import { RenderContext, RenderData } from '@fmfe/genesis-core';
const mergeArr = (
data: RenderData,
cb: (arr: RenderData[]) => string
): string => {
// 展开成一维数组
const arr = [data];
const mergeState = (state, deep) => {
const remoteArr = state.__remote_view_state__ || [];
if (!remote... |
a8ba2045ac73cf1ae6d02f86cc3695720116fc53 | TypeScript | saraqarab/CHI-Angular-Tutorials | /T006-Observables/src/app/page-1/child/child.component.ts | 2.84375 | 3 |
import { Output, EventEmitter } from '@angular/core';
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-page-1-child',
templateUrl: './child.component.html',
styleUrls: ['./child.component.scss']
})
export class Page1ChildComponent implements OnInit {
/*
Using @Input() is the mos... |
76baeb7bf8d0d8c5dddbd725771c6bb88406c64a | TypeScript | djungowski/tslint-jasmine | /src/noJasmineExcludeRule.ts | 2.640625 | 3 | import * as Lint from "tslint";
import * as ts from "typescript";
import { RuleFailure } from "tslint";
import { JasmineRuleWalker } from "./JasmineRule";
/**
* TSLint Check to disallow xdescribe and xit
*
* Usage in tslint.json: "no-jasmine-exclude": true
*/
export class Rule extends Lint.Rules.AbstractRule {
/... |
800939a8dea65589d22702b02629d1f9695c14d5 | TypeScript | marcotamburelli/DP | /src/component/dom/DomWrappers.ts | 3 | 3 | export interface DomWrapper<N extends Node> {
parentDomWrapper: DomWrapper<any>;
readonly domElement?: N;
id: string;
appendChild<F extends Node>(child: DomWrapper<F> | string);
provideParent<P extends Node>(parent: DomWrapper<P>);
removeChild(child: DomWrapper<any>);
clone(): DomWrapper<N>;
}
export... |
75663d9654503a0c731adb912d25ae0c136a1715 | TypeScript | ryaa/ionic3-multi-level-select | /src/providers/helpers/helpers.ts | 2.78125 | 3 | import { Injectable } from '@angular/core';
// MODELS
import { LookUpItem, LookUpItemRaw, SortOrder } from '../../models/models';
@Injectable()
export class MultiLevelSelectHelpers {
public buildHierarchicalLookUp(lookups: LookUpItemRaw[]): LookUpItem[] {
if (lookups && lookups.length > 0) {
... |
67ef1b850f3d3cefbae3d092644fd7d797e6f40d | TypeScript | joeferner/mongoapi4es | /src/Cursor.ts | 2.875 | 3 | import { CursorResult } from './types';
export abstract class Cursor<T> {
protected _limit?: number;
protected _skip?: number;
protected _sortKeyOrList?: string | object[] | object;
protected _sortDirection?: number | undefined;
protected _projection?: object;
limit(value: number): Cursor<T> {... |
1f7611ea0e2fe668e4c16db7eb7bf92a515697ac | TypeScript | sunkaiqi00/zhihu | /src/typeings/interface.ts | 2.640625 | 3 | export interface ColumnProps {
_id: string;
title: string;
avatar?: ImageProps;
description: string;
}
export interface ImageProps {
_id?: string;
url?: string;
createAt?: string;
filename?: string;
extname?: string;
}
export interface UserProps {
isLogin: boolean;
nickName?: string;
_id?: str... |
192ec0243d3964183655c54d3a2f2f2e460730cd | TypeScript | NikitaKrymov/noteApp | /client/src/actions/authActions.ts | 2.515625 | 3 | import { AUTH_USER_FAILED, AUTH_USER_REQUEST, AUTH_USER_SUCCESS, FETCH_USER_FAILED, FETCH_USER_REQUEST, FETCH_USER_SUCCESS, LOG_OUT_USER_FAILED, LOG_OUT_USER_REQUEST, LOG_OUT_USER_SUCCESS, PASSWORDS_VALIDATION_FAILED, PASSWORDS_VALIDATION_REQUEST, PASSWORDS_VALIDATION_SUCCESS, REG_USER_FAILED, REG_USER_REQUEST, REG_USE... |
db690c59ce1b4d974b31e9607a3a6a7cee721f86 | TypeScript | ZappRx/material-ui-pickers | /lib/src/__tests__/utils/date-fns-utils.test.ts | 2.53125 | 3 | import ruLocale from 'date-fns/locale/ru';
import DateFnsUtils from '../../utils/date-fns-utils';
describe('DateFnsUtils', () => {
const enUtils = new DateFnsUtils();
const uaUtils = new DateFnsUtils({ locale: ruLocale });
describe('getWeekDays', () => {
it('Should start week from Sunday by default', () => ... |
44e312836531ca4897cd7bad55b869a5cab75237 | TypeScript | Hyprtxt/deno.hyprtxt.dev | /deploy/poker.deno.dev.ts | 2.703125 | 3 | let count = 0
const URL_BASE = "https://poker.hyprtxt.dev"
async function handleRequest(request: any) {
const { pathname } = new URL(request.url)
console.log(`Received request #${++count} to ${pathname}`)
if (pathname.startsWith("/")) {
const diced = pathname.split("/")
const stuff = diced.slice(1, dice... |
2d5926b8cb9d9843a999d5d763c681ba4572719e | TypeScript | jayarathambavita/IM | /src/models/user.ts | 2.9375 | 3 | export interface Iuser{
id?: string
firstName?: string
lastName?: string
COMName?: string
email?: string
password?:string
}
export class User implements Iuser{
constructor(
public id?: string,
public firstName?: string,
public lastName?: string,
public COMName?: string... |
32fdfc9f813c72793ab2740e2cead26f08f59e6b | TypeScript | green-fox-academy/Sorsi | /week-01/day-05/exam.ts | 3.96875 | 4 | 'use strict';
// Write a program that asks for a number.
// It would ask this many times to enter an number,
// if all the numbers are entered, it should print the sum and average of these
// numbers like:
//
// Sum: 22, Average: 4.4
let numbers = [3, 5, 6, 72, 100];
let total: number = 0;
for (let i: number = 0;... |
dee6a5d9ebc8231d14c98a48d4c1083337ea2bc8 | TypeScript | GitRaymond/FinancialDashboard | /src/main/webapp/app/shared/model/split-transaction.model.ts | 2.78125 | 3 | export const enum Sign {
PLUS = 'PLUS',
MINUS = 'MINUS'
}
export interface ISplitTransaction {
id?: number;
splitName?: string;
amount?: number;
sign?: Sign;
transactionIngId?: number;
}
export class SplitTransaction implements ISplitTransaction {
constructor(
public id?: numbe... |
d3c6973a62f1ed4ec07b5dabdbd378b49f79928b | TypeScript | AliA1997/twitter-clone-typescript | /server/models/Entity.ts | 2.578125 | 3 | // import { Model, Table, Column, DataType, PrimaryKey, CreatedAt, UpdatedAt, DeletedAt } from 'sequelize-typescript';
import { PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, DeleteDateColumn } from 'typeorm';
// @Table
export abstract class Entity {
@PrimaryGeneratedColumn()
id?: number;
... |
0bac1c678f207c09cd58ae3c998582355d9c7fbb | TypeScript | g-surkis/nodejs-school-2021 | /lecture_14/examples/common/infrastructure/services/pdfGenerator/PuppeteerPDFGenerator.ts | 2.609375 | 3 | import { Injectable } from "@nestjs/common";
import { Readable } from "stream";
import { AbstractPDFTemplate } from "../../../application/services/pdfGenerator/AbstractPDFTemplate";
import { IPDFGenerator } from "../../../application/services/pdfGenerator/IPDFGenerator";
import { Browser, launch, PDFFormat, PDFOptions ... |
2ae6bba7cc5ce167d64a0c82a049aefa16b8ca7a | TypeScript | geometryzen/davinci-eight | /src/lib/math/dotVectorE2.ts | 2.859375 | 3 | import { isDefined } from '../checks/isDefined';
import { VectorE2 } from '../math/VectorE2';
/**
* @hidden
*/
export function dotVectorE2(a: VectorE2, b: VectorE2): number {
if (isDefined(a) && isDefined(b)) {
return a.x * b.x + a.y * b.y;
}
else {
return void 0;
}
}
|
0742aa582adece65fc36a2eeea1038966e514397 | TypeScript | narcisdiaconu/Licenta2019DiaconuNarcisConstantin | /Licenta2019DiaconuNarcisConstantin/Aplicatie/Gateway/src/main/webapp/app/shared/model/stations/station.model.ts | 2.765625 | 3 | import { ICity } from './city.model';
export interface IStation {
id?: number;
name?: string;
address?: string;
latitude?: number;
longitude?: number;
cityId?: number;
city: ICity;
}
export class Station implements IStation {
city: ICity;
constructor(
public id?: number,
... |
7f7ed716e27508b74f7aa3e66579dcccee80ce09 | TypeScript | HassenBF/treasure-hunt-game | /src/test/mocks/game.mock.ts | 2.578125 | 3 | import {GameData, Player} from '../../app/shared/models/interfaces/gameData';
import {GameMap} from '../../app/shared/models/interfaces/game-map.interface';
export const MOCK_GAME_DATA: GameData = {
mapSize: {
nbHorizontalTiles: 3,
nbVerticalTiles: 4
},
mountains: [
{
positionX: 1,
positi... |
4eeaf2295deb5927653822e46c6a500a3d9089c7 | TypeScript | uprm-inso-4116-2020-2021-S1/semester-project-team-b | /src/pages/api/review/[id]/index.ts | 2.5625 | 3 | import { NextApiResponse } from 'next';
import { ERROR_MESSAGE, OK_MESSAGE } from '../../../../lib/application/constants';
import container from '../../../../lib/container';
import { IReview } from '../../../../lib/domain/review';
import { IRequestWithIssuer } from '../../../../lib/middleware';
const mid = container.g... |
36dea6b0b601ecc284593226da01356a9333dbd1 | TypeScript | Rudeg/rushstack | /stack/rush-stack/src/logic/BuildContext.ts | 2.703125 | 3 | // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
import { PackageJsonLookup } from '@microsoft/node-core-library';
export interface IBuildContextParameters {
/**
* If unspecified, then process.cwd() is used.
... |
b08339baa870d87d2555442e0e08e0b621288361 | TypeScript | loliallen/mobile-kai-proxy | /src/utils/logger.ts | 2.96875 | 3 | import fs from "fs"
import path from "path"
interface ILogger {
log(data:string): void;
}
class Logger implements ILogger {
constructor(private readonly path:string){}
log(data: string){
let date = new Date();
fs.appendFileSync(path.join(this.path, `${date.toLocaleDateString()}.log`), `[$... |
89ba9d46118ca32da845215668ffb5c1db1e107e | TypeScript | IntensNow/CRUD | /client/src/utils/request.ts | 2.75 | 3 | async function request(url: string, method: string, data?: {}) {
try {
const headers: HeadersInit = {};
let body
if (data) {
headers['Content-Type'] = 'application/json'
body = JSON.stringify(data)
}
const response = await fetch(url, {
m... |
2a825c2729d3dfe734860dd7fe2233e3d391a92d | TypeScript | joerivett/oscillate | /src/model/World.ts | 2.9375 | 3 | import Particle from './Particle';
import Waves from './Waves';
import SceneRenderer from '../view/SceneRenderer';
class World
{
DISTANCE_BETWEEN_RINGS:number = 0.7;
DEFAULT_NUMBER_OF_RINGS:number = 8;
PARTICLE_RADIUS:number = 0.3;
PARTICLE_DEFAULT_Y:number = 3;
arrPoints:Array<Array<Particle>>;
view:Sce... |
74065420b75b41cfab56f71ee5a39f76c46e632b | TypeScript | perimosocordiae/Ninia | /src/optable.ts | 3.140625 | 3 | /// <reference path="../lib/node.d.ts" />
import Py_FrameObject = require('./frameobject');
import Py_Int = require('./integer');
import Py_FuncObject = require('./funcobject');
import opcodes = require('./opcodes');
import NotImplementedError = require('./notimplementederror');
import None = require('./none');
// Big... |
328bfb4b14b2095b08abbafc3724c836fd7d2184 | TypeScript | kedards25/Angular-6_Jan_2021 | /function-demo.ts | 3.28125 | 3 | function add(num1:number,num2:number):void{
var sum=num1+num2;
console.log("Addition of "+num1+" and "+num2+" is "+sum)
}
add(5,7) |
49c2904b0119b12d422f9dbdca896a04e90bfe78 | TypeScript | molstar/molstar | /src/mol-util/index.ts | 2.828125 | 3 | /**
* Copyright (c) 2017-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { BitFlags } from './bit-flags';
import { StringBuilder } from './string-builder';
import { UUID }... |
4c06aab178c6d42c0083ad5b7e8c909137bd9764 | TypeScript | dengliming/redisai-js | /src/helpers.ts | 3.421875 | 3 | export class Helpers {
/**
* Returns the index of the first occurrence of the maximum value along an array.
* @param arr
*/
argmax(arr): number {
let index = 0;
let value = arr[0];
arr.forEach((item, key) => {
if (item > value) {
value = item;
index = key;
}
});... |
c5f69132392539807e40312ea83e7a0785f1cbf5 | TypeScript | raydenl/fuel-watch | /src/history/History.ts | 2.609375 | 3 | import { History as IHistory } from "./types"
export class History implements IHistory {
place_id: string;
petrolType: string;
price: number;
confirmedAt: Date;
constructor(history: IHistory) {
this.place_id = history.place_id
this.petrolType = history.petrolType
this.price... |
574e948f91d580e1ee2e9a86ce0c491cbb1994cb | TypeScript | nomaed/ts2test | /src/ng-comp-ctrl.ts | 2.890625 | 3 | import * as angular from "angular";
abstract class MyBase {
public name = "Foo";
}
class MyComponent1 extends MyBase {
public $onInit() {
this.name = "BarBar";
}
}
class MyComponent2 extends MyBase {
public $onInit() {
this.name = "MooMoo";
}
}
function getComponentOptions(Ctrl: typeof MyBase) {
... |
7d31025d2cbfe4242dd09064131ee0f731b6e866 | TypeScript | oguzliv/MasterMind | /Angular7 + TypeScript + DevExtreme/computer.component.ts | 2.65625 | 3 | import { Component, OnInit } from '@angular/core';
import { LogicService } from '../logic.service';
import { ListItem } from '../listItem';
@Component({
selector: 'app-computer',
templateUrl: './computer.component.html',
styleUrls: ['./computer.component.css']
})
/**
* This class handles and implements compute... |
fb8f2fad5fa6e0f719af0bd78f080e1bc563e6fb | TypeScript | NumericFactory/manager-app | /src/app/services/project.service.ts | 2.515625 | 3 | import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
import { map } from 'rxjs/operators';
import { ProjectModel, ListModel } from '../models/project.model';
@Injectable({
providedIn: 'root'
})
export class ProjectService {
API_URL ... |
dafc2600bf2b0876da88378546c778bc1b778a9f | TypeScript | anujverma000/Tasks | /app/storage/CategoryStrore.ts | 2.65625 | 3 | import {TodoCategoryProps} from '../types';
import {saveData, getData, removeData, getAllKeys, multiGet} from './Storage';
const CATEGORY_STORAGE_KEY = '@com.tasks.category';
class CategoryStrore {
async getCategory(id: string): Promise<TodoCategoryProps> {
return getData(`${CATEGORY_STORAGE_KEY}:${id}`).then(j... |
5def458bbdd1d155b476a7878ea98e4def9dfb15 | TypeScript | ziarkomarcin/Frontend_Frameworks | /src/reducers/worksReducers.ts | 2.9375 | 3 | import * as actionTypes from '../actions/workTypes';
import { IWork } from '../interfaces/IWork';
export interface IWorksReducer {
works: IWork[] | null;
}
const defaultState = (): IWorksReducer => ({
works: null,
});
export default (state = defaultState(), action: any) => {
switch (action.type) {
... |
73108afe53a60d914cef41667ef319fdfc112baf | TypeScript | kmccullough/jukebox | /src/app/model/jukebox.model.spec.ts | 2.703125 | 3 | import { Jukebox } from './jukebox.model';
import { MusicalSection } from './musical-section.model';
import { SongRequest } from './song-request.model';
describe('SongRequest Model', () => {
it('should construct with properties', () => {
const jukebox = new Jukebox(
[new SongRequest('Name', 'Artist', 100, ... |
678669e071c6881e8f933920d1eef2287069f489 | TypeScript | serenity-js/serenity-js | /packages/core/src/errors/model/LogicError.ts | 3.046875 | 3 | import type { JSONObject } from 'tiny-types';
import { ErrorSerialiser } from '../ErrorSerialiser';
import { RuntimeError } from './RuntimeError';
/**
* Thrown to indicate that an {@apilink Interaction}, a {@apilink Task} or a test scenario
* can't be executed due to a logical error.
*
* For example, it's not pos... |
229d2105de3a3fbb202d9bb2795b012651b98831 | TypeScript | antfu/vscode-as-fs | /src/modules/base.ts | 2.53125 | 3 | import { Disposable, ExtensionContext, Uri } from 'vscode'
import FS from '../fs'
export default abstract class Module {
abstract name: string
active = false
disposables: Disposable[] = []
files: string[] = []
constructor(
public readonly ctx: ExtensionContext,
public readonly fs: FS,
) {
this... |
f3e18dc2c7488af354f045c97dbb6073e5c59cb6 | TypeScript | klaus-liebler/whsplc01 | /plcwebide/wwwsrc/flowchartOperator.ts | 2.65625 | 3 | import {FlowchartInputConnector, FlowchartOutputConnector } from "./flowchartConnector";
import {Flowchart} from "./flowchart";
import {Location2D, Utils} from "./utils"
export abstract class FlowchartOperator {
private Inputs: FlowchartInputConnector[]=[];
private Outputs: FlowchartOutputConnector[]= [];
... |
30835f5c5a3248523fe9828093385f3124b3e427 | TypeScript | uber/baseweb | /src/menu/__tests__/utils.test.ts | 2.71875 | 3 | /*
Copyright (c) Uber Technologies, Inc.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
import * as Utils from '../utils';
describe('Menu Utils - scrollItemIntoView', () => {
// |=======================| <-- top of parent window (at 0)
//... |
1b1c0aa68d8cb2908d34cb4a20bbcd227f46eae7 | TypeScript | nakayuu07/typescript_trrainig | /decolator.ts | 2.65625 | 3 | const logging = (target: Function) => {
console.log('Logging');
};
@logging
class User {
name = 'quill';
constructor() {
console.log('User was created');
}
}
|
807a27a1d4cbdd2fe698089992248cba9064bb06 | TypeScript | sambacha/deth | /packages/evm/src/opcodes/control.ts | 2.546875 | 3 | import { ExecutionContext } from '../ExecutionContext'
import { GasCost } from './gasCosts'
import { InvalidJumpDestination } from '../errors'
import { Bytes } from '../Bytes'
export function opSTOP (ctx: ExecutionContext) {
ctx.useGas(GasCost.ZERO)
ctx.returnValue = Bytes.EMPTY
}
export function opRETURN (ctx: E... |
d84c108262c04a381971597c89b732d0f87da239 | TypeScript | 111Lore111/EjerciciosLore | /Ejercicio4/src/app/service/user.service.ts | 2.640625 | 3 | import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { User } from './../model/models'
import { HttpClient } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class UserService {
//declaracion de url falsa
private userUrl = 'api/user';
constructor(
priv... |
2ff1151ffd46aa8f570f125b348044af0bfd0757 | TypeScript | derekchancts/Typescript---Drag-and-Drop | /src/components/project-input.ts | 2.859375 | 3 |
import { Component } from './base-component.js';
// import Component from './base-component.js';
// import Cmp from './base-component.js';
import { Validatable, validate } from '../util/validation.js';
// import * as Validation from '../util/validation.js';
import { autobind } from '../decorators/autobind.js';
// im... |
548d56af7ef4c39e90c9f84e7a3a607484bd2817 | TypeScript | raghurana/qtech-flutter-firebase-angular | /src/web/admin-portal/src/app/app-services/data.converters.ts | 2.875 | 3 | import * as moment from 'moment';
import { AppointmentStatus } from '../app-models/enums';
import { Appointment } from '../app-models/interfaces';
export const DataConverters = {
Appointments: {
fromText: (scheduleText: string): Appointment[] => {
const returnList: Appointment[] = [];
const allLines ... |
5629a8d7b71d5171569183c5deb1b8a541f56c7c | TypeScript | ryuxik/piu | /blob-punch/src/BaseImplementations/BaseProjectlie.ts | 2.609375 | 3 | import { EntityInterface, EntityManagerInterface, ProjectileInterface, RendererInterface } from '../CommonInterfaces/Entity';
import { Direction } from '../CommonEnums';
import { PlayerLogic, PlayerRender, GameLogic } from '../Constants';
import { RectangleInterface, Coordinate2DInterface, Vector2DInterface } from '../... |
4106517528fdf337af21cbebc345680d45a7d3c3 | TypeScript | JAspeling/actionsports.manager | /src/app/models/position.ts | 2.65625 | 3 | import { PropType } from "./PropType";
export type Positions = Position[];
export class Position {
name: string;
imageSrc: string;
propType: PropType;
assigned: boolean = false;
constructor(init?: Partial<Position>) {
Object.assign(this, init);
}
}
|
38ecac9bc1db1f59e360ba7120a2a04768152e6b | TypeScript | ajuhos/beanie-assistant | /src/IntegratedAssistant.ts | 2.765625 | 3 | import {SpeechContext, CommandProcessor, CommandResult} from './components';
import { hasKeyword, splitByKeyword, extractVoiceEmoji } from './utils'
const DEFAULT_EMOJI_LIST = [
'clap clap',
'angry angry',
'cry cry',
'evil evil',
'hallelujah hallelujah',
'kiss kiss',
'yoda yoda',
'sick ... |
0401233b8adde4f0321d3f1b5b5103664d449e2e | TypeScript | kevinkoste/corner | /api/src/models/Invite.ts | 2.609375 | 3 | import mongoose from 'mongoose'
const inviteSchema = new mongoose.Schema(
{
email: {
type: String,
required: true,
},
},
{ timestamps: true }
)
export interface Invite {
email: string
}
interface InviteDocument extends mongoose.Document, Invite {}
interface InviteModel extends mongoose.M... |
3da259599ddd3d08b4d2e9d19a7fb722ec35b580 | TypeScript | bhadresh-goswami/assignment-vineela | /src/app/task/task.component.ts | 2.515625 | 3 | import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-task',
templateUrl: './task.component.html',
styleUrls: ['./task.component.css']
})
export class TaskComponent implements OnInit {
name ="";
date = "";
assigned = "";
constructor() { }
data = [
{"name": "Test Task #1", "date": "12/... |
eab7474f57e2589d4552f6890e933bff0f15547d | TypeScript | wmakeev/ecwid | /src/tools/index.ts | 3.3125 | 3 | import isArray from 'lodash.isarray'
import isPlainObject from 'lodash.isplainobject'
export type PojoValue = string | number | boolean | null | undefined
export type PojoArray = Array<PojoValue | PojoObject | PojoArray>
export interface PojoObject {
[key: string]: Pojo
}
export type Pojo = PojoValue | PojoObject... |
7f727b8c4dc504fff4659837a6ab2a0d170ba858 | TypeScript | somethiiing/ng2-netflix | /src/app/services/api.ts | 2.65625 | 3 | import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/Rx';
@Injectable()
export class Api {
tmdb_api_key: string = '037e1ef528d041a22be4bb907e3efced';
tmdb_api_url: string = 'https://api.themoviedb.org/3'
constructor(private http: Http) { ... |
368410e845066e81f20d293b532aba5ed967ff73 | TypeScript | MyMobiApp/bhula | /src/contact-interfaces.ts | 2.875 | 3 | export interface IInviteJSON {
phoneNumber: string;
sentTimestamp: string;
acceptedTimestamp: string;
ignoredTimestamp: string;
status: number; // Invited: 0, Accepted: 1, Ignored/Rejected: 2
}
export class CInviteJSON implements IInviteJSON {
phoneNumber: string;
sentTimestamp: string;
acc... |
49c609db186664ccce832bdccaad0abafdf4cafe | TypeScript | spec-tacles/spectacles.js | /packages/util/src/Permissions.test.ts | 2.796875 | 3 | import Permissions from './Permissions';
test('begins 0', () => {
const p = new Permissions();
expect(p.bitfield).toBe(0);
});
test('adds permissions', () => {
const p = new Permissions();
for (const perm of Object.values(Permissions.FLAGS)) {
p.add(perm);
expect(p.has(perm)).toBe(true);
}
});
... |
152e8706b45f291edf369cda1e37670e6c150c59 | TypeScript | cyco/WebFun | /src/extension/array/clear.ts | 2.625 | 3 | import { Array } from "src/std";
const clear = function (): void {
this.splice(0, this.length);
};
Array.prototype.clear = Array.prototype.clear || clear;
declare global {
interface Array<T> {
clear(): void;
}
}
export default clear;
|
86d0b4a285af341ed96a8ec167840b0dd05304be | TypeScript | 6card/UrlApi | /src/app/components/pagination/pagination.component.ts | 2.65625 | 3 | import { Component, Input, Output, OnInit, EventEmitter, OnChanges } from '@angular/core';
@Component({
selector: 'app-pagination',
templateUrl: './pagination.component.html',
// host: { '[class.pagination]': 'true' },
})
export class PaginationComponent implements OnInit, OnChanges {
@Input() page: ... |
e95684d819f048b33e456e0fffd1bf86dafa90a2 | TypeScript | cod8io/ar-measure | /services/selectors/ar-selector.ts | 2.765625 | 3 | import { ReduxState } from '../types'
export const getFirstPoint = (state: ReduxState) => state.ar.points.first
export const getSecondPoint = (state: ReduxState) => state.ar.points.second
export const getReticlePoint = (state: ReduxState) => state.ar.points.reticle
export const getDistance = (state: ReduxState) => {
... |
f37d6f0be1d915785e6b7b19f92fb7d904780fcd | TypeScript | ask-utils/ask-utils | /packages/error-handlers/libs/index.ts | 2.671875 | 3 | import { ErrorHandler, RequestInterceptor, HandlerInput } from 'ask-sdk-core'
import { Response } from 'ask-sdk-model'
import * as Sentry from '@sentry/node'
Sentry.init({ dsn: process.env.SENTRY_DNS as string })
export type ErrorHandle = (handlerInput: HandlerInput, error: Error) => Promise<Response> | Response
expor... |
09f478edee9dae96309a47275b2d142224298582 | TypeScript | kmontag/here2019 | /kontrol/frameplayer/src/Frameplayer.ts | 2.90625 | 3 | import { frameplayer } from './proto';
import magic from './magic';
import StrictEventEmitter from 'strict-event-emitter-types';
import { EventEmitter } from 'events';
export interface Channel {
readonly length: number;
readonly frames: ReadonlyArray<ReadonlyArray<Pixel>>;
};
export interface FrameEvent {
reado... |
5a9f36462d3337f09b5fe5a829d2c0af31a2f4bc | TypeScript | Vidushi-Gupta/vscode-python | /types/vscode.proposed.d.ts | 2.78125 | 3 | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
/* eslint-disable */
// Copy nb section from https://github.com/microsoft/vscode/blob/master/src/vs/vscode.proposed.d.ts.
declare module 'vscode' {
//#region https://github.com/microsoft/vscode/issues/106744, Notebooks ... |
6d974491b32bab0309eea5bc9a82f302ca6380c6 | TypeScript | mohsensaremi/google-rank-tracker-backend | /src/app/entity/Keyword.ts | 2.546875 | 3 | import * as t from 'io-ts';
import {MongoDBObjectIDCodec} from "codec/MongoDBObjectID";
import {MongoDBObjectIDStringCodec} from "codec/MongoDBObjectIDString";
import {partialNullableType} from "utils/codec/partialNullableType";
export const KeywordCodec = t.intersection([
t.type({
id: MongoDBObjectIDCodec... |
4b91eaabecb599c55d858ed807145d0aa5c199ef | TypeScript | voltrevo/chess | /src/demoNoUi.ts | 2.640625 | 3 | import { headToHead } from './headToHead';
import {
applyDepth,
applyDepthPromise,
applyPromise
} from './pickMoveByRating';
import { BoardRater, BoardRaterParams } from './BoardRater';
import { runChessGame } from './runChessGame';
const params: BoardRaterParams = [
3.5, // bishopVal
3.5, // knightVal... |
bc54f68dcae8e1972fc1d936a3fb1f0bc53abe0e | TypeScript | Hackavist/NetfaAdminApp | /src/models/Users.ts | 2.765625 | 3 |
export type Location = {
lng: string,
lat: string,
}
export type Address = {
country: string,
city: string,
name: string,
buldingNumber: string,
unitNumber: string,
location: Location
}
export type User = {
id: string,
name: string,
email: string,
mobile: string,
a... |
b2f9ef9d4e433b4806628dc2c789989a6174c2e0 | TypeScript | linode/manager | /packages/manager/src/utilities/errorUtils.ts | 3.25 | 3 | import { APIError } from '@linode/api-v4/lib/types';
import { pathOr } from 'ramda';
import { DEFAULT_ERROR_MESSAGE } from 'src/constants';
/**
*
* Override the default error message provided by our Axios
* interceptor with a more situation-specific message.
*
* @todo rename this method
* @todo make the second ... |
782448ba592ac3a705a3fae1a5772591e4ea68f5 | TypeScript | codeplastique/plastique-components | /field/ValidableText.ts | 3.0625 | 3 | import ValidableField from "./ValidableField";
import Types from "@plastique/core/base/Types";
export default class ValidableText extends ValidableField{
public error: string;
constructor(
protected validator: (text: string) => Promise<any> | boolean,
value?: string,
placeholder?: strin... |
421ea8d956c5d14dca9645772f87da5d22581ac4 | TypeScript | tgoc99/layouts-service | /src/SnapAndDock/Service/state/event.ts | 2.796875 | 3 | import {Point} from '../utils/point';
import {Bounds, WindowIdentity} from '../utils/window';
import {clone, Updater, WindowStateMember} from './store';
export interface BoundsChangingEvent {
active: boolean;
window: WindowStateMember|null;
handling: boolean;
synthMove: boolean;
left: number|null;
top: nu... |
0b1906b85de408e3bca16a1cb08d453b59ba1fb6 | TypeScript | wenluzhizhi/games101-course | /src/utils/index.ts | 2.828125 | 3 | import { vec2, vec3 } from "gl-matrix";
export function initShaders(
gl: WebGLRenderingContext,
vertexShaderString: string,
fragmentShaderString: string)
{
const vertexShader = gl.createShader(gl.VERTEX_SHADER);
if (!vertexShader) {
throw new Error('create Vertex Shader Error');
... |
ea8d27348dad5a33fa200b3ebc3de61ebc758ba6 | TypeScript | ilodi/cursoRxJS | /src/index.ts | 3.265625 | 3 | import { Observable, Subject, Observer } from "rxjs";
const observer: Observer<any> = {
next: value => console.log("[next:]", value),
error: error => console.warn("[obs]:", error),
complete: () => console.info("Completado")
};
const interbalo$ = new Observable<number>(subs => {
const intervalID = setInterval(... |
12bb20ec3297a0cd9b18a74a0f00fc49817d1e87 | TypeScript | samo-war/jslab | /homework2/src/app/homework.ts | 2.765625 | 3 | export default class Homework {
public nameTheme: string;
public task: string;
public status: boolean;
constructor(nameTheme: string, task: string, status: boolean) {
this.nameTheme = nameTheme;
this.task = task;
this.status = status;
}
}
|
cb3daca1635629d7ab523119a6532569c2aa5c9a | TypeScript | luvies/deno_bson | /raw_types/double.ts | 3.09375 | 3 | import { BsonStaticType, BsonType, ParseOptions } from "../types.ts";
import { ensureLength } from "../utils.ts";
const BYTE_LENGTH = 8;
export type BsonDoubleStatic = BsonStaticType<BsonDouble, number>;
export class BsonDouble implements BsonType<number> {
public static readonly marker = 0x01;
public static pa... |
cb879dd1940e20d54b72c99b3ff42d7a3ac1548d | TypeScript | Magora-Systems-Frontend/pivot_client | /app/helpers/reducers.ts | 3.25 | 3 | export interface ActionTypes {
load: string,
loadSuccess: string,
error: string,
}
interface StoreItems {
items: any[],
isLoading: boolean,
error: string|null,
}
export function itemsReducer(actionTypes: ActionTypes) {
const initialState = {
items: [],
isLoading: false,
error: null,
};
... |
7b0f099ac63423f6abe80c6a0da4d7eb0d503c8c | TypeScript | Kotarski/Layout-Prototype-Boards | /typescript/fileIO/save/-createFile.ts | 2.625 | 3 | import manifest from "../../circuit/manifest";
import mappings from "../../circuit/mappings";
function createFile(): string {
let componentStrings: string[] = [];
manifest.layout.concat(manifest.schematic).forEach(component => {
try {
const componentMap = mappings.getComponentMap(component);
... |
8187f76e900361be8234f41e31bbd452f6e7666e | TypeScript | jmarks-lws/utilities | /src/objects/compactObject.ts | 3.0625 | 3 | import { filter } from '../arrays/where';
import { Hash } from './types/Hash';
import { keys } from './keys';
import { pick } from './pick';
/**
* Returns a new object with a subset of properties where properties which have null or undefined values have been removed.
* @param o
*/
export const compactObject = <T ex... |
97d757410c6b5f00f459e9f0638d8ceb7eef187a | TypeScript | bezaca/ts-server | /controllers/users.controller.ts | 2.65625 | 3 | import { Request, Response } from 'express';
import User from '../models/user';
export const getUsers = async (req: Request, res: Response) => {
const users = await User.findAll();
res.json({ users });
};
export const getUser = async (req: Request, res: Response) => {
const { id } = req.params;
const user =... |
8b9c914597bdf0aa223117c84ea3c05b5283132c | TypeScript | JessicaSachs/chakra-ui-vue-next | /packages/core/src/parse-icons.ts | 2.890625 | 3 | import { mergeWith } from '@chakra-ui/vue-utils'
interface InternalIcon {
[key: string]:
| {
path: string
viewBox?: string
attrs?: string
}
| any
}
export type MergedIcons = {
[key in keyof InternalIcon]: InternalIcon
}
/**
* Currently the parseIcon function only supports i... |
e675b77d899534be29c89b5335df69a36cebae48 | TypeScript | AmalAhmedibrahim/NGRX-ShoppingList | /src/app/store/reducers/shopping.reducer.ts | 2.78125 | 3 | import { ShoppingActionTypes } from '../Action/shopping.actions';
import { ShoppingItem } from '../models/shopping-item.model';
import * as AppAction from '../Action/shopping.actions'
export interface ShoppingState {
list?: ShoppingItem[];
loading?: boolean;
error?: Error;
}
const intialStat... |
a8044c426076d88396e0ddad0b06119501d6a425 | TypeScript | RinerJBonilla/CleanTypeNodeAPi | /app/src/routes/tag.routes.ts | 2.53125 | 3 | import TagController from "../controller/tagController";
import VerifyToken from "../middlewares/VerifyToken";
import { Router } from "express";
export default class TagRouter {
private router: any;
constructor(tagController: TagController) {
this.router = Router();
this.router.route("/tags").get(VerifyT... |
a38caab24d64d482ddc11552c5f8a351e2cb4354 | TypeScript | 4lm/learn-react | /crwn-clothing/src/utils/reducer/reducer.utils.ts | 2.953125 | 3 | import { AnyAction } from "redux";
import { EnumType } from "typescript";
export type ActionWithPayload<T, P> = {
type: T;
payload: P;
};
export type Action<T> = {
type: T;
};
export function createAction<T extends string, P>(
type: T,
payload: P
): ActionWithPayload<T, P>;
export function createAction<T ... |
85b10ecf0b331db5c85df5677fa2bbace3e0b728 | TypeScript | Mostafa-Megria123/DokanyApp | /Dokany UI/src/app/admin/dtos/creditCardDto.ts | 2.703125 | 3 | export class CreditCardDto{
Id: Number;
CardNumber: Number;
CardName: String;
Month: Number;
Year: Number;
constructor(id: Number,
cardNumber: Number,
cardName: String,
month: Number,
year: Number){
this.Id = id;
this.CardName = cardName;
... |
c4957fdebc59a253f80856d9614546e71d8c5833 | TypeScript | 01alchemist/speedy.js | /packages/compiler/__tests__/code-generation/cases/array/unshift.ts | 2.703125 | 3 | async function arrayUnshift(): Promise<void> {
"use speedyjs";
const array = [1, 2];
array.unshift();
array.unshift(1);
const newLength = array.unshift(1, 2, 3);
}
|
fdc2792ddcd8a8f2da19d4c93bc2d6473a9770ed | TypeScript | DataDog/datadog-api-client-typescript | /examples/v1/dashboard-lists/UpdateDashboardList.ts | 2.546875 | 3 | /**
* Update a dashboard list returns "OK" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v1.DashboardListsApi(configuration);
// there is a valid "dashboard_list" in the system
const DASHBOARD_LIST_ID = parseInt(pro... |
4fe5a910d9e7e589916eee31d7e5d74911d894ae | TypeScript | rocketbase-io/rollup-plugin-exec | /tests/unit/normalize-commands.spec.ts | 2.578125 | 3 | import { normalizeCommands } from "src/normalize-commands";
describe("normalize-commands.ts", () => {
describe("normalizeCommands()", () => {
it("should return an array as is", () => {
const commands = ["echo hello world", "echo foo bar"];
expect(normalizeCommands(commands)).toEqual(commands);
})... |
08bc10a2f6d6c7ffe21bb4774c52f6c68634bd59 | TypeScript | Quanyails/Quanyails.github.io | /src/features/qed/sobel.ts | 2.953125 | 3 | import type { Pixel, PixelMatrix } from "features/qed/matrix";
import { getPixelMatrix } from "features/qed/matrix";
const convolute = ({
convoluteAlpha,
mask,
matrix,
x,
y,
}: {
convoluteAlpha: boolean;
// Assume mask is a square 2D array
mask: number[][];
matrix: PixelMatrix;
x: number;
y: numb... |
da9912c0ca345ed25edc755dba363b3fc49f9eed | TypeScript | MiggieNRG/vscode-gitblame | /src/git/util/uncommitted.ts | 2.546875 | 3 | import type { Commit } from "./stream-parsing";
export function isUncomitted(commit: Commit): boolean {
return /^0{40}$/.test(commit.hash);
}
|
46268d50abad0db108d1bd093df8da0cc7876d64 | TypeScript | PeculiarVentures/node-webcrypto-p11 | /src/mechs/rsa/key.ts | 2.640625 | 3 | import { CryptoKey } from "../../key";
import { Pkcs11RsaHashedKeyAlgorithm } from "../../types";
export class RsaCryptoKey extends CryptoKey<Pkcs11RsaHashedKeyAlgorithm> {
protected override onAssign(): void {
if (!this.algorithm.modulusLength) {
this.algorithm.modulusLength = 0;
try {
this... |
9a1d75d2145e3ca880b273a2b5305c8fb7cbd1bf | TypeScript | teachduttonteach/gse-tools | /built/classroom/ClassInfo.d.ts | 3.109375 | 3 | import { CourseWork } from './CourseWork';
import { Work } from './Work';
/**
* Class for all of the particular course information
* Resets the announcements and topics.
*/
export declare function newClassInfo(): ClassInfo;
/**
* Get the topic ids
*
* @param {ClassInfo} obj the ClassInfo object
* @return {Arra... |
52097ce0b2b146f0a08d1a6c6dd405f9b51a6ac2 | TypeScript | WyomingSoftware/noditor-mobile | /src/components/message.ts | 2.75 | 3 | import {Component} from '@angular/core';
import { AlertController } from 'ionic-angular';
import { LoggerService } from '../providers/loggerService';
@Component({
template: ''
})
/**
* Displays alert boxes with info passed. In the case of showError the error is
* also logged to the logger.
* @param {AlertContr... |
7840853564504691dafec1227d09673c6f94b961 | TypeScript | e-marinkin/angular-presentation | /ClientApp/src/app/instructors/instructor.service.ts | 2.578125 | 3 | import { Injectable, Inject } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Instructor } from './instructor';
import { catchError } from 'rxjs/operators';
const httpOptions = {
he... |
aa43f3d8d01ac923b74498214f8b9ab1ec423612 | TypeScript | javinegre/negre.co-home | /src/ts/hooks/useMousePosition.ts | 2.859375 | 3 | import { useEffect, useState } from 'react';
const useMousePosition: (config: { isActive: boolean }) => { x: number, y: number } = (config) => {
const [position, setPosition] = useState({ x: 0, y: 0 });
useEffect(() => {
const setFromEvent = (ev: MouseEvent) => setPosition({ x: ev.clientX, y: ev.clientY });
... |
6f76d41a91d580bf33b02dd623aaeb86b20c6bc7 | TypeScript | BobNisco/ComBOBiler | /scripts/static_table.ts | 2.84375 | 3 | ///<reference path="static_table_entry.ts" />
module Combobiler {
export class StaticTable implements ICodeGenTable<StaticTableEntry> {
public entries: Array<StaticTableEntry>;
public currentTempNumber: number;
public tempIdRegex = /^(T[0-9])/;
private currentOffsetNumber: number;
constructor() {
this.e... |
0ac9c74dd4c1ea18874c0fb65be007e79ff8f6b2 | TypeScript | lazarljubenovic/grafaro | /src/app/websocket.service.ts | 2.859375 | 3 | import {ReplaySubject, Observable} from 'rxjs/Rx';
import {Message} from './message';
export class WebSocketService {
private ws: WebSocket;
private messages: ReplaySubject<Message<any>>;
private _roomId: string = '';
public set roomId(value: string) {
this._roomId = value;
}
private m... |
c8cd13160f2fee71672c588e154c7d36c928c2c8 | TypeScript | donPindyukel/xiag-test | /front/src/services/socketService.ts | 2.75 | 3 | import io from "socket.io-client";
import { PORT, PROTOCOL, URL, SOCKET_EVENTS } from "Constants";
import { ISocketData } from "Models";
export class SocketHandler {
socket: any;
action: () => void;
pollId: string;
constructor(action: () => void, pollId: string) {
this.socket = io(`${PROTOCOL}://${URL}:${... |
d9c8ad43848d5adf391ee6fa7d55c708406497b8 | TypeScript | jehincastic/calendly | /pages/api/get-timezone.ts | 2.71875 | 3 | import type { NextApiRequest, NextApiResponse } from "next";
import Axios from "axios";
import { CommonResponse, TimezoneOption } from "@interfaces/index";
const ApiHandler = async (
req: NextApiRequest,
res: NextApiResponse<CommonResponse<TimezoneOption[] | string>>,
) => {
if (req.method?.toLowerCase() === "p... |
863f870c9e1f763b7b36fce3903048a13577c07f | TypeScript | torredefarol24/tm-rxjs-yt | /src/promiseObservables.ts | 2.578125 | 3 | let promiseConfig = function(resolve, reject){
console.log("Creating Promise");
setTimeout( () => {
resolve("Dummy Data ")
}, 2500);
}
let dummyPromise = new Promise(promiseConfig)
let apiPromimseConfig = function(resolve, reject){
let endpointURL = "https://jsonplaceholder.typicode.com/users"
fetc... |
c61cbd57ee8aed1ed4976dac086a4de8ade1f2b4 | TypeScript | mohitgurjar15/laytravel-backend | /src/auth/dto/social-login.dto.ts | 2.5625 | 3 | import {
IsNotEmpty,
IsEmail,
ValidationArguments,
ValidateIf,
IsEnum,
IsOptional,
} from "class-validator";
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { errorMessage } from "src/config/common.config";
export class SocialLoginDto {
@IsNotEmpty({
... |
bdff5410d82a2d981ed9ca22e74a6bacda4f6ddd | TypeScript | umanking/gitCodeShare.com | /stores/Editor.ts | 2.546875 | 3 | import debounce from 'lodash.debounce';
import { highlightAuto } from 'highlight.js';
import {
FONTS_HASH,
DEFAULT_THEME,
DEFAULT_CODE,
DEFAULT_LANGUAGE,
DEFAULT_FONT,
LANGUAGES_NAME_HASH,
THEMES_NAME_HASH,
LANGUAGES_MODE_HASH,
LANGUAGES_SHORT_HASH,
} from './../common/constants';
import { Instance, t... |
b80bd66225827483c69e656f1fbbbb50206dacb6 | TypeScript | rafalogan/curso-typescript | /inicio/classes/classes.ts | 3.390625 | 3 | class Data {
// Público por padrão
dia: number;
public mes: number;
ano: number;
constructor(dia: number = 1, mes: number = 1, ano: number = 1970) {
this.dia = dia;
this.mes = mes;
this.ano = ano;
}
}
const aniversario = new Data(31);
aniversario.dia = 7;
console.log(aniversario.dia);
console... |
515e452a1e8dfba6702f06af5bea5fc5f5b0bdb3 | TypeScript | dwojno/rad-modules | /services/security/src/app/features/tokens/commands/remove-access-key.command.ts | 2.578125 | 3 | import { Command } from "../../../../../../../shared/command-bus";
export const REMOVE_ACCESS_KEY_COMMAND_TYPE = "tokens/REMOVEACCESSKEY";
export interface RemoveAccessKeyCommandPayload {
apiKey: string;
}
export class RemoveAccessKeyCommand implements Command<RemoveAccessKeyCommandPayload> {
public type: string... |
7adc25794d95ecd99e8e75ca8b302a79d2ec31e5 | TypeScript | PlaceOS/ts-client | /src/oauth-sources/oauth-source.ts | 2.578125 | 3 | import { PlaceResource } from '../resources/resource';
import { HashMap } from '../utilities/types';
export class PlaceOAuthSource extends PlaceResource {
/** Type of auth source */
public readonly type = 'oauth';
/** ID of the authority associted with the auth method */
public readonly authority_id: s... |
4f5969cf46da0bdc53a2bfaef454b782df9d0d89 | TypeScript | samouss/react-hooks-sse | /src/createSourceManager.ts | 3.125 | 3 | import { Source, Listener } from './source';
type State = {
source: Source | null;
listenersByName: Map<string, Set<Listener>>;
};
export type SourceManager = {
addEventListener(name: string, listener: Listener): void;
removeEventListener(name: string, listener: Listener): void;
};
export const createSourceM... |
7d1ee0a7980eb4efe8ee50bb7199c6610e99ae5f | TypeScript | viniciusdecarvalho/localizandoapp-io4 | /src/app/services/categories.service.ts | 2.546875 | 3 | import { Injectable } from '@angular/core';
import { Repository } from './api';
import { Observable } from 'rxjs';
import { Category } from '../models';
import { map } from 'rxjs/operators';
class DefaultCategory
implements Category {
constructor(val) {
Object.keys(val).forEach(key => {
this[key] = val[ke... |