It will check if current branch is master or a release branch and, if so, prevents a commit or push
- Enable git templates
git config --global init.templatedir '~/.git-templates'
const { rxObserver } = require('api/v0.3'); | |
const { Observable, ConnectableObservable, GroupedObservable, observable, Subject, BehaviorSubject, ReplaySubject, AsyncSubject, asapScheduler, asyncScheduler, queueScheduler, animationFrameScheduler, VirtualTimeScheduler, VirtualAction, Scheduler, Subscription, Subscriber, pipe, noop, identity, isObservable, ArgumentOutOfRangeError, EmptyError, ObjectUnsubscribedError, UnsubscriptionError, TimeoutError, bindCallback, bindNodeCallback, defer, empty, forkJoin, from, fromEvent, fromEventPattern, generate, iif, interval, never, of, pairs, range, throwError, timer, using, EMPTY, NEVER, config } = require('rxjs'); | |
const { audit, auditTime, buffer, bufferCount, bufferTime, bufferToggle, bufferWhen, catchError, combineAll, combineLatest, concat, concatAll, concatMap, concatMapTo, count, debounce, debounceTime, defaultIfEmpty, delay, delayWhen, dematerialize, distinct, distinctUntilChanged, distinctUntilKeyChanged, elementAt, endWith, every, exhaust, exhaustMap, expand, fil |
const Git = require('nodegit'); | |
const CLIEngine = require('eslint').CLIEngine; | |
/** | |
* Usage: node lint_modified_lines.js | |
* | |
* This script: | |
* 1. Determines the files and lines that have been added or changed compared to the master branch. | |
* 2. Runs eslint. | |
* 3. Filters the lint results to only the lines that have been added or changed. |
/* tslint:disable:no-console */ | |
/** | |
* Example usage: ts-node --project ./tsconfig-tsnode.json ./test_encapsulation.ts <some-file.ts> | |
* | |
* Example tsconfig-tsnode.json is at the bottom of this file | |
*/ | |
import { ClassDeclaration, Project, PropertyDeclaration, ReferencedSymbol, ReferenceEntry, SourceFile } from 'ts-morph'; | |
function main(fileNameOrPath: string): void { |
import { HttpHeaders, HttpRequest } from '@angular/common/http'; | |
import { isNullOrUndefined } from '../../util/misc-util'; | |
import { HttpClientHeaders, HttpClientOptions } from './http-client-options'; | |
/** | |
* Unfortunately Angular does not provide a way to pass metadata/configs into interceptors so | |
* we have to do it ourselves. | |
* | |
* https://github.com/angular/angular/issues/18155 | |
*/ |
import { HttpRequest } from '@angular/common/http'; | |
import { isNullOrUndefined } from '../../util/misc-util'; | |
import { isPositiveInteger } from '../../util/num-util'; | |
import { InterceptorRequestConfigSerializer, PullInterceptorConfigResult } from '../entities/interceptor-request-config-serializer'; | |
import { HttpClientOptions } from '../entities/http-client-options'; | |
export interface ErrorNotificationInterceptorConfig { | |
ignoredResStatusCodes: number[]; | |
} |
// <project_root>/e2e/protractorDownloads/protractor-download-helper.ts | |
import { browser } from 'protractor'; | |
const fs = require('fs'); | |
const path = require('path'); | |
export class ProtractorDownloadHelper { | |
private readonly maxReadWaitTime = 10000; // 10 seconds |
import { Injectable } from '@angular/core'; | |
import { | |
EMPTY, | |
merge as observableMerge, | |
Observable, | |
of as observableOf, | |
Subject, | |
timer as observableTimer | |
} from 'rxjs'; | |
import { delay, expand, map, takeUntil, takeWhile } from 'rxjs/operators'; |
import { defer, Observable, ObservableInput } from 'rxjs'; | |
import { finalize } from 'rxjs/operators'; | |
/** | |
* This is an RxJS operator that keeps a running counter of the number of active requests. | |
* This can be used to show a spinner for the first of a series of requests, and hide the spinner | |
* once all requests in the series are complete. | |
* | |
* For example: | |
* const activeRequestMonitor: ActiveRequestMonitor = monitorActiveRequests({ |
/** | |
* Example: | |
* | |
* const builder = new XPathBuilder(); | |
* const xpathStr = builder | |
* .addDescendant({ nodeName: 'carbon-dropdown' }) | |
* .addDescendant({ className: 'bx--label', innerText: 'AWS Region' }) | |
* .addAncestor({ nodeName: 'carbon-dropdown' }) | |
* .build(); | |
* |