Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Replace mock training content by big one readme | import {EditTrainingSummary} from '../../model/editTrainingSummary';
export const trainingContentMockData: EditTrainingSummary[] = [
{
id: 1,
content: 'This is a test markdown sample using # H1',
},
{
id: 2,
content: 'This is a test markdown sample using a **bold text**',
},
];
| import {EditTrainingSummary} from '../../model/editTrainingSummary';
export const trainingContentMockData: EditTrainingSummary[] = [
{
id: 1,
content: `
## Login

## Lecturers trainings
 Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import styled from 'react-emotion';
import {colors} from './colors';
import {Component} from 'react';
import {shell}... | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import styled from 'react-emotion';
import {colors} from './colors';
import {Component} from 'react';
import {shell}... |
Use string dict for project description | /**
* Copyright 2019 Google LLC
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | /**
* Copyright 2019 Google LLC
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
Fix some tests/issues with mocDOMSource | import {Observable} from 'rx';
export interface DOMSelection {
observable: Observable<any>;
events: (eventType: string) => Observable<any>;
}
export class MockedDOMSelection {
public observable: Observable<any>;
constructor(private mockConfigEventTypes: Object,
mockConfigObservable?: Observable... | import {Observable} from 'rx';
export interface DOMSelection {
observable: Observable<any>;
events: (eventType: string) => Observable<any>;
}
export class MockedDOMSource {
public observable: Observable<any>;
constructor(private _mockConfig: Object) {
if (_mockConfig['observable']) {
this.observabl... |
Fix route detection for tab group | import {Component, ElementRef, Inject} from '@angular/core';
import {PageScrollService, PageScrollInstance} from 'ng2-page-scroll';
import {DOCUMENT} from "@angular/platform-browser";
import {Router, NavigationEnd} from "@angular/router";
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
... | import {Component, ElementRef, Inject} from '@angular/core';
import {PageScrollService, PageScrollInstance} from 'ng2-page-scroll';
import {DOCUMENT} from "@angular/platform-browser";
import {Router, NavigationEnd} from "@angular/router";
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
... |
Use the PST timezone instead of a magic string. Renamed timezone to timezoneService for clarity. | import { timezone } from './timezone.service';
import { defaultFormats } from '../date/date.module';
import * as moment from 'moment';
import 'moment-timezone';
describe('timezone', (): void => {
it('should return the timezone', (): void => {
let date: moment.Moment = moment('2001-4-1T12:00:00-07:00', defaultForma... | import { timezone as timezoneService } from './timezone.service';
import { defaultFormats } from '../date/date.module';
import * as moment from 'moment';
import 'moment-timezone';
import { timezones } from './timezone.enum';
describe('timezone', (): void => {
it('should return the timezone', (): void => {
let dat... |
Add schemes to documentSelector in LanguageClientOptions |
/*#######.
########",#:
#########',##".
##'##'## .##',##.
## ## ## # ##",#.
## ## ## ## ##'
## ## ## :##
## ## ##*/
'use strict'
import { join } from 'path'
import { workspace, ExtensionContext } from 'vscode'
import {
LanguageClient,
LanguageClientOptions,
ServerOptions,
Tr... |
/*#######.
########",#:
#########',##".
##'##'## .##',##.
## ## ## # ##",#.
## ## ## ## ##'
## ## ## :##
## ## ##*/
'use strict'
import { join } from 'path'
import { workspace, ExtensionContext } from 'vscode'
import {
LanguageClient,
LanguageClientOptions,
ServerOptions,
Tr... |
Disable animation for BrowserContext, it doesn't play well with BrowserView | import { messages } from "common/butlerd";
import { Space } from "common/helpers/space";
import { Dispatch } from "common/types";
import React from "react";
import butlerCaller, { LoadingStateDiv } from "renderer/hocs/butlerCaller";
import { hook } from "renderer/hocs/hook";
import { withSpace } from "renderer/hocs/wit... | import { messages } from "common/butlerd";
import { Space } from "common/helpers/space";
import { Dispatch } from "common/types";
import React from "react";
import butlerCaller from "renderer/hocs/butlerCaller";
import { hook } from "renderer/hocs/hook";
import { withSpace } from "renderer/hocs/withSpace";
import { bro... |
Remove slash before the "node_modules" string in "Require cycle" warn message regex | import { Constants } from 'expo-constants';
import Logs from '../logs/Logs';
import RemoteLogging from '../logs/RemoteLogging';
if (Constants.manifest && Constants.manifest.logUrl) {
// Enable logging to the Expo dev tools only if this JS is not running in a web browser (ex: the
// remote debugger)
if (!navigat... | import { Constants } from 'expo-constants';
import Logs from '../logs/Logs';
import RemoteLogging from '../logs/RemoteLogging';
if (Constants.manifest && Constants.manifest.logUrl) {
// Enable logging to the Expo dev tools only if this JS is not running in a web browser (ex: the
// remote debugger)
if (!navigat... |
Add a space between unit and number | import { round } from './round'
/**
* Number sign display mode
*/
export const enum Sign {
Normal,
Forced,
}
/**
* Display bytes in human readable format like:
* 23GB
* -43B
* It's also possible to force sign in order to get the
* plus sign in case of positive numbers like:
* +23GB
* -43B
*/
ex... | import { round } from './round'
/**
* Number sign display mode
*/
export const enum Sign {
Normal,
Forced,
}
/**
* Display bytes in human readable format like:
* 23GB
* -43B
* It's also possible to force sign in order to get the
* plus sign in case of positive numbers like:
* +23GB
* -43B
*/
ex... |
Update test to use Git 2.19.3 | import { GitProcess, IGitResult } from '../lib'
// NOTE: bump these versions to the latest stable releases
export const gitVersion = '2.19.2'
export const gitLfsVersion = '2.6.0'
const temp = require('temp').track()
export async function initialize(repositoryName: string): Promise<string> {
const testRepoPath = te... | import { GitProcess, IGitResult } from '../lib'
// NOTE: bump these versions to the latest stable releases
export const gitVersion = '2.19.3'
export const gitLfsVersion = '2.6.0'
const temp = require('temp').track()
export async function initialize(repositoryName: string): Promise<string> {
const testRepoPath = te... |
Use string literal type for action type | declare module 'connected-react-router' {
import * as React from 'react'
import { Middleware, Reducer } from 'redux'
import { History, Path, Location, LocationState, LocationDescriptorObject } from 'history'
interface ConnectedRouterProps {
history: History
}
export enum RouterActionType {
POP =... | declare module 'connected-react-router' {
import * as React from 'react'
import { Middleware, Reducer } from 'redux'
import { History, Path, Location, LocationState, LocationDescriptorObject } from 'history'
interface ConnectedRouterProps {
history: History
}
export enum RouterActionType {
POP =... |
Revert "$mol_after_frame: reduce native api usage to improve performance." | namespace $ {
export class $mol_after_frame extends $mol_object2 {
static queue = new Set< ()=> void >()
static scheduled = 0
static schedule( task : ()=> void ) {
this.queue.add( task )
if( this.scheduled ) return
this.scheduled = requestAnimationFrame( ()=> this.run() )
}
static run(... | namespace $ {
export class $mol_after_frame extends $mol_object2 {
id : any
constructor(
public task : ()=> void ,
) {
super()
this.id = requestAnimationFrame( task )
}
destructor() {
cancelAnimationFrame( this.id )
}
}
}
|
Duplicate boostrap to be able to toggle easy between HTML5 push and hash based location strategy | import {Component, View, provide} from 'angular2/core';
import {bootstrap} from 'angular2/platform/browser';
import {RouteConfig, ROUTER_PROVIDERS, ROUTER_DIRECTIVES, LocationStrategy, HashLocationStrategy} from 'angular2/router';
import {PersonsView} from './views/persons/personsViewComponent';
import {AboutView} fro... | import {Component, View, provide} from 'angular2/core';
import {bootstrap} from 'angular2/platform/browser';
import {RouteConfig, ROUTER_PROVIDERS, ROUTER_DIRECTIVES, LocationStrategy, HashLocationStrategy} from 'angular2/router';
import {PersonsView} from './views/persons/personsViewComponent';
import {AboutView} fro... |
Make tasks cancellable by default | import { CancellationToken, Progress } from "vscode";
import { Extension } from "../Extensibility/Extension";
import { IProgressState } from "./IProgressState";
/**
* Represents a task.
*
* @template TExtension
* The type of the extension.
*/
export abstract class Task<TExtension extends Extension = Extension>
{
... | import { CancellationToken, Progress } from "vscode";
import { Extension } from "../Extensibility/Extension";
import { IProgressState } from "./IProgressState";
/**
* Represents a task.
*
* @template TExtension
* The type of the extension.
*/
export abstract class Task<TExtension extends Extension = Extension>
{
... |
Modify the module style of koa-session | import * as Koa from 'koa';
import * as session from 'koa-session';
const app = new Koa();
app.use(session(app));
app.listen(3000);
| import * as Koa from 'koa';
import session = require('koa-session');
const app = new Koa();
app.use(session(app));
app.listen(3000);
|
Fix for new menu design | import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { TodoComponent } from './todo.component';
import { FirstUpperPipe } from '../../shared/pipes/first-upper.pipe';
import { DoNothingDirective } from '../../shared/directives/do-nothing.directive';
/**
* @igno... | import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { TodoComponent } from './todo.component';
import { FirstUpperPipe } from '../../shared/pipes/first-upper.pipe';
import { DoNothingDirective } from '../../shared/directives/do-nothing.directive';
/**
* @igno... |
Define MapStateToParamsFn interface with a generic | import { Observable, components } from 'knockout';
export function setState<T>(state: T): void;
export function getState<T>(): Observable<T>;
interface ViewModelFactoryFunction {
(params?: components.ViewModelParams): components.ViewModel;
}
interface ViewModelInstantiator
extends components.ViewModelConstructo... | import { Observable, components } from 'knockout';
export function setState<T>(state: T): void;
export function getState<T>(): Observable<T>;
interface ViewModelFactoryFunction {
(params?: components.ViewModelParams): components.ViewModel;
}
interface ViewModelInstantiator
extends components.ViewModelConstructo... |
ADD gray button to story | import React from 'react';
import { storiesOf } from '@storybook/react';
import { Button } from './Button';
import { Icons } from '../icon/icon';
import { Form } from '../form/index';
const { Button: FormButton } = Form;
storiesOf('Basics/Button', module).add('all buttons', () => (
<div>
<p>Button that is used... | import React from 'react';
import { storiesOf } from '@storybook/react';
import { Button } from './Button';
import { Icons } from '../icon/icon';
import { Form } from '../form/index';
const { Button: FormButton } = Form;
storiesOf('Basics/Button', module).add('all buttons', () => (
<div>
<p>Button that is used... |
Remove ellipsis on Auth modal title | import { c } from 'ttag';
import { useState } from 'react';
import { FormModal, Loader } from '../../components';
import PasswordTotpInputs from './PasswordTotpInputs';
import useAskAuth from './useAskAuth';
interface Props {
onClose?: () => void;
onSubmit: (data: { password: string; totp: string }) => void;
... | import { c } from 'ttag';
import { useState } from 'react';
import { FormModal, Loader } from '../../components';
import PasswordTotpInputs from './PasswordTotpInputs';
import useAskAuth from './useAskAuth';
interface Props {
onClose?: () => void;
onSubmit: (data: { password: string; totp: string }) => void;
... |
Set day and month to 1 if not set | import {Component, Input} from '@angular/core';
import {NgbDateParserFormatter, NgbDateStruct} from '@ng-bootstrap/ng-bootstrap';
import {Resource} from '../../../model/resource';
import {DocumentEditChangeMonitor} from '../document-edit-change-monitor';
@Component({
moduleId: module.id,
selector: 'dai-date',... | import {Component, Input} from '@angular/core';
import {NgbDateParserFormatter, NgbDateStruct} from '@ng-bootstrap/ng-bootstrap';
import {Resource} from '../../../model/resource';
import {DocumentEditChangeMonitor} from '../document-edit-change-monitor';
@Component({
moduleId: module.id,
selector: 'dai-date',... |
Kill child process on exit | import * as childProcess from 'child_process';
import Xev from 'xev';
const ev = new Xev();
export default function() {
const log: any[] = [];
const p = childProcess.fork(__dirname + '/notes-stats-child.js');
p.on('message', stats => {
ev.emit('notesStats', stats);
log.push(stats);
if (log.length > 100) lo... | import * as childProcess from 'child_process';
import Xev from 'xev';
const ev = new Xev();
export default function () {
const log: any[] = [];
const p = childProcess.fork(__dirname + '/notes-stats-child.js');
p.on('message', stats => {
ev.emit('notesStats', stats);
log.push(stats);
if (log.length > 100) l... |
Allow use applicationinsights disk retry caching | 'use strict';
import { RestClientSettings } from './models/configurationSettings';
import * as Constants from './constants';
import * as appInsights from "applicationinsights";
appInsights.setup(Constants.AiKey)
.setAutoCollectDependencies(false)
.setAutoCollectExceptions(false)
.setAutoCollectPe... | 'use strict';
import { RestClientSettings } from './models/configurationSettings';
import * as Constants from './constants';
import * as appInsights from "applicationinsights";
appInsights.setup(Constants.AiKey)
.setAutoCollectConsole(false)
.setAutoCollectDependencies(false)
.setAutoCollectExcep... |
Remove unused text and circle | import * as React from 'react'
import { Component } from 'react'
import { StyleSheet } from 'react-native'
import { Text } from 'react-native'
import { View } from 'react-native'
import { Card } from './Card'
import { Circle } from './Circle'
import { Draggable } from './Draggable'
import { Suit } from './Suit'
expor... | import * as React from 'react'
import { Component } from 'react'
import { StyleSheet } from 'react-native'
import { Text } from 'react-native'
import { View } from 'react-native'
import { Card } from './Card'
import { Draggable } from './Draggable'
import { Suit } from './Suit'
export default class App extends Compon... |
Add placeholders for missing methods | import Knex from 'knex';
import {
Identifiable,
ConnectorConstructor,
ModelStatic,
ModelConstructor,
Bindings
} from '@next-model/core';
export class NextModelKnexConnector<S extends Identifiable> implements ConnectorConstructor<S> {
knex: Knex;
constructor(options: Knex.Config) {
this.knex = Knex(o... | import Knex from 'knex';
import {
Identifiable,
ConnectorConstructor,
ModelStatic,
ModelConstructor,
Bindings
} from '@next-model/core';
export class NextModelKnexConnector<S extends Identifiable> implements ConnectorConstructor<S> {
knex: Knex;
constructor(options: Knex.Config) {
this.knex = Knex(o... |
Add Bluperint entry point in prod | /// <reference path='webpack.fix.d.ts' />
import * as ExtractTextPlugin from 'extract-text-webpack-plugin'
import * as path from 'path'
import * as webpack from 'webpack'
import * as ParallelUglifyPlugin from 'webpack-parallel-uglify-plugin'
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
import baseC... | /// <reference path='webpack.fix.d.ts' />
import * as ExtractTextPlugin from 'extract-text-webpack-plugin'
import * as path from 'path'
import * as webpack from 'webpack'
import * as ParallelUglifyPlugin from 'webpack-parallel-uglify-plugin'
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
import baseC... |
Add tasks: audio-source-separation and voice-activity-detection |
/// Order by decreasing specificity
export enum PipelineType {
"text-classification" = "text-classification",
"token-classification" = "token-classification",
"table-question-answering" = "table-question-answering",
"question-answering" = "question-answering",
"zero-shot-classification" = "zero-shot-classificatio... |
/// In each category, order by decreasing specificity
export enum PipelineType {
/// nlp
"text-classification" = "text-classification",
"token-classification" = "token-classification",
"table-question-answering" = "table-question-answering",
"question-answering" = "question-answering",
"zero-shot-classification"... |
Modify tests for exam spec-runner | /// <reference path="../../definitions/mocha/mocha.d.ts" />
/// <reference path="../../definitions/chai/chai.d.ts" />
/// <reference path="../../src/service/twitter.ts" />
module Spec {
chai.should();
describe('ServiceTwitter', () => {
it('should be true', () => {
true.should.be.false;
... | /// <reference path="../../definitions/mocha/mocha.d.ts" />
/// <reference path="../../definitions/chai/chai.d.ts" />
/// <reference path="../../src/service/twitter.ts" />
module Spec {
chai.should();
describe('ServiceTwitter', () => {
it('should be true', () => {
true.should.be.true;
... |
Refactor url address to a single variable | import {Injectable} from "@angular/core";
import {Player} from "../models/player.model";
import {Headers, Http} from "@angular/http";
@Injectable()
export class PlayerService{
player1: Player;
player2: Player;
constructor(private http: Http){};
getPlayers(){
let url = 'http://localhost:4000/players... | import {Injectable} from "@angular/core";
import {Player} from "../models/player.model";
import {Headers, Http} from "@angular/http";
@Injectable()
export class PlayerService{
player1: Player;
player2: Player;
API_URL = 'http://192.168.1.3:4000';
constructor(private http: Http){};
getPlayers(){
l... |
Increase release version to 1.0.5 | import { EnvConfig } from './env-config.interface';
const BaseConfig: EnvConfig = {
// Sample API url
API: 'https://demo.com',
RELEASEURL: 'https://github.com/nie-ine/raeber-website/releases/tag/1.0.4',
RELEASEVERSION: '1.0.4'
};
export = BaseConfig;
| import { EnvConfig } from './env-config.interface';
const BaseConfig: EnvConfig = {
// Sample API url
API: 'https://demo.com',
RELEASEURL: 'https://github.com/nie-ine/raeber-website/releases/tag/1.0.5',
RELEASEVERSION: '1.0.5'
};
export = BaseConfig;
|
Add react-router path for abou | import * as React from "react";
import * as ReactDOM from "react-dom";
import * as injectTapEventPlugin from "react-tap-event-plugin";
import MenuBar from "./components/menu/MenuBar";
import SimpleContent from "./components/SimpleContent";
import TopPage from "./components/top/TopPage";
import EventPage from "./compone... | import * as React from "react";
import * as ReactDOM from "react-dom";
import * as injectTapEventPlugin from "react-tap-event-plugin";
import MenuBar from "./components/menu/MenuBar";
import SimpleContent from "./components/SimpleContent";
import TopPage from "./components/top/TopPage";
import EventPage from "./compone... |
Use secrets in env vars, not hardcoded! | import * as rp from 'request-promise'
export namespace Auth0Manager {
export function getEncryptedUserDetailsByID(auth0_id: string): PromiseLike<string> {
let req_opts = {
method: 'POST',
url: process.env.AUTH0_BASE_URL + "/oauth/token",
headers: { 'content-type': 'appl... | import * as rp from 'request-promise'
export namespace Auth0Manager {
export function getEncryptedUserDetailsByID(auth0_id: string): PromiseLike<string> {
let req_opts = {
method: 'POST',
url: process.env.AUTH0_BASE_URL + "/oauth/token",
headers: { 'content-type': 'appl... |
Add type to "catch" to support higher TS versions | import { renderError } from '../../common';
import { IAppController } from '../app.controller.interface';
import { Config } from '../config';
import { Context, HttpResponse } from '../http';
export async function convertErrorToResponse(
error: Error, ctx: Context, appController: IAppController, log = console.error
)... | import { renderError } from '../../common';
import { IAppController } from '../app.controller.interface';
import { Config } from '../config';
import { Context, HttpResponse } from '../http';
export async function convertErrorToResponse(
error: Error, ctx: Context, appController: IAppController, log = console.error
)... |
Revert "feat: make frameworkerLoader load both JS and TS loaders as they will be migrated to TS" | /* eslint-disable global-require,import/no-dynamic-require */
import fs from 'fs';
import path from 'path';
import { Loader } from './Loader';
import { StoryshotsOptions } from '../api/StoryshotsOptions';
const loaderScriptName = 'loader';
const isDirectory = (source: string) => fs.lstatSync(source).isDirectory();
f... | /* eslint-disable global-require,import/no-dynamic-require */
import fs from 'fs';
import path from 'path';
import { Loader } from './Loader';
import { StoryshotsOptions } from '../api/StoryshotsOptions';
const loaderScriptName = 'loader.js';
const isDirectory = (source: string) => fs.lstatSync(source).isDirectory();... |
Use metaphysics url from ENV rather than hard-coded value | import * as Relay from "react-relay"
const sharify = require("sharify")
export const metaphysicsURL = "https://metaphysics-production.artsy.net"
export function artsyNetworkLayer(user?: any) {
return new Relay.DefaultNetworkLayer(metaphysicsURL, {
headers: !!user ? {
"X-USER-ID": user.id,
"X-ACCESS-... | import * as Relay from "react-relay"
const sharify = require("sharify")
export function artsyNetworkLayer(user?: any) {
return new Relay.DefaultNetworkLayer(sharify.data.METAPHYSICS_ENDPOINT, {
headers: !!user ? {
"X-USER-ID": user.id,
"X-ACCESS-TOKEN": user.accessToken,
} : {},
})
}
/*
* For... |
Update to current sources (no new strings) + update Polish translation | <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="pl">
<context>
<name>TreeWindow</name>
<message>
<location filename="../../../treewindow.ui" line="14"/>
<source>Panel DOM tree</source>
<translation type="unfinished"></translation>
</message>
<mess... | <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="pl">
<context>
<name>TreeWindow</name>
<message>
<location filename="../../../treewindow.ui" line="14"/>
<source>Panel DOM tree</source>
<translation>Drzewo DOM panelu</translation>
</message>
<messa... |
Use generics on watchQuery call | import { Component, OnInit } from '@angular/core';
import { Apollo } from 'apollo-angular';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import helloWorldQuery from 'graphql-tag/loader!./hello-world.query.graphql';
import helloMutantWorldMutation from 'graphql-tag/loader!./hello-mutant... | import { Component, OnInit } from '@angular/core';
import { Apollo } from 'apollo-angular';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import helloWorldQuery from 'graphql-tag/loader!./hello-world.query.graphql';
import helloMutantWorldMutation from 'graphql-tag/loader!./hello-mutant... |
Update Link component to work with internal and external URLs | import React, { PropsWithChildren, ReactElement } from 'react'
import { Link as HyperLink, LinkProps } from 'react-router-dom'
export default function Link({
to,
children,
...rest
}: PropsWithChildren<LinkProps>): ReactElement {
return (
<HyperLink to={to} {...rest} replace>
{children}
</HyperLin... | import React, { PropsWithChildren, ReactElement } from 'react'
import { Link as HyperLink, LinkProps } from 'react-router-dom'
import join from 'utils/join'
export interface LinkDef extends LinkProps {
classNames?: (string | string[])[]
}
export default function Link({
to,
children,
classNames,
...rest
}: P... |
Update iOS version for tests | export * from './intern';
export const environments = [
{ browserName: 'internet explorer', version: [ '10.0', '11.0' ], platform: 'Windows 7' },
{ browserName: 'microsoftedge', platform: 'Windows 10' },
{ browserName: 'firefox', platform: 'Windows 10' },
{ browserName: 'chrome', platform: 'Windows 10' },
{ brows... | export * from './intern';
export const environments = [
{ browserName: 'internet explorer', version: [ '10.0', '11.0' ], platform: 'Windows 7' },
{ browserName: 'microsoftedge', platform: 'Windows 10' },
{ browserName: 'firefox', platform: 'Windows 10' },
{ browserName: 'chrome', platform: 'Windows 10' },
{ brows... |
Add additional test for brace matching | /// <reference path="fourslash.ts"/>
//////curly braces
////module Foo [|{
//// class Bar [|{
//// private f() [|{
//// }|]
////
//// private f2() [|{
//// if (true) [|{ }|] [|{ }|];
//// }|]
//// }|]
////}|]
////
//////parenthesis
////class FooBar {
//// ... | /// <reference path="fourslash.ts"/>
//////curly braces
////module Foo [|{
//// class Bar [|{
//// private f() [|{
//// }|]
////
//// private f2() [|{
//// if (true) [|{ }|] [|{ }|];
//// }|]
//// }|]
////}|]
////
//////parenthesis
////class FooBar {
//// ... |
Add error messages when failing to login | import * as AWS from 'aws-sdk';
import * as React from 'react';
import GoogleLogin, {GoogleLoginResponse} from 'react-google-login';
interface LoginProps {
onSuccessfulLogin: () => void
}
export default class extends React.Component<LoginProps, {}> {
onSuccessfulGoogleLogin = (res: GoogleLoginResponse) => {
A... | import * as AWS from 'aws-sdk';
import * as React from 'react';
import GoogleLogin, {GoogleLoginResponse} from 'react-google-login';
interface LoginProps {
onSuccessfulLogin: () => void
}
interface LoginState {
errorMessage: string | null
}
export default class extends React.Component<LoginProps, LoginState> {
... |
Add autoslide section with clear interval onclick | import {Component, OnInit, OnDestroy} from '@angular/core';
declare var $: any;
@Component({
selector: 'app-slides',
templateUrl: './slides.component.html',
styleUrls: ['./slides.component.sass']
})
export class SlidesComponent implements OnInit, OnDestroy {
constructor() {
}
ngOnInit() {
$('#fullpage').ful... | import {Component, OnInit, OnDestroy} from '@angular/core';
declare var $: any;
@Component({
selector: 'app-slides',
templateUrl: './slides.component.html',
styleUrls: ['./slides.component.sass']
})
export class SlidesComponent implements OnInit, OnDestroy {
constructor() {
}
ngOnInit() {
$('#fullpage').ful... |
Fix codelensProvider import to use correct casing | import * as vscode from 'vscode';
import DocumentTracker from './documentTracker';
import CodeLensProvider from './codeLensProvider';
import CommandHandler from './commandHandler';
import Decorator from './mergeDecorator';
const ConfigurationSectionName = 'better-merge';
export default class ServiceWrapper implements... | import * as vscode from 'vscode';
import DocumentTracker from './documentTracker';
import CodeLensProvider from './codelensProvider';
import CommandHandler from './commandHandler';
import Decorator from './mergeDecorator';
const ConfigurationSectionName = 'better-merge';
export default class ServiceWrapper implements... |
Add IdleBadge to StatusAndPrivileges section | import { Key } from './Key';
import { USER_ROLES } from '../constants';
export enum MNEMONIC_STATUS {
DISABLED = 0,
ENABLED = 1,
OUTDATED = 2,
SET = 3,
PROMPT = 4,
}
export enum UserType {
PROTON = 1,
MANAGED = 2,
EXTERNAL = 3,
}
export interface User {
ID: string;
Name: strin... | import { Key } from './Key';
import { USER_ROLES } from '../constants';
export enum MNEMONIC_STATUS {
DISABLED = 0,
ENABLED = 1,
OUTDATED = 2,
SET = 3,
PROMPT = 4,
}
export enum UserType {
PROTON = 1,
MANAGED = 2,
EXTERNAL = 3,
}
export interface User {
ID: string;
Name: strin... |
Remove unnecessary eslint line exclusion | /**
* Known potential responses from the remote API.
*
* https://haveibeenpwned.com/API/v2#PwnedPasswords
*
*/
export interface PwnedPasswordsApiResponse {
// eslint-disable-next-line no-restricted-globals
status: number;
data?: string;
}
/** @internal */
export const OK = {
status: 200,
};
/** @interna... | /**
* Known potential responses from the remote API.
*
* https://haveibeenpwned.com/API/v2#PwnedPasswords
*
*/
export interface PwnedPasswordsApiResponse {
status: number;
data?: string;
}
/** @internal */
export const OK = {
status: 200,
};
/** @internal */
export const BAD_REQUEST = {
status: 400,
d... |
Fix error in object/array matching on shapes | import {SchemaType} from '../diff'
export function getValueError(value: unknown, schemaType: SchemaType) {
const {jsonType} = schemaType
const valueType = typeof value
if (value === null || valueType === 'undefined') {
return undefined
}
if (Array.isArray(value) && jsonType !== 'array') {
return {e... | import {SchemaType} from '../diff'
export function getValueError(value: unknown, schemaType: SchemaType) {
const {jsonType} = schemaType
const valueType = Array.isArray(value) ? 'array' : typeof value
if (value === null || valueType === 'undefined') {
return undefined
}
if (valueType !== jsonType) {
... |
Add HeroDetailComponent to the NgModule | import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms'
import { AppComponent } from './app.component';
@NgModule({
imports: [ BrowserModule, FormsModule],
declarations: [ AppComponent ],
bootstrap: [ App... | import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms'
import { AppComponent } from './app.component';
import { HeroDetailComponent } from './hero-detail.component';
@NgModule({
imports: [ BrowserModule, Forms... |
Update script reference to new name | /**
* A script to generate `../shared/styles/mathjax.css`.
*
* Run using `npm run build:mathjax`.
*/
import fs from 'fs'
import MathJax from 'mathjax-node'
import path from 'path'
const dest = path.join(__dirname, '..', 'shared', 'styles', 'mathjax.css')
MathJax.typeset(
{
css: true
},
result => {
... | /**
* A script to generate `../shared/styles/mathjax.css`.
*
* Run using `npm run generate:mathjax`.
*/
import fs from 'fs'
import MathJax from 'mathjax-node'
import path from 'path'
const dest = path.join(__dirname, '..', 'shared', 'styles', 'mathjax.css')
MathJax.typeset(
{
css: true
},
result => {
... |
Update scripts log assertion message | import { deepEqual } from 'assert';
export default (_module: NodeModule, tester: (check: <T>(name: string, a: T, b: T) => void ) => void) => {
const checkedCounts: { [key: string]: number } = {};
const stackRegex = new RegExp(`${_module.filename}:([0-9]+):[0-9]+`);
let failedCount = 0;
let passedCount = 0;
... | import { deepEqual } from 'assert';
export default (_module: NodeModule, tester: (check: <T>(name: string, a: T, b: T) => void ) => void) => {
const checkedCounts: { [key: string]: number } = {};
const stackRegex = new RegExp(`${_module.filename}:([0-9]+):[0-9]+`);
let failedCount = 0;
let passedCount = 0;
... |
Change user local storage key | import { useLocalStorage } from 'react-use';
export const USERNAME_LOCAL_STORAGE_KEY = 'USERNAME';
interface User {
username: string;
}
const useUser = () => {
return useLocalStorage<User | undefined>(USERNAME_LOCAL_STORAGE_KEY);
};
export default useUser;
| import { useLocalStorage } from 'react-use';
export const USER_LOCAL_STORAGE_KEY = 'USER';
interface User {
username: string;
}
const useUser = () => {
return useLocalStorage<User | undefined>(USER_LOCAL_STORAGE_KEY);
};
export default useUser;
|
Read elm-analyse configuration from the directory where the elm.json is rather than the current working directory of the process. This helps with running in a multi-project structure where you may open "/project/" in an editor and have an elm project under "/project/web/". | import * as fs from 'fs';
import * as fileGatherer from '../util/file-gatherer';
import { ElmApp, Context } from '../domain';
function setup(app: ElmApp, directory: string) {
app.ports.loadContext.subscribe(() => {
const input = fileGatherer.gather(directory);
var configuration;
try {
... | import * as fs from 'fs';
import * as fileGatherer from '../util/file-gatherer';
import { ElmApp, Context } from '../domain';
import * as path from 'path';
function setup(app: ElmApp, directory: string) {
app.ports.loadContext.subscribe(() => {
const input = fileGatherer.gather(directory);
var conf... |
Return data on error from the server | import axios from 'axios';
import { Request, Response } from 'express';
interface ProxyRequest {
body: string;
headers: { [name: string]: string };
method: string;
url: string;
}
export function proxy(req: Request, res: Response) {
const content = req.body as ProxyRequest;
const request = {
... | import axios from 'axios';
import { Request, Response } from 'express';
interface ProxyRequest {
body: string;
headers: { [name: string]: string };
method: string;
url: string;
}
export function proxy(req: Request, res: Response) {
const content = req.body as ProxyRequest;
const request = {
... |
Verify that moment handles daylight savings time correctly. We can just pass a consistent timezone offset to the client and let moment handle daylight savings time internally. | import { timezone } from './timezone.service';
import { defaultFormats } from '../date/date.module';
import * as moment from 'moment';
import 'moment-timezone';
describe('timezone', (): void => {
it('should return the timezone', (): void => {
let date: moment.Moment = moment('2016-4-1T12:00:00-07:00', defaultForma... | import { timezone } from './timezone.service';
import { defaultFormats } from '../date/date.module';
import * as moment from 'moment';
import 'moment-timezone';
describe('timezone', (): void => {
it('should return the timezone', (): void => {
let date: moment.Moment = moment('2016-4-1T12:00:00-07:00', defaultForma... |
Check if an error is from the API before converting to a TaxjarError | import * as requestPromise from 'request-promise-native';
import { Config, Request, TaxjarError } from '../util/types';
const proxyError = (result): never => {
throw new TaxjarError(
result.error.error,
result.error.detail,
result.statusCode,
);
};
export default (config: Config): Request => {
const... | import * as requestPromise from 'request-promise-native';
import { Config, Request, TaxjarError } from '../util/types';
const proxyError = (result): never => {
const isTaxjarError = result.statusCode && result.error && result.error.error && result.error.detail;
if (isTaxjarError) {
throw new TaxjarError(
... |
Allow GetType to return undefined | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... |
Add signOut and deleteAccount functions | import * as firebase from "firebase";
const projectId = process.env.REACT_APP_FIREBASE_PROJECT_ID;
export function initialize(): void {
firebase.initializeApp({
apiKey: process.env.REACT_APP_FIREBASE_API_KEY,
authDomain: `${projectId}.firebaseapp.com`,
databaseURL: `https://${projectId}.fi... | import * as firebase from "firebase";
const projectId = process.env.REACT_APP_FIREBASE_PROJECT_ID;
export function initialize(): void {
firebase.initializeApp({
apiKey: process.env.REACT_APP_FIREBASE_API_KEY,
authDomain: `${projectId}.firebaseapp.com`,
databaseURL: `https://${projectId}.fi... |
Add checkbox for toggling all todos | import * as React from 'react'
import { Component } from 'react'
import { TodoModel } from './TodoModel'
import { TodoList } from './TodoList'
interface Props {
deleteTodo: (todo: TodoModel) => void
todos: Array<TodoModel>
}
export class Main extends Component<Props, void> {
public render() {
return (
... | import * as React from 'react'
import { Component } from 'react'
import { observer } from 'mobx-react'
import { TodoModel } from './TodoModel'
import { TodoList } from './TodoList'
interface Props {
deleteTodo: (todo: TodoModel) => void
todos: Array<TodoModel>
}
@observer
export class Main extends Component<Prop... |
Update latest extension version to "~0.3" | export class Constants {
public static latestExtensionVersion = "~0.2";
public static latest = "latest";
public static extensionVersionAppSettingName = "FUNCTIONS_EXTENSION_VERSION";
}
| export class Constants {
public static latestExtensionVersion = "~0.3";
public static latest = "latest";
public static extensionVersionAppSettingName = "FUNCTIONS_EXTENSION_VERSION";
}
|
Use es6 import to be tslint compiant | require('dotenv').config();
/**
* This is the database configuration for the migrations and
* the seeders.
*/
module.exports = {
client: process.env.DB_CLIENT,
connection: process.env.DB_CONNECTION,
migrations: {
directory: process.env.DB_MIGRATION_DIR,
tableName: process.env.DB_MIGRATIO... | import * as dotenv from 'dotenv';
dotenv.config();
/**
* This is the database configuration for the migrations and
* the seeders.
*/
module.exports = {
client: process.env.DB_CLIENT,
connection: process.env.DB_CONNECTION,
migrations: {
directory: process.env.DB_MIGRATION_DIR,
tableName: ... |
Move instance uuid to useState hook | import * as React from 'react';
import DisplayName from '../helpers/DisplayName';
import { DivAttributes } from '../helpers/types';
import { assertValidHtmlId, nextUuid } from '../helpers/uuid';
import {
Consumer as ItemConsumer,
ItemContext,
Provider as ItemProvider,
UUID,
} from './ItemContext';
type... | import * as React from 'react';
import { useState } from 'react';
import DisplayName from '../helpers/DisplayName';
import { DivAttributes } from '../helpers/types';
import { assertValidHtmlId, nextUuid } from '../helpers/uuid';
import {
Consumer as ItemConsumer,
ItemContext,
Provider as ItemProvider,
U... |
Update `decreaseIndentPattern` to match Atom | const languageConfiguration = {
indentationRules: {
increaseIndentPattern: /^(\s*(module|class|((private|protected)\s+)?def|unless|if|else|elsif|case|when|begin|rescue|ensure|for|while|until|(?=.*?\b(do|begin|case|if|unless)\b)("(\\.|[^\\"])*"|'(\\.|[^\\'])*'|[^#"'])*(\s(do|begin|case)|[-+=&|*/~%^<>~]\s*(if|unless))... | const languageConfiguration = {
indentationRules: {
increaseIndentPattern: /^(\s*(module|class|((private|protected)\s+)?def|unless|if|else|elsif|case|when|begin|rescue|ensure|for|while|until|(?=.*?\b(do|begin|case|if|unless)\b)("(\\.|[^\\"])*"|'(\\.|[^\\'])*'|[^#"'])*(\s(do|begin|case)|[-+=&|*/~%^<>~]\s*(if|unless))... |
Fix issue with formatting of api response | import { APIModule } from './base'
import { camel, snake } from './converters'
import { Message, MessageOptions } from '../types'
import * as messageFormat from '../helpers/formatters/message'
export class Chat extends APIModule {
delete(channel: string, ts: string, options: { asUser?: boolean } = {}): Promise<{ cha... | import { APIModule } from './base'
import { camel, snake } from './converters'
import { Message, MessageOptions } from '../types'
import * as messageFormat from '../helpers/formatters/message'
export class Chat extends APIModule {
delete(channel: string, ts: string, options: { asUser?: boolean } = {}): Promise<{ cha... |
Remove flip disabled modifier to fix UI bug | import React from 'react';
import { registerComponent, Components } from '../../lib/vulcan-lib';
import { useHover } from "../common/withHover";
const PostsItemTooltipWrapper = ({children, post, className}: {
children?: React.ReactNode,
post: PostsList,
className?: string,
}) => {
const { LWPopper, PostsPrevie... | import React from 'react';
import { registerComponent, Components } from '../../lib/vulcan-lib';
import { useHover } from "../common/withHover";
const PostsItemTooltipWrapper = ({children, post, className}: {
children?: React.ReactNode,
post: PostsList,
className?: string,
}) => {
const { LWPopper, PostsPrevie... |
Add alias for unique files function |
export function uniqueFilterFnGenerator<T>(): (v: T) => boolean;
export function uniqueFilterFnGenerator<T, U>(extractFn: (v: T) => U): (v: T) => boolean;
export function uniqueFilterFnGenerator<T>(extractFn?: (v: T) => T): (v: T) => boolean {
const values = new Set<T>();
const extractor = extractFn || (a => a... |
// alias for uniqueFilterFnGenerator
export const uniqueFn = uniqueFilterFnGenerator;
export function uniqueFilterFnGenerator<T>(): (v: T) => boolean;
export function uniqueFilterFnGenerator<T, U>(extractFn: (v: T) => U): (v: T) => boolean;
export function uniqueFilterFnGenerator<T>(extractFn?: (v: T) => T): (v: T) =... |
Set auth to only returnable | import {Request} from 'express';
import {HookableComponent, HookableModels} from '../hookable';
import {DependencyInjectorComponent} from '../dependency-injector';
import {User} from './models/user';
/**
* Connect to a database and perform operation in ... | import {Request} from 'express';
import {HookableComponent, HookableModels} from '../hookable';
import {DependencyInjectorComponent} from '../dependency-injector';
import {User} from './models/user';
/**
* Connect to a database and perform operation in ... |
Remove selection when track changed | import { observe } from "mobx"
import { isNotNull } from "../../common/helpers/array"
import { resetSelection } from "../actions"
import MIDIOutput from "../services/MIDIOutput"
import RootStore from "./RootStore"
export const registerReactions = (rootStore: RootStore) => {
// reset selection when tool changed
obs... | import { autorun, observe } from "mobx"
import { isNotNull } from "../../common/helpers/array"
import { emptySelection } from "../../common/selection/Selection"
import { resetSelection } from "../actions"
import MIDIOutput from "../services/MIDIOutput"
import RootStore from "./RootStore"
export const registerReactions... |
Set undefined to onClick prop when nothing is provided by parent | import * as React from "react";
import "./style/Button.css";
interface IProps {
className?: string;
onClick?: () => void;
onMouseOver?: () => void;
onMouseOut?: () => void;
style?: object;
type?: string;
}
export default class extends React.Component<IProps> {
public render() {
co... | import * as React from "react";
import "./style/Button.css";
interface IProps {
className?: string;
onClick?: () => void;
onMouseOver?: () => void;
onMouseOut?: () => void;
style?: object;
type?: string;
}
export default class extends React.Component<IProps> {
public render() {
co... |
Change type to play nicer with tsickle. | /**
* @license
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
*
* 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
... | /**
* @license
* Copyright 2018 The Incremental DOM Authors. All Rights Reserved.
*
* 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
... |
Remove mobile app menu for VPN settings | import React from 'react';
import { useActiveBreakpoint } from '../../index';
interface Props {
children: React.ReactNode;
}
const MobileNavServices = ({ children }: Props) => {
const { isNarrow } = useActiveBreakpoint();
if (!isNarrow) {
return null;
}
return <nav className="p1 flex flex... | import React from 'react';
import { APPS } from 'proton-shared/lib/constants';
import { useActiveBreakpoint, useConfig } from '../../index';
interface Props {
children: React.ReactNode;
}
const MobileNavServices = ({ children }: Props) => {
const { isNarrow } = useActiveBreakpoint();
const { APP_NAME } = ... |
Implement naive fuzzy searching for emoji | import * as React from 'react'
import { IAutocompletionProvider } from './index'
/** Autocompletion provider for emoji. */
export default class EmojiAutocompletionProvider implements IAutocompletionProvider<string> {
private emoji: Map<string, string>
public constructor(emoji: Map<string, string>) {
this.emoj... | import * as React from 'react'
import { IAutocompletionProvider } from './index'
import { escapeRegExp } from '../lib/escape-regex'
export interface IEmojiHit {
emoji: string,
matchStart: number,
matchLength: number
}
/** Autocompletion provider for emoji. */
export default class EmojiAutocompletionProvider imp... |
Change tenantId from 'rest-test' to 'test'. | /// Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
/// and other contributors as indicated by the @author tags.
///
/// 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... | /// Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
/// and other contributors as indicated by the @author tags.
///
/// 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... |
Improve the accessability of exception-info | /**
* Represents an Exception
*/
export class Exception extends Error
{
/**
* A collection of key/value pairs that provide additional user-defined information about the exception.
*/
private data: any[];
/**
* The Exception instance that caused the current exception.
*/
private in... | /**
* Represents an Exception
*/
export class Exception extends Error
{
/**
* A collection of key/value pairs that provide additional user-defined information about the exception.
*/
private data: any[];
/**
* The message of the exception.
*/
private exceptionMessage: string;
... |
Add 0 as fallback when minReward evaluates to NaN. | import { SearchOptions, SearchSort } from '../types';
import { WorkerSearchParams, WorkerSortParam } from '../worker-mturk-api';
export const generateParams = (options: SearchOptions): WorkerSearchParams => {
const { sortType, minReward, qualifiedOnly, searchTerm } = options;
return {
sort: sortParam(s... | import { SearchOptions, SearchSort } from '../types';
import { WorkerSearchParams, WorkerSortParam } from '../worker-mturk-api';
export const generateParams = (options: SearchOptions): WorkerSearchParams => {
const { sortType, minReward, qualifiedOnly, searchTerm } = options;
return {
sort: sortParam(s... |
Add support for the label | import { Component, createElement } from "react";
import { Switch } from "./components/Switch";
import { SwitchContainerProps } from "./components/SwitchContainer";
import * as css from "./ui/Switch.sass";
// tslint:disable class-name
export class preview extends Component<SwitchContainerProps, {}> {
componentWil... | import { Component, createElement } from "react";
import { Switch } from "./components/Switch";
import { SwitchContainerProps } from "./components/SwitchContainer";
import * as css from "./ui/Switch.sass";
import { Label } from "./components/Label";
// tslint:disable class-name
export class preview extends Component<... |
Add properties used in HsCore to HsConfig type def | export class HsConfig {
constructor(){}
} | export class HsConfig {
componentsEnabled: any;
mapInteractionsEnabled: boolean;
allowAddExternalDatasets: boolean;
sidebarClosed: boolean;
constructor() {
}
} |
Add some properties to the room interface | import { IUser } from '../users';
import { RoomType } from './RoomType';
export interface IRoom {
id: string;
name: string;
type: RoomType;
creator: IUser;
usernames: Array<string>;
isDefault?: boolean;
messageCount?: number;
createdAt?: Date;
updatedAt?: Date;
lastModifiedAt?: ... | import { IUser } from '../users';
import { RoomType } from './RoomType';
export interface IRoom {
id: string;
displayName: string;
slugifiedName?: string;
type: RoomType;
creator: IUser;
usernames: Array<string>;
isDefault?: boolean;
isReadOnly?: boolean;
displaySystemMessages?: boo... |
Fix live sounds playing during playback when not the right time. | import { Injectable } from '@angular/core';
import { Actions, Effect } from '@ngrx/effects';
import { Grid } from '../../main/grid/grid.model';
import { Note } from '../../../common/core/note.model';
import { PlayerActions } from './player.actions';
import { SoundService } from "../../../common/sound/sound.service";
i... | import { Injectable } from '@angular/core';
import { Actions, Effect } from '@ngrx/effects';
import { Grid } from '../../main/grid/grid.model';
import { Note } from '../../../common/core/note.model';
import { PlayerActions } from './player.actions';
import { SoundService } from "../../../common/sound/sound.service";
i... |
Add commata to currency numbers | import * as React from 'react'
import data from '../../../../data'
import {FundPrereq} from "../../../../definitions/Prerequisites/FundPrereq"
function stringifyCondition(condition: any) {
if (condition.familyMember) {
return ` if you have ${condition.familyMember} family members`
}
}
const FundBox =... | import * as React from 'react'
import data from '../../../../data'
import {FundPrereq} from "../../../../definitions/Prerequisites/FundPrereq"
function stringifyCondition(condition: any) {
if (condition.familyMember) {
return ` if you have ${condition.familyMember} family members`
}
}
const FundBox =... |
Add key, alt, and title to the emoji image | import * as React from 'react'
interface IEmojiTextProps {
readonly className?: string
readonly emoji: Map<string, string>
readonly children?: string
}
/**
* A component which replaces any emoji shortcuts (e.g., :+1:) in its child text
* with the appropriate image tag.
*/
export default class EmojiText exten... | import * as React from 'react'
interface IEmojiTextProps {
readonly className?: string
readonly emoji: Map<string, string>
readonly children?: string
}
/**
* A component which replaces any emoji shortcuts (e.g., :+1:) in its child text
* with the appropriate image tag.
*/
export default class EmojiText exten... |
Tweak the descriptions for MD5. | import * as crypto from 'crypto';
import * as core from './core';
abstract class StringToMD5Transformer implements core.Transformer {
protected abstract get digestMethodDescription(): string
protected abstract get digestMethod(): crypto.HexBase64Latin1Encoding
public get label(): string {
return `String to MD5 ... | import * as crypto from 'crypto';
import * as core from './core';
abstract class StringToMD5Transformer implements core.Transformer {
protected abstract get digestMethodDescription(): string
protected abstract get digestMethod(): crypto.HexBase64Latin1Encoding
public get label(): string {
return `String to MD5 ... |
Fix an error with the used controller | import * as angular from "angular";
<% if (!moduleOnly) { %>import { <%= pName %>Config } from "./<%= hName %>.config";
import { <%= pName %>Controller } from "./<%= hName %>.controller";
<% } %>export const <%= name %> = angular
.module("<%= appName %>.<%= name %>", ["ui.router"])<% if (!moduleOnly) { %>
.con... | import * as angular from "angular";
<% if (!moduleOnly) { %>import { <%= pName %>Config } from "./<%= hName %>.config";
import { <%= pName %>Controller } from "./<%= hName %>.controller";
<% } %>export const <%= name %> = angular
.module("<%= appName %>.<%= name %>", ["ui.router"])<% if (!moduleOnly) { %>
.con... |
Fix crash when going resource category to details and back | import { useCurrentStateAndParams } from '@uirouter/react';
import * as React from 'react';
import useAsync from 'react-use/lib/useAsync';
import { LoadingSpinner } from '@waldur/core/LoadingSpinner';
import { translate } from '@waldur/i18n';
import { getCategory } from '@waldur/marketplace/common/api';
import { useTi... | import { useCurrentStateAndParams } from '@uirouter/react';
import * as React from 'react';
import { useSelector } from 'react-redux';
import useAsync from 'react-use/lib/useAsync';
import { LoadingSpinner } from '@waldur/core/LoadingSpinner';
import { translate } from '@waldur/i18n';
import { getCategory } from '@wal... |
Add typography for unity theme | import * as React from 'react';
import Card from 'material-ui/Card';
import { withStyles } from 'material-ui/styles';
interface Props {
userName: string;
text: string;
channelName: string;
}
const styles = theme => ({
card: {
minWidth: 275,
},
bullet: {
display: 'inline-block',
margin: '0 2px... | import * as React from 'react';
import Card, { CardContent } from 'material-ui/Card';
import Typography from 'material-ui/Typography';
import { withStyles } from 'material-ui/styles';
interface Props {
userName: string;
text: string;
channelName: string;
}
const styles = theme => ({
card: {
minWidth: 275... |
Remove unnecessary ts-ignore for archive | /**
* Copyright 2018-present Facebook.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @format
*/
import BaseDevice from './BaseDevice';
import {DeviceType, OS, DeviceShell, DeviceLogEntry} from './BaseDevice';
export default class Arch... | /**
* Copyright 2018-present Facebook.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @format
*/
import BaseDevice from './BaseDevice';
import {DeviceType, OS, DeviceShell, DeviceLogEntry} from './BaseDevice';
function normalizeArchive... |
Add utility function to strip dollar symbols and separators from currency strings. | /**
* Trims leading and trailing whitespace and line terminators and replaces all
* characters after character 90 with an ellipsis.
* @param str
*/
export const truncate = (str: string, max = 90): string => {
const trimmed = str.trim();
return trimmed.length > max ? trimmed.slice(0, max).concat(' ...') ... | const currencyFormatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2
});
/**
* Trims leading and trailing whitespace and line terminators and replaces all
* characters after character 90 with an ellipsis.
* @param str
*/
export const truncate = (... |
Improve type resolution for UMD libraries | import {
Component as _Component,
useState as _useState,
Dispatch,
SetStateAction,
} from 'react';
// Globally available modules must be declared here
// Copy type definitions from @types/react/index.d.ts, because namespaces can't be re-exported
declare global {
namespace React {
function useState<S>(
initi... | import _React from 'react';
import _Reactstrap from 'reactstrap';
import _PropTypes from 'prop-types';
declare global {
const React: typeof _React;
const Reactstrap: typeof _Reactstrap;
const PropTypes: typeof _PropTypes;
}
|
Add card attributes to model. | import * as Big from "bignumber.js";
import * as Frames from "../definitions/FrameDirectory";
import {ItemTypes} from "./Inventory";
import {Attributes, RequestContext} from "./SkillContext";
export class Frame {
constructor(id: string, entry: ReturnsResponseContext, unhandled: ReturnsFrame, FrameMap: ActionMap) {... | import * as Big from "bignumber.js";
import * as Frames from "../definitions/FrameDirectory";
import {ItemTypes} from "./Inventory";
import {Attributes, RequestContext} from "./SkillContext";
export class Frame {
constructor(id: string, entry: ReturnsResponseContext, unhandled: ReturnsFrame, FrameMap: ActionMap) {... |
Make overview home showing just blank space. | import {Component, OnInit, Inject, ViewChild, TemplateRef} from '@angular/core';
import {Router} from '@angular/router';
import {IdaiFieldDocument} from '../model/idai-field-document';
import {ObjectList} from "./object-list";
import {Messages} from "idai-components-2/idai-components-2";
import {M} from "../m";
import ... | import {Component} from "@angular/core";
@Component({
moduleId: module.id,
template: ``
})
/**
*/
export class OverviewHomeComponent {}
|
Update deprecated method signature for apollo-client 0.5.8. | /**
* Created by grischa on 12/8/16.
*
* Get a connection to the Backend to run GraphQL query
*
*/
/// <reference path="../types.d.ts" />
import {createNetworkInterface, default as ApolloClient} from "apollo-client";
export class EDMConnection extends ApolloClient {
constructor(host: string, token: string) ... | /**
* Created by grischa on 12/8/16.
*
* Get a connection to the Backend to run GraphQL query
*
*/
/// <reference path="../types.d.ts" />
import {createNetworkInterface, default as ApolloClient} from "apollo-client";
import {NetworkInterfaceOptions} from "apollo-client/transport/networkInterface";
export class ED... |
Add function to ensure the component always has a valid title | import * as React from 'react'
import { IGitHubUser } from '../../lib/dispatcher'
interface IAvatarProps {
readonly gitHubUser: IGitHubUser | null
readonly title: string | null
}
export class Avatar extends React.Component<IAvatarProps, void> {
public render() {
const DefaultAvatarURL = 'https://github.com/... | import * as React from 'react'
import { IGitHubUser } from '../../lib/dispatcher'
interface IAvatarProps {
readonly gitHubUser: IGitHubUser | null
readonly title: string | null
}
const DefaultAvatarURL = 'https://github.com/hubot.png'
export class Avatar extends React.Component<IAvatarProps, void> {
private g... |
Add missing import of ngModule | import { ModuleWithProviders } from '@angular/core';
import { SocketIoConfig } from './config/socket-io.config';
import { WrappedSocket } from './socket-io.service';
/** Socket factory */
export function SocketFactory(config: SocketIoConfig) {
return new WrappedSocket(config);
}
export const socketConfig: string ... | import { NgModule, ModuleWithProviders } from '@angular/core';
import { SocketIoConfig } from './config/socket-io.config';
import { WrappedSocket } from './socket-io.service';
/** Socket factory */
export function SocketFactory(config: SocketIoConfig) {
return new WrappedSocket(config);
}
export const socketConfi... |
Rename baseline query param to variant=b | /* Copyright 2019 Google LLC. All Rights Reserved.
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 ... | /* Copyright 2019 Google LLC. All Rights Reserved.
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 ... |
Make projections just be an event listener. |
import {TypedEventListener} from "../EventHandling/TypedEventListener";
import {ProjectionStorage} from "./Storage/ProjectionStorage";
import {Projection} from "./Projection";
export abstract class Projections<T extends Projection> extends TypedEventListener {
constructor(protected storage: ProjectionStorage<T>) ... |
import {EventListener} from "../EventHandling/EventListener";
import {ProjectionStorage} from "./Storage/ProjectionStorage";
import {Projection} from "./Projection";
import {Event} from "../Message/Event";
export abstract class Projections<T extends Projection> implements EventListener {
constructor(protected sto... |
Add some padding to card story | import React from 'react';
import { storiesOf } from '@storybook/react';
import { Card } from '../../components/card';
storiesOf('Card', module).add('default', () => <Card>Hello world</Card>);
| import React from 'react';
import { storiesOf } from '@storybook/react';
import { Card } from '../../components/card';
import { Box } from 'components/box';
storiesOf('Card', module).add('default', () => (
<Box p={4}>
<Card>Hello world</Card>
</Box>
));
|
Set production variable to true | export const environment = {
production: false,
shibbolethSessionUrl: 'https://research-hub.cer.auckland.ac.nz:8443/Shibboleth.sso/Session.json',
apiUrl: 'https://research-hub.cer.auckland.ac.nz:8443/api/',
analyticsCode: 'UA-77710107-3'
};
| export const environment = {
production: true,
shibbolethSessionUrl: 'https://research-hub.cer.auckland.ac.nz:8443/Shibboleth.sso/Session.json',
apiUrl: 'https://research-hub.cer.auckland.ac.nz:8443/api/',
analyticsCode: 'UA-77710107-3'
};
|
Add type information to array | import {Component} from 'angular2/core';
import {Http, Headers} from 'angular2/http';
@Component({
selector: 'playlistr',
template: `
<h1>Playlistr</h1>
<ul>
<li *ngFor="#release of releases" >
{{release.basic_information.title}}
-
<st... | import {Component} from 'angular2/core';
import {Http, Headers} from 'angular2/http';
@Component({
selector: 'playlistr',
template: `
<h1>Playlistr</h1>
<ul>
<li *ngFor="#release of releases" >
{{release.basic_information.title}}
-
<st... |
Add Cobol & MUMPS language modes | import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { MaterialModule } from './../material/material.module';
import { CoreModule } from './../core';
import { Chron... | import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { MaterialModule } from './../material/material.module';
import { CoreModule } from './../core';
import { Chron... |
Add `form` attribute to allowed list | /**
* Delay time before close autocomplete.
*
* (This prevent autocomplete DOM get detroyed before access data.)
*/
export const AUTOCOMPLETE_CLOSE_DELAY = 250;
/**
* Allowed attributes that can be passed to internal input.
*/
export const ALLOWED_ATTRS = [
'autofocus',
'disabled',
'id',
'inputmode',
'list'... | /**
* Delay time before close autocomplete.
*
* (This prevent autocomplete DOM get detroyed before access data.)
*/
export const AUTOCOMPLETE_CLOSE_DELAY = 250;
/**
* Allowed attributes that can be passed to internal input.
*/
export const ALLOWED_ATTRS = [
'autofocus',
'disabled',
'form',
'id',
'inputmode'... |
Use <= rather than === for count | export class IsaacGenerator {
private _count: number;
constructor() {
this._count = 0;
}
public getValue(): number {
if (this._count === 0) {
this._randomise();
}
return 0;
}
private _randomise(): void {
}
}
| export class IsaacGenerator {
private _count: number;
constructor() {
this._count = 0;
}
public getValue(): number {
if (this._count <= 0) {
this._randomise();
}
return 0;
}
private _randomise(): void {
}
}
|
Support height, width, and alt attributes for images in Markdown images. | // Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
import * as sanitize from 'sanitize-html';
export
interface ISanitizer {
/**
* Sanitize an HTML string.
*/
sanitize(dirty: string): string;
}
/**
* A class to sanitize HTML strings.
*/
class Sanitizer ... | // Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
import * as sanitize from 'sanitize-html';
export
interface ISanitizer {
/**
* Sanitize an HTML string.
*/
sanitize(dirty: string): string;
}
/**
* A class to sanitize HTML strings.
*/
class Sanitizer ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.