new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Subscription.js","sources":["src/Subscription.ts"],"names":[],"mappings":";;;;;AAAA,8CAAyC"}
|
||||
@@ -0,0 +1,70 @@
|
||||
# Authors
|
||||
|
||||
#### Ordered by first contribution.
|
||||
|
||||
- Romain Beauxis (toots@rastageeks.org)
|
||||
- Tobias Koppers (tobias.koppers@googlemail.com)
|
||||
- Janus (ysangkok@gmail.com)
|
||||
- Rainer Dreyer (rdrey1@gmail.com)
|
||||
- Tõnis Tiigi (tonistiigi@gmail.com)
|
||||
- James Halliday (mail@substack.net)
|
||||
- Michael Williamson (mike@zwobble.org)
|
||||
- elliottcable (github@elliottcable.name)
|
||||
- rafael (rvalle@livelens.net)
|
||||
- Andrew Kelley (superjoe30@gmail.com)
|
||||
- Andreas Madsen (amwebdk@gmail.com)
|
||||
- Mike Brevoort (mike.brevoort@pearson.com)
|
||||
- Brian White (mscdex@mscdex.net)
|
||||
- Feross Aboukhadijeh (feross@feross.org)
|
||||
- Ruben Verborgh (ruben@verborgh.org)
|
||||
- eliang (eliang.cs@gmail.com)
|
||||
- Jesse Tane (jesse.tane@gmail.com)
|
||||
- Alfonso Boza (alfonso@cloud.com)
|
||||
- Mathias Buus (mathiasbuus@gmail.com)
|
||||
- Devon Govett (devongovett@gmail.com)
|
||||
- Daniel Cousens (github@dcousens.com)
|
||||
- Joseph Dykstra (josephdykstra@gmail.com)
|
||||
- Parsha Pourkhomami (parshap+git@gmail.com)
|
||||
- Damjan Košir (damjan.kosir@gmail.com)
|
||||
- daverayment (dave.rayment@gmail.com)
|
||||
- kawanet (u-suke@kawa.net)
|
||||
- Linus Unnebäck (linus@folkdatorn.se)
|
||||
- Nolan Lawson (nolan.lawson@gmail.com)
|
||||
- Calvin Metcalf (calvin.metcalf@gmail.com)
|
||||
- Koki Takahashi (hakatasiloving@gmail.com)
|
||||
- Guy Bedford (guybedford@gmail.com)
|
||||
- Jan Schär (jscissr@gmail.com)
|
||||
- RaulTsc (tomescu.raul@gmail.com)
|
||||
- Matthieu Monsch (monsch@alum.mit.edu)
|
||||
- Dan Ehrenberg (littledan@chromium.org)
|
||||
- Kirill Fomichev (fanatid@ya.ru)
|
||||
- Yusuke Kawasaki (u-suke@kawa.net)
|
||||
- DC (dcposch@dcpos.ch)
|
||||
- John-David Dalton (john.david.dalton@gmail.com)
|
||||
- adventure-yunfei (adventure030@gmail.com)
|
||||
- Emil Bay (github@tixz.dk)
|
||||
- Sam Sudar (sudar.sam@gmail.com)
|
||||
- Volker Mische (volker.mische@gmail.com)
|
||||
- David Walton (support@geekstocks.com)
|
||||
- Сковорода Никита Андреевич (chalkerx@gmail.com)
|
||||
- greenkeeper[bot] (greenkeeper[bot]@users.noreply.github.com)
|
||||
- ukstv (sergey.ukustov@machinomy.com)
|
||||
- Renée Kooi (renee@kooi.me)
|
||||
- ranbochen (ranbochen@qq.com)
|
||||
- Vladimir Borovik (bobahbdb@gmail.com)
|
||||
- greenkeeper[bot] (23040076+greenkeeper[bot]@users.noreply.github.com)
|
||||
- kumavis (aaron@kumavis.me)
|
||||
- Sergey Ukustov (sergey.ukustov@machinomy.com)
|
||||
- Fei Liu (liu.feiwood@gmail.com)
|
||||
- Blaine Bublitz (blaine.bublitz@gmail.com)
|
||||
- clement (clement@seald.io)
|
||||
- Koushik Dutta (koushd@gmail.com)
|
||||
- Jordan Harband (ljharb@gmail.com)
|
||||
- Niklas Mischkulnig (mischnic@users.noreply.github.com)
|
||||
- Nikolai Vavilov (vvnicholas@gmail.com)
|
||||
- Fedor Nezhivoi (gyzerok@users.noreply.github.com)
|
||||
- Peter Newman (peternewman@users.noreply.github.com)
|
||||
- mathmakgakpak (44949126+mathmakgakpak@users.noreply.github.com)
|
||||
- jkkang (jkkang@smartauth.kr)
|
||||
|
||||
#### Generated by bin/update-authors.sh.
|
||||
@@ -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/operators/windowWhen"));
|
||||
//# sourceMappingURL=windowWhen.js.map
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={"0":"24","1":"25","2":"26","3":"27","4":"28","5":"29","6":"30","7":"31","8":"32","9":"33",A:"10",B:"11",C:"12",D:"109",E:"7",F:"8",G:"9",H:"15",I:"4",J:"6",K:"13",L:"14",M:"16",N:"17",O:"18",P:"79",Q:"80",R:"81",S:"83",T:"84",U:"85",V:"86",W:"87",X:"88",Y:"89",Z:"90",a:"91",b:"92",c:"93",d:"94",e:"73",f:"95",g:"96",h:"97",i:"98",j:"99",k:"100",l:"101",m:"102",n:"103",o:"104",p:"105",q:"106",r:"107",s:"108",t:"110",u:"5",v:"19",w:"20",x:"21",y:"22",z:"23",AB:"34",BB:"35",CB:"36",DB:"37",EB:"38",FB:"39",GB:"40",HB:"41",IB:"42",JB:"43",KB:"44",LB:"45",MB:"46",NB:"47",OB:"48",PB:"49",QB:"50",RB:"51",SB:"52",TB:"53",UB:"54",VB:"55",WB:"56",XB:"57",YB:"58",ZB:"60",aB:"62",bB:"63",cB:"64",dB:"65",eB:"66",fB:"67",gB:"68",hB:"69",iB:"70",jB:"71",kB:"72",lB:"74",mB:"75",nB:"76",oB:"77",pB:"78",qB:"11.1",rB:"12.1",sB:"16.0",tB:"3",uB:"59",vB:"61",wB:"82",xB:"111",yB:"112",zB:"3.2","0B":"10.1","1B":"13.1","2B":"15.2-15.3","3B":"15.4","4B":"15.5","5B":"15.6","6B":"16.1","7B":"16.2","8B":"16.3","9B":"11.5",AC:"4.2-4.3",BC:"5.5",CC:"2",DC:"3.5",EC:"3.6",FC:"113",GC:"3.1",HC:"5.1",IC:"6.1",JC:"7.1",KC:"9.1",LC:"14.1",MC:"15.1",NC:"TP",OC:"9.5-9.6",PC:"10.0-10.1",QC:"10.5",RC:"10.6",SC:"11.6",TC:"4.0-4.1",UC:"5.0-5.1",VC:"6.0-6.1",WC:"7.0-7.1",XC:"8.1-8.4",YC:"9.0-9.2",ZC:"9.3",aC:"10.0-10.2",bC:"10.3",cC:"11.0-11.2",dC:"11.3-11.4",eC:"12.0-12.1",fC:"12.2-12.5",gC:"13.0-13.1",hC:"13.2",iC:"13.3",jC:"13.4-13.7",kC:"14.0-14.4",lC:"14.5-14.8",mC:"15.0-15.1",nC:"all",oC:"2.1",pC:"2.2",qC:"2.3",rC:"4.1",sC:"4.4",tC:"4.4.3-4.4.4",uC:"13.4",vC:"5.0-5.4",wC:"6.2-6.4",xC:"7.2-7.4",yC:"8.2",zC:"9.2","0C":"11.1-11.2","1C":"12.0","2C":"13.0","3C":"14.0","4C":"15.0","5C":"17.0","6C":"18.0","7C":"19.0","8C":"13.18","9C":"2.5"};
|
||||
@@ -0,0 +1,64 @@
|
||||
import { Operator } from '../Operator';
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { Observable } from '../Observable';
|
||||
import { SubscribeOnObservable } from '../observable/SubscribeOnObservable';
|
||||
import { MonoTypeOperatorFunction, SchedulerLike, TeardownLogic } from '../types';
|
||||
|
||||
/**
|
||||
* Asynchronously subscribes Observers to this Observable on the specified {@link SchedulerLike}.
|
||||
*
|
||||
* With `subscribeOn` you can decide what type of scheduler a specific Observable will be using when it is subscribed to.
|
||||
*
|
||||
* Schedulers control the speed and order of emissions to observers from an Observable stream.
|
||||
*
|
||||
* 
|
||||
*
|
||||
* ## Example
|
||||
* Given the following code:
|
||||
* ```javascript
|
||||
* import { of, merge } from 'rxjs';
|
||||
*
|
||||
* const a = of(1, 2, 3, 4);
|
||||
* const b = of(5, 6, 7, 8, 9);
|
||||
* merge(a, b).subscribe(console.log);
|
||||
* ```
|
||||
*
|
||||
* Both Observable `a` and `b` will emit their values directly and synchronously once they are subscribed to.
|
||||
* This will result in the output of `1 2 3 4 5 6 7 8 9`.
|
||||
*
|
||||
* But if we instead us the `subscribeOn` operator declaring that we want to use the {@link asyncScheduler} for values emited by Observable `a`:
|
||||
* ```javascript
|
||||
* import { of, merge, asyncScheduler } from 'rxjs';
|
||||
* import { subscribeOn } from 'rxjs/operators';
|
||||
*
|
||||
* const a = of(1, 2, 3, 4).pipe(subscribeOn(asyncScheduler));
|
||||
* const b = of(5, 6, 7, 8, 9);
|
||||
* merge(a, b).subscribe(console.log);
|
||||
* ```
|
||||
*
|
||||
* The output will instead be `5 6 7 8 9 1 2 3 4`.
|
||||
* The reason for this is that Observable `b` emits its values directly and synchronously like before
|
||||
* but the emissions from `a` are scheduled on the event loop because we are now using the {@link asyncScheduler} for that specific Observable.
|
||||
*
|
||||
* @param {SchedulerLike} scheduler - The {@link SchedulerLike} to perform subscription actions on.
|
||||
* @return {Observable<T>} The source Observable modified so that its subscriptions happen on the specified {@link SchedulerLike}.
|
||||
.
|
||||
* @method subscribeOn
|
||||
* @owner Observable
|
||||
*/
|
||||
export function subscribeOn<T>(scheduler: SchedulerLike, delay: number = 0): MonoTypeOperatorFunction<T> {
|
||||
return function subscribeOnOperatorFunction(source: Observable<T>): Observable<T> {
|
||||
return source.lift(new SubscribeOnOperator<T>(scheduler, delay));
|
||||
};
|
||||
}
|
||||
|
||||
class SubscribeOnOperator<T> implements Operator<T, T> {
|
||||
constructor(private scheduler: SchedulerLike,
|
||||
private delay: number) {
|
||||
}
|
||||
call(subscriber: Subscriber<T>, source: any): TeardownLogic {
|
||||
return new SubscribeOnObservable<T>(
|
||||
source, this.delay, this.scheduler
|
||||
).subscribe(subscriber);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"concat.js","sources":["../../src/internal/observable/concat.ts"],"names":[],"mappings":";;AAGA,2BAA0B;AAE1B,oDAAmD;AA2InD,SAAgB,MAAM;IAAoC,qBAAwC;SAAxC,UAAwC,EAAxC,qBAAwC,EAAxC,IAAwC;QAAxC,gCAAwC;;IAChG,OAAO,qBAAS,EAAK,CAAC,OAAE,eAAI,WAAW,EAAE,CAAC;AAC5C,CAAC;AAFD,wBAEC"}
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "colorette",
|
||||
"version": "1.4.0",
|
||||
"type": "module",
|
||||
"main": "index.cjs",
|
||||
"module": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"description": "Easily set the text color and style in the terminal.",
|
||||
"repository": "jorgebucaran/colorette",
|
||||
"license": "MIT",
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": {
|
||||
"require": "./index.cjs",
|
||||
"import": "./index.js"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"*.*(c)[tj]s*"
|
||||
],
|
||||
"author": "Jorge Bucaran",
|
||||
"keywords": [
|
||||
"terminal",
|
||||
"styles",
|
||||
"color",
|
||||
"ansi"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "c8 twist tests/*.js",
|
||||
"build": "node -e \"fs.writeFileSync('index.cjs', fs.readFileSync('index.js', 'utf8').replace(/export const /g, 'exports.').replace(/import \\* as ([^ ]+) from \\\"(.+)\\\"/, 'const \\$1 = require(\\\"\\$2\\\")'), 'utf8')\"",
|
||||
"deploy": "npm test && git commit --all --message $tag && git tag --sign $tag --message $tag && git push && git push --tags",
|
||||
"release": "tag=$npm_package_version npm run deploy && npm publish --access public",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"c8": "*",
|
||||
"twist": "*"
|
||||
}
|
||||
}
|
||||
@@ -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/observable/fromEvent"));
|
||||
//# sourceMappingURL=fromEvent.js.map
|
||||
@@ -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/observable/onErrorResumeNext"));
|
||||
//# sourceMappingURL=onErrorResumeNext.js.map
|
||||
@@ -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.0959,"53":0,"54":0,"55":0.00599,"56":0,"57":0,"58":0,"59":0,"60":0.02398,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0.16783,"69":0,"70":0,"71":0.00599,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.10789,"79":0.01199,"80":0.00599,"81":0.04196,"82":0.01199,"83":0.01798,"84":0.00599,"85":0,"86":0,"87":0,"88":0.00599,"89":0.00599,"90":0,"91":0.00599,"92":0,"93":0,"94":0,"95":0.01798,"96":0.00599,"97":0.01199,"98":0.00599,"99":0.01199,"100":0.01199,"101":0.01199,"102":0.06593,"103":0.02997,"104":0.02997,"105":0.02398,"106":0.02997,"107":0.04795,"108":1.18681,"109":0.60539,"110":0.00599,"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,"30":0,"31":0.00599,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0.00599,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0.00599,"49":0.08392,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0.00599,"57":0.00599,"58":0,"59":0.07792,"60":0,"61":0.01199,"62":0,"63":0.00599,"64":0,"65":0,"66":0,"67":0,"68":0.00599,"69":0.00599,"70":0.00599,"71":0.01199,"72":0.00599,"73":0.00599,"74":0.01199,"75":0.00599,"76":0.00599,"77":0.00599,"78":0.00599,"79":0.02398,"80":0.01798,"81":0.03596,"83":0.03596,"84":0.18581,"85":0.07193,"86":0.0959,"87":0.04795,"88":0.02997,"89":0.01798,"90":0.14985,"91":0.13786,"92":0.14386,"93":0.13786,"94":0.13786,"95":0.02997,"96":0.05994,"97":0.05994,"98":0.06593,"99":0.04196,"100":0.06593,"101":0.04795,"102":0.10789,"103":0.1019,"104":0.10789,"105":0.08991,"106":0.10789,"107":0.26973,"108":9.45254,"109":7.71428,"110":0.01199,"111":0.01199,"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,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0.01798,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0.00599,"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.00599,"63":0,"64":0.00599,"65":0,"66":0,"67":0.00599,"68":0.01199,"69":0.01199,"70":0.00599,"71":0.01199,"72":0.02997,"73":0.25774,"74":0.00599,"75":0,"76":0,"77":0.00599,"78":0,"79":0.05395,"80":0.01199,"81":0.00599,"82":0.02398,"83":0.02398,"84":0.02997,"85":0.14386,"86":0.04196,"87":0.01798,"88":0.00599,"89":0.01199,"90":0.01199,"91":0.01199,"92":0.04795,"93":1.07293,"94":6.76123,"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.02398},B:{"12":0,"13":0,"14":0.00599,"15":0,"16":0,"17":0,"18":0.00599,"79":0,"80":0,"81":0,"83":0,"84":0.00599,"85":0.00599,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.00599,"93":0,"94":0,"95":0.00599,"96":0.02997,"97":0.01199,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0.01798,"107":0.01798,"108":0.47952,"109":0.3956},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.00599,"14":0.05994,"15":0.00599,_:"0","3.1":0,"3.2":0,"5.1":0.01798,"6.1":0,"7.1":0,"9.1":0.00599,"10.1":0,"11.1":0,"12.1":0.00599,"13.1":0.03596,"14.1":0.05395,"15.1":0.01199,"15.2-15.3":0.00599,"15.4":0.01798,"15.5":0.04795,"15.6":0.19181,"16.0":0.02997,"16.1":0.14386,"16.2":0.22777,"16.3":0.02398},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.0044,"6.0-6.1":0.00586,"7.0-7.1":0.03077,"8.1-8.4":0.00586,"9.0-9.2":0.00733,"9.3":0.05568,"10.0-10.2":0.00147,"10.3":0.03517,"11.0-11.2":0.02491,"11.3-11.4":0.02051,"12.0-12.1":0.00879,"12.2-12.5":0.26228,"13.0-13.1":0.01026,"13.2":0.01172,"13.3":0.03224,"13.4-13.7":0.08792,"14.0-14.4":0.20807,"14.5-14.8":0.4264,"15.0-15.1":0.11136,"15.2-15.3":0.18756,"15.4":0.19488,"15.5":0.32236,"15.6":1.24402,"16.0":2.87341,"16.1":3.83463,"16.2":3.30274,"16.3":0.31357},P:{"4":0.05286,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.06343,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0.01057,"12.0":0.01057,"13.0":0.01057,"14.0":0.02114,"15.0":0.01057,"16.0":0.02114,"17.0":0.02114,"18.0":0.06343,"19.0":0.85628},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0.00658,"4.1":0.00439,"4.2-4.3":0.02851,"4.4":0,"4.4.3-4.4.4":0.09649},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0.01262,"9":0.00631,"10":0.00631,"11":0.21452,"5.5":0},N:{"10":0,"11":0},J:{"7":0,"10":0},Q:{"13.1":0},O:{"0":0.14822},H:{"0":5.45},L:{"0":38.30579},S:{"2.5":0},R:{_:"0"},M:{"0":0.15223}};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"throwError.js","sources":["../../../src/internal/observable/throwError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAoE3C,MAAM,UAAU,UAAU,CAAC,KAAU,EAAE,SAAyB;IAC9D,IAAI,CAAC,SAAS,EAAE;QACd,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;KAC9D;SAAM;QACL,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;KAC7F;AACH,CAAC;AAOD,SAAS,QAAQ,CAAC,EAAE,KAAK,EAAE,UAAU,EAAe;IAClD,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC"}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,69 @@
|
||||
import { Operator } from '../Operator';
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError';
|
||||
import { Observable } from '../Observable';
|
||||
import { MonoTypeOperatorFunction, TeardownLogic } from '../types';
|
||||
import { filter } from './filter';
|
||||
import { throwIfEmpty } from './throwIfEmpty';
|
||||
import { defaultIfEmpty } from './defaultIfEmpty';
|
||||
import { take } from './take';
|
||||
|
||||
/**
|
||||
* Emits the single value at the specified `index` in a sequence of emissions
|
||||
* from the source Observable.
|
||||
*
|
||||
* <span class="informal">Emits only the i-th value, then completes.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* `elementAt` returns an Observable that emits the item at the specified
|
||||
* `index` in the source Observable, or a default value if that `index` is out
|
||||
* of range and the `default` argument is provided. If the `default` argument is
|
||||
* not given and the `index` is out of range, the output Observable will emit an
|
||||
* `ArgumentOutOfRangeError` error.
|
||||
*
|
||||
* ## Example
|
||||
* Emit only the third click event
|
||||
* ```ts
|
||||
* import { fromEvent } from 'rxjs';
|
||||
* import { elementAt } from 'rxjs/operators';
|
||||
*
|
||||
* const clicks = fromEvent(document, 'click');
|
||||
* const result = clicks.pipe(elementAt(2));
|
||||
* result.subscribe(x => console.log(x));
|
||||
*
|
||||
* // Results in:
|
||||
* // click 1 = nothing
|
||||
* // click 2 = nothing
|
||||
* // click 3 = MouseEvent object logged to console
|
||||
* ```
|
||||
*
|
||||
* @see {@link first}
|
||||
* @see {@link last}
|
||||
* @see {@link skip}
|
||||
* @see {@link single}
|
||||
* @see {@link take}
|
||||
*
|
||||
* @throws {ArgumentOutOfRangeError} When using `elementAt(i)`, it delivers an
|
||||
* ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0` or the
|
||||
* Observable has completed before emitting the i-th `next` notification.
|
||||
*
|
||||
* @param {number} index Is the number `i` for the i-th source emission that has
|
||||
* happened since the subscription, starting from the number `0`.
|
||||
* @param {T} [defaultValue] The default value returned for missing indices.
|
||||
* @return {Observable} An Observable that emits a single item, if it is found.
|
||||
* Otherwise, will emit the default value if given. If not, then emits an error.
|
||||
* @method elementAt
|
||||
* @owner Observable
|
||||
*/
|
||||
export function elementAt<T>(index: number, defaultValue?: T): MonoTypeOperatorFunction<T> {
|
||||
if (index < 0) { throw new ArgumentOutOfRangeError(); }
|
||||
const hasDefaultValue = arguments.length >= 2;
|
||||
return (source: Observable<T>) => source.pipe(
|
||||
filter((v, i) => i === index),
|
||||
take(1),
|
||||
hasDefaultValue
|
||||
? defaultIfEmpty(defaultValue)
|
||||
: throwIfEmpty(() => new ArgumentOutOfRangeError()),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
import 'rxjs-compat/add/operator/race';
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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/repeatWhen"));
|
||||
//# sourceMappingURL=repeatWhen.js.map
|
||||
@@ -0,0 +1,12 @@
|
||||
/** PURE_IMPORTS_START _observable_zip PURE_IMPORTS_END */
|
||||
import { zip as zipStatic } from '../observable/zip';
|
||||
export function zip() {
|
||||
var observables = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
observables[_i] = arguments[_i];
|
||||
}
|
||||
return function zipOperatorFunction(source) {
|
||||
return source.lift.call(zipStatic.apply(void 0, [source].concat(observables)));
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=zip.js.map
|
||||
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
|
||||
module.exports = function () {
|
||||
const isWindows = process.platform === 'win32';
|
||||
const yarnPath = isWindows ? path.join('Yarn', 'config', 'global') : path.join('.config', 'yarn', 'global');
|
||||
if (__dirname.includes(yarnPath)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
@@ -0,0 +1,359 @@
|
||||
/** PURE_IMPORTS_START tslib,_Observable,_Notification,_ColdObservable,_HotObservable,_SubscriptionLog,_scheduler_VirtualTimeScheduler,_scheduler_AsyncScheduler PURE_IMPORTS_END */
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Observable } from '../Observable';
|
||||
import { Notification } from '../Notification';
|
||||
import { ColdObservable } from './ColdObservable';
|
||||
import { HotObservable } from './HotObservable';
|
||||
import { SubscriptionLog } from './SubscriptionLog';
|
||||
import { VirtualTimeScheduler, VirtualAction } from '../scheduler/VirtualTimeScheduler';
|
||||
import { AsyncScheduler } from '../scheduler/AsyncScheduler';
|
||||
var defaultMaxFrame = 750;
|
||||
var TestScheduler = /*@__PURE__*/ (function (_super) {
|
||||
tslib_1.__extends(TestScheduler, _super);
|
||||
function TestScheduler(assertDeepEqual) {
|
||||
var _this = _super.call(this, VirtualAction, defaultMaxFrame) || this;
|
||||
_this.assertDeepEqual = assertDeepEqual;
|
||||
_this.hotObservables = [];
|
||||
_this.coldObservables = [];
|
||||
_this.flushTests = [];
|
||||
_this.runMode = false;
|
||||
return _this;
|
||||
}
|
||||
TestScheduler.prototype.createTime = function (marbles) {
|
||||
var indexOf = marbles.indexOf('|');
|
||||
if (indexOf === -1) {
|
||||
throw new Error('marble diagram for time should have a completion marker "|"');
|
||||
}
|
||||
return indexOf * TestScheduler.frameTimeFactor;
|
||||
};
|
||||
TestScheduler.prototype.createColdObservable = function (marbles, values, error) {
|
||||
if (marbles.indexOf('^') !== -1) {
|
||||
throw new Error('cold observable cannot have subscription offset "^"');
|
||||
}
|
||||
if (marbles.indexOf('!') !== -1) {
|
||||
throw new Error('cold observable cannot have unsubscription marker "!"');
|
||||
}
|
||||
var messages = TestScheduler.parseMarbles(marbles, values, error, undefined, this.runMode);
|
||||
var cold = new ColdObservable(messages, this);
|
||||
this.coldObservables.push(cold);
|
||||
return cold;
|
||||
};
|
||||
TestScheduler.prototype.createHotObservable = function (marbles, values, error) {
|
||||
if (marbles.indexOf('!') !== -1) {
|
||||
throw new Error('hot observable cannot have unsubscription marker "!"');
|
||||
}
|
||||
var messages = TestScheduler.parseMarbles(marbles, values, error, undefined, this.runMode);
|
||||
var subject = new HotObservable(messages, this);
|
||||
this.hotObservables.push(subject);
|
||||
return subject;
|
||||
};
|
||||
TestScheduler.prototype.materializeInnerObservable = function (observable, outerFrame) {
|
||||
var _this = this;
|
||||
var messages = [];
|
||||
observable.subscribe(function (value) {
|
||||
messages.push({ frame: _this.frame - outerFrame, notification: Notification.createNext(value) });
|
||||
}, function (err) {
|
||||
messages.push({ frame: _this.frame - outerFrame, notification: Notification.createError(err) });
|
||||
}, function () {
|
||||
messages.push({ frame: _this.frame - outerFrame, notification: Notification.createComplete() });
|
||||
});
|
||||
return messages;
|
||||
};
|
||||
TestScheduler.prototype.expectObservable = function (observable, subscriptionMarbles) {
|
||||
var _this = this;
|
||||
if (subscriptionMarbles === void 0) {
|
||||
subscriptionMarbles = null;
|
||||
}
|
||||
var actual = [];
|
||||
var flushTest = { actual: actual, ready: false };
|
||||
var subscriptionParsed = TestScheduler.parseMarblesAsSubscriptions(subscriptionMarbles, this.runMode);
|
||||
var subscriptionFrame = subscriptionParsed.subscribedFrame === Number.POSITIVE_INFINITY ?
|
||||
0 : subscriptionParsed.subscribedFrame;
|
||||
var unsubscriptionFrame = subscriptionParsed.unsubscribedFrame;
|
||||
var subscription;
|
||||
this.schedule(function () {
|
||||
subscription = observable.subscribe(function (x) {
|
||||
var value = x;
|
||||
if (x instanceof Observable) {
|
||||
value = _this.materializeInnerObservable(value, _this.frame);
|
||||
}
|
||||
actual.push({ frame: _this.frame, notification: Notification.createNext(value) });
|
||||
}, function (err) {
|
||||
actual.push({ frame: _this.frame, notification: Notification.createError(err) });
|
||||
}, function () {
|
||||
actual.push({ frame: _this.frame, notification: Notification.createComplete() });
|
||||
});
|
||||
}, subscriptionFrame);
|
||||
if (unsubscriptionFrame !== Number.POSITIVE_INFINITY) {
|
||||
this.schedule(function () { return subscription.unsubscribe(); }, unsubscriptionFrame);
|
||||
}
|
||||
this.flushTests.push(flushTest);
|
||||
var runMode = this.runMode;
|
||||
return {
|
||||
toBe: function (marbles, values, errorValue) {
|
||||
flushTest.ready = true;
|
||||
flushTest.expected = TestScheduler.parseMarbles(marbles, values, errorValue, true, runMode);
|
||||
}
|
||||
};
|
||||
};
|
||||
TestScheduler.prototype.expectSubscriptions = function (actualSubscriptionLogs) {
|
||||
var flushTest = { actual: actualSubscriptionLogs, ready: false };
|
||||
this.flushTests.push(flushTest);
|
||||
var runMode = this.runMode;
|
||||
return {
|
||||
toBe: function (marbles) {
|
||||
var marblesArray = (typeof marbles === 'string') ? [marbles] : marbles;
|
||||
flushTest.ready = true;
|
||||
flushTest.expected = marblesArray.map(function (marbles) {
|
||||
return TestScheduler.parseMarblesAsSubscriptions(marbles, runMode);
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
TestScheduler.prototype.flush = function () {
|
||||
var _this = this;
|
||||
var hotObservables = this.hotObservables;
|
||||
while (hotObservables.length > 0) {
|
||||
hotObservables.shift().setup();
|
||||
}
|
||||
_super.prototype.flush.call(this);
|
||||
this.flushTests = this.flushTests.filter(function (test) {
|
||||
if (test.ready) {
|
||||
_this.assertDeepEqual(test.actual, test.expected);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
};
|
||||
TestScheduler.parseMarblesAsSubscriptions = function (marbles, runMode) {
|
||||
var _this = this;
|
||||
if (runMode === void 0) {
|
||||
runMode = false;
|
||||
}
|
||||
if (typeof marbles !== 'string') {
|
||||
return new SubscriptionLog(Number.POSITIVE_INFINITY);
|
||||
}
|
||||
var len = marbles.length;
|
||||
var groupStart = -1;
|
||||
var subscriptionFrame = Number.POSITIVE_INFINITY;
|
||||
var unsubscriptionFrame = Number.POSITIVE_INFINITY;
|
||||
var frame = 0;
|
||||
var _loop_1 = function (i) {
|
||||
var nextFrame = frame;
|
||||
var advanceFrameBy = function (count) {
|
||||
nextFrame += count * _this.frameTimeFactor;
|
||||
};
|
||||
var c = marbles[i];
|
||||
switch (c) {
|
||||
case ' ':
|
||||
if (!runMode) {
|
||||
advanceFrameBy(1);
|
||||
}
|
||||
break;
|
||||
case '-':
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case '(':
|
||||
groupStart = frame;
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case ')':
|
||||
groupStart = -1;
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case '^':
|
||||
if (subscriptionFrame !== Number.POSITIVE_INFINITY) {
|
||||
throw new Error('found a second subscription point \'^\' in a ' +
|
||||
'subscription marble diagram. There can only be one.');
|
||||
}
|
||||
subscriptionFrame = groupStart > -1 ? groupStart : frame;
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case '!':
|
||||
if (unsubscriptionFrame !== Number.POSITIVE_INFINITY) {
|
||||
throw new Error('found a second subscription point \'^\' in a ' +
|
||||
'subscription marble diagram. There can only be one.');
|
||||
}
|
||||
unsubscriptionFrame = groupStart > -1 ? groupStart : frame;
|
||||
break;
|
||||
default:
|
||||
if (runMode && c.match(/^[0-9]$/)) {
|
||||
if (i === 0 || marbles[i - 1] === ' ') {
|
||||
var buffer = marbles.slice(i);
|
||||
var match = buffer.match(/^([0-9]+(?:\.[0-9]+)?)(ms|s|m) /);
|
||||
if (match) {
|
||||
i += match[0].length - 1;
|
||||
var duration = parseFloat(match[1]);
|
||||
var unit = match[2];
|
||||
var durationInMs = void 0;
|
||||
switch (unit) {
|
||||
case 'ms':
|
||||
durationInMs = duration;
|
||||
break;
|
||||
case 's':
|
||||
durationInMs = duration * 1000;
|
||||
break;
|
||||
case 'm':
|
||||
durationInMs = duration * 1000 * 60;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
advanceFrameBy(durationInMs / this_1.frameTimeFactor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new Error('there can only be \'^\' and \'!\' markers in a ' +
|
||||
'subscription marble diagram. Found instead \'' + c + '\'.');
|
||||
}
|
||||
frame = nextFrame;
|
||||
out_i_1 = i;
|
||||
};
|
||||
var this_1 = this, out_i_1;
|
||||
for (var i = 0; i < len; i++) {
|
||||
_loop_1(i);
|
||||
i = out_i_1;
|
||||
}
|
||||
if (unsubscriptionFrame < 0) {
|
||||
return new SubscriptionLog(subscriptionFrame);
|
||||
}
|
||||
else {
|
||||
return new SubscriptionLog(subscriptionFrame, unsubscriptionFrame);
|
||||
}
|
||||
};
|
||||
TestScheduler.parseMarbles = function (marbles, values, errorValue, materializeInnerObservables, runMode) {
|
||||
var _this = this;
|
||||
if (materializeInnerObservables === void 0) {
|
||||
materializeInnerObservables = false;
|
||||
}
|
||||
if (runMode === void 0) {
|
||||
runMode = false;
|
||||
}
|
||||
if (marbles.indexOf('!') !== -1) {
|
||||
throw new Error('conventional marble diagrams cannot have the ' +
|
||||
'unsubscription marker "!"');
|
||||
}
|
||||
var len = marbles.length;
|
||||
var testMessages = [];
|
||||
var subIndex = runMode ? marbles.replace(/^[ ]+/, '').indexOf('^') : marbles.indexOf('^');
|
||||
var frame = subIndex === -1 ? 0 : (subIndex * -this.frameTimeFactor);
|
||||
var getValue = typeof values !== 'object' ?
|
||||
function (x) { return x; } :
|
||||
function (x) {
|
||||
if (materializeInnerObservables && values[x] instanceof ColdObservable) {
|
||||
return values[x].messages;
|
||||
}
|
||||
return values[x];
|
||||
};
|
||||
var groupStart = -1;
|
||||
var _loop_2 = function (i) {
|
||||
var nextFrame = frame;
|
||||
var advanceFrameBy = function (count) {
|
||||
nextFrame += count * _this.frameTimeFactor;
|
||||
};
|
||||
var notification = void 0;
|
||||
var c = marbles[i];
|
||||
switch (c) {
|
||||
case ' ':
|
||||
if (!runMode) {
|
||||
advanceFrameBy(1);
|
||||
}
|
||||
break;
|
||||
case '-':
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case '(':
|
||||
groupStart = frame;
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case ')':
|
||||
groupStart = -1;
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case '|':
|
||||
notification = Notification.createComplete();
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case '^':
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case '#':
|
||||
notification = Notification.createError(errorValue || 'error');
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
default:
|
||||
if (runMode && c.match(/^[0-9]$/)) {
|
||||
if (i === 0 || marbles[i - 1] === ' ') {
|
||||
var buffer = marbles.slice(i);
|
||||
var match = buffer.match(/^([0-9]+(?:\.[0-9]+)?)(ms|s|m) /);
|
||||
if (match) {
|
||||
i += match[0].length - 1;
|
||||
var duration = parseFloat(match[1]);
|
||||
var unit = match[2];
|
||||
var durationInMs = void 0;
|
||||
switch (unit) {
|
||||
case 'ms':
|
||||
durationInMs = duration;
|
||||
break;
|
||||
case 's':
|
||||
durationInMs = duration * 1000;
|
||||
break;
|
||||
case 'm':
|
||||
durationInMs = duration * 1000 * 60;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
advanceFrameBy(durationInMs / this_2.frameTimeFactor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
notification = Notification.createNext(getValue(c));
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
}
|
||||
if (notification) {
|
||||
testMessages.push({ frame: groupStart > -1 ? groupStart : frame, notification: notification });
|
||||
}
|
||||
frame = nextFrame;
|
||||
out_i_2 = i;
|
||||
};
|
||||
var this_2 = this, out_i_2;
|
||||
for (var i = 0; i < len; i++) {
|
||||
_loop_2(i);
|
||||
i = out_i_2;
|
||||
}
|
||||
return testMessages;
|
||||
};
|
||||
TestScheduler.prototype.run = function (callback) {
|
||||
var prevFrameTimeFactor = TestScheduler.frameTimeFactor;
|
||||
var prevMaxFrames = this.maxFrames;
|
||||
TestScheduler.frameTimeFactor = 1;
|
||||
this.maxFrames = Number.POSITIVE_INFINITY;
|
||||
this.runMode = true;
|
||||
AsyncScheduler.delegate = this;
|
||||
var helpers = {
|
||||
cold: this.createColdObservable.bind(this),
|
||||
hot: this.createHotObservable.bind(this),
|
||||
flush: this.flush.bind(this),
|
||||
expectObservable: this.expectObservable.bind(this),
|
||||
expectSubscriptions: this.expectSubscriptions.bind(this),
|
||||
};
|
||||
try {
|
||||
var ret = callback(helpers);
|
||||
this.flush();
|
||||
return ret;
|
||||
}
|
||||
finally {
|
||||
TestScheduler.frameTimeFactor = prevFrameTimeFactor;
|
||||
this.maxFrames = prevMaxFrames;
|
||||
this.runMode = false;
|
||||
AsyncScheduler.delegate = undefined;
|
||||
}
|
||||
};
|
||||
return TestScheduler;
|
||||
}(VirtualTimeScheduler));
|
||||
export { TestScheduler };
|
||||
//# sourceMappingURL=TestScheduler.js.map
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "has-yarn",
|
||||
"version": "2.1.0",
|
||||
"description": "Check if a project is using Yarn",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/has-yarn",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"yarn",
|
||||
"has",
|
||||
"detect",
|
||||
"is",
|
||||
"project",
|
||||
"app",
|
||||
"module",
|
||||
"package",
|
||||
"manager",
|
||||
"npm"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.1",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"publishBehavior.js","sources":["../src/operators/publishBehavior.ts"],"names":[],"mappings":";;;;;AAAA,2DAAsD"}
|
||||
Reference in New Issue
Block a user