new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
import { Operator } from '../Operator';
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { Observable } from '../Observable';
|
||||
import { OperatorFunction, MonoTypeOperatorFunction, TeardownLogic } from '../types';
|
||||
|
||||
/* tslint:disable:max-line-length */
|
||||
export function filter<T, S extends T>(predicate: (value: T, index: number) => value is S,
|
||||
thisArg?: any): OperatorFunction<T, S>;
|
||||
export function filter<T>(predicate: (value: T, index: number) => boolean,
|
||||
thisArg?: any): MonoTypeOperatorFunction<T>;
|
||||
/* tslint:enable:max-line-length */
|
||||
|
||||
/**
|
||||
* Filter items emitted by the source Observable by only emitting those that
|
||||
* satisfy a specified predicate.
|
||||
*
|
||||
* <span class="informal">Like
|
||||
* [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),
|
||||
* it only emits a value from the source if it passes a criterion function.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* Similar to the well-known `Array.prototype.filter` method, this operator
|
||||
* takes values from the source Observable, passes them through a `predicate`
|
||||
* function and only emits those values that yielded `true`.
|
||||
*
|
||||
* ## Example
|
||||
* Emit only click events whose target was a DIV element
|
||||
* ```ts
|
||||
* import { fromEvent } from 'rxjs';
|
||||
* import { filter } from 'rxjs/operators';
|
||||
*
|
||||
* const clicks = fromEvent(document, 'click');
|
||||
* const clicksOnDivs = clicks.pipe(filter(ev => ev.target.tagName === 'DIV'));
|
||||
* clicksOnDivs.subscribe(x => console.log(x));
|
||||
* ```
|
||||
*
|
||||
* @see {@link distinct}
|
||||
* @see {@link distinctUntilChanged}
|
||||
* @see {@link distinctUntilKeyChanged}
|
||||
* @see {@link ignoreElements}
|
||||
* @see {@link partition}
|
||||
* @see {@link skip}
|
||||
*
|
||||
* @param {function(value: T, index: number): boolean} predicate A function that
|
||||
* evaluates each value emitted by the source Observable. If it returns `true`,
|
||||
* the value is emitted, if `false` the value is not passed to the output
|
||||
* Observable. The `index` parameter is the number `i` for the i-th source
|
||||
* emission that has happened since the subscription, starting from the number
|
||||
* `0`.
|
||||
* @param {any} [thisArg] An optional argument to determine the value of `this`
|
||||
* in the `predicate` function.
|
||||
* @return {Observable} An Observable of values from the source that were
|
||||
* allowed by the `predicate` function.
|
||||
* @method filter
|
||||
* @owner Observable
|
||||
*/
|
||||
export function filter<T>(predicate: (value: T, index: number) => boolean,
|
||||
thisArg?: any): MonoTypeOperatorFunction<T> {
|
||||
return function filterOperatorFunction(source: Observable<T>): Observable<T> {
|
||||
return source.lift(new FilterOperator(predicate, thisArg));
|
||||
};
|
||||
}
|
||||
|
||||
class FilterOperator<T> implements Operator<T, T> {
|
||||
constructor(private predicate: (value: T, index: number) => boolean,
|
||||
private thisArg?: any) {
|
||||
}
|
||||
|
||||
call(subscriber: Subscriber<T>, source: any): TeardownLogic {
|
||||
return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We need this JSDoc comment for affecting ESDoc.
|
||||
* @ignore
|
||||
* @extends {Ignored}
|
||||
*/
|
||||
class FilterSubscriber<T> extends Subscriber<T> {
|
||||
|
||||
count: number = 0;
|
||||
|
||||
constructor(destination: Subscriber<T>,
|
||||
private predicate: (value: T, index: number) => boolean,
|
||||
private thisArg: any) {
|
||||
super(destination);
|
||||
}
|
||||
|
||||
// the try catch block below is left specifically for
|
||||
// optimization and perf reasons. a tryCatcher is not necessary here.
|
||||
protected _next(value: T) {
|
||||
let result: any;
|
||||
try {
|
||||
result = this.predicate.call(this.thisArg, value, this.count++);
|
||||
} catch (err) {
|
||||
this.destination.error(err);
|
||||
return;
|
||||
}
|
||||
if (result) {
|
||||
this.destination.next(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ObjectUnsubscribedError.js","sources":["../../src/internal/util/ObjectUnsubscribedError.ts"],"names":[],"mappings":";;AAOA,IAAM,2BAA2B,GAAG,CAAC;IACnC,SAAS,2BAA2B;QAClC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,qBAAqB,CAAC;QACrC,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,2BAA2B,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAEvE,OAAO,2BAA2B,CAAC;AACrC,CAAC,CAAC,EAAE,CAAC;AAWQ,QAAA,uBAAuB,GAAgC,2BAAkC,CAAC"}
|
||||
@@ -0,0 +1,225 @@
|
||||
import { Operator } from '../Operator';
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { Observable } from '../Observable';
|
||||
import { Subscription } from '../Subscription';
|
||||
import { OuterSubscriber } from '../OuterSubscriber';
|
||||
import { InnerSubscriber } from '../InnerSubscriber';
|
||||
import { subscribeToResult } from '../util/subscribeToResult';
|
||||
import { MonoTypeOperatorFunction, TeardownLogic } from '../types';
|
||||
|
||||
/* tslint:disable:max-line-length */
|
||||
/** @deprecated In future versions, empty notifiers will no longer re-emit the source value on the output observable. */
|
||||
export function delayWhen<T>(delayDurationSelector: (value: T, index: number) => Observable<never>, subscriptionDelay?: Observable<any>): MonoTypeOperatorFunction<T>;
|
||||
export function delayWhen<T>(delayDurationSelector: (value: T, index: number) => Observable<any>, subscriptionDelay?: Observable<any>): MonoTypeOperatorFunction<T>;
|
||||
/* tslint:disable:max-line-length */
|
||||
|
||||
/**
|
||||
* Delays the emission of items from the source Observable by a given time span
|
||||
* determined by the emissions of another Observable.
|
||||
*
|
||||
* <span class="informal">It's like {@link delay}, but the time span of the
|
||||
* delay duration is determined by a second Observable.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* `delayWhen` time shifts each emitted value from the source Observable by a
|
||||
* time span determined by another Observable. When the source emits a value,
|
||||
* the `delayDurationSelector` function is called with the source value as
|
||||
* argument, and should return an Observable, called the "duration" Observable.
|
||||
* The source value is emitted on the output Observable only when the duration
|
||||
* Observable emits a value or completes.
|
||||
* The completion of the notifier triggering the emission of the source value
|
||||
* is deprecated behavior and will be removed in future versions.
|
||||
*
|
||||
* Optionally, `delayWhen` takes a second argument, `subscriptionDelay`, which
|
||||
* is an Observable. When `subscriptionDelay` emits its first value or
|
||||
* completes, the source Observable is subscribed to and starts behaving like
|
||||
* described in the previous paragraph. If `subscriptionDelay` is not provided,
|
||||
* `delayWhen` will subscribe to the source Observable as soon as the output
|
||||
* Observable is subscribed.
|
||||
*
|
||||
* ## Example
|
||||
* Delay each click by a random amount of time, between 0 and 5 seconds
|
||||
* ```ts
|
||||
* import { fromEvent, interval } from 'rxjs';
|
||||
* import { delayWhen } from 'rxjs/operators';
|
||||
*
|
||||
* const clicks = fromEvent(document, 'click');
|
||||
* const delayedClicks = clicks.pipe(
|
||||
* delayWhen(event => interval(Math.random() * 5000)),
|
||||
* );
|
||||
* delayedClicks.subscribe(x => console.log(x));
|
||||
* ```
|
||||
*
|
||||
* @see {@link delay}
|
||||
* @see {@link throttle}
|
||||
* @see {@link throttleTime}
|
||||
* @see {@link debounce}
|
||||
* @see {@link debounceTime}
|
||||
* @see {@link sample}
|
||||
* @see {@link sampleTime}
|
||||
* @see {@link audit}
|
||||
* @see {@link auditTime}
|
||||
*
|
||||
* @param {function(value: T, index: number): Observable} delayDurationSelector A function that
|
||||
* returns an Observable for each value emitted by the source Observable, which
|
||||
* is then used to delay the emission of that item on the output Observable
|
||||
* until the Observable returned from this function emits a value.
|
||||
* @param {Observable} subscriptionDelay An Observable that triggers the
|
||||
* subscription to the source Observable once it emits any value.
|
||||
* @return {Observable} An Observable that delays the emissions of the source
|
||||
* Observable by an amount of time specified by the Observable returned by
|
||||
* `delayDurationSelector`.
|
||||
* @method delayWhen
|
||||
* @owner Observable
|
||||
*/
|
||||
export function delayWhen<T>(delayDurationSelector: (value: T, index: number) => Observable<any>,
|
||||
subscriptionDelay?: Observable<any>): MonoTypeOperatorFunction<T> {
|
||||
if (subscriptionDelay) {
|
||||
return (source: Observable<T>) =>
|
||||
new SubscriptionDelayObservable(source, subscriptionDelay)
|
||||
.lift(new DelayWhenOperator(delayDurationSelector));
|
||||
}
|
||||
return (source: Observable<T>) => source.lift(new DelayWhenOperator(delayDurationSelector));
|
||||
}
|
||||
|
||||
class DelayWhenOperator<T> implements Operator<T, T> {
|
||||
constructor(private delayDurationSelector: (value: T, index: number) => Observable<any>) {
|
||||
}
|
||||
|
||||
call(subscriber: Subscriber<T>, source: any): TeardownLogic {
|
||||
return source.subscribe(new DelayWhenSubscriber(subscriber, this.delayDurationSelector));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We need this JSDoc comment for affecting ESDoc.
|
||||
* @ignore
|
||||
* @extends {Ignored}
|
||||
*/
|
||||
class DelayWhenSubscriber<T, R> extends OuterSubscriber<T, R> {
|
||||
private completed: boolean = false;
|
||||
private delayNotifierSubscriptions: Array<Subscription> = [];
|
||||
private index: number = 0;
|
||||
|
||||
constructor(destination: Subscriber<T>,
|
||||
private delayDurationSelector: (value: T, index: number) => Observable<any>) {
|
||||
super(destination);
|
||||
}
|
||||
|
||||
notifyNext(outerValue: T, _innerValue: any,
|
||||
_outerIndex: number, _innerIndex: number,
|
||||
innerSub: InnerSubscriber<T, R>): void {
|
||||
this.destination.next!(outerValue);
|
||||
this.removeSubscription(innerSub);
|
||||
this.tryComplete();
|
||||
}
|
||||
|
||||
notifyError(error: any, innerSub: InnerSubscriber<T, R>): void {
|
||||
this._error(error);
|
||||
}
|
||||
|
||||
notifyComplete(innerSub: InnerSubscriber<T, R>): void {
|
||||
const value = this.removeSubscription(innerSub);
|
||||
if (value) {
|
||||
this.destination.next!(value);
|
||||
}
|
||||
this.tryComplete();
|
||||
}
|
||||
|
||||
protected _next(value: T): void {
|
||||
const index = this.index++;
|
||||
try {
|
||||
const delayNotifier = this.delayDurationSelector(value, index);
|
||||
if (delayNotifier) {
|
||||
this.tryDelay(delayNotifier, value);
|
||||
}
|
||||
} catch (err) {
|
||||
this.destination.error!(err);
|
||||
}
|
||||
}
|
||||
|
||||
protected _complete(): void {
|
||||
this.completed = true;
|
||||
this.tryComplete();
|
||||
this.unsubscribe();
|
||||
}
|
||||
|
||||
private removeSubscription(subscription: InnerSubscriber<T, R>): T {
|
||||
subscription.unsubscribe();
|
||||
|
||||
const subscriptionIdx = this.delayNotifierSubscriptions.indexOf(subscription);
|
||||
if (subscriptionIdx !== -1) {
|
||||
this.delayNotifierSubscriptions.splice(subscriptionIdx, 1);
|
||||
}
|
||||
|
||||
return subscription.outerValue;
|
||||
}
|
||||
|
||||
private tryDelay(delayNotifier: Observable<any>, value: T): void {
|
||||
const notifierSubscription = subscribeToResult(this, delayNotifier, value);
|
||||
|
||||
if (notifierSubscription && !notifierSubscription.closed) {
|
||||
const destination = this.destination as Subscription;
|
||||
destination.add(notifierSubscription);
|
||||
this.delayNotifierSubscriptions.push(notifierSubscription);
|
||||
}
|
||||
}
|
||||
|
||||
private tryComplete(): void {
|
||||
if (this.completed && this.delayNotifierSubscriptions.length === 0) {
|
||||
this.destination.complete!();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We need this JSDoc comment for affecting ESDoc.
|
||||
* @ignore
|
||||
* @extends {Ignored}
|
||||
*/
|
||||
class SubscriptionDelayObservable<T> extends Observable<T> {
|
||||
constructor(public source: Observable<T>, private subscriptionDelay: Observable<any>) {
|
||||
super();
|
||||
}
|
||||
|
||||
/** @deprecated This is an internal implementation detail, do not use. */
|
||||
_subscribe(subscriber: Subscriber<T>) {
|
||||
this.subscriptionDelay.subscribe(new SubscriptionDelaySubscriber(subscriber, this.source));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We need this JSDoc comment for affecting ESDoc.
|
||||
* @ignore
|
||||
* @extends {Ignored}
|
||||
*/
|
||||
class SubscriptionDelaySubscriber<T> extends Subscriber<T> {
|
||||
private sourceSubscribed: boolean = false;
|
||||
|
||||
constructor(private parent: Subscriber<T>, private source: Observable<T>) {
|
||||
super();
|
||||
}
|
||||
|
||||
protected _next(unused: any) {
|
||||
this.subscribeToSource();
|
||||
}
|
||||
|
||||
protected _error(err: any) {
|
||||
this.unsubscribe();
|
||||
this.parent.error(err);
|
||||
}
|
||||
|
||||
protected _complete() {
|
||||
this.unsubscribe();
|
||||
this.subscribeToSource();
|
||||
}
|
||||
|
||||
private subscribeToSource(): void {
|
||||
if (!this.sourceSubscribed) {
|
||||
this.sourceSubscribed = true;
|
||||
this.unsubscribe();
|
||||
this.source.subscribe(this.parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
# figures [](https://travis-ci.org/sindresorhus/figures)
|
||||
|
||||
> Unicode symbols with Windows CMD fallbacks
|
||||
|
||||
[](index.js)
|
||||
|
||||
[*and more...*](index.js)
|
||||
|
||||
Windows CMD only supports a [limited character set](http://en.wikipedia.org/wiki/Code_page_437).
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install figures
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
See the [source](index.js) for supported symbols.
|
||||
|
||||
```js
|
||||
const figures = require('figures');
|
||||
|
||||
console.log(figures('✔︎ check'));
|
||||
// On non-Windows OSes: ✔︎ check
|
||||
// On Windows: √ check
|
||||
|
||||
console.log(figures.tick);
|
||||
// On non-Windows OSes: ✔︎
|
||||
// On Windows: √
|
||||
|
||||
console.log(figures.main.tick);
|
||||
// On all OSes: ✔︎
|
||||
|
||||
console.log(figures.windows.tick);
|
||||
// On all OSes: √
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### figures(string)
|
||||
|
||||
Returns the input with replaced fallback Unicode symbols on Windows.
|
||||
|
||||
All the below [figures](#figures) are attached to the main export as shown in the example above.
|
||||
|
||||
#### string
|
||||
|
||||
Type: `string`
|
||||
|
||||
String where the Unicode symbols will be replaced with fallback symbols depending on the OS.
|
||||
|
||||
### figures.main
|
||||
|
||||
Symbols to use when not running on Windows.
|
||||
|
||||
### figures.windows
|
||||
|
||||
Symbols to use when running on Windows.
|
||||
|
||||
|
||||
## Figures
|
||||
|
||||
| Name | Non-Windows | Windows |
|
||||
| ------------------ | :---------: | :-----: |
|
||||
| tick | ✔ | √ |
|
||||
| cross | ✖ | × |
|
||||
| star | ★ | * |
|
||||
| square | ▇ | █ |
|
||||
| squareSmall | ◻ | [ ] |
|
||||
| squareSmallFilled | ◼ | [█] |
|
||||
| play | ▶ | ► |
|
||||
| circle | ◯ | ( ) |
|
||||
| circleFilled | ◉ | (*) |
|
||||
| circleDotted | ◌ | ( ) |
|
||||
| circleDouble | ◎ | ( ) |
|
||||
| circleCircle | ⓞ | (○) |
|
||||
| circleCross | ⓧ | (×) |
|
||||
| circlePipe | Ⓘ | (│) |
|
||||
| circleQuestionMark | ?⃝ | (?) |
|
||||
| bullet | ● | * |
|
||||
| dot | ․ | . |
|
||||
| line | ─ | ─ |
|
||||
| ellipsis | … | ... |
|
||||
| pointer | ❯ | > |
|
||||
| pointerSmall | › | » |
|
||||
| info | ℹ | i |
|
||||
| warning | ⚠ | ‼ |
|
||||
| hamburger | ☰ | ≡ |
|
||||
| smiley | ㋡ | ☺ |
|
||||
| mustache | ෴ | ┌─┐ |
|
||||
| heart | ♥ | ♥ |
|
||||
| nodejs | ⬢ | ♦ |
|
||||
| arrowUp | ↑ | ↑ |
|
||||
| arrowDown | ↓ | ↓ |
|
||||
| arrowLeft | ← | ← |
|
||||
| arrowRight | → | → |
|
||||
| radioOn | ◉ | (*) |
|
||||
| radioOff | ◯ | ( ) |
|
||||
| checkboxOn | ☒ | [×] |
|
||||
| checkboxOff | ☐ | [ ] |
|
||||
| checkboxCircleOn | ⓧ | (×) |
|
||||
| checkboxCircleOff | Ⓘ | ( ) |
|
||||
| questionMarkPrefix | ?⃝ | ? |
|
||||
| oneHalf | ½ | 1/2 |
|
||||
| oneThird | ⅓ | 1/3 |
|
||||
| oneQuarter | ¼ | 1/4 |
|
||||
| oneFifth | ⅕ | 1/5 |
|
||||
| oneSixth | ⅙ | 1/6 |
|
||||
| oneSeventh | ⅐ | 1/7 |
|
||||
| oneEighth | ⅛ | 1/8 |
|
||||
| oneNinth | ⅑ | 1/9 |
|
||||
| oneTenth | ⅒ | 1/10 |
|
||||
| twoThirds | ⅔ | 2/3 |
|
||||
| twoFifths | ⅖ | 2/5 |
|
||||
| threeQuarters | ¾ | 3/4 |
|
||||
| threeFifths | ⅗ | 3/5 |
|
||||
| threeEighths | ⅜ | 3/8 |
|
||||
| fourFifths | ⅘ | 4/5 |
|
||||
| fiveSixths | ⅚ | 5/6 |
|
||||
| fiveEighths | ⅝ | 5/8 |
|
||||
| sevenEighths | ⅞ | 7/8 |
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [log-symbols](https://github.com/sindresorhus/log-symbols) - Colored symbols for various log levels
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-figures?utm_source=npm-figures&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
||||
@@ -0,0 +1 @@
|
||||
export declare function isObject(x: any): x is Object;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ArgumentOutOfRangeError.js","sources":["../../../src/internal/util/ArgumentOutOfRangeError.ts"],"names":[],"mappings":"AAOA,IAAM,2BAA2B,GAAG,CAAC;IACnC,SAAS,2BAA2B;QAClC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,uBAAuB,CAAC;QACvC,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,2BAA2B,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAEvE,OAAO,2BAA2B,CAAC;AACrC,CAAC,CAAC,EAAE,CAAC;AAYL,MAAM,CAAC,IAAM,uBAAuB,GAAgC,2BAAkC,CAAC"}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
||||
export var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });
|
||||
//# sourceMappingURL=isArrayLike.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"publishBehavior.js","sources":["../../src/add/operator/publishBehavior.ts"],"names":[],"mappings":";;AAAA,oDAAkD"}
|
||||
@@ -0,0 +1,28 @@
|
||||
let Declaration = require('../declaration')
|
||||
|
||||
class GridRowAlign extends Declaration {
|
||||
/**
|
||||
* Do not prefix flexbox values
|
||||
*/
|
||||
check (decl) {
|
||||
return !decl.value.includes('flex-') && decl.value !== 'baseline'
|
||||
}
|
||||
|
||||
/**
|
||||
* Change property name for IE
|
||||
*/
|
||||
prefixed (prop, prefix) {
|
||||
return prefix + 'grid-row-align'
|
||||
}
|
||||
|
||||
/**
|
||||
* Change IE property back
|
||||
*/
|
||||
normalize () {
|
||||
return 'align-self'
|
||||
}
|
||||
}
|
||||
|
||||
GridRowAlign.names = ['grid-row-align']
|
||||
|
||||
module.exports = GridRowAlign
|
||||
@@ -0,0 +1,23 @@
|
||||
import Node from './shared/Node';
|
||||
import Attribute from './Attribute';
|
||||
import Binding from './Binding';
|
||||
import EventHandler from './EventHandler';
|
||||
import Expression from './shared/Expression';
|
||||
import Component from '../Component';
|
||||
import Let from './Let';
|
||||
import TemplateScope from './shared/TemplateScope';
|
||||
import { INode } from './interfaces';
|
||||
import { TemplateNode } from '../../interfaces';
|
||||
export default class InlineComponent extends Node {
|
||||
type: 'InlineComponent';
|
||||
name: string;
|
||||
expression: Expression;
|
||||
attributes: Attribute[];
|
||||
bindings: Binding[];
|
||||
handlers: EventHandler[];
|
||||
lets: Let[];
|
||||
children: INode[];
|
||||
scope: TemplateScope;
|
||||
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
|
||||
get slot_template_name(): string;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var ConnectableObservable_1 = require("../observable/ConnectableObservable");
|
||||
function multicast(subjectOrSubjectFactory, selector) {
|
||||
return function multicastOperatorFunction(source) {
|
||||
var subjectFactory;
|
||||
if (typeof subjectOrSubjectFactory === 'function') {
|
||||
subjectFactory = subjectOrSubjectFactory;
|
||||
}
|
||||
else {
|
||||
subjectFactory = function subjectFactory() {
|
||||
return subjectOrSubjectFactory;
|
||||
};
|
||||
}
|
||||
if (typeof selector === 'function') {
|
||||
return source.lift(new MulticastOperator(subjectFactory, selector));
|
||||
}
|
||||
var connectable = Object.create(source, ConnectableObservable_1.connectableObservableDescriptor);
|
||||
connectable.source = source;
|
||||
connectable.subjectFactory = subjectFactory;
|
||||
return connectable;
|
||||
};
|
||||
}
|
||||
exports.multicast = multicast;
|
||||
var MulticastOperator = (function () {
|
||||
function MulticastOperator(subjectFactory, selector) {
|
||||
this.subjectFactory = subjectFactory;
|
||||
this.selector = selector;
|
||||
}
|
||||
MulticastOperator.prototype.call = function (subscriber, source) {
|
||||
var selector = this.selector;
|
||||
var subject = this.subjectFactory();
|
||||
var subscription = selector(subject).subscribe(subscriber);
|
||||
subscription.add(source.subscribe(subject));
|
||||
return subscription;
|
||||
};
|
||||
return MulticastOperator;
|
||||
}());
|
||||
exports.MulticastOperator = MulticastOperator;
|
||||
//# sourceMappingURL=multicast.js.map
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"1":"Y Z a b c d f g h i j k l m n o p q r s D t","2":"C K L H M N O P Q","257":"R S T U V W X"},C:{"1":"2 3 4 5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","2":"0 1 CC tB I u J E F G A B C K L H M N O v w x y z DC EC"},D:{"1":"Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","2":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q","257":"R S T U V W X"},E:{"1":"L H 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","2":"I u J E F G A B C K GC zB HC IC JC KC 0B qB rB"},F:{"1":"oB pB P Q R wB S T U V W X Y Z a b c d","2":"0 1 2 3 4 5 6 7 8 9 G B C H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB OC PC QC RC qB 9B SC rB","257":"gB hB iB jB kB e lB mB nB"},G:{"1":"kC lC mC 2B 3B 4B 5B sB 6B 7B 8B","132":"F zB TC AC UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC"},H:{"2":"nC"},I:{"1":"D","2":"tB I oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"1":"e","2":"A B C qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"2":"uC"},P:{"1":"4C sB 5C 6C 7C","2":"I vC wC xC yC zC 0B 0C 1C","257":"2C 3C"},Q:{"2":"1B"},R:{"1":"8C"},S:{"1":"9C"}},B:4,C:"CSS3 image-orientation"};
|
||||
@@ -0,0 +1,434 @@
|
||||
"use strict";
|
||||
/// <reference lib="es2018"/>
|
||||
/// <reference lib="dom"/>
|
||||
/// <reference types="node"/>
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const typedArrayTypeNames = [
|
||||
'Int8Array',
|
||||
'Uint8Array',
|
||||
'Uint8ClampedArray',
|
||||
'Int16Array',
|
||||
'Uint16Array',
|
||||
'Int32Array',
|
||||
'Uint32Array',
|
||||
'Float32Array',
|
||||
'Float64Array',
|
||||
'BigInt64Array',
|
||||
'BigUint64Array'
|
||||
];
|
||||
function isTypedArrayName(name) {
|
||||
return typedArrayTypeNames.includes(name);
|
||||
}
|
||||
const objectTypeNames = [
|
||||
'Function',
|
||||
'Generator',
|
||||
'AsyncGenerator',
|
||||
'GeneratorFunction',
|
||||
'AsyncGeneratorFunction',
|
||||
'AsyncFunction',
|
||||
'Observable',
|
||||
'Array',
|
||||
'Buffer',
|
||||
'Blob',
|
||||
'Object',
|
||||
'RegExp',
|
||||
'Date',
|
||||
'Error',
|
||||
'Map',
|
||||
'Set',
|
||||
'WeakMap',
|
||||
'WeakSet',
|
||||
'ArrayBuffer',
|
||||
'SharedArrayBuffer',
|
||||
'DataView',
|
||||
'Promise',
|
||||
'URL',
|
||||
'FormData',
|
||||
'URLSearchParams',
|
||||
'HTMLElement',
|
||||
...typedArrayTypeNames
|
||||
];
|
||||
function isObjectTypeName(name) {
|
||||
return objectTypeNames.includes(name);
|
||||
}
|
||||
const primitiveTypeNames = [
|
||||
'null',
|
||||
'undefined',
|
||||
'string',
|
||||
'number',
|
||||
'bigint',
|
||||
'boolean',
|
||||
'symbol'
|
||||
];
|
||||
function isPrimitiveTypeName(name) {
|
||||
return primitiveTypeNames.includes(name);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
function isOfType(type) {
|
||||
return (value) => typeof value === type;
|
||||
}
|
||||
const { toString } = Object.prototype;
|
||||
const getObjectType = (value) => {
|
||||
const objectTypeName = toString.call(value).slice(8, -1);
|
||||
if (/HTML\w+Element/.test(objectTypeName) && is.domElement(value)) {
|
||||
return 'HTMLElement';
|
||||
}
|
||||
if (isObjectTypeName(objectTypeName)) {
|
||||
return objectTypeName;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
const isObjectOfType = (type) => (value) => getObjectType(value) === type;
|
||||
function is(value) {
|
||||
if (value === null) {
|
||||
return 'null';
|
||||
}
|
||||
switch (typeof value) {
|
||||
case 'undefined':
|
||||
return 'undefined';
|
||||
case 'string':
|
||||
return 'string';
|
||||
case 'number':
|
||||
return 'number';
|
||||
case 'boolean':
|
||||
return 'boolean';
|
||||
case 'function':
|
||||
return 'Function';
|
||||
case 'bigint':
|
||||
return 'bigint';
|
||||
case 'symbol':
|
||||
return 'symbol';
|
||||
default:
|
||||
}
|
||||
if (is.observable(value)) {
|
||||
return 'Observable';
|
||||
}
|
||||
if (is.array(value)) {
|
||||
return 'Array';
|
||||
}
|
||||
if (is.buffer(value)) {
|
||||
return 'Buffer';
|
||||
}
|
||||
const tagType = getObjectType(value);
|
||||
if (tagType) {
|
||||
return tagType;
|
||||
}
|
||||
if (value instanceof String || value instanceof Boolean || value instanceof Number) {
|
||||
throw new TypeError('Please don\'t use object wrappers for primitive types');
|
||||
}
|
||||
return 'Object';
|
||||
}
|
||||
is.undefined = isOfType('undefined');
|
||||
is.string = isOfType('string');
|
||||
const isNumberType = isOfType('number');
|
||||
is.number = (value) => isNumberType(value) && !is.nan(value);
|
||||
is.bigint = isOfType('bigint');
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
is.function_ = isOfType('function');
|
||||
is.null_ = (value) => value === null;
|
||||
is.class_ = (value) => is.function_(value) && value.toString().startsWith('class ');
|
||||
is.boolean = (value) => value === true || value === false;
|
||||
is.symbol = isOfType('symbol');
|
||||
is.numericString = (value) => is.string(value) && !is.emptyStringOrWhitespace(value) && !Number.isNaN(Number(value));
|
||||
is.array = (value, assertion) => {
|
||||
if (!Array.isArray(value)) {
|
||||
return false;
|
||||
}
|
||||
if (!is.function_(assertion)) {
|
||||
return true;
|
||||
}
|
||||
return value.every(assertion);
|
||||
};
|
||||
is.buffer = (value) => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = value) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.isBuffer) === null || _c === void 0 ? void 0 : _c.call(_b, value)) !== null && _d !== void 0 ? _d : false; };
|
||||
is.blob = (value) => isObjectOfType('Blob')(value);
|
||||
is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value);
|
||||
is.object = (value) => !is.null_(value) && (typeof value === 'object' || is.function_(value));
|
||||
is.iterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.iterator]); };
|
||||
is.asyncIterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.asyncIterator]); };
|
||||
is.generator = (value) => { var _a, _b; return is.iterable(value) && is.function_((_a = value) === null || _a === void 0 ? void 0 : _a.next) && is.function_((_b = value) === null || _b === void 0 ? void 0 : _b.throw); };
|
||||
is.asyncGenerator = (value) => is.asyncIterable(value) && is.function_(value.next) && is.function_(value.throw);
|
||||
is.nativePromise = (value) => isObjectOfType('Promise')(value);
|
||||
const hasPromiseAPI = (value) => {
|
||||
var _a, _b;
|
||||
return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a.then) &&
|
||||
is.function_((_b = value) === null || _b === void 0 ? void 0 : _b.catch);
|
||||
};
|
||||
is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value);
|
||||
is.generatorFunction = isObjectOfType('GeneratorFunction');
|
||||
is.asyncGeneratorFunction = (value) => getObjectType(value) === 'AsyncGeneratorFunction';
|
||||
is.asyncFunction = (value) => getObjectType(value) === 'AsyncFunction';
|
||||
// eslint-disable-next-line no-prototype-builtins, @typescript-eslint/ban-types
|
||||
is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype');
|
||||
is.regExp = isObjectOfType('RegExp');
|
||||
is.date = isObjectOfType('Date');
|
||||
is.error = isObjectOfType('Error');
|
||||
is.map = (value) => isObjectOfType('Map')(value);
|
||||
is.set = (value) => isObjectOfType('Set')(value);
|
||||
is.weakMap = (value) => isObjectOfType('WeakMap')(value);
|
||||
is.weakSet = (value) => isObjectOfType('WeakSet')(value);
|
||||
is.int8Array = isObjectOfType('Int8Array');
|
||||
is.uint8Array = isObjectOfType('Uint8Array');
|
||||
is.uint8ClampedArray = isObjectOfType('Uint8ClampedArray');
|
||||
is.int16Array = isObjectOfType('Int16Array');
|
||||
is.uint16Array = isObjectOfType('Uint16Array');
|
||||
is.int32Array = isObjectOfType('Int32Array');
|
||||
is.uint32Array = isObjectOfType('Uint32Array');
|
||||
is.float32Array = isObjectOfType('Float32Array');
|
||||
is.float64Array = isObjectOfType('Float64Array');
|
||||
is.bigInt64Array = isObjectOfType('BigInt64Array');
|
||||
is.bigUint64Array = isObjectOfType('BigUint64Array');
|
||||
is.arrayBuffer = isObjectOfType('ArrayBuffer');
|
||||
is.sharedArrayBuffer = isObjectOfType('SharedArrayBuffer');
|
||||
is.dataView = isObjectOfType('DataView');
|
||||
is.enumCase = (value, targetEnum) => Object.values(targetEnum).includes(value);
|
||||
is.directInstanceOf = (instance, class_) => Object.getPrototypeOf(instance) === class_.prototype;
|
||||
is.urlInstance = (value) => isObjectOfType('URL')(value);
|
||||
is.urlString = (value) => {
|
||||
if (!is.string(value)) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
new URL(value); // eslint-disable-line no-new
|
||||
return true;
|
||||
}
|
||||
catch (_a) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
// Example: `is.truthy = (value: unknown): value is (not false | not 0 | not '' | not undefined | not null) => Boolean(value);`
|
||||
is.truthy = (value) => Boolean(value);
|
||||
// Example: `is.falsy = (value: unknown): value is (not true | 0 | '' | undefined | null) => Boolean(value);`
|
||||
is.falsy = (value) => !value;
|
||||
is.nan = (value) => Number.isNaN(value);
|
||||
is.primitive = (value) => is.null_(value) || isPrimitiveTypeName(typeof value);
|
||||
is.integer = (value) => Number.isInteger(value);
|
||||
is.safeInteger = (value) => Number.isSafeInteger(value);
|
||||
is.plainObject = (value) => {
|
||||
// From: https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
|
||||
if (toString.call(value) !== '[object Object]') {
|
||||
return false;
|
||||
}
|
||||
const prototype = Object.getPrototypeOf(value);
|
||||
return prototype === null || prototype === Object.getPrototypeOf({});
|
||||
};
|
||||
is.typedArray = (value) => isTypedArrayName(getObjectType(value));
|
||||
const isValidLength = (value) => is.safeInteger(value) && value >= 0;
|
||||
is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length);
|
||||
is.inRange = (value, range) => {
|
||||
if (is.number(range)) {
|
||||
return value >= Math.min(0, range) && value <= Math.max(range, 0);
|
||||
}
|
||||
if (is.array(range) && range.length === 2) {
|
||||
return value >= Math.min(...range) && value <= Math.max(...range);
|
||||
}
|
||||
throw new TypeError(`Invalid range: ${JSON.stringify(range)}`);
|
||||
};
|
||||
const NODE_TYPE_ELEMENT = 1;
|
||||
const DOM_PROPERTIES_TO_CHECK = [
|
||||
'innerHTML',
|
||||
'ownerDocument',
|
||||
'style',
|
||||
'attributes',
|
||||
'nodeValue'
|
||||
];
|
||||
is.domElement = (value) => {
|
||||
return is.object(value) &&
|
||||
value.nodeType === NODE_TYPE_ELEMENT &&
|
||||
is.string(value.nodeName) &&
|
||||
!is.plainObject(value) &&
|
||||
DOM_PROPERTIES_TO_CHECK.every(property => property in value);
|
||||
};
|
||||
is.observable = (value) => {
|
||||
var _a, _b, _c, _d;
|
||||
if (!value) {
|
||||
return false;
|
||||
}
|
||||
// eslint-disable-next-line no-use-extend-native/no-use-extend-native
|
||||
if (value === ((_b = (_a = value)[Symbol.observable]) === null || _b === void 0 ? void 0 : _b.call(_a))) {
|
||||
return true;
|
||||
}
|
||||
if (value === ((_d = (_c = value)['@@observable']) === null || _d === void 0 ? void 0 : _d.call(_c))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
is.nodeStream = (value) => is.object(value) && is.function_(value.pipe) && !is.observable(value);
|
||||
is.infinite = (value) => value === Infinity || value === -Infinity;
|
||||
const isAbsoluteMod2 = (remainder) => (value) => is.integer(value) && Math.abs(value % 2) === remainder;
|
||||
is.evenInteger = isAbsoluteMod2(0);
|
||||
is.oddInteger = isAbsoluteMod2(1);
|
||||
is.emptyArray = (value) => is.array(value) && value.length === 0;
|
||||
is.nonEmptyArray = (value) => is.array(value) && value.length > 0;
|
||||
is.emptyString = (value) => is.string(value) && value.length === 0;
|
||||
const isWhiteSpaceString = (value) => is.string(value) && !/\S/.test(value);
|
||||
is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value);
|
||||
// TODO: Use `not ''` when the `not` operator is available.
|
||||
is.nonEmptyString = (value) => is.string(value) && value.length > 0;
|
||||
// TODO: Use `not ''` when the `not` operator is available.
|
||||
is.nonEmptyStringAndNotWhitespace = (value) => is.string(value) && !is.emptyStringOrWhitespace(value);
|
||||
is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0;
|
||||
// TODO: Use `not` operator here to remove `Map` and `Set` from type guard:
|
||||
// - https://github.com/Microsoft/TypeScript/pull/29317
|
||||
is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0;
|
||||
is.emptySet = (value) => is.set(value) && value.size === 0;
|
||||
is.nonEmptySet = (value) => is.set(value) && value.size > 0;
|
||||
is.emptyMap = (value) => is.map(value) && value.size === 0;
|
||||
is.nonEmptyMap = (value) => is.map(value) && value.size > 0;
|
||||
// `PropertyKey` is any value that can be used as an object key (string, number, or symbol)
|
||||
is.propertyKey = (value) => is.any([is.string, is.number, is.symbol], value);
|
||||
is.formData = (value) => isObjectOfType('FormData')(value);
|
||||
is.urlSearchParams = (value) => isObjectOfType('URLSearchParams')(value);
|
||||
const predicateOnArray = (method, predicate, values) => {
|
||||
if (!is.function_(predicate)) {
|
||||
throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`);
|
||||
}
|
||||
if (values.length === 0) {
|
||||
throw new TypeError('Invalid number of values');
|
||||
}
|
||||
return method.call(values, predicate);
|
||||
};
|
||||
is.any = (predicate, ...values) => {
|
||||
const predicates = is.array(predicate) ? predicate : [predicate];
|
||||
return predicates.some(singlePredicate => predicateOnArray(Array.prototype.some, singlePredicate, values));
|
||||
};
|
||||
is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values);
|
||||
const assertType = (condition, description, value, options = {}) => {
|
||||
if (!condition) {
|
||||
const { multipleValues } = options;
|
||||
const valuesMessage = multipleValues ?
|
||||
`received values of types ${[
|
||||
...new Set(value.map(singleValue => `\`${is(singleValue)}\``))
|
||||
].join(', ')}` :
|
||||
`received value of type \`${is(value)}\``;
|
||||
throw new TypeError(`Expected value which is \`${description}\`, ${valuesMessage}.`);
|
||||
}
|
||||
};
|
||||
exports.assert = {
|
||||
// Unknowns.
|
||||
undefined: (value) => assertType(is.undefined(value), 'undefined', value),
|
||||
string: (value) => assertType(is.string(value), 'string', value),
|
||||
number: (value) => assertType(is.number(value), 'number', value),
|
||||
bigint: (value) => assertType(is.bigint(value), 'bigint', value),
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
function_: (value) => assertType(is.function_(value), 'Function', value),
|
||||
null_: (value) => assertType(is.null_(value), 'null', value),
|
||||
class_: (value) => assertType(is.class_(value), "Class" /* class_ */, value),
|
||||
boolean: (value) => assertType(is.boolean(value), 'boolean', value),
|
||||
symbol: (value) => assertType(is.symbol(value), 'symbol', value),
|
||||
numericString: (value) => assertType(is.numericString(value), "string with a number" /* numericString */, value),
|
||||
array: (value, assertion) => {
|
||||
const assert = assertType;
|
||||
assert(is.array(value), 'Array', value);
|
||||
if (assertion) {
|
||||
value.forEach(assertion);
|
||||
}
|
||||
},
|
||||
buffer: (value) => assertType(is.buffer(value), 'Buffer', value),
|
||||
blob: (value) => assertType(is.blob(value), 'Blob', value),
|
||||
nullOrUndefined: (value) => assertType(is.nullOrUndefined(value), "null or undefined" /* nullOrUndefined */, value),
|
||||
object: (value) => assertType(is.object(value), 'Object', value),
|
||||
iterable: (value) => assertType(is.iterable(value), "Iterable" /* iterable */, value),
|
||||
asyncIterable: (value) => assertType(is.asyncIterable(value), "AsyncIterable" /* asyncIterable */, value),
|
||||
generator: (value) => assertType(is.generator(value), 'Generator', value),
|
||||
asyncGenerator: (value) => assertType(is.asyncGenerator(value), 'AsyncGenerator', value),
|
||||
nativePromise: (value) => assertType(is.nativePromise(value), "native Promise" /* nativePromise */, value),
|
||||
promise: (value) => assertType(is.promise(value), 'Promise', value),
|
||||
generatorFunction: (value) => assertType(is.generatorFunction(value), 'GeneratorFunction', value),
|
||||
asyncGeneratorFunction: (value) => assertType(is.asyncGeneratorFunction(value), 'AsyncGeneratorFunction', value),
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
asyncFunction: (value) => assertType(is.asyncFunction(value), 'AsyncFunction', value),
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
boundFunction: (value) => assertType(is.boundFunction(value), 'Function', value),
|
||||
regExp: (value) => assertType(is.regExp(value), 'RegExp', value),
|
||||
date: (value) => assertType(is.date(value), 'Date', value),
|
||||
error: (value) => assertType(is.error(value), 'Error', value),
|
||||
map: (value) => assertType(is.map(value), 'Map', value),
|
||||
set: (value) => assertType(is.set(value), 'Set', value),
|
||||
weakMap: (value) => assertType(is.weakMap(value), 'WeakMap', value),
|
||||
weakSet: (value) => assertType(is.weakSet(value), 'WeakSet', value),
|
||||
int8Array: (value) => assertType(is.int8Array(value), 'Int8Array', value),
|
||||
uint8Array: (value) => assertType(is.uint8Array(value), 'Uint8Array', value),
|
||||
uint8ClampedArray: (value) => assertType(is.uint8ClampedArray(value), 'Uint8ClampedArray', value),
|
||||
int16Array: (value) => assertType(is.int16Array(value), 'Int16Array', value),
|
||||
uint16Array: (value) => assertType(is.uint16Array(value), 'Uint16Array', value),
|
||||
int32Array: (value) => assertType(is.int32Array(value), 'Int32Array', value),
|
||||
uint32Array: (value) => assertType(is.uint32Array(value), 'Uint32Array', value),
|
||||
float32Array: (value) => assertType(is.float32Array(value), 'Float32Array', value),
|
||||
float64Array: (value) => assertType(is.float64Array(value), 'Float64Array', value),
|
||||
bigInt64Array: (value) => assertType(is.bigInt64Array(value), 'BigInt64Array', value),
|
||||
bigUint64Array: (value) => assertType(is.bigUint64Array(value), 'BigUint64Array', value),
|
||||
arrayBuffer: (value) => assertType(is.arrayBuffer(value), 'ArrayBuffer', value),
|
||||
sharedArrayBuffer: (value) => assertType(is.sharedArrayBuffer(value), 'SharedArrayBuffer', value),
|
||||
dataView: (value) => assertType(is.dataView(value), 'DataView', value),
|
||||
enumCase: (value, targetEnum) => assertType(is.enumCase(value, targetEnum), 'EnumCase', value),
|
||||
urlInstance: (value) => assertType(is.urlInstance(value), 'URL', value),
|
||||
urlString: (value) => assertType(is.urlString(value), "string with a URL" /* urlString */, value),
|
||||
truthy: (value) => assertType(is.truthy(value), "truthy" /* truthy */, value),
|
||||
falsy: (value) => assertType(is.falsy(value), "falsy" /* falsy */, value),
|
||||
nan: (value) => assertType(is.nan(value), "NaN" /* nan */, value),
|
||||
primitive: (value) => assertType(is.primitive(value), "primitive" /* primitive */, value),
|
||||
integer: (value) => assertType(is.integer(value), "integer" /* integer */, value),
|
||||
safeInteger: (value) => assertType(is.safeInteger(value), "integer" /* safeInteger */, value),
|
||||
plainObject: (value) => assertType(is.plainObject(value), "plain object" /* plainObject */, value),
|
||||
typedArray: (value) => assertType(is.typedArray(value), "TypedArray" /* typedArray */, value),
|
||||
arrayLike: (value) => assertType(is.arrayLike(value), "array-like" /* arrayLike */, value),
|
||||
domElement: (value) => assertType(is.domElement(value), "HTMLElement" /* domElement */, value),
|
||||
observable: (value) => assertType(is.observable(value), 'Observable', value),
|
||||
nodeStream: (value) => assertType(is.nodeStream(value), "Node.js Stream" /* nodeStream */, value),
|
||||
infinite: (value) => assertType(is.infinite(value), "infinite number" /* infinite */, value),
|
||||
emptyArray: (value) => assertType(is.emptyArray(value), "empty array" /* emptyArray */, value),
|
||||
nonEmptyArray: (value) => assertType(is.nonEmptyArray(value), "non-empty array" /* nonEmptyArray */, value),
|
||||
emptyString: (value) => assertType(is.emptyString(value), "empty string" /* emptyString */, value),
|
||||
emptyStringOrWhitespace: (value) => assertType(is.emptyStringOrWhitespace(value), "empty string or whitespace" /* emptyStringOrWhitespace */, value),
|
||||
nonEmptyString: (value) => assertType(is.nonEmptyString(value), "non-empty string" /* nonEmptyString */, value),
|
||||
nonEmptyStringAndNotWhitespace: (value) => assertType(is.nonEmptyStringAndNotWhitespace(value), "non-empty string and not whitespace" /* nonEmptyStringAndNotWhitespace */, value),
|
||||
emptyObject: (value) => assertType(is.emptyObject(value), "empty object" /* emptyObject */, value),
|
||||
nonEmptyObject: (value) => assertType(is.nonEmptyObject(value), "non-empty object" /* nonEmptyObject */, value),
|
||||
emptySet: (value) => assertType(is.emptySet(value), "empty set" /* emptySet */, value),
|
||||
nonEmptySet: (value) => assertType(is.nonEmptySet(value), "non-empty set" /* nonEmptySet */, value),
|
||||
emptyMap: (value) => assertType(is.emptyMap(value), "empty map" /* emptyMap */, value),
|
||||
nonEmptyMap: (value) => assertType(is.nonEmptyMap(value), "non-empty map" /* nonEmptyMap */, value),
|
||||
propertyKey: (value) => assertType(is.propertyKey(value), 'PropertyKey', value),
|
||||
formData: (value) => assertType(is.formData(value), 'FormData', value),
|
||||
urlSearchParams: (value) => assertType(is.urlSearchParams(value), 'URLSearchParams', value),
|
||||
// Numbers.
|
||||
evenInteger: (value) => assertType(is.evenInteger(value), "even integer" /* evenInteger */, value),
|
||||
oddInteger: (value) => assertType(is.oddInteger(value), "odd integer" /* oddInteger */, value),
|
||||
// Two arguments.
|
||||
directInstanceOf: (instance, class_) => assertType(is.directInstanceOf(instance, class_), "T" /* directInstanceOf */, instance),
|
||||
inRange: (value, range) => assertType(is.inRange(value, range), "in range" /* inRange */, value),
|
||||
// Variadic functions.
|
||||
any: (predicate, ...values) => {
|
||||
return assertType(is.any(predicate, ...values), "predicate returns truthy for any value" /* any */, values, { multipleValues: true });
|
||||
},
|
||||
all: (predicate, ...values) => assertType(is.all(predicate, ...values), "predicate returns truthy for all values" /* all */, values, { multipleValues: true })
|
||||
};
|
||||
// Some few keywords are reserved, but we'll populate them for Node.js users
|
||||
// See https://github.com/Microsoft/TypeScript/issues/2536
|
||||
Object.defineProperties(is, {
|
||||
class: {
|
||||
value: is.class_
|
||||
},
|
||||
function: {
|
||||
value: is.function_
|
||||
},
|
||||
null: {
|
||||
value: is.null_
|
||||
}
|
||||
});
|
||||
Object.defineProperties(exports.assert, {
|
||||
class: {
|
||||
value: exports.assert.class_
|
||||
},
|
||||
function: {
|
||||
value: exports.assert.function_
|
||||
},
|
||||
null: {
|
||||
value: exports.assert.null_
|
||||
}
|
||||
});
|
||||
exports.default = is;
|
||||
// For CommonJS default export support
|
||||
module.exports = is;
|
||||
module.exports.default = is;
|
||||
module.exports.assert = exports.assert;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pluck.js","sources":["../../../src/internal/operators/pluck.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AA6C5B,MAAM,UAAU,KAAK;IAAO,oBAAuB;SAAvB,UAAuB,EAAvB,qBAAuB,EAAvB,IAAuB;QAAvB,+BAAuB;;IACjD,IAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IACjC,IAAI,MAAM,KAAK,CAAC,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;KACxD;IACD,OAAO,UAAC,MAAqB,IAAK,OAAA,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,MAAa,CAAC,EAA/C,CAA+C,CAAC;AACpF,CAAC;AAED,SAAS,OAAO,CAAC,KAAe,EAAE,MAAc;IAC9C,IAAM,MAAM,GAAG,UAAC,CAAS;QACvB,IAAI,WAAW,GAAG,CAAC,CAAC;QACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;YAC/B,IAAM,CAAC,GAAG,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAClE,IAAI,CAAC,KAAK,KAAK,CAAC,EAAE;gBAChB,WAAW,GAAG,CAAC,CAAC;aACjB;iBAAM;gBACL,OAAO,SAAS,CAAC;aAClB;SACF;QACD,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
||||
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
Get the name of a Windows version from the release number: `5.1.2600` → `XP`.
|
||||
|
||||
@param release - By default, the current OS is used, but you can supply a custom release number, which is the output of [`os.release()`](https://nodejs.org/api/os.html#os_os_release).
|
||||
|
||||
Note: Most Windows Server versions cannot be detected based on the release number alone. There is runtime detection in place to work around this, but it will only be used if no argument is supplied, or the supplied argument matches `os.release()`.
|
||||
|
||||
@example
|
||||
```
|
||||
import * as os from 'os';
|
||||
import windowsRelease = require('windows-release');
|
||||
|
||||
// On a Windows XP system
|
||||
|
||||
windowsRelease();
|
||||
//=> 'XP'
|
||||
|
||||
os.release();
|
||||
//=> '5.1.2600'
|
||||
|
||||
windowsRelease(os.release());
|
||||
//=> 'XP'
|
||||
|
||||
windowsRelease('4.9.3000');
|
||||
//=> 'ME'
|
||||
```
|
||||
*/
|
||||
declare function windowsRelease(release?: string): string;
|
||||
|
||||
export = windowsRelease;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"1":"P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t","2":"C K L H M N O"},C:{"1":"TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","2":"0 1 2 3 4 5 6 7 8 9 CC tB I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB DC EC"},D:{"1":"XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","2":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},E:{"1":"C K L H qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","2":"I u J E F G A B GC zB HC IC JC KC 0B"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d","2":"0 1 2 3 4 5 6 7 8 9 G B C H M N O v w x y z AB BB CB DB EB FB GB HB IB JB OC PC QC RC qB 9B SC rB"},G:{"1":"dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B","2":"F zB TC AC UC VC WC XC YC ZC aC bC cC"},H:{"2":"nC"},I:{"1":"D","2":"tB I oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"1":"e","2":"A B C qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"uC"},P:{"1":"xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C","2":"I vC wC"},Q:{"1":"1B"},R:{"1":"8C"},S:{"2":"9C"}},B:2,C:"CSS caret-color"};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"F G A B","8":"J E BC"},B:{"1":"C K L H M N O P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t"},C:{"1":"5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","33":"0 1 2 3 4 CC tB I u J E F G A B C K L H M N O v w x y z DC EC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","33":"I u J E F G"},E:{"1":"J E F G A B C K L H HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","33":"I u GC zB"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d OC PC QC RC qB 9B SC rB","2":"G"},G:{"1":"F UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B","33":"zB TC AC"},H:{"1":"nC"},I:{"1":"I D rC AC sC tC","33":"tB oC pC qC"},J:{"1":"A","33":"E"},K:{"1":"A B C e qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"uC"},P:{"1":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"1":"1B"},R:{"1":"8C"},S:{"1":"9C"}},B:5,C:"CSS3 Box-sizing"};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"scan.js","sources":["../../src/internal/operators/scan.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,4CAA2C;AAoD3C,SAAgB,IAAI,CAAO,WAAmD,EAAE,IAAY;IAC1F,IAAI,OAAO,GAAG,KAAK,CAAC;IAMpB,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC,EAA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AAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC9B;aAAM;YACL,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SAC7B;IACH,CAAC;IAEO,iCAAQ,GAAhB,UAAiB,KAAQ;QACvB,IAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI,MAAW,CAAC;QAChB,IAAI;YACF,MAAM,GAAG,IAAI,CAAC,WAAW,CAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SACvD;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SAC7B;QACD,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC;QACnB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IACH,qBAAC;AAAD,CAAC,AArCD,CAAmC,uBAAU,GAqC5C"}
|
||||
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var SubscribeOnObservable_1 = require("../observable/SubscribeOnObservable");
|
||||
function subscribeOn(scheduler, delay) {
|
||||
if (delay === void 0) { delay = 0; }
|
||||
return function subscribeOnOperatorFunction(source) {
|
||||
return source.lift(new SubscribeOnOperator(scheduler, delay));
|
||||
};
|
||||
}
|
||||
exports.subscribeOn = subscribeOn;
|
||||
var SubscribeOnOperator = (function () {
|
||||
function SubscribeOnOperator(scheduler, delay) {
|
||||
this.scheduler = scheduler;
|
||||
this.delay = delay;
|
||||
}
|
||||
SubscribeOnOperator.prototype.call = function (subscriber, source) {
|
||||
return new SubscribeOnObservable_1.SubscribeOnObservable(source, this.delay, this.scheduler).subscribe(subscriber);
|
||||
};
|
||||
return SubscribeOnOperator;
|
||||
}());
|
||||
//# sourceMappingURL=subscribeOn.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version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CAAC;SAClB;KACF;SAAM;QACL,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;KAC1B;IACD,IAAI,SAAS,EAAE;QACb,IAAI,eAAe,SAAS,CAAC;QAC7B,IAAI;YACF,eAAe,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1C;QAAC,OAAO,GAAG,EAAE;YACZ,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACtB,OAAO,SAAS,CAAC;SAClB;QACD,IAAI,CAAC,eAAe,EAAE;YACpB,UAAU,CAAC,QAAQ,EAAE,CAAC;YACtB,OAAO,SAAS,CAAC;SAClB;QACD,IAAI,UAAU,CAAC,MAAM,EAAE;YACrB,OAAO,SAAS,CAAC;SAClB;KACF;IACD,IAAI,KAAQ,CAAC;IACb,IAAI;QACF,KAAK,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KAC3C;IAAC,OAAO,GAAG,EAAE;QACZ,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACtB,OAAO,SAAS,CAAC;KAClB;IACD,IAAI,UAAU,CAAC,MAAM,EAAE;QACrB,OAAO,SAAS,CAAC;KAClB;IACD,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvB,IAAI,UAAU,CAAC,MAAM,EAAE;QACrB,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC"}
|
||||
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__export(require("rxjs-compat/operator/dematerialize"));
|
||||
//# sourceMappingURL=dematerialize.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"animationFrame.js","sources":["../../../src/internal/scheduler/animationFrame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAiCpE,MAAM,CAAC,IAAM,uBAAuB,GAAG,IAAI,uBAAuB,CAAC,oBAAoB,CAAC,CAAC;AAKzF,MAAM,CAAC,IAAM,cAAc,GAAG,uBAAuB,CAAC"}
|
||||
@@ -0,0 +1,227 @@
|
||||
<!-- badges/ -->
|
||||
[](http://travis-ci.org/tim-kos/node-retry "Check this project's build status on TravisCI")
|
||||
[](https://codecov.io/gh/tim-kos/node-retry)
|
||||
<!-- /badges -->
|
||||
|
||||
# retry
|
||||
|
||||
Abstraction for exponential and custom retry strategies for failed operations.
|
||||
|
||||
## Installation
|
||||
|
||||
npm install retry
|
||||
|
||||
## Current Status
|
||||
|
||||
This module has been tested and is ready to be used.
|
||||
|
||||
## Tutorial
|
||||
|
||||
The example below will retry a potentially failing `dns.resolve` operation
|
||||
`10` times using an exponential backoff strategy. With the default settings, this
|
||||
means the last attempt is made after `17 minutes and 3 seconds`.
|
||||
|
||||
``` javascript
|
||||
var dns = require('dns');
|
||||
var retry = require('retry');
|
||||
|
||||
function faultTolerantResolve(address, cb) {
|
||||
var operation = retry.operation();
|
||||
|
||||
operation.attempt(function(currentAttempt) {
|
||||
dns.resolve(address, function(err, addresses) {
|
||||
if (operation.retry(err)) {
|
||||
return;
|
||||
}
|
||||
|
||||
cb(err ? operation.mainError() : null, addresses);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
faultTolerantResolve('nodejs.org', function(err, addresses) {
|
||||
console.log(err, addresses);
|
||||
});
|
||||
```
|
||||
|
||||
Of course you can also configure the factors that go into the exponential
|
||||
backoff. See the API documentation below for all available settings.
|
||||
currentAttempt is an int representing the number of attempts so far.
|
||||
|
||||
``` javascript
|
||||
var operation = retry.operation({
|
||||
retries: 5,
|
||||
factor: 3,
|
||||
minTimeout: 1 * 1000,
|
||||
maxTimeout: 60 * 1000,
|
||||
randomize: true,
|
||||
});
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### retry.operation([options])
|
||||
|
||||
Creates a new `RetryOperation` object. `options` is the same as `retry.timeouts()`'s `options`, with two additions:
|
||||
|
||||
* `forever`: Whether to retry forever, defaults to `false`.
|
||||
* `unref`: Whether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`.
|
||||
* `maxRetryTime`: The maximum time (in milliseconds) that the retried operation is allowed to run. Default is `Infinity`.
|
||||
|
||||
### retry.timeouts([options])
|
||||
|
||||
Returns an array of timeouts. All time `options` and return values are in
|
||||
milliseconds. If `options` is an array, a copy of that array is returned.
|
||||
|
||||
`options` is a JS object that can contain any of the following keys:
|
||||
|
||||
* `retries`: The maximum amount of times to retry the operation. Default is `10`. Seting this to `1` means `do it once, then retry it once`.
|
||||
* `factor`: The exponential factor to use. Default is `2`.
|
||||
* `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`.
|
||||
* `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`.
|
||||
* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`.
|
||||
|
||||
The formula used to calculate the individual timeouts is:
|
||||
|
||||
```
|
||||
Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout)
|
||||
```
|
||||
|
||||
Have a look at [this article][article] for a better explanation of approach.
|
||||
|
||||
If you want to tune your `factor` / `times` settings to attempt the last retry
|
||||
after a certain amount of time, you can use wolfram alpha. For example in order
|
||||
to tune for `10` attempts in `5 minutes`, you can use this equation:
|
||||
|
||||

|
||||
|
||||
Explaining the various values from left to right:
|
||||
|
||||
* `k = 0 ... 9`: The `retries` value (10)
|
||||
* `1000`: The `minTimeout` value in ms (1000)
|
||||
* `x^k`: No need to change this, `x` will be your resulting factor
|
||||
* `5 * 60 * 1000`: The desired total amount of time for retrying in ms (5 minutes)
|
||||
|
||||
To make this a little easier for you, use wolfram alpha to do the calculations:
|
||||
|
||||
<http://www.wolframalpha.com/input/?i=Sum%5B1000*x^k%2C+{k%2C+0%2C+9}%5D+%3D+5+*+60+*+1000>
|
||||
|
||||
[article]: http://dthain.blogspot.com/2009/02/exponential-backoff-in-distributed.html
|
||||
|
||||
### retry.createTimeout(attempt, opts)
|
||||
|
||||
Returns a new `timeout` (integer in milliseconds) based on the given parameters.
|
||||
|
||||
`attempt` is an integer representing for which retry the timeout should be calculated. If your retry operation was executed 4 times you had one attempt and 3 retries. If you then want to calculate a new timeout, you should set `attempt` to 4 (attempts are zero-indexed).
|
||||
|
||||
`opts` can include `factor`, `minTimeout`, `randomize` (boolean) and `maxTimeout`. They are documented above.
|
||||
|
||||
`retry.createTimeout()` is used internally by `retry.timeouts()` and is public for you to be able to create your own timeouts for reinserting an item, see [issue #13](https://github.com/tim-kos/node-retry/issues/13).
|
||||
|
||||
### retry.wrap(obj, [options], [methodNames])
|
||||
|
||||
Wrap all functions of the `obj` with retry. Optionally you can pass operation options and
|
||||
an array of method names which need to be wrapped.
|
||||
|
||||
```
|
||||
retry.wrap(obj)
|
||||
|
||||
retry.wrap(obj, ['method1', 'method2'])
|
||||
|
||||
retry.wrap(obj, {retries: 3})
|
||||
|
||||
retry.wrap(obj, {retries: 3}, ['method1', 'method2'])
|
||||
```
|
||||
The `options` object can take any options that the usual call to `retry.operation` can take.
|
||||
|
||||
### new RetryOperation(timeouts, [options])
|
||||
|
||||
Creates a new `RetryOperation` where `timeouts` is an array where each value is
|
||||
a timeout given in milliseconds.
|
||||
|
||||
Available options:
|
||||
* `forever`: Whether to retry forever, defaults to `false`.
|
||||
* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`.
|
||||
|
||||
If `forever` is true, the following changes happen:
|
||||
* `RetryOperation.errors()` will only output an array of one item: the last error.
|
||||
* `RetryOperation` will repeatedly use the `timeouts` array. Once all of its timeouts have been used up, it restarts with the first timeout, then uses the second and so on.
|
||||
|
||||
#### retryOperation.errors()
|
||||
|
||||
Returns an array of all errors that have been passed to `retryOperation.retry()` so far. The
|
||||
returning array has the errors ordered chronologically based on when they were passed to
|
||||
`retryOperation.retry()`, which means the first passed error is at index zero and the last is
|
||||
at the last index.
|
||||
|
||||
#### retryOperation.mainError()
|
||||
|
||||
A reference to the error object that occured most frequently. Errors are
|
||||
compared using the `error.message` property.
|
||||
|
||||
If multiple error messages occured the same amount of time, the last error
|
||||
object with that message is returned.
|
||||
|
||||
If no errors occured so far, the value is `null`.
|
||||
|
||||
#### retryOperation.attempt(fn, timeoutOps)
|
||||
|
||||
Defines the function `fn` that is to be retried and executes it for the first
|
||||
time right away. The `fn` function can receive an optional `currentAttempt` callback that represents the number of attempts to execute `fn` so far.
|
||||
|
||||
Optionally defines `timeoutOps` which is an object having a property `timeout` in miliseconds and a property `cb` callback function.
|
||||
Whenever your retry operation takes longer than `timeout` to execute, the timeout callback function `cb` is called.
|
||||
|
||||
|
||||
#### retryOperation.try(fn)
|
||||
|
||||
This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead.
|
||||
|
||||
#### retryOperation.start(fn)
|
||||
|
||||
This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead.
|
||||
|
||||
#### retryOperation.retry(error)
|
||||
|
||||
Returns `false` when no `error` value is given, or the maximum amount of retries
|
||||
has been reached.
|
||||
|
||||
Otherwise it returns `true`, and retries the operation after the timeout for
|
||||
the current attempt number.
|
||||
|
||||
#### retryOperation.stop()
|
||||
|
||||
Allows you to stop the operation being retried. Useful for aborting the operation on a fatal error etc.
|
||||
|
||||
#### retryOperation.reset()
|
||||
|
||||
Resets the internal state of the operation object, so that you can call `attempt()` again as if this was a new operation object.
|
||||
|
||||
#### retryOperation.attempts()
|
||||
|
||||
Returns an int representing the number of attempts it took to call `fn` before it was successful.
|
||||
|
||||
## License
|
||||
|
||||
retry is licensed under the MIT license.
|
||||
|
||||
|
||||
# Changelog
|
||||
|
||||
0.10.0 Adding `stop` functionality, thanks to @maxnachlinger.
|
||||
|
||||
0.9.0 Adding `unref` functionality, thanks to @satazor.
|
||||
|
||||
0.8.0 Implementing retry.wrap.
|
||||
|
||||
0.7.0 Some bug fixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13).
|
||||
|
||||
0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in milliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called.
|
||||
|
||||
0.5.0 Some minor refactoring.
|
||||
|
||||
0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it.
|
||||
|
||||
0.3.0 Added retryOperation.start() which is an alias for retryOperation.try().
|
||||
|
||||
0.2.0 Added attempts() function and parameter to retryOperation.try() representing the number of attempts it took to call fn().
|
||||
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var switchMap_1 = require("./switchMap");
|
||||
function switchMapTo(innerObservable, resultSelector) {
|
||||
return resultSelector ? switchMap_1.switchMap(function () { return innerObservable; }, resultSelector) : switchMap_1.switchMap(function () { return innerObservable; });
|
||||
}
|
||||
exports.switchMapTo = switchMapTo;
|
||||
//# sourceMappingURL=switchMapTo.js.map
|
||||
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
require("rxjs-compat/add/operator/switchMapTo");
|
||||
//# sourceMappingURL=switchMapTo.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sources":["../src/webSocket/index.ts"],"names":[],"mappings":";;AAAA,kEAA8E;AAArE,gCAAA,SAAS,CAAa;AAC/B,gFAAuG;AAA9F,8CAAA,gBAAgB,CAAA"}
|
||||
@@ -0,0 +1,33 @@
|
||||
import * as OctokitTypes from "@octokit/types";
|
||||
export declare type AnyResponse = OctokitTypes.OctokitResponse<any>;
|
||||
export declare type StrategyInterface = OctokitTypes.StrategyInterface<[
|
||||
Token
|
||||
], [
|
||||
], Authentication>;
|
||||
export declare type EndpointDefaults = OctokitTypes.EndpointDefaults;
|
||||
export declare type EndpointOptions = OctokitTypes.EndpointOptions;
|
||||
export declare type RequestParameters = OctokitTypes.RequestParameters;
|
||||
export declare type RequestInterface = OctokitTypes.RequestInterface;
|
||||
export declare type Route = OctokitTypes.Route;
|
||||
export declare type Token = string;
|
||||
export declare type OAuthTokenAuthentication = {
|
||||
type: "token";
|
||||
tokenType: "oauth";
|
||||
token: Token;
|
||||
};
|
||||
export declare type InstallationTokenAuthentication = {
|
||||
type: "token";
|
||||
tokenType: "installation";
|
||||
token: Token;
|
||||
};
|
||||
export declare type AppAuthentication = {
|
||||
type: "token";
|
||||
tokenType: "app";
|
||||
token: Token;
|
||||
};
|
||||
export declare type UserToServerAuthentication = {
|
||||
type: "token";
|
||||
tokenType: "user-to-server";
|
||||
token: Token;
|
||||
};
|
||||
export declare type Authentication = OAuthTokenAuthentication | InstallationTokenAuthentication | AppAuthentication | UserToServerAuthentication;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"repeatWhen.js","sources":["../../../src/internal/operators/repeatWhen.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAIrC,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAgCjG,MAAM,UAAU,UAAU,CAAI,QAA6D;IACzF,OAAO,UAAC,MAAqB,IAAK,OAAA,MAAM,CAAC,IAAI,CAAC,IAAI,kBAAkB,CAAC,QAAQ,CAAC,CAAC,EAA7C,CAA6C,CAAC;AAClF,CAAC;AAED;IACE,4BAAsB,QAA6D;QAA7D,aAAQ,GAAR,QAAQ,CAAqD;IACnF,CAAC;IAED,iCAAI,GAAJ,UAAK,UAAyB,EAAE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5B,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;SAChC;QACD,IAAI,mBAAmB,EAAE;YACvB,mBAAmB,CAAC,WAAW,EAAE,CAAC;YAClC,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;SACtC;QACD,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3B,CAAC;IAGD,qDAAsB,GAAtB;QACU,IAAA,gCAAY,CAAU;QAE9B,IAAI,CAAC,YAAY,GAAG,IAAK,CAAC;QAC1B,iBAAM,sBAAsB,WAAE,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QAEjC,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,iDAAkB,GAA1B;QACE,IAAI,CAAC,aAAa,GAAG,IAAI,OAAO,EAAE,CAAC;QACnC,IAAI,OAAO,CAAC;QACZ,IAAI;YACM,IAAA,wBAAQ,CAAU;YAC1B,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;SACxC;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,iBAAM,QAAQ,WAAE,CAAC;SACzB;QACD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,mBAAmB,GAAG,cAAc,CAAC,OAAO,EAAE,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;IACtF,CAAC;IACH,2BAAC;AAAD,CAAC,AA7ED,CAAyC,qBAAqB,GA6E7D"}
|
||||
@@ -0,0 +1,3 @@
|
||||
import Renderer, { RenderOptions } from '../Renderer';
|
||||
import RawMustacheTag from '../../nodes/RawMustacheTag';
|
||||
export default function (node: RawMustacheTag, renderer: Renderer, _options: RenderOptions): void;
|
||||
Reference in New Issue
Block a user