new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';
|
||||
export function catchError(selector) {
|
||||
return function catchErrorOperatorFunction(source) {
|
||||
const operator = new CatchOperator(selector);
|
||||
const caught = source.lift(operator);
|
||||
return (operator.caught = caught);
|
||||
};
|
||||
}
|
||||
class CatchOperator {
|
||||
constructor(selector) {
|
||||
this.selector = selector;
|
||||
}
|
||||
call(subscriber, source) {
|
||||
return source.subscribe(new CatchSubscriber(subscriber, this.selector, this.caught));
|
||||
}
|
||||
}
|
||||
class CatchSubscriber extends SimpleOuterSubscriber {
|
||||
constructor(destination, selector, caught) {
|
||||
super(destination);
|
||||
this.selector = selector;
|
||||
this.caught = caught;
|
||||
}
|
||||
error(err) {
|
||||
if (!this.isStopped) {
|
||||
let result;
|
||||
try {
|
||||
result = this.selector(err, this.caught);
|
||||
}
|
||||
catch (err2) {
|
||||
super.error(err2);
|
||||
return;
|
||||
}
|
||||
this._unsubscribeAndRecycle();
|
||||
const innerSubscriber = new SimpleInnerSubscriber(this);
|
||||
this.add(innerSubscriber);
|
||||
const innerSubscription = innerSubscribe(result, innerSubscriber);
|
||||
if (innerSubscription !== innerSubscriber) {
|
||||
this.add(innerSubscription);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=catchError.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"import-from","version":"3.0.0","files":{"license":{"checkedAt":1678887829653,"integrity":"sha512-nIst73auX/5NY2Fmv5Y116vWnNrEv4GaIUX3lpZG05rpXJY2S8EX+fpUS5hRjClCM0VdT2Za9DDHXXB5jdSrEw==","mode":420,"size":1109},"package.json":{"checkedAt":1678887829997,"integrity":"sha512-jdVpvgzt7uCpNDFNiRYtEJWcoXGKXNIZd7isq4xD+KU9iYN7vRCAGO14yn6fvelB8/oGkHFZB0iO2r/xvtdnsg==","mode":420,"size":664},"index.d.ts":{"checkedAt":1678887829997,"integrity":"sha512-toC9mujJxBNNdGriyfyZYQGyFzVmdMNEeJ3pUKultHm3qTusPEJ0gE3UynFi1Y0H7gC/DB/g6B2ojUtzRIF2wg==","mode":420,"size":1183},"index.js":{"checkedAt":1678887829997,"integrity":"sha512-iZbVOv4QxTtyja5aslUow2rbz5L5cXMEkVA2sFLQLSXoBsHsWyaq7Xiy5epO/v+xD0iabt+nEIwks+dV4b2XjQ==","mode":420,"size":291},"readme.md":{"checkedAt":1678887829997,"integrity":"sha512-lkgMUtFp/k9CNMfQTwB05WU/osGGzz1wQ4Eoq+gUYXFv75UiSdViHCRIeu6rmRY+Z3+uZlJEBwFzE08ecpdpdA==","mode":420,"size":1777}}}
|
||||
@@ -0,0 +1,61 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { isArray } from '../util/isArray';
|
||||
import { map } from '../operators/map';
|
||||
import { isObject } from '../util/isObject';
|
||||
import { from } from './from';
|
||||
export function forkJoin(...sources) {
|
||||
if (sources.length === 1) {
|
||||
const first = sources[0];
|
||||
if (isArray(first)) {
|
||||
return forkJoinInternal(first, null);
|
||||
}
|
||||
if (isObject(first) && Object.getPrototypeOf(first) === Object.prototype) {
|
||||
const keys = Object.keys(first);
|
||||
return forkJoinInternal(keys.map(key => first[key]), keys);
|
||||
}
|
||||
}
|
||||
if (typeof sources[sources.length - 1] === 'function') {
|
||||
const resultSelector = sources.pop();
|
||||
sources = (sources.length === 1 && isArray(sources[0])) ? sources[0] : sources;
|
||||
return forkJoinInternal(sources, null).pipe(map((args) => resultSelector(...args)));
|
||||
}
|
||||
return forkJoinInternal(sources, null);
|
||||
}
|
||||
function forkJoinInternal(sources, keys) {
|
||||
return new Observable(subscriber => {
|
||||
const len = sources.length;
|
||||
if (len === 0) {
|
||||
subscriber.complete();
|
||||
return;
|
||||
}
|
||||
const values = new Array(len);
|
||||
let completed = 0;
|
||||
let emitted = 0;
|
||||
for (let i = 0; i < len; i++) {
|
||||
const source = from(sources[i]);
|
||||
let hasValue = false;
|
||||
subscriber.add(source.subscribe({
|
||||
next: value => {
|
||||
if (!hasValue) {
|
||||
hasValue = true;
|
||||
emitted++;
|
||||
}
|
||||
values[i] = value;
|
||||
},
|
||||
error: err => subscriber.error(err),
|
||||
complete: () => {
|
||||
completed++;
|
||||
if (completed === len || !hasValue) {
|
||||
if (emitted === len) {
|
||||
subscriber.next(keys ?
|
||||
keys.reduce((result, key, i) => (result[key] = values[i], result), {}) :
|
||||
values);
|
||||
}
|
||||
subscriber.complete();
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=forkJoin.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"deprecated-obj","version":"2.0.0","files":{"LICENSE":{"checkedAt":1678887829553,"integrity":"sha512-CU5UsRw1RCbepM6fAodgdKRitmTVxvW2EeaXHagJfBc4mYYTHnzJqpqEHRsvmaY4XtT4rR9avUfZHUiQB+wUGg==","mode":420,"size":1069},"package.json":{"checkedAt":1678887829553,"integrity":"sha512-B4cncJH3zEznB/qVqa/nXV8gmtmk4c0aFbKFBIgyuNfdVZFeKa3CxDivI+indnMe1gNzdhymD0Ibj3IB4wXa+A==","mode":420,"size":752},"test.js":{"checkedAt":1678887829553,"integrity":"sha512-Q1OSenJmH5dIo7EirbRoOkdJf1WIsb5JZKvO75qsWphKdggYrZmYs+EY3h66rmdUYrCclVuzo07MaM5l5hPi/w==","mode":420,"size":1398},"index.js":{"checkedAt":1678887829553,"integrity":"sha512-66a1K+lRkOfn4VPMM5Adz/2qdk46pPqiBnVRnXhWWp03e+94o/FCwo84lUnuurUwc1l/FrAqfuJyeq2H8iXqUg==","mode":420,"size":1514},"README.md":{"checkedAt":1678887829553,"integrity":"sha512-oaAvBbKBXBXg6dCDAjrC+upPTTPNvYidxnnRzsAXeABsKM9xG7BSieZGqxbwfFTmTjyid2aUIEl4XpQBnZgnTA==","mode":420,"size":1437}}}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0.00463,"32":0,"33":0,"34":0.00463,"35":0,"36":0,"37":0.00463,"38":0,"39":0,"40":0,"41":0.00463,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.00463,"50":0.00463,"51":0,"52":0.00925,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0.00463,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0.00463,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.00463,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.00463,"93":0,"94":0,"95":0,"96":0.00463,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.037,"103":0.00925,"104":0.00463,"105":0.00925,"106":0.00463,"107":0.037,"108":0.63363,"109":0.40238,"110":0.02775,"111":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.00463,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0.00463,"35":0,"36":0,"37":0,"38":0.0185,"39":0,"40":0,"41":0,"42":0,"43":0.02313,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0.00463,"51":0,"52":0,"53":0,"54":0,"55":0.00463,"56":0.00463,"57":0,"58":0.00463,"59":0,"60":0.00463,"61":0.00463,"62":0,"63":0,"64":0.00463,"65":0.00925,"66":0,"67":0,"68":0.00463,"69":0.00463,"70":0,"71":0.00463,"72":0,"73":0,"74":0.02313,"75":0.00463,"76":0.00463,"77":0.01388,"78":0,"79":0.01388,"80":0.01388,"81":0.01388,"83":0.00925,"84":0.03238,"85":0.00463,"86":0.0185,"87":0.02313,"88":0.00463,"89":0.02775,"90":0.00463,"91":0.0185,"92":0.00925,"93":0.0185,"94":0.00463,"95":0.02775,"96":0.01388,"97":0.00925,"98":0.02313,"99":0.02775,"100":0.0185,"101":0.01388,"102":0.01388,"103":0.11563,"104":0.037,"105":0.0925,"106":0.06013,"107":0.26363,"108":7.511,"109":6.42413,"110":0.0185,"111":0.00925,"112":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0.00463,"29":0,"30":0.00463,"31":0.00463,"32":0.00463,"33":0.00463,"34":0,"35":0,"36":0,"37":0.00463,"38":0,"39":0,"40":0,"41":0,"42":0.00463,"43":0,"44":0,"45":0,"46":0,"47":0.00463,"48":0,"49":0,"50":0,"51":0.00925,"52":0,"53":0.00925,"54":0,"55":0.00463,"56":0.00925,"57":0.00463,"58":0.00463,"60":0.15263,"62":0,"63":0.24975,"64":0.06475,"65":0.00925,"66":0.28213,"67":0.01388,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0.03238,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0.00463,"86":0,"87":0,"88":0,"89":0.00463,"90":0.0185,"91":0,"92":0,"93":0.05088,"94":0.32838,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0.00463},B:{"12":0.06938,"13":0.04163,"14":0.01388,"15":0.00463,"16":0.01388,"17":0.00925,"18":0.074,"79":0,"80":0,"81":0,"83":0,"84":0.00925,"85":0.01388,"86":0,"87":0,"88":0,"89":0.01388,"90":0.00463,"91":0,"92":0.0555,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0.00463,"101":0.00463,"102":0,"103":0.00463,"104":0.00463,"105":0.0185,"106":0.02313,"107":0.0555,"108":0.87413,"109":0.95738},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.00463,"14":0.00925,"15":0.00463,_:"0","3.1":0,"3.2":0,"5.1":0.00925,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0.00925,"13.1":0.02313,"14.1":0.04163,"15.1":0.00463,"15.2-15.3":0,"15.4":0.01388,"15.5":0.01388,"15.6":0.06475,"16.0":0.00925,"16.1":0.05088,"16.2":0.0555,"16.3":0.00463},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.00519,"6.0-6.1":0,"7.0-7.1":0.02206,"8.1-8.4":0,"9.0-9.2":0.0013,"9.3":0.04671,"10.0-10.2":0.00389,"10.3":0.23226,"11.0-11.2":0.02206,"11.3-11.4":0.00389,"12.0-12.1":0.0506,"12.2-12.5":1.33257,"13.0-13.1":0.00649,"13.2":0.0026,"13.3":0.03114,"13.4-13.7":0.16349,"14.0-14.4":0.42949,"14.5-14.8":0.43727,"15.0-15.1":0.17517,"15.2-15.3":0.27248,"15.4":0.26729,"15.5":0.55405,"15.6":0.97964,"16.0":0.90568,"16.1":2.15392,"16.2":2.2668,"16.3":0.16219},P:{"4":0.09233,"5.0-5.4":0.04103,"6.2-6.4":0.01026,"7.2-7.4":0.11284,"8.2":0,"9.2":0.02052,"10.1":0,"11.1-11.2":0.02052,"12.0":0,"13.0":0.01026,"14.0":0.02052,"15.0":0.01026,"16.0":0.04103,"17.0":0.20517,"18.0":0.1231,"19.0":1.08741},I:{"0":0,"3":0,"4":0.0026,"2.1":0,"2.2":0,"2.3":0,"4.1":0.0026,"4.2-4.3":0.0039,"4.4":0,"4.4.3-4.4.4":0.11714},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.0555,"5.5":0},J:{"7":0,"10":0},N:{"10":0,"11":0},S:{"2.5":0.0645},R:{_:"0"},M:{"0":0.215},Q:{"13.1":0.00538},O:{"0":0.215},H:{"0":6.78833},L:{"0":56.07938}};
|
||||
@@ -0,0 +1,82 @@
|
||||
import { AjaxCreationMethod } from './AjaxObservable';
|
||||
/**
|
||||
* There is an ajax operator on the Rx object.
|
||||
*
|
||||
* It creates an observable for an Ajax request with either a request object with
|
||||
* url, headers, etc or a string for a URL.
|
||||
*
|
||||
*
|
||||
* ## Using ajax() to fetch the response object that is being returned from API.
|
||||
* ```ts
|
||||
* import { ajax } from 'rxjs/ajax';
|
||||
* import { map, catchError } from 'rxjs/operators';
|
||||
* import { of } from 'rxjs';
|
||||
*
|
||||
* const obs$ = ajax(`https://api.github.com/users?per_page=5`).pipe(
|
||||
* map(userResponse => console.log('users: ', userResponse)),
|
||||
* catchError(error => {
|
||||
* console.log('error: ', error);
|
||||
* return of(error);
|
||||
* })
|
||||
* );
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* ## Using ajax.getJSON() to fetch data from API.
|
||||
* ```ts
|
||||
* import { ajax } from 'rxjs/ajax';
|
||||
* import { map, catchError } from 'rxjs/operators';
|
||||
* import { of } from 'rxjs';
|
||||
*
|
||||
* const obs$ = ajax.getJSON(`https://api.github.com/users?per_page=5`).pipe(
|
||||
* map(userResponse => console.log('users: ', userResponse)),
|
||||
* catchError(error => {
|
||||
* console.log('error: ', error);
|
||||
* return of(error);
|
||||
* })
|
||||
* );
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* ## Using ajax() with object as argument and method POST with a two seconds delay.
|
||||
* ```ts
|
||||
* import { ajax } from 'rxjs/ajax';
|
||||
* import { of } from 'rxjs';
|
||||
*
|
||||
* const users = ajax({
|
||||
* url: 'https://httpbin.org/delay/2',
|
||||
* method: 'POST',
|
||||
* headers: {
|
||||
* 'Content-Type': 'application/json',
|
||||
* 'rxjs-custom-header': 'Rxjs'
|
||||
* },
|
||||
* body: {
|
||||
* rxjs: 'Hello World!'
|
||||
* }
|
||||
* }).pipe(
|
||||
* map(response => console.log('response: ', response)),
|
||||
* catchError(error => {
|
||||
* console.log('error: ', error);
|
||||
* return of(error);
|
||||
* })
|
||||
* );
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* ## Using ajax() to fetch. An error object that is being returned from the request.
|
||||
* ```ts
|
||||
* import { ajax } from 'rxjs/ajax';
|
||||
* import { map, catchError } from 'rxjs/operators';
|
||||
* import { of } from 'rxjs';
|
||||
*
|
||||
* const obs$ = ajax(`https://api.github.com/404`).pipe(
|
||||
* map(userResponse => console.log('users: ', userResponse)),
|
||||
* catchError(error => {
|
||||
* console.log('error: ', error);
|
||||
* return of(error);
|
||||
* })
|
||||
* );
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
export declare const ajax: AjaxCreationMethod;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"A B","2":"J E F G 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":"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 2 3 4 5 6 CC tB I u J E F G A B C K L H M N O v w x y z DC EC","194":"7 8 9 AB"},D:{"1":"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 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 I u J E F G A B C K L H M N O v w x y z"},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 GC zB HC IC JC KC 0B","260":"B"},F:{"1":"0 1 2 3 4 5 6 7 8 9 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","2":"G B C OC PC QC RC qB 9B SC rB"},G:{"1":"cC 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"},H:{"2":"nC"},I:{"1":"D sC tC","2":"tB I oC pC qC rC AC"},J:{"2":"E A"},K:{"1":"e","2":"A B C 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:4,C:"Resource Timing"};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"skip.js","sources":["../../../src/internal/operators/skip.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAe3C,MAAM,UAAU,IAAI,CAAI,KAAa;IACnC,OAAO,CAAC,MAAqB,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,YAAY;IAChB,YAAoB,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;IACjC,CAAC;IAED,IAAI,CAAC,UAAyB,EAAE,MAAW;QACzC,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACtE,CAAC;CACF;AAOD,MAAM,cAAkB,SAAQ,UAAa;IAG3C,YAAY,WAA0B,EAAU,KAAa;QAC3D,KAAK,CAAC,WAAW,CAAC,CAAC;QAD2B,UAAK,GAAL,KAAK,CAAQ;QAF7D,UAAK,GAAW,CAAC,CAAC;IAIlB,CAAC;IAES,KAAK,CAAC,CAAI;QAClB,IAAI,EAAE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;YAC7B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAC1B;IACH,CAAC;CACF"}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.01323,"103":0,"104":0,"105":0,"106":0.02205,"107":0.02205,"108":0.52038,"109":0.44982,"110":0.02646,"111":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0.00441,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.00441,"50":0.01764,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0.00441,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0.00441,"72":0,"73":0,"74":0.00441,"75":0,"76":0.00882,"77":0,"78":0.00441,"79":0.00882,"80":0,"81":0.00441,"83":0.09702,"84":0,"85":0,"86":0,"87":0.00441,"88":0.00882,"89":0,"90":0.01323,"91":0.00441,"92":0.00441,"93":0.03087,"94":0.01764,"95":0.02646,"96":0,"97":0,"98":0.00882,"99":0.00441,"100":0.01764,"101":0.00441,"102":0.03969,"103":0.10584,"104":0.07938,"105":0.01323,"106":0.03528,"107":0.12348,"108":4.4541,"109":3.21048,"110":0.00441,"111":0,"112":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0.00882,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0.00441,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.10143,"94":0.2646,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0.00441,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.00441,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.00441,"103":0.00441,"104":0,"105":0.02646,"106":0.00882,"107":0.02205,"108":1.73754,"109":1.07163},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0.08379,"15":0,_:"0","3.1":0,"3.2":0,"5.1":0.00882,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0.00441,"12.1":0.00441,"13.1":0.09261,"14.1":0.07056,"15.1":0.00441,"15.2-15.3":0.00441,"15.4":0.02205,"15.5":0.02646,"15.6":0.99225,"16.0":0.0441,"16.1":0.34398,"16.2":0.22491,"16.3":0.01764},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0.00404,"7.0-7.1":0.01212,"8.1-8.4":0.05453,"9.0-9.2":0,"9.3":0.14744,"10.0-10.2":0,"10.3":0.09897,"11.0-11.2":0.0202,"11.3-11.4":0,"12.0-12.1":0.0202,"12.2-12.5":0.70084,"13.0-13.1":0,"13.2":0,"13.3":0.00808,"13.4-13.7":0.01616,"14.0-14.4":0.18985,"14.5-14.8":0.12926,"15.0-15.1":0.45646,"15.2-15.3":0.04443,"15.4":0.09089,"15.5":1.94095,"15.6":1.48248,"16.0":2.6317,"16.1":5.36035,"16.2":4.31817,"16.3":0.31104},P:{"4":0.28329,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.26063,"8.2":0,"9.2":0.01133,"10.1":0,"11.1-11.2":0.01133,"12.0":0.02266,"13.0":0.03399,"14.0":0.01133,"15.0":0.05666,"16.0":0.05666,"17.0":0.07932,"18.0":0.10198,"19.0":2.4023},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.18512,"4.4":0,"4.4.3-4.4.4":0.80217},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.02205,"5.5":0},J:{"7":0,"10":0},N:{"10":0,"11":0},S:{"2.5":0},R:{_:"0"},M:{"0":0.14534},Q:{"13.1":0},O:{"0":0.64285},H:{"0":0.10585},L:{"0":60.09426}};
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
||||
|
||||
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
||||
|
||||
@example
|
||||
```
|
||||
import {ConditionalKeys} from 'type-fest';
|
||||
|
||||
interface Example {
|
||||
a: string;
|
||||
b: string | number;
|
||||
c?: string;
|
||||
d: {};
|
||||
}
|
||||
|
||||
type StringKeysOnly = ConditionalKeys<Example, string>;
|
||||
//=> 'a'
|
||||
```
|
||||
|
||||
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
||||
|
||||
@example
|
||||
```
|
||||
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
||||
//=> 'a' | 'c'
|
||||
```
|
||||
*/
|
||||
export type ConditionalKeys<Base, Condition> = NonNullable<
|
||||
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
||||
{
|
||||
// Map through all the keys of the given base type.
|
||||
[Key in keyof Base]:
|
||||
// Pick only keys with types extending the given `Condition` type.
|
||||
Base[Key] extends Condition
|
||||
// Retain this key since the condition passes.
|
||||
? Key
|
||||
// Discard this key since the condition fails.
|
||||
: never;
|
||||
|
||||
// Convert the produced object into a union type of the keys which passed the conditional test.
|
||||
}[keyof Base]
|
||||
>;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"fromEvent.js","sources":["../../../src/internal/observable/fromEvent.ts"],"names":[],"mappings":"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"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ignoreElements.js","sources":["../src/operators/ignoreElements.ts"],"names":[],"mappings":";;;;;AAAA,0DAAqD"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"publishReplay.js","sources":["../../src/internal/operators/publishReplay.ts"],"names":[],"mappings":";;AACA,kDAAiD;AACjD,yCAAwC;AASxC,SAAgB,aAAa,CAAO,UAAmB,EACnB,UAAmB,EACnB,mBAA4D,EAC5D,SAAyB;IAE3D,IAAI,mBAAmB,IAAI,OAAO,mBAAmB,KAAK,UAAU,EAAE;QACpE,SAAS,GAAG,mBAAmB,CAAC;KACjC;IAED,IAAM,QAAQ,GAAG,OAAO,mBAAmB,KAAK,UAAU,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7F,IAAM,OAAO,GAAG,IAAI,6BAAa,CAAI,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IAExE,OAAO,UAAC,MAAqB,IAAK,OAAA,qBAAS,CAAC,cAAM,OAAA,OAAO,EAAP,CAAO,EAAE,QAAQ,CAAC,CAAC,MAAM,CAA6B,EAAtE,CAAsE,CAAC;AAC3G,CAAC;AAbD,sCAaC"}
|
||||
@@ -0,0 +1,48 @@
|
||||
import { MonoTypeOperatorFunction } from '../types';
|
||||
/**
|
||||
* Emits only the first `count` values emitted by the source Observable.
|
||||
*
|
||||
* <span class="informal">Takes the first `count` values from the source, then
|
||||
* completes.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* `take` returns an Observable that emits only the first `count` values emitted
|
||||
* by the source Observable. If the source emits fewer than `count` values then
|
||||
* all of its values are emitted. After that, it completes, regardless if the
|
||||
* source completes.
|
||||
*
|
||||
* ## Example
|
||||
* Take the first 5 seconds of an infinite 1-second interval Observable
|
||||
* ```ts
|
||||
* import { interval } from 'rxjs';
|
||||
* import { take } from 'rxjs/operators';
|
||||
*
|
||||
* const intervalCount = interval(1000);
|
||||
* const takeFive = intervalCount.pipe(take(5));
|
||||
* takeFive.subscribe(x => console.log(x));
|
||||
*
|
||||
* // Logs:
|
||||
* // 0
|
||||
* // 1
|
||||
* // 2
|
||||
* // 3
|
||||
* // 4
|
||||
* ```
|
||||
*
|
||||
* @see {@link takeLast}
|
||||
* @see {@link takeUntil}
|
||||
* @see {@link takeWhile}
|
||||
* @see {@link skip}
|
||||
*
|
||||
* @throws {ArgumentOutOfRangeError} When using `take(i)`, it delivers an
|
||||
* ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0`.
|
||||
*
|
||||
* @param {number} count The maximum number of `next` values to emit.
|
||||
* @return {Observable<T>} An Observable that emits only the first `count`
|
||||
* values emitted by the source Observable, or all of the values from the source
|
||||
* if the source emits fewer than `count` values.
|
||||
* @method take
|
||||
* @owner Observable
|
||||
*/
|
||||
export declare function take<T>(count: number): MonoTypeOperatorFunction<T>;
|
||||
@@ -0,0 +1,82 @@
|
||||
import { ThrottleConfig } from './throttle';
|
||||
import { MonoTypeOperatorFunction, SchedulerLike } from '../types';
|
||||
/**
|
||||
* Emits a value from the source Observable, then ignores subsequent source
|
||||
* values for `duration` milliseconds, then repeats this process.
|
||||
*
|
||||
* <span class="informal">Lets a value pass, then ignores source values for the
|
||||
* next `duration` milliseconds.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* `throttleTime` emits the source Observable values on the output Observable
|
||||
* when its internal timer is disabled, and ignores source values when the timer
|
||||
* is enabled. Initially, the timer is disabled. As soon as the first source
|
||||
* value arrives, it is forwarded to the output Observable, and then the timer
|
||||
* is enabled. After `duration` milliseconds (or the time unit determined
|
||||
* internally by the optional `scheduler`) has passed, the timer is disabled,
|
||||
* and this process repeats for the next source value. Optionally takes a
|
||||
* {@link SchedulerLike} for managing timers.
|
||||
*
|
||||
* ## Examples
|
||||
*
|
||||
* #### Limit click rate
|
||||
*
|
||||
* Emit clicks at a rate of at most one click per second
|
||||
* ```ts
|
||||
* import { fromEvent } from 'rxjs';
|
||||
* import { throttleTime } from 'rxjs/operators';
|
||||
*
|
||||
* const clicks = fromEvent(document, 'click');
|
||||
* const result = clicks.pipe(throttleTime(1000));
|
||||
* result.subscribe(x => console.log(x));
|
||||
* ```
|
||||
*
|
||||
* #### Double Click
|
||||
*
|
||||
* The following example only emits clicks which happen within a subsequent
|
||||
* delay of 400ms of the previous click. This for example can emulate a double
|
||||
* click. It makes use of the `trailing` parameter of the throttle configuration.
|
||||
*
|
||||
* ```ts
|
||||
* import { fromEvent, asyncScheduler } from 'rxjs';
|
||||
* import { throttleTime, withLatestFrom } from 'rxjs/operators';
|
||||
*
|
||||
* // defaultThottleConfig = { leading: true, trailing: false }
|
||||
* const throttleConfig = {
|
||||
* leading: false,
|
||||
* trailing: true
|
||||
* }
|
||||
*
|
||||
* const click = fromEvent(document, 'click');
|
||||
* const doubleClick = click.pipe(
|
||||
* throttleTime(400, asyncScheduler, throttleConfig)
|
||||
* );
|
||||
*
|
||||
* doubleClick.subscribe((throttleValue: Event) => {
|
||||
* console.log(`Double-clicked! Timestamp: ${throttleValue.timeStamp}`);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* If you enable the `leading` parameter in this example, the output would be the primary click and
|
||||
* the double click, but restricts additional clicks within 400ms.
|
||||
*
|
||||
* @see {@link auditTime}
|
||||
* @see {@link debounceTime}
|
||||
* @see {@link delay}
|
||||
* @see {@link sampleTime}
|
||||
* @see {@link throttle}
|
||||
*
|
||||
* @param {number} duration Time to wait before emitting another value after
|
||||
* emitting the last value, measured in milliseconds or the time unit determined
|
||||
* internally by the optional `scheduler`.
|
||||
* @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for
|
||||
* managing the timers that handle the throttling.
|
||||
* @param {Object} config a configuration object to define `leading` and
|
||||
* `trailing` behavior. Defaults to `{ leading: true, trailing: false }`.
|
||||
* @return {Observable<T>} An Observable that performs the throttle operation to
|
||||
* limit the rate of emissions from the source.
|
||||
* @method throttleTime
|
||||
* @owner Observable
|
||||
*/
|
||||
export declare function throttleTime<T>(duration: number, scheduler?: SchedulerLike, config?: ThrottleConfig): MonoTypeOperatorFunction<T>;
|
||||
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var ajax_1 = require("../internal/observable/dom/ajax");
|
||||
exports.ajax = ajax_1.ajax;
|
||||
var AjaxObservable_1 = require("../internal/observable/dom/AjaxObservable");
|
||||
exports.AjaxResponse = AjaxObservable_1.AjaxResponse;
|
||||
exports.AjaxError = AjaxObservable_1.AjaxError;
|
||||
exports.AjaxTimeoutError = AjaxObservable_1.AjaxTimeoutError;
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"json-buffer","version":"3.0.0","files":{"LICENSE":{"checkedAt":1678887830333,"integrity":"sha512-qm3bFL/jeaPb+QhmG/ii2H51/Dh9d8VKrSpbf6iljULKI36QUs1WT1ZlDjMPs9GTMoQTwSl21123NsNjW2FCdw==","mode":420,"size":1071},"package.json":{"checkedAt":1678887830330,"integrity":"sha512-wVVhwpP+BwanPYBqbIhSJhcZQtgKxxuL/Hg0X4NuRi0kDBkDkRLAOyHTGo6/ww8VIrEzeH42ec6ur1aSEPUjgQ==","mode":420,"size":878},".npmignore":{"checkedAt":1678887830330,"integrity":"sha512-/lpMCiIUit6tSsyREgOpKZUVzAxlpewZaeft5py+cVKn/2pS76yYxGCheET8nr6mZ2shYcWx/rtQFGOuWhIPdg==","mode":420,"size":42},".travis.yml":{"checkedAt":1678887830333,"integrity":"sha512-/Pm6C1Wjtqv7QM5k5N/+D7VYqrQ7aq/ivAZQA1On7+Vx8WvUNdRSyXPkiWy92WGKwOHTAkSJTF36hDn+6w4YKw==","mode":420,"size":38},"index.js":{"checkedAt":1678887830330,"integrity":"sha512-Ae5AUhZZg8fH/T9RGp82vMbPrAdGlAmPus/cl6izyEEDRDNObbd2qU7BTLmZQIuw0eVtb/vC6YGIm/Hg4TdDtg==","mode":420,"size":1503},"README.md":{"checkedAt":1678887830330,"integrity":"sha512-xwB1PD9V29habu8J3EMZRL9dV7SB4Zan6ApMkgJj1R07gECDBz0LRXacnuFuKUTE89p8JuO8pZSGOmc7eZTRZg==","mode":420,"size":658},"test/index.js":{"checkedAt":1678887830330,"integrity":"sha512-0FcHjdlDlvo0I32RPmZXyU9tOfgVm9V5mz180JqKeNa6wCzPUdFIYuIl3uwrXvIUbp5ua7bMMD3lN4edrcDXsw==","mode":420,"size":1246}}}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"count.js","sources":["../../../src/internal/operators/count.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA6D3C,MAAM,UAAU,KAAK,CAAI,SAAuE;IAC9F,OAAO,UAAC,MAAqB,IAAK,OAAA,MAAM,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,EAAjD,CAAiD,CAAC;AACtF,CAAC;AAED;IACE,uBAAoB,SAAuE,EACvE,MAAsB;QADtB,cAAS,GAAT,SAAS,CAA8D;QACvE,WAAM,GAAN,MAAM,CAAgB;IAC1C,CAAC;IAED,4BAAI,GAAJ,UAAK,UAA8B,EAAE,MAAW;QAC9C,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACxF,CAAC;IACH,oBAAC;AAAD,CAAC,AARD,IAQC;AAOD;IAAiC,2CAAa;IAI5C,yBAAY,WAA6B,EACrB,SAAuE,EACvE,MAAsB;QAF1C,YAGE,kBAAM,WAAW,CAAC,SACnB;QAHmB,eAAS,GAAT,SAAS,CAA8D;QACvE,YAAM,GAAN,MAAM,CAAgB;QALlC,WAAK,GAAW,CAAC,CAAC;QAClB,WAAK,GAAW,CAAC,CAAC;;IAM1B,CAAC;IAES,+BAAK,GAAf,UAAgB,KAAQ;QACtB,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SAC3B;aAAM;YACL,IAAI,CAAC,KAAK,EAAE,CAAC;SACd;IACH,CAAC;IAEO,uCAAa,GAArB,UAAsB,KAAQ;QAC5B,IAAI,MAAW,CAAC;QAEhB,IAAI;YACF,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;SAC3D;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5B,OAAO;SACR;QAED,IAAI,MAAM,EAAE;YACV,IAAI,CAAC,KAAK,EAAE,CAAC;SACd;IACH,CAAC;IAES,mCAAS,GAAnB;QACE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;IAC9B,CAAC;IACH,sBAAC;AAAD,CAAC,AArCD,CAAiC,UAAU,GAqC1C"}
|
||||
@@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _validate = _interopRequireDefault(require("./validate.js"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function parse(uuid) {
|
||||
if (!(0, _validate.default)(uuid)) {
|
||||
throw TypeError('Invalid UUID');
|
||||
}
|
||||
|
||||
let v;
|
||||
const arr = new Uint8Array(16); // Parse ########-....-....-....-............
|
||||
|
||||
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
|
||||
arr[1] = v >>> 16 & 0xff;
|
||||
arr[2] = v >>> 8 & 0xff;
|
||||
arr[3] = v & 0xff; // Parse ........-####-....-....-............
|
||||
|
||||
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
|
||||
arr[5] = v & 0xff; // Parse ........-....-####-....-............
|
||||
|
||||
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
|
||||
arr[7] = v & 0xff; // Parse ........-....-....-####-............
|
||||
|
||||
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
|
||||
arr[9] = v & 0xff; // Parse ........-....-....-....-############
|
||||
// (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
|
||||
|
||||
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
|
||||
arr[11] = v / 0x100000000 & 0xff;
|
||||
arr[12] = v >>> 24 & 0xff;
|
||||
arr[13] = v >>> 16 & 0xff;
|
||||
arr[14] = v >>> 8 & 0xff;
|
||||
arr[15] = v & 0xff;
|
||||
return arr;
|
||||
}
|
||||
|
||||
var _default = parse;
|
||||
exports.default = _default;
|
||||
Reference in New Issue
Block a user