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'
| // <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 { 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[]; | |
| } |
| 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 | |
| */ |
| /* 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 { |
| 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. |
| 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 { rxObserver } = require('api/v0.3'); | |
| const { of, timer } = require('rxjs'); | |
| const { delay, expand, takeWhile, map } = require('rxjs/operators'); | |
| const sessionDuration = 9; | |
| const warningAmount = 7; | |
| const expireEpoch = Date.now() + sessionDuration | |
| const warningEpoch = expireEpoch - warningAmount; |
| import { Observable, BehaviorSubject, Subject } from 'rxjs'; | |
| export enum StoreState { | |
| INIT, | |
| LOADING, | |
| READY | |
| } | |
| interface StoreInterface<T> { | |
| value$: Observable<T>; |
| import { CurrencyPipe } from '@angular/common'; | |
| import { Pipe, PipeTransform } from '@angular/core'; | |
| @Pipe({name: 'appCurrency'}) | |
| export class I18NCurrencyPipe extends CurrencyPipe implements PipeTransform { | |
| constructor() { | |
| // NOTE: This seemingly doesn't change anything, but is required. | |
| super('en'); | |
| } |