Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Remove reference to Infviz Toolkit
/// <reference path="Reference.d.ts"/> module Orange.Modularity { export class RegionManager { constructor(public container: Orange.Modularity.Container) { } public disposeRegions(root: HTMLElement) { var attr = root.getAttribute("data-view"); if (attr == null || attr == ...
/// <reference path="Reference.d.ts"/> module Orange.Modularity { export class RegionManager { constructor(public container: Orange.Modularity.Container) { } public disposeRegions(root: HTMLElement) { var attr = root.getAttribute("data-view"); if (attr == null || attr == ...
Revert "docs(demo): remove unnecessary window declaration"
import Panzoom from '../src/panzoom' console.log('This is a demo version of Panzoom for testing.') console.log('It exposes a global (window.Panzoom) and should not be used in production.') window.Panzoom = Panzoom
import Panzoom from '../src/panzoom' console.log('This is a demo version of Panzoom for testing.') console.log('It exposes a global (window.Panzoom) and should not be used in production.') declare global { interface Window { Panzoom: typeof Panzoom } } window.Panzoom = Panzoom
Remove `as const` from article sorts export constant
import { GraphQLEnumType } from "graphql" export const ARTICLE_SORTS = { PUBLISHED_AT_ASC: { value: "published_at", }, PUBLISHED_AT_DESC: { value: "-published_at", }, } as const const ArticleSorts = { type: new GraphQLEnumType({ name: "ArticleSorts", values: ARTICLE_SORTS, }), } export ty...
import { GraphQLEnumType } from "graphql" export const ARTICLE_SORTS = { PUBLISHED_AT_ASC: { value: "published_at", }, PUBLISHED_AT_DESC: { value: "-published_at", }, } const ArticleSorts = { type: new GraphQLEnumType({ name: "ArticleSorts", values: ARTICLE_SORTS, }), } export type Articl...
Correct string for the IOption interface
/** * Option model interface * @author Islam Attrash */ export interface IOption { /** * Text for the option */ text: string; /** * The option value */ value: any; //Any other dynamic user selection [key: string]: any; }
/** * Option model interface * @author Islam Attrash */ export interface IOption { /** * Text for the option */ text: string; /** * The option value */ value: any; /** * Any other OPTIONAL dynamic user properties */ [key: string]: any; }
Disable minification temporaly (Fuck Webkit)
const StringReplacePlugin = require('string-replace-webpack-plugin'); import constant from './const'; import minify from './minify'; import banner from './banner'; const env = process.env.NODE_ENV; const isProduction = env === 'production'; export default version => { const plugins = [ constant(), new StringRep...
const StringReplacePlugin = require('string-replace-webpack-plugin'); import constant from './const'; import minify from './minify'; import banner from './banner'; const env = process.env.NODE_ENV; const isProduction = env === 'production'; export default version => { const plugins = [ constant(), new StringRep...
Fix off by one, include all lines in range
import { DiffSelection } from '../../../models/diff' import { ISelectionStrategy } from './selection-strategy' import { DiffLineGutter } from '../diff-line-gutter' import { range } from '../../../lib/range' /** apply hunk selection to the current diff */ export class RangeSelection implements ISelectionStrategy { pr...
import { DiffSelection } from '../../../models/diff' import { ISelectionStrategy } from './selection-strategy' import { DiffLineGutter } from '../diff-line-gutter' import { range } from '../../../lib/range' /** apply hunk selection to the current diff */ export class RangeSelection implements ISelectionStrategy { pr...
Add router testing module to Error Component tests
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { TitleService } from '../shared/title.service'; import { MockTitleService } from '../shared/mocks/mock-title.service'; import { PageHeroComponent } from '../shared/page-hero/page-hero.component'; import { ErrorComponent } from './error...
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { TitleService } from '../shared/title.service'; import { MockTitleService } from '../shared/mocks/mock-title.service'; import { PageHeroComponent } from '../shared/page-hero...
Fix whitespace above header image
import { Flex } from "@artsy/palette" import { ArtistSeriesHeader_artistSeries } from "__generated__/ArtistSeriesHeader_artistSeries.graphql" import OpaqueImageView from "lib/Components/OpaqueImageView/OpaqueImageView" import React from "react" import { createFragmentContainer, graphql } from "react-relay" interface A...
import { Flex } from "@artsy/palette" import { ArtistSeriesHeader_artistSeries } from "__generated__/ArtistSeriesHeader_artistSeries.graphql" import OpaqueImageView from "lib/Components/OpaqueImageView/OpaqueImageView" import React from "react" import { createFragmentContainer, graphql } from "react-relay" interface A...
Return true if we can make all the units
import {ISolution} from '../solution.interface'; export class Solution implements ISolution<string, string> { units = { "Probe": 1, "Zealot": 2, "Sentry": 2, "Stalker": 2, "HighTemplar": 2, "DarkTemplar": 2, "Immortal": 4, "Colossus": 6, "Archon": 4, "Observer": 1, "WarpPr...
import {ISolution} from '../solution.interface'; export class Solution implements ISolution<string, string> { units = { "Probe": 1, "Zealot": 2, "Sentry": 2, "Stalker": 2, "HighTemplar": 2, "DarkTemplar": 2, "Immortal": 4, "Colossus": 6, "Archon": 4, "Observer": 1, "WarpPr...
Change display size to full screen
import { app, BrowserWindow } from 'electron'; import * as electronReload from 'electron-reload'; let mainWindow; function createWindow() { mainWindow = new BrowserWindow({ width: 400, height: 380, webPreferences: { webSecurity: false }, }); mainWindow.loadURL(`file://${__dirname}/index.html`); ...
import { app, BrowserWindow } from 'electron'; import * as electronReload from 'electron-reload'; let mainWindow; function createWindow() { mainWindow = new BrowserWindow({ fullscreen: true, webPreferences: { webSecurity: false }, }); mainWindow.loadURL(`file://${__dirname}/index.html`); mainWindow...
Fix Google Maps scroll issue
/// <reference path="../typings/browser.d.ts" /> namespace AFCC { export function activate(selector: string) { $(selector).addClass("active"); } export function splashDanceParty() { activate(".dance-party-header"); } export function splashDancePartyBunnies() { activate("#splash .page-background...
/// <reference path="../typings/browser.d.ts" /> namespace AFCC { export function activate(selector: string) { $(selector).addClass("active"); } export function splashDanceParty() { activate(".dance-party-header"); } export function splashDancePartyBunnies() { activate("#splash .page-background...
Use import instead of require. Remove unnecessary namespace.
import {ResponseBody} from "./Common"; import {ResponseModel} from "./Handler"; let ViewsDirectory = require("../definitions/ViewsDirectory"); namespace Views { export class View { constructor(id: string, render: RendersResponse) { this.id = id; this.render = render; V...
import * as ViewsDirectory from "../definitions/ViewsDirectory"; import {ResponseBody} from "./Common"; import {ResponseModel} from "./Handler"; export class View { constructor(id: string, render: RendersResponse) { this.id = id; this.render = render; ViewsDirectory[id] = this; } ...
Improve typescript support for test utils
import Vuex from 'vuex' import {shallowMount, createLocalVue} from '@vue/test-utils' export const mountMixin = ( component: object, mountOptions: object = {}, template: string = '<div />' ) => { const localVue = createLocalVue(); localVue.use(Vuex); return shallowMount({ template, mixins: [compon...
import Vuex from 'vuex' import { shallowMount, createLocalVue, Wrapper, ThisTypedShallowMountOptions } from '@vue/test-utils'; import Vue, { ComponentOptions } from 'vue'; export const mountMixin = <V extends Vue>( component: ComponentOptions<V>, mountOptions: ThisTypedShallowMountOptions<V> = {}, template = '<d...
Add ability to retrieve the index of an item in the PaperMenuComponent
// Copyright (c) 2016 Vadim Macagon // MIT License, see LICENSE file for full terms. import * as React from 'react'; import { PolymerComponent } from './polymer'; import { omitOwnProps } from '../../../common/utils'; /** * React component that wraps a Polymer paper-menu custom element. */ export class PaperMenuComp...
// Copyright (c) 2016 Vadim Macagon // MIT License, see LICENSE file for full terms. import * as React from 'react'; import { PolymerComponent } from './polymer'; import { omitOwnProps } from '../../../common/utils'; /** * React component that wraps a Polymer paper-menu custom element. */ export class PaperMenuComp...
Make book have verify true again when editing an existing one
import { createCollection } from '../../vulcan-lib'; import schema from './schema'; import { makeEditable } from '../../editor/make_editable'; import { addUniversalFields, getDefaultResolvers, getDefaultMutations } from '../../collectionUtils' export const Books: BooksCollection = createCollection({ collectionName: ...
import { createCollection } from '../../vulcan-lib'; import schema from './schema'; import { makeEditable } from '../../editor/make_editable'; import { addUniversalFields, getDefaultResolvers, getDefaultMutations } from '../../collectionUtils' export const Books: BooksCollection = createCollection({ collectionName: ...
Print iOS Simulator device logs
///<reference path="../../../.d.ts"/> "use strict"; import {ApplicationManagerBase} from "../../application-manager-base"; import Future = require("fibers/future"); export class IOSSimulatorApplicationManager extends ApplicationManagerBase implements Mobile.IDeviceApplicationManager { constructor(private iosSim: any...
///<reference path="../../../.d.ts"/> "use strict"; import {ApplicationManagerBase} from "../../application-manager-base"; import Future = require("fibers/future"); export class IOSSimulatorApplicationManager extends ApplicationManagerBase implements Mobile.IDeviceApplicationManager { constructor(private iosSim: any...
Add test for register/unregister in event class map.
import {expect} from "chai"; import {EventClassMap} from "../../../main/Apha/EventStore/EventClassMap"; import {Event, EventType} from "../../../main/Apha/Message/Event"; import {UnknownEventException} from "../../../main/Apha/EventStore/UnknownEventException"; describe("EventClassMap", () => { describe("getTypeB...
import {expect} from "chai"; import {EventClassMap} from "../../../main/Apha/EventStore/EventClassMap"; import {Event, EventType} from "../../../main/Apha/Message/Event"; import {UnknownEventException} from "../../../main/Apha/EventStore/UnknownEventException"; describe("EventClassMap", () => { describe("getTypeB...
Fix the args array where config should be added
'use strict'; import {ChildProcess, spawn} from 'child_process'; import {ProjectWorkspace} from './project_workspace'; /** * Spawns and returns a Jest process with specific args * * @param {string[]} args * @returns {ChildProcess} */ export function jestChildProcessWithArgs(workspace: ProjectWorkspace, args: ...
'use strict'; import {ChildProcess, spawn} from 'child_process'; import {ProjectWorkspace} from './project_workspace'; /** * Spawns and returns a Jest process with specific args * * @param {string[]} args * @returns {ChildProcess} */ export function jestChildProcessWithArgs(workspace: ProjectWorkspace, args: ...
Make useMiddlewares accept logger as an argument
import { Middleware } from '../index' import { Logger } from '../utils/logger' import { argsParser } from './argsParser' import { commandCaller } from './commandCaller' import { commandFinder } from './commandFinder' import { errorsHandler } from './errorsHandler' import { helper } from './helper' import { rawArgsParse...
import { Middleware } from '../index' import { Logger } from '../utils/logger' import { argsParser } from './argsParser' import { commandCaller } from './commandCaller' import { commandFinder } from './commandFinder' import { errorsHandler } from './errorsHandler' import { helper } from './helper' import { rawArgsParse...
Clarify the exact version of a file that is pulled from nteract
/* tslint:disable */ 'use strict'; // THis code is from @nteract/transforms-full except without the Vega transforms // https://github.com/nteract/nteract/blob/master/packages/transforms-full/src/index.js // Vega transforms mess up our npm pkg install because they rely on the npm canvas module that needs // to be...
/* tslint:disable */ 'use strict'; // This code is from @nteract/transforms-full except without the Vega transforms: // https://github.com/nteract/nteract/blob/v0.12.2/packages/transforms-full/src/index.js . // Vega transforms mess up our npm pkg install because they rely on the npm canvas module that needs // t...
Fix url parser warning during tests
import {UserSchema, IUserModel} from "../../src/server/data/User"; import {GameSchema, IGameModel} from "../../src/server/data/GameModel"; import mongoose from "mongoose"; import assert from "assert"; const connectionString = "mongodb://localhost/test" const User = mongoose.model("User", UserSchema) as IUserModel; con...
import {UserSchema, IUserModel} from "../../src/server/data/User"; import {GameSchema, IGameModel} from "../../src/server/data/GameModel"; import mongoose from "mongoose"; import assert from "assert"; const connectionString = "mongodb://localhost:27017/test" const User = mongoose.model("User", UserSchema) as IUserMode...
Change import * to require to align with tests
// Type definitions for fastify-static 0.14 // Project: https://github.com/fastify/fastify-static // Definitions by: Leonhard Melzer <https://github.com/leomelzer> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 import { Server, IncomingMessage, ServerResponse } from "http...
// Type definitions for fastify-static 0.14 // Project: https://github.com/fastify/fastify-static // Definitions by: Leonhard Melzer <https://github.com/leomelzer> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 import fastify = require("fastify"); import { Server, Incomi...
Change a check that caused Typescript errors
import { BaseApp, HandleRequest, Plugin, PluginConfig } from 'jovo-core'; import _merge = require('lodash.merge'); import PulseLabsRecorder = require('pulselabs-recorder'); import { InitOptions } from 'pulselabs-recorder/dist/interfaces/init-options.interface'; // tslint:disable-line export interface Config extends P...
import { BaseApp, HandleRequest, Plugin, PluginConfig } from 'jovo-core'; import _merge = require('lodash.merge'); import PulseLabsRecorder = require('pulselabs-recorder'); import { InitOptions } from 'pulselabs-recorder/dist/interfaces/init-options.interface'; // tslint:disable-line export interface Config extends P...
Fix name for service unit test
/* beautify ignore:start */ import { it, inject, //injectAsync, beforeEachProviders //TestComponentBuilder } from 'angular2/testing'; import {<%=servicenameClass%>Service} from './<%=servicenameFile%>.service.ts'; /* beautify ignore:end */ describe('Service: <%=servicename%>' , () => { beforeE...
/* beautify ignore:start */ import { it, inject, //injectAsync, beforeEachProviders //TestComponentBuilder } from 'angular2/testing'; import {<%=servicenameClass%>Service} from './<%=servicenameFile%>.service.ts'; /* beautify ignore:end */ describe('Service: <%=servicenameClass%>Service' , () => { ...
Remove get-started because we have it on the landing page
import { program } from "commander"; import { version } from "../package.json"; program.version(version); console.log("Hello en3", version);
import { program } from "commander"; import { version } from "../package.json"; program.version(version); console.log("Hello en5", version);
Remove redundant method in FileContainer
import { BasicFileContainer } from "./basicFileContainer"; import * as common from "./common"; import * as utils from "../common/utils"; import * as view from "../view/common"; export class FileContainer extends BasicFileContainer { constructor() { super(); } getDescriptorsAll(): view.FileStageQu...
import { BasicFileContainer } from "./basicFileContainer"; import * as common from "./common"; import * as utils from "../common/utils"; import * as view from "../view/common"; export class FileContainer extends BasicFileContainer { constructor() { super(); } getDescriptorsAll(): view.FileStageQu...
Add emoji to request for contribution in fallback tutorial
/* * Copyright (c) 2014-2020 Bjoern Kimminich. * SPDX-License-Identifier: MIT */ import { waitInMs } from './helpers/helpers' import { ChallengeInstruction } from './' export const TutorialUnavailableInstruction: ChallengeInstruction = { name: null, hints: [ { text: "😓 Sorry, this hacking ...
/* * Copyright (c) 2014-2020 Bjoern Kimminich. * SPDX-License-Identifier: MIT */ import { waitInMs } from './helpers/helpers' import { ChallengeInstruction } from './' export const TutorialUnavailableInstruction: ChallengeInstruction = { name: null, hints: [ { text: "😓 Sorry, this hacking ...
FIx for copy paste errors
import { Minion } from './minion.model'; ///This is a repo class for the various minions that can be hired for a warband. export class EquipmentVault { public static items = new Array<Minion>(); constructor(){ } static loadMinionTemplatesIntoVault(){ var minion = new Minion('War Dog'); minion.move...
import { Minion } from './minion.model'; ///This is a repo class for the various minions that can be hired for a warband. export class WarbandVault { public static templates = new Array<Minion>(); constructor(){ } static loadMinionTemplatesIntoVault(){ var minion = new Minion('War Dog'); minion.mo...
Send usage as a notice
export class Plugin { bot: any; commands: any; constructor(bot : any) { this.bot = bot; this.commands = { 'lmgtfy': 'onCommandLmgtfy' }; this.querystring = require('querystring'); } onCommandLmgtfy(from: string, to: string, message: string, args: Array<string>) { if (args.length < ...
export class Plugin { bot: any; commands: any; constructor(bot : any) { this.bot = bot; this.commands = { 'lmgtfy': 'onCommandLmgtfy' }; this.querystring = require('querystring'); } onCommandLmgtfy(from: string, to: string, message: string, args: Array<string>) { if (args.length < ...
Fix for showing wms layers
module csComp.Services { 'use strict'; export class WmsSource implements ILayerSource { title = "wms"; service : LayerService; init(service : LayerService){ this.service = service; } public addLayer(layer : ProjectLayer, callback : Function) { var wms ...
module csComp.Services { 'use strict'; export class WmsSource implements ILayerSource { title = "wms"; service : LayerService; init(service : LayerService){ this.service = service; } public addLayer(layer : ProjectLayer, callback : Function) { var wms ...
Handle promise rejection in ItemSwitch
export abstract class ItemSwitch<T> { protected loadMoreItems: Function; public setLoadMoreItemsCallback(loadMoreItems?: () => Promise<T[]>) { this.loadMoreItems = loadMoreItems; } public showPreviousItem(items: T[]) { this.showItem(items, -1); } public showNextItem(items: T[]...
export abstract class ItemSwitch<T> { protected loadMoreItems: Function; public setLoadMoreItemsCallback(loadMoreItems?: () => Promise<T[]>) { this.loadMoreItems = loadMoreItems; } public showPreviousItem(items: T[]) { this.showItem(items, -1); } public showNextItem(items: T[]...
Replace a TODO that is now done with a doc comment instead :)
import logger from './logging/logger' // TODO(tec27): Move this to a more common location export class JsonLocalStorageValue<T> { constructor(readonly name: string) {} /** * Retrieves the current `localStorage` value (parsed as JSON). * @returns the parsed value, or `undefined` if it isn't set or fails to p...
import logger from './logging/logger' /** * A manager for a JSON value stored in local storage. Provides easy methods to set and retrieve * the value (if any), doing the necessary parsing/encoding. */ export class JsonLocalStorageValue<T> { constructor(readonly name: string) {} /** * Retrieves the current `...
Remove --dry-run to try for real.
import fs = require("fs"); import { exec } from "shelljs"; function cmd(command: string): string { const result: any = exec(command); return result.stdout.trim().replace("\r\n", "\n"); } const currentBranch = cmd("git rev-parse --abbrev-ref HEAD"); if (currentBranch !== "master") { throw new Error("This s...
import fs = require("fs"); import { exec } from "shelljs"; function cmd(command: string): string { const result: any = exec(command); return result.stdout.trim().replace("\r\n", "\n"); } const currentBranch = cmd("git rev-parse --abbrev-ref HEAD"); if (currentBranch !== "master") { throw new Error("This s...
Select default time period filter selection via RadioGroup instead of Radio
import React from "react" import { FilterState } from "../../FilterState" import { Radio, RadioGroup } from "@artsy/palette" export const TimePeriodFilter: React.SFC<{ filters: FilterState timePeriods?: string[] }> = ({ filters, timePeriods }) => { const periods = (timePeriods || allowedPeriods).filter(timePeri...
import React from "react" import { FilterState } from "../../FilterState" import { Radio, RadioGroup } from "@artsy/palette" import { get } from "Utils/get" export const TimePeriodFilter: React.SFC<{ filters: FilterState timePeriods?: string[] }> = ({ filters, timePeriods }) => { const periods = (timePeriods ||...
Fix error when no languages given
import hljs from 'highlight.js/lib/highlight'; import { HLJSLang } from '../types'; /** * Register Highlight.js languages. * * @export * @param {Record<string, HLJSLang>} languages Highlight.js languages */ export default function registerLanguages( languages: Record<string, HLJSLang> ): void { Object.keys(lan...
import hljs from 'highlight.js/lib/highlight'; import { HLJSLang } from '../types'; /** * Register Highlight.js languages. * * @export * @param {Record<string, HLJSLang>} languages Highlight.js languages */ export default function registerLanguages( languages: Record<string, HLJSLang> ): void { if (typeof lang...
Add comment describing caveats of the Vue3 plugin
import { Client, InitConfig } from '@jovotech/client-web'; import { Plugin, reactive, ref } from 'vue'; declare global { interface Window { JovoWebClientVue?: typeof import('.'); } } declare module '@vue/runtime-core' { export interface ComponentCustomProperties { $client: Client; } } export interfac...
import { Client, InitConfig } from '@jovotech/client-web'; import { Plugin, reactive, ref } from 'vue'; declare global { interface Window { JovoWebClientVue?: typeof import('.'); } } declare module '@vue/runtime-core' { export interface ComponentCustomProperties { $client: Client; } } export interfac...
Add export default object literal usage
/** * Size of the ball, in cm. */ enum BallSize { ThrityEight = 0.38, Fourty = 0.4, FourtyPlus = 0.4025, FourtyFour = 0.44 } export default BallSize;
// define as object literal for demo purpose /** * Size of the ball, in cm. */ var BallSize = { ThrityEight: 0.38, Fourty: 0.4, FourtyPlus: 0.4025, FourtyFour: 0.44 } export default BallSize;
Add query element to make fake data a little bit more dynamic
// https://angular.io/docs/ts/latest/guide/server-communication.html#!#http-client import {Injectable, Inject} from 'angular2/core'; import {Http, Response} from 'angular2/http'; import {Observable} from 'rxjs/Observable'; import 'rxjs/Rx'; @Injectable() export class MainService { constructor(@Inject(Http) ...
// https://angular.io/docs/ts/latest/guide/server-communication.html#!#http-client import {Injectable, Inject} from 'angular2/core'; import {Http, Response} from 'angular2/http'; import {Observable} from 'rxjs/Observable'; import 'rxjs/Rx'; @Injectable() export class MainService { constructor(@Inject(Http) ...
Use search service and analytics service
import {Component, EventEmitter, Input, OnDestroy, OnInit, Output} from '@angular/core'; @Component({ selector: 'app-search', templateUrl: './search.component.html', styleUrls: ['./search.component.css'] }) export class SearchComponent implements OnInit { categories = [ {value: 'All'}, {value: 'Data s...
import {Component, EventEmitter, Input, OnDestroy, OnInit, Output} from '@angular/core'; import {Subject} from 'rxjs/Subject'; import {AnalyticsService} from '../app.analytics.service'; import {SearchService} from '../app.search.service'; @Component({ selector: 'app-search', templateUrl: './search.component.html'...
Drop switchMap from the operators used
// import 'rxjs/Rx'; // adds ALL RxJS statics & operators to Observable // See node_module/rxjs/Rxjs.js // Import just the rxjs statics and operators we need for THIS app. // Statics import 'rxjs/add/observable/throw'; import 'rxjs/add/observable/of'; // Operators import 'rxjs/add/operator/catch'; import 'rxjs/add/o...
// import 'rxjs/Rx'; // adds ALL RxJS statics & operators to Observable // See node_module/rxjs/Rxjs.js // Import just the rxjs statics and operators we need for THIS app. // Statics import 'rxjs/add/observable/throw'; import 'rxjs/add/observable/of'; // Operators import 'rxjs/add/operator/catch'; import 'rxjs/add/o...
Fix child_process imported as default import
import { createConnection } from 'net'; import child from 'child_process'; import { NeovimClient } from './../api/client'; import { logger } from '../utils/logger'; export interface Attach { reader?: NodeJS.ReadableStream; writer?: NodeJS.WritableStream; proc?: NodeJS.Process | child.ChildProcess; socket?: st...
import { createConnection } from 'net'; import * as child from 'child_process'; import { NeovimClient } from './../api/client'; import { logger } from '../utils/logger'; export interface Attach { reader?: NodeJS.ReadableStream; writer?: NodeJS.WritableStream; proc?: NodeJS.Process | child.ChildProcess; socket...
Add initial test for 'childlist' event
import * as registerSuite from 'intern!object'; import * as assert from 'intern/chai!assert'; import createParentMixin from 'src/mixins/createParentMixin'; registerSuite({ name: 'mixins/createParentMixin', creation() { const parent = createParentMixin(); assert.isFunction(parent.append); assert.isFunction(pare...
import * as registerSuite from 'intern!object'; import * as assert from 'intern/chai!assert'; import createParentMixin from 'src/mixins/createParentMixin'; import createRenderable from 'src/mixins/createRenderable'; import { List } from 'immutable/immutable'; registerSuite({ name: 'mixins/createParentMixin', creatio...
Make sure this is numeric
import { Property } from "tns-core-modules/ui/core/properties"; import { MLKitCameraView } from "../mlkit-cameraview"; export const confidenceThresholdProperty = new Property<MLKitImageLabeling, number>({ name: "confidenceThreshold", defaultValue: 0.5, }); export abstract class MLKitImageLabeling extends MLKitCam...
import { Property } from "tns-core-modules/ui/core/properties"; import { MLKitCameraView } from "../mlkit-cameraview"; export const confidenceThresholdProperty = new Property<MLKitImageLabeling, number>({ name: "confidenceThreshold", defaultValue: 0.5, }); export abstract class MLKitImageLabeling extends MLKitCam...
Fix check for authorization in getUserId util func
import * as jwt from 'jsonwebtoken'; import { Prisma } from './generated/prisma'; export interface Context { db: Prisma; request: any; } export function getUserId(ctx: Context) { const Authorization = ctx.request.get('Authorization'); if (Authorization) { const token = Authorization.replace('Bearer ', '')...
import * as jwt from 'jsonwebtoken'; import { Prisma } from './generated/prisma'; export interface Context { db: Prisma; request: any; } export function getUserId(ctx: Context) { const Authorization = ctx.request.get('Authorization'); // Apollo Client sets header to the string 'null' when not logged in if (...
Fix missing export of IThemeManager token
// Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. import '../style/index.css'; export * from './clientsession'; export * from './clipboard'; export * from './collapse'; export * from './commandlinker'; export * from './commandpalette'; export * from './dialog'; exp...
// Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. import '../style/index.css'; export * from './clientsession'; export * from './clipboard'; export * from './collapse'; export * from './commandlinker'; export * from './commandpalette'; export * from './dialog'; exp...
Add active and selected classNames to combatant
import * as React from "react"; import { CombatantState } from "../../common/CombatantState"; export function CombatantRow(props: { combatantState: CombatantState; isActive: boolean; isSelected: boolean; showIndexLabel: boolean; }) { const displayName = props.combatantState.Alias.length ? props.combatan...
import * as React from "react"; import { CombatantState } from "../../common/CombatantState"; export function CombatantRow(props: { combatantState: CombatantState; isActive: boolean; isSelected: boolean; showIndexLabel: boolean; }) { const classNames = ["combatant"]; if (props.isActive) { classNames.p...
Remove retry from the AsyncRetry namespace
// Type definitions for async-retry 1.2 // Project: https://github.com/zeit/async-retry#readme // Definitions by: Albert Wu <https://github.com/albertywu> // Pablo Rodríguez <https://github.com/MeLlamoPablo> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare function AsyncRetry<...
// Type definitions for async-retry 1.2 // Project: https://github.com/zeit/async-retry#readme // Definitions by: Albert Wu <https://github.com/albertywu> // Pablo Rodríguez <https://github.com/MeLlamoPablo> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare function AsyncRetry<...
Remove include README.md on home page
import { Component, OnInit } from '@angular/core'; import { AppService } from '../../shared/app.service'; import { TranslateService } from '@ngx-translate/core'; let readme = require('html-loader!markdown-loader!./../../../README.md'); @Component({ selector: 'home-page', templateUrl: './home-page.componen...
import { Component, OnInit } from '@angular/core'; import { AppService } from '../../shared/app.service'; import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'home-page', templateUrl: './home-page.component.html', styleUrls: ['./home-page.component.scss'] }) export class Hom...
Update typings on StoreSubscription to properly use StoreBase
/** * Types.ts * Author: David de Regt * Copyright: Microsoft 2016 * * Shared basic types for ReSub. */ export type SubscriptionCallbackFunction = { (keys?: string[]): void; } export type SubscriptionCallbackBuildStateFunction<S> = { (keys?: string[]): S | void; } export interface StoreSubscription<S> { store: an...
/** * Types.ts * Author: David de Regt * Copyright: Microsoft 2016 * * Shared basic types for ReSub. */ import { StoreBase } from './StoreBase'; export type SubscriptionCallbackFunction = { (keys?: string[]): void; } export type SubscriptionCallbackBuildStateFunction<S> = { (keys?: string[]): S | void; } export inter...
Read should always provide a big context
import { IMessageExtend, IMessageRead, IRead } from '../accessors/index'; import { IRoom } from '../rooms/index'; import { IUser } from '../users/index'; import { IMessage } from './IMessage'; export interface IPreMessageSentHandler { /** * First step when a handler is executed: Enables the handler to signal ...
import { IMessageExtend, IRead } from '../accessors/index'; import { IMessage } from './IMessage'; export interface IPreMessageSentHandler { /** * First step when a handler is executed: Enables the handler to signal * to the Rocketlets framework whether handler shall actually execute for the message ...
Remove swagger base path - fix curl bug
import {NestFactory} from '@nestjs/core'; import {SwaggerModule, DocumentBuilder} from '@nestjs/swagger'; import {ValidationPipe, INestApplication} from '@nestjs/common'; import * as bodyParser from 'body-parser'; import * as cors from 'cors'; import {AppModule} from './app.module'; import {AuthGuard} from './auth/aut...
import {NestFactory} from '@nestjs/core'; import {SwaggerModule, DocumentBuilder} from '@nestjs/swagger'; import {ValidationPipe, INestApplication} from '@nestjs/common'; import * as bodyParser from 'body-parser'; import * as cors from 'cors'; import {AppModule} from './app.module'; import {AuthGuard} from './auth/aut...
Remove new reply dialog experiment from KnownExperimentId
/** * @license * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless require...
/** * @license * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless require...
Fix custom matcher for new jest version
/* eslint-env jest */ import { NodePath as NodePathConstructor, astNodesAreEquivalent, ASTNode, } from 'ast-types'; import { NodePath } from 'ast-types/lib/node-path'; import diff from 'jest-diff'; import utils from 'jest-matcher-utils'; const matchers = { toEqualASTNode: function (received: NodePath, expecte...
/* eslint-env jest */ import { NodePath as NodePathConstructor, astNodesAreEquivalent, ASTNode, } from 'ast-types'; import { NodePath } from 'ast-types/lib/node-path'; import { diff } from 'jest-diff'; import { printExpected, printReceived } from 'jest-matcher-utils'; const matchers = { toEqualASTNode: functi...
Clean up health check output to be less verbose
import { Injectable } from "@nestjs/common"; import { HealthIndicator, HealthIndicatorResult, HealthCheckError } from "@nestjs/terminus"; import { TopologyService } from "../districts/services/topology.service"; @Injectable() export default class TopologyLoadedIndicator extends HealthIndicator { constructor(public ...
import { Injectable } from "@nestjs/common"; import { HealthIndicator, HealthIndicatorResult, HealthCheckError } from "@nestjs/terminus"; import { TopologyService } from "../districts/services/topology.service"; @Injectable() export default class TopologyLoadedIndicator extends HealthIndicator { constructor(public ...
Add Input Component to App Component
import Component from 'inferno-component' import h from 'inferno-hyperscript' interface Props {} export default class App extends Component<Props, {}> { render() { return h('p', 'hello') } }
import Component from 'inferno-component' import h from 'inferno-hyperscript' import Input from './input.ts' interface Props {} interface State { titles: string[] } export default class App extends Component<Props, State> { constructor(props: Props) { super(props) this.state = { titles: [] } }...
Use member reference base class from cxml.
// This file is part of cxsd, copyright (c) 2016 BusFaster Ltd. // Released under the MIT license, see LICENSE. import {Namespace} from './Namespace'; import {Member} from './Member'; import {Type} from './Type'; export class MemberRef { constructor(member: Member, min: number, max: number) { this.member = member;...
// This file is part of cxsd, copyright (c) 2016 BusFaster Ltd. // Released under the MIT license, see LICENSE. import * as cxml from 'cxml'; import {Member} from './Member'; export class MemberRef extends cxml.MemberRefBase<Member> { prefix: string; }
Move judges info to separate folder Judges JSON contains not only declarations
const NAVBAR = [ { title : 'Про нас', state : 'about' }, { title : 'Головна', state : 'home' }, { title : 'Судді', state : 'list' } ]; const SOURCE = '/source'; const URLS = { listUrl : `${SOURCE}/judges.json`, dictionaryUrl : `${SOURCE}/dictionary.json`, dictionaryTimeStamp...
const NAVBAR = [ { title : 'Про нас', state : 'about' }, { title : 'Головна', state : 'home' }, { title : 'Судді', state : 'list' } ]; const SOURCE = '/source'; const URLS = { listUrl : `${SOURCE}/judges.json`, dictionaryUrl : `${SOURCE}/dictionary.json`, dictionaryTimeStamp...
Change to error logging for EcmaScript 5.
/* Copyright 2016 James Craig Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wri...
/* Copyright 2016 James Craig Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wri...
Remove self assigned values of the eventPhase enum
/** * An enum for possible event phases that an event can be in */ const enum EventPhase { /** * Indicates that the event is currently not being dispatched */ NONE = 0, /** * Indicates that the event is in the capturing phase, moving down from the top-most EventDispatcher * instance to the parent of the ta...
/** * An enum for possible event phases that an event can be in */ const enum EventPhase { /** * Indicates that the event is currently not being dispatched */ NONE, /** * Indicates that the event is in the capturing phase, moving down from the top-most EventDispatcher * instance to the parent of the target...
Change name of list bullet component
import Vue from 'vue'; import { PluginObject } from 'vue'; import Component from 'vue-class-component'; import { Prop } from 'vue-property-decorator'; import WithRender from './list-bullet.html?style=./list-bullet.scss'; import { LIST_BULLET_NAME } from '../component-names'; @WithRender @Component export class MList e...
import Vue from 'vue'; import { PluginObject } from 'vue'; import Component from 'vue-class-component'; import { Prop } from 'vue-property-decorator'; import WithRender from './list-bullet.html?style=./list-bullet.scss'; import { LIST_BULLET_NAME } from '../component-names'; @WithRender @Component export class MListBu...
Fix PrivateRoute pass lang prop
import { Redirect } from "@reach/router"; import React, { Component } from "react"; import { useLoginState } from "../profile/hooks"; export const PrivateRoute = ({ component: PrivateComponent, lang, ...rest }: any) => { const [loggedIn, _] = useLoginState(false); const loginUrl = `${lang}/login`; if (!l...
import { Redirect } from "@reach/router"; import React, { Component } from "react"; import { useLoginState } from "../profile/hooks"; export const PrivateRoute = ({ component: PrivateComponent, lang, ...rest }: any) => { const [loggedIn, _] = useLoginState(false); const loginUrl = `${lang}/login`; if (!l...
Fix links being comma seperated.
import h from '../../../lib/tsx/TsxParser'; export interface LinkProps { href: string; title: string; } function Link(props: Partial<LinkProps>): JSX.Element { const { href, title } = props as LinkProps; return ( <a href={href} title={title} target="_blank" rel="noopener"> {title}...
import h from '../../../lib/tsx/TsxParser'; export interface LinkProps { href: string; title: string; } function Link(props: Partial<LinkProps>): JSX.Element { const { href, title } = props as LinkProps; return ( <a href={href} title={title} target="_blank" rel="noopener"> {title}...
Return an error code equal to the number of errors found
import chalk from 'chalk'; import { RuleToRuleApplicationResult } from './../types'; import logToConsole from './console'; import { compactProjectLogs } from './flatten'; export const consoleLogger = (projectResult: RuleToRuleApplicationResult): number => { const projectLogs = compactProjectLogs(projectResult); ...
import chalk from 'chalk'; import { RuleToRuleApplicationResult } from './../types'; import logToConsole from './console'; import { compactProjectLogs } from './flatten'; export const consoleLogger = (projectResult: RuleToRuleApplicationResult): number => { const projectLogs = compactProjectLogs(projectResult); ...
Comment all edge directions and remove unused.
/** Enumeration for directions * @enum string * @readonly */ export enum EdgeDirection { /** * Next photo in the sequence */ NEXT = 0, /** * Previous photo in the sequence */ PREV = 3, /** * Step to the photo on the left */ STEP_LEFT, /** * Step to th...
/** * Enumeration for edge directions * @enum {number} * @readonly * @description Directions for edges in node graph describing * sequence, spatial and node type relations between nodes. */ export enum EdgeDirection { /** * Next node in the sequence */ NEXT = 0, /** * Previous node in...
Fix syntax for factorying local storage function
import { always, merge, objOf, pipe } from 'ramda'; import { Clear, Delete, Read, Write } from '../commands/local_storage'; import { constructMessage, safeParse, safeStringify } from '../util'; const get = (() => ( typeof window === 'undefined' ? always('<running outside browser context>') : window && window.loc...
import { always, merge, objOf, pipe } from 'ramda'; import { Clear, Delete, Read, Write } from '../commands/local_storage'; import { constructMessage, safeParse, safeStringify } from '../util'; const get = (() => ( typeof window === 'undefined' ? always('<running outside browser context>') : window && window.loc...
Change default route to people/1 for dev simplification
import { Routes, RouterModule } from '@angular/router'; import { ListPageComponent } from './list-page/list-page.component'; import { DetailPageComponent } from './detail-page/detail-page.component'; const isariRoutes: Routes = [ { path: '', redirectTo: '/people', pathMatch: 'full' }, { path: ...
import { Routes, RouterModule } from '@angular/router'; import { ListPageComponent } from './list-page/list-page.component'; import { DetailPageComponent } from './detail-page/detail-page.component'; const isariRoutes: Routes = [ { path: '', redirectTo: '/people/1', pathMatch: 'full' }, { path...
Add necessary typecast for supporting jlab 1 and 2
// Copyright (c) {{ cookiecutter.author_name }} // Distributed under the terms of the Modified BSD License. import { Application, IPlugin } from '@phosphor/application'; import { Widget } from '@phosphor/widgets'; import { IJupyterWidgetRegistry } from '@jupyter-widgets/base'; import * as widgetExports from ...
// Copyright (c) {{ cookiecutter.author_name }} // Distributed under the terms of the Modified BSD License. import { Application, IPlugin } from '@phosphor/application'; import { Widget } from '@phosphor/widgets'; import { IJupyterWidgetRegistry } from '@jupyter-widgets/base'; import * as widgetExports from ...
Add fade in transition to tooltip
import React, { PureComponent } from 'react'; import { Manager, Popper as ReactPopper, Reference } from 'react-popper'; interface Props { renderContent: (content: any) => any; show: boolean; placement?: any; content: string | ((props: any) => JSX.Element); refClassName?: string; } class Popper extends Pure...
import React, { PureComponent } from 'react'; import { Manager, Popper as ReactPopper, Reference } from 'react-popper'; import Transition from 'react-transition-group/Transition'; const defaultTransitionStyles = { transition: 'opacity 200ms linear', opacity: 0, }; const transitionStyles = { exited: { opacity: ...
Make 'published' a public field on events
import { EventActions } from './EventActions' import { Event, User, Permission } from '../models' import { rejectIfNull } from './util' import * as mongodb from '../mongodb/Event' export class EventActionsImpl implements EventActions { getEvents(auth: User): Promise<Event[]> { if (auth) { // All fields ...
import { EventActions } from './EventActions' import { Event, User, Permission } from '../models' import { rejectIfNull } from './util' import * as mongodb from '../mongodb/Event' export class EventActionsImpl implements EventActions { getEvents(auth: User): Promise<Event[]> { if (auth) { // All fields ...
Fix broken test due to direct provision of the actual service rather than a test double
/* tslint:disable:no-unused-variable */ /*! * Suitability Map Panel Component Test * * Copyright(c) Exequiel Ceasar Navarrete <esnavarrete1@up.edu.ph> * Licensed under MIT */ import { Renderer } from '@angular/core'; import { TestBed, async, inject } from '@angular/core/testing'; import { Router } from '@angular...
/* tslint:disable:no-unused-variable */ /*! * Suitability Map Panel Component Test * * Copyright(c) Exequiel Ceasar Navarrete <esnavarrete1@up.edu.ph> * Licensed under MIT */ import { Renderer } from '@angular/core'; import { TestBed, async, inject } from '@angular/core/testing'; import { Router } from '@angular...
Set delay when hiding window (again)
import { IpcEmitter } from "./ipc-emitter"; import { ipcMain } from "electron"; import { IpcChannels } from "./ipc-channels"; export class ProductionIpcEmitter implements IpcEmitter { public emitResetUserInput(): void { ipcMain.emit(IpcChannels.resetUserInput); } public emitHideWindow(): void { ...
import { IpcEmitter } from "./ipc-emitter"; import { ipcMain } from "electron"; import { IpcChannels } from "./ipc-channels"; export class ProductionIpcEmitter implements IpcEmitter { private windowHideDelayInMilliSeconds = 50; public emitResetUserInput(): void { ipcMain.emit(IpcChannels.resetUserInpu...
Remove debug log and fix blank suggestions bug
module ImprovedInitiative { export class PlayerSuggestion { constructor( public Socket: SocketIOClient.Socket, public EncounterId: string ) {} SuggestionVisible = ko.observable(false); Combatant: KnockoutObservable<StaticCombatantViewModel> = ko.observable();...
module ImprovedInitiative { export class PlayerSuggestion { constructor( public Socket: SocketIOClient.Socket, public EncounterId: string ) {} SuggestionVisible = ko.observable(false); Combatant: KnockoutObservable<StaticCombatantViewModel> = ko.observable();...
Add docs for the typescript task
import * as gulp from 'gulp'; import * as gulpif from 'gulp-if'; import * as sourcemaps from 'gulp-sourcemaps'; import * as typescript from 'gulp-typescript'; export const DIR_TMP = '.tmp'; export const DIR_DST = 'dist'; export const DIR_SRC = 'src'; /** * The `project` is used inside the "ts" task to compile TypeSc...
import * as gulp from 'gulp'; import * as gulpif from 'gulp-if'; import * as sourcemaps from 'gulp-sourcemaps'; import * as typescript from 'gulp-typescript'; export const DIR_TMP = '.tmp'; export const DIR_DST = 'dist'; export const DIR_SRC = 'src'; /** * The `project` is used inside the "ts" task to compile TypeSc...
Add debugging message to middlewares.
/** * Compose `middleware` returning * a fully valid middleware comprised * of all those which are passed. * * @param {Array} middleware * @return {Function} * @api public */ export function compose(middleware: Function[]) { if (!Array.isArray(middleware)) throw new TypeError('Middleware stack must be an...
import * as _ from 'underscore'; import debug from 'debug'; const d = debug('sbase:utils'); /** * Compose `middleware` returning a fully valid middleware comprised of all * those which are passed. */ export function compose(middleware: Function[]) { if (!Array.isArray(middleware)) { throw new TypeError('Midd...
Update real feature level detection.
import { browser, by, ExpectedConditions as until, $, element } from 'protractor'; import { AppPage } from './app.page'; export class UserSettingsPage extends AppPage { public async gotoFeaturesTab(): Promise<FeaturesTab> { await browser.wait(until.presenceOf(element(by.cssContainingText('a', 'Features Op...
import { browser, by, ExpectedConditions as until, $, element } from 'protractor'; import { AppPage } from './app.page'; export class UserSettingsPage extends AppPage { public async gotoFeaturesTab(): Promise<FeaturesTab> { await browser.wait(until.presenceOf(element(by.cssContainingText('a', 'Features Op...
Fix usage of Observable of method
import {Injectable} from '@angular/core'; import {CanActivate, Router} from '@angular/router'; import {Observable} from 'rxjs'; import * as myGlobals from '../globals'; @Injectable({providedIn: 'root'}) export class HomepageActivateService implements CanActivate { config = myGlobals.config; constructor(privat...
import {Injectable} from '@angular/core'; import {CanActivate, Router} from '@angular/router'; import {Observable} from 'rxjs'; import { of } from 'rxjs'; import * as myGlobals from '../globals'; @Injectable({providedIn: 'root'}) export class HomepageActivateService implements CanActivate { config = myGlobals.conf...
Add utility function for converting date objects to Mturk formatted date strings.
/** * Expects a string in MTurk's URL encoded date format * (e.g. '09262017' would be converted into a Date object for * September 26th, 2017) * @param encodedDate string in described format */ export const encodedDateStringToDate = (encodedDate: string): Date => { const parseableDateString = encod...
/** * Expects a string in MTurk's URL encoded date format * (e.g. '09262017' would be converted into a Date object for * September 26th, 2017) * @param encodedDate string in described format */ export const encodedDateStringToDate = (encodedDate: string): Date => { const parseableDateString = encod...
Revert to `symbol` from `unique symbol`.
declare const observableSymbol: symbol; export default observableSymbol; declare global { export interface SymbolConstructor { readonly observable: unique symbol; } }
declare const observableSymbol: symbol; export default observableSymbol; declare global { export interface SymbolConstructor { readonly observable: symbol; } }
Add interface for execAsync result
import {exec} from 'child_process'; export function execAsync(command: string) { return new Promise<any>( (resolve, reject) => exec(command, (error, stdout, stderr) => { if (error) { reject(error); } else { resolve({ stdout: stdout, stderr: stderr });...
import {exec} from 'child_process'; export interface IExecAsyncResult { stdout: string; stderr: string; } export function execAsync(command: string) { return new Promise<IExecAsyncResult>( (resolve, reject) => exec(command, (error, stdout, stderr) => { if (error) { reje...
Update media cons. to use new token types
import { Convention } from './Convention' import { TokenMeaning } from './Token' import { MediaSyntaxNodeType } from '../../SyntaxNodes/MediaSyntaxNode' import { MediaConvention } from './MediaConvention' import { AudioNode } from '../../SyntaxNodes/AudioNode' import { ImageNode } from '../../SyntaxNodes/ImageNode' imp...
import { MediaConvention } from './MediaConvention' import { AudioToken } from './Tokens/AudioToken' import { ImageToken } from './Tokens/ImageToken' import { VideoToken } from './Tokens/VideoToken' import { AudioNode } from '../../SyntaxNodes/AudioNode' import { ImageNode } from '../../SyntaxNodes/ImageNode' import { ...
Fix toolbar's logo placement in toolbar's template
import * as DOM from "../../core/util/dom"; interface ToolbarProps { location: "above" | "below" | "left" | "right"; sticky: "sticky" | "non-sticky"; logo?: "normal" | "grey"; } export default (props: ToolbarProps): HTMLElement => { let logo; if (props.logo != null) { const cls = props.logo === "grey" ?...
import * as DOM from "../../core/util/dom"; interface ToolbarProps { location: "above" | "below" | "left" | "right"; sticky: "sticky" | "non-sticky"; logo?: "normal" | "grey"; } export default (props: ToolbarProps): HTMLElement => { let logo; if (props.logo != null) { const cls = props.logo === "grey" ?...
Return success: true when loader mutation is run
import { TruffleDB } from "truffle-db"; import { ArtifactsLoader } from "./artifacts"; import { schema as rootSchema } from "truffle-db/schema"; import { Workspace, schema } from "truffle-db/workspace"; const tmp = require("tmp"); import { makeExecutableSchema } from "@gnd/graphql-tools"; import { gql } from "apollo-...
import { TruffleDB } from "truffle-db"; import { ArtifactsLoader } from "./artifacts"; import { schema as rootSchema } from "truffle-db/schema"; import { Workspace, schema } from "truffle-db/workspace"; const tmp = require("tmp"); import { makeExecutableSchema } from "@gnd/graphql-tools"; import { gql } from "apollo-...
Fix windows paths in scanner
import * as Path from "path"; export function cleanGlobPatterns(files: string | string[], excludes: string[]): string[] { excludes = excludes.map((s: string) => "!" + s.replace(/!/gi, "")); return [] .concat(files as any) .map((file: string) => { if (!require.extensions[".ts"] && !process.env["TS_TE...
import * as Path from "path"; export function cleanGlobPatterns(files: string | string[], excludes: string[]): string[] { excludes = excludes.map((s: string) => "!" + s.replace(/!/gi, "").replace(/\\/g, "/")); return [] .concat(files as any) .map((file: string) => { if (!require.extensions[".ts"] &&...
Remove scroll after every event for perf
module ImprovedInitiative { export class EventLog { Events = ko.observableArray<string>(); LatestEvent = ko.pureComputed(() => this.Events()[this.Events().length - 1] || "Welcome to Improved Initiative!"); EventsTail = ko.pureComputed(() => this.Events().slice(0, this.Events().lengt...
module ImprovedInitiative { export class EventLog { Events = ko.observableArray<string>(); LatestEvent = ko.pureComputed(() => this.Events()[this.Events().length - 1] || "Welcome to Improved Initiative!"); EventsTail = ko.pureComputed(() => this.Events().slice(0, this.Events().lengt...
Return Undefined on Empty Input
import * as React from "react"; export interface InputProps{ onChange: (value: any) => void, label?: string id?: string, class?: string, value?: string } export function Input(props: InputProps) { return <div className={props.class +" float-label"}> <input required value={prop...
import * as React from "react"; export interface InputProps{ onChange: (value: any) => void, label?: string id?: string, class?: string, value?: string } export function Input(props: InputProps) { return <div className={props.class +" float-label"}> <input required value={prop...
Fix cgroup not deleted after sandbox finished
import { SandboxParameter } from './interfaces'; import nativeAddon from './nativeAddon'; import { SandboxProcess } from './sandboxProcess'; import { existsSync } from 'fs'; import * as randomString from 'randomstring'; import * as path from 'path'; export * from './interfaces'; if (!existsSync('/sys/fs/cgroup/memory...
import { SandboxParameter } from './interfaces'; import nativeAddon from './nativeAddon'; import { SandboxProcess } from './sandboxProcess'; import { existsSync } from 'fs'; import * as randomString from 'randomstring'; import * as path from 'path'; export * from './interfaces'; if (!existsSync('/sys/fs/cgroup/memory...
Make command optional for IMiddlewareArguments
import { middleware, Middleware as GenericMiddleware } from '@pawelgalazka/middleware' import { useMiddlewares } from './middlewares' export { useMiddlewares } from './middlewares' export { help, withHelp } from './middlewares/helper' export { rawArgs } from './middlewares/rawArgsParser' export type CommandFuncti...
import { middleware, Middleware as GenericMiddleware } from '@pawelgalazka/middleware' import { useMiddlewares } from './middlewares' export { useMiddlewares } from './middlewares' export { help, withHelp } from './middlewares/helper' export { rawArgs } from './middlewares/rawArgsParser' export type CommandFuncti...
Validate accepts an array of models
import {PropertyType} from "./model/property-type"; import {ModelOptions, ProcessMode} from "./model/options"; import {ValidateResult} from "./manager/validate"; import {model} from "./model/model"; import {type} from "./decorator/type"; import {length} from "./decorator/length"; import {range} from "./decorator/rang...
import {PropertyType} from "./model/property-type"; import {ModelOptions, ProcessMode} from "./model/options"; import {ValidateResult} from "./manager/validate"; import {model} from "./model/model"; import {type} from "./decorator/type"; import {length} from "./decorator/length"; import {range} from "./decorator/rang...
Expand apphost to support multiple components
import * as React from 'react'; export default class AppHost extends React.Component<any, any> { constructor() { super(); } render() { return ( React.Children.only(this.props.children) ); } }
import * as React from 'react'; export default class AppHost extends React.Component<any, any> { constructor() { super(); } render() { return ( <div> {this.props.children} </div> ); } }
Fix naming mismatches in the Haskell/Rust sets
import { createTrainingSet } from './training-set'; export const goRustAssignmentsTrainingSet = { title: "Go vs Rust", left: "Go.Assignment.", right: "Rust.Assignment.", baseUrl: "languages/", examples: createTrainingSet({ name: "Go.Assignment.", number: 19, prefix: ".png" }, { name: "Rust.Assignme...
import { createTrainingSet } from './training-set'; export const goRustAssignmentsTrainingSet = { title: "Go vs Rust", left: "Go.Assignment.", right: "Rust.Assignment.", baseUrl: "languages/", examples: createTrainingSet({ name: "Go.Assignment.", number: 19, prefix: ".png" }, { name: "Rust.Assignme...
Revert "render blank content for unknown types"
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. // See the LICENCE file in the repository root for full licence text. import StringWithComponent from 'components/string-with-component'; import BeatmapsetDiscussionPostJson from 'interfaces/beatmapset-discussion-...
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. // See the LICENCE file in the repository root for full licence text. import StringWithComponent from 'components/string-with-component'; import BeatmapsetDiscussionPostJson from 'interfaces/beatmapset-discussion-...
Send message to all windows (for now)
export interface IMessage { data: {}; name: string; sender: string; } export class Service { private uid : number; constructor(public _postMessage) { var _self = this; } private postMessage(name: string, data: {}) : void { var _self = this; var message : IMessag...
export interface IMessage { data: {}; name: string; sender: string; } export class Service { private uid : number; constructor(public _postMessage) { var _self = this; } private postMessage(name: string, data: {}) : void { var _self = this; var message : IMessag...
Add passing naked URL test
import { expect } from 'chai' import * as Up from '../../index' import { insideDocumentAndParagraph } from './Helpers' import { LinkNode } from '../../SyntaxNodes/LinkNode' import { DocumentNode } from '../../SyntaxNodes/DocumentNode' import { PlainTextNode } from '../../SyntaxNodes/PlainTextNode' import { EmphasisNod...
import { expect } from 'chai' import * as Up from '../../index' import { insideDocumentAndParagraph } from './Helpers' import { LinkNode } from '../../SyntaxNodes/LinkNode' import { DocumentNode } from '../../SyntaxNodes/DocumentNode' import { PlainTextNode } from '../../SyntaxNodes/PlainTextNode' import { EmphasisNod...
Remove roles from our entity model
import { Affiliation, Household } from 'cmpd-common-api'; import { BaseEntity, Column, Entity, JoinColumn, OneToMany, OneToOne, PrimaryColumn } from 'typeorm'; @Entity('nominators') export class Nominator extends BaseEntity { private constructor(props) { super(); Object.assign(this, props); } @PrimaryCo...
import { Affiliation, Household } from 'cmpd-common-api'; import { BaseEntity, Column, Entity, JoinColumn, OneToMany, OneToOne, PrimaryColumn } from 'typeorm'; @Entity('nominators') export class Nominator extends BaseEntity { private constructor(props) { super(); Object.assign(this, props); } @PrimaryCo...
Fix typescript for lazy-loaded iframes
import React, { Component } from 'react'; import window from 'global'; interface IFrameProps { id: string; key?: string; title: string; src: string; allowFullScreen: boolean; scale: number; style?: any; } interface BodyStyle { width: string; height: string; transform: string; transformOrigin: st...
import React, { Component } from 'react'; import window from 'global'; interface IFrameProps { id: string; key?: string; title: string; src: string; allowFullScreen: boolean; scale: number; style?: any; } interface BodyStyle { width: string; height: string; transform: string; transformOrigin: st...
Add tapReporter to package export
export { default as matchTestFiles } from "./matchTestFiles"; export { default as globals } from "./globals"; export { default as specSyntax } from "./specSyntax"; export { default as suiteSyntax } from "./suiteSyntax"; export { default as runner } from "./runner"; export { default as resultsReporter } from "./resultsR...
export { default as matchTestFiles } from "./matchTestFiles"; export { default as globals } from "./globals"; export { default as specSyntax } from "./specSyntax"; export { default as suiteSyntax } from "./suiteSyntax"; export { default as runner } from "./runner"; export { default as resultsReporter } from "./resultsR...
Fix 404.html import in app template
/** * Created by Caleydo Team on 31.08.2016. */ import 'file-loader?name=index.html!extract-loader!html-loader?interpolate!./index.html'; import 'file-loader?name=404.html-loader!./404.html'; import 'file-loader?name=robots.txt!./robots.txt'; import 'phovea_ui/src/_bootstrap'; import './style.scss'; import {create a...
/** * Created by Caleydo Team on 31.08.2016. */ import 'file-loader?name=index.html!extract-loader!html-loader?interpolate!./index.html'; import 'file-loader?name=404.html!./404.html'; import 'file-loader?name=robots.txt!./robots.txt'; import 'phovea_ui/src/_bootstrap'; import './style.scss'; import {create as creat...
Add more strict types to DB methods
import { openDB, type IDBPDatabase } from 'idb'; export async function getDB() { const db = await openDB('pokeapi.js', 1, { async upgrade(db) { const objectStore = db.createObjectStore('cachedResources', { keyPath: 'cacheKey', }); objectStore.createIndex('whenCached', 'whenCached', { ...
import { openDB, type IDBPDatabase, type DBSchema } from 'idb'; interface CacheDBSchema extends DBSchema { cachedResources: { key: string; value: { cacheKey: string; whenCached: number; data: string; }; indexes: { whenCached: number } }; } export async function getDB() ...
Disable atom task wrapping of all event handlers.
declare class WeakMap< Key , Value > { get( key : Key ) : Value set( key : Key , value : Value ) : this } namespace $ { export class $mol_view_dom extends $mol_object { static nodes = new ( WeakMap || $mol_dict )< $mol_view , Element >() static node( view : $mol_view ) { let node = $mol_view_dom.node...
declare class WeakMap< Key , Value > { get( key : Key ) : Value set( key : Key , value : Value ) : this } namespace $ { export class $mol_view_dom extends $mol_object { static nodes = new ( WeakMap || $mol_dict )< $mol_view , Element >() static node( view : $mol_view ) { let node = $mol_view_dom.node...
Extend Contraint with searchRecursively boolean
export interface Constraint { value: string|string[]; type: string; // add | subtract } /** * Companion object */ export class Constraint { public static convertTo(constraint: Constraint|string|string[]): Constraint { return (Array.isArray(constraint) || typeof(constraint) == 'string') ...
export interface Constraint { value: string|string[]; type: string; // add | subtract searchRecursively?: boolean; } export class Constraint { public static convertTo(constraint: Constraint|string|string[]): Constraint { return (Array.isArray(constraint) || typeof(constraint) == 'string')...