new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A BC","164":"B"},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","36":"C K L H M N O"},C:{"1":"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":"CC tB I u J E F G A B C K L H M N DC EC","36":"0 1 2 3 4 5 6 7 8 9 O v w x y z AB BB CB DB EB FB GB HB IB JB"},D:{"1":"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 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"},E:{"2":"I u J E F G A B C K L H GC zB HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC"},F:{"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 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 G B C H M N O v w x y z OC PC QC RC qB 9B SC rB"},G:{"2":"F zB TC AC 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"},H:{"2":"nC"},I:{"2":"tB I D 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","36":"B"},O:{"1":"uC"},P:{"1":"vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C","16":"I"},Q:{"1":"1B"},R:{"1":"8C"},S:{"1":"9C"}},B:5,C:"Screen Orientation"};
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/util/isScheduler';
|
||||
@@ -0,0 +1,31 @@
|
||||
# decompress-response [](https://travis-ci.org/sindresorhus/decompress-response)
|
||||
|
||||
> Decompress a HTTP response if needed
|
||||
|
||||
Decompresses the [response](https://nodejs.org/api/http.html#http_class_http_incomingmessage) from [`http.request`](https://nodejs.org/api/http.html#http_http_request_options_callback) if it's gzipped or deflated, otherwise just passes it through.
|
||||
|
||||
Used by [`got`](https://github.com/sindresorhus/got).
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install decompress-response
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const http = require('http');
|
||||
const decompressResponse = require('decompress-response');
|
||||
|
||||
http.get('http://sindresorhus.com', response => {
|
||||
response = decompressResponse(response);
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isIterable.js","sources":["../../src/internal/util/isIterable.ts"],"names":[],"mappings":";;AAAA,+CAAiE;AAGjE,SAAgB,UAAU,CAAC,KAAU;IACnC,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,mBAAe,CAAC,KAAK,UAAU,CAAC;AAC/D,CAAC;AAFD,gCAEC"}
|
||||
@@ -0,0 +1,11 @@
|
||||
export class Scheduler {
|
||||
constructor(SchedulerAction, now = Scheduler.now) {
|
||||
this.SchedulerAction = SchedulerAction;
|
||||
this.now = now;
|
||||
}
|
||||
schedule(work, delay = 0, state) {
|
||||
return new this.SchedulerAction(this, work).schedule(state, delay);
|
||||
}
|
||||
}
|
||||
Scheduler.now = () => Date.now();
|
||||
//# sourceMappingURL=Scheduler.js.map
|
||||
@@ -0,0 +1,139 @@
|
||||
import {Resolver, promises as dnsPromises, lookup} from 'dns';
|
||||
import {Agent} from 'http';
|
||||
|
||||
type AsyncResolver = dnsPromises.Resolver;
|
||||
|
||||
export type IPFamily = 4 | 6;
|
||||
|
||||
type TPromise<T> = T | Promise<T>;
|
||||
|
||||
export interface CacheInstance {
|
||||
set(hostname: string, entries: EntryObject[], ttl: number): TPromise<void | boolean | this>;
|
||||
get(hostname: string): TPromise<EntryObject[] | undefined>;
|
||||
delete(hostname: string): TPromise<boolean>;
|
||||
clear(): TPromise<void>;
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
/**
|
||||
* Custom cache instance. If `undefined`, it will create a new one.
|
||||
* @default undefined
|
||||
*/
|
||||
cache?: CacheInstance;
|
||||
/**
|
||||
* Limits the cache time (TTL). If set to `0`, it will make a new DNS query each time.
|
||||
* @default Infinity
|
||||
*/
|
||||
maxTtl?: number;
|
||||
/**
|
||||
* DNS Resolver used to make DNS queries.
|
||||
* @default new dns.promises.Resolver()
|
||||
*/
|
||||
resolver?: Resolver | AsyncResolver;
|
||||
/**
|
||||
* When the DNS server responds with `ENOTFOUND` or `ENODATA` and the OS reports that the entry is available,
|
||||
* it will use `dns.lookup(...)` directly for the requested hostnames for the specified amount of time (in seconds).
|
||||
*
|
||||
* If you don't query internal hostnames (such as `localhost`, `database.local` etc.),
|
||||
* it is strongly recommended to set this value to `0`.
|
||||
* @default 3600
|
||||
*/
|
||||
fallbackDuration?: number;
|
||||
/**
|
||||
* The time how long it needs to remember failed queries (TTL in seconds).
|
||||
*
|
||||
* **Note**: This option is independent, `options.maxTtl` does not affect this.
|
||||
* @default 0.15
|
||||
*/
|
||||
errorTtl?: number;
|
||||
/**
|
||||
* The fallback function to use when the DNS server responds with `ENOTFOUND` or `ENODATA`.
|
||||
*
|
||||
* **Note**: This has no effect if the `fallbackDuration` option is less than `1`.
|
||||
* @default dns.lookup
|
||||
*/
|
||||
lookup?: typeof lookup;
|
||||
}
|
||||
|
||||
export interface EntryObject {
|
||||
/**
|
||||
* The IP address (can be an IPv4 or IPv5 address).
|
||||
*/
|
||||
readonly address: string;
|
||||
/**
|
||||
* The IP family.
|
||||
*/
|
||||
readonly family: IPFamily;
|
||||
/**
|
||||
* The original TTL.
|
||||
*/
|
||||
readonly ttl?: number;
|
||||
/**
|
||||
* The expiration timestamp.
|
||||
*/
|
||||
readonly expires?: number;
|
||||
}
|
||||
|
||||
export interface LookupOptions {
|
||||
/**
|
||||
* One or more supported getaddrinfo flags. Multiple flags may be passed by bitwise ORing their values.
|
||||
*/
|
||||
hints?: number;
|
||||
/**
|
||||
* The record family. Must be `4` or `6`. IPv4 and IPv6 addresses are both returned by default.
|
||||
*/
|
||||
family?: IPFamily;
|
||||
/**
|
||||
* When `true`, the callback returns all resolved addresses in an array. Otherwise, returns a single address.
|
||||
* @default false
|
||||
*/
|
||||
all?: boolean;
|
||||
}
|
||||
|
||||
export default class CacheableLookup {
|
||||
constructor(options?: Options);
|
||||
/**
|
||||
* The DNS servers used to make queries. Can be overridden - doing so will clear the cache.
|
||||
*/
|
||||
servers: string[];
|
||||
/**
|
||||
* @see https://nodejs.org/api/dns.html#dns_dns_lookup_hostname_options_callback
|
||||
*/
|
||||
lookup(hostname: string, family: IPFamily, callback: (error: NodeJS.ErrnoException, address: string, family: IPFamily) => void): void;
|
||||
lookup(hostname: string, callback: (error: NodeJS.ErrnoException, address: string, family: IPFamily) => void): void;
|
||||
lookup(hostname: string, options: LookupOptions & {all: true}, callback: (error: NodeJS.ErrnoException, result: ReadonlyArray<EntryObject>) => void): void;
|
||||
lookup(hostname: string, options: LookupOptions, callback: (error: NodeJS.ErrnoException, address: string, family: IPFamily) => void): void;
|
||||
/**
|
||||
* The asynchronous version of `dns.lookup(…)`.
|
||||
*/
|
||||
lookupAsync(hostname: string, options: LookupOptions & {all: true}): Promise<ReadonlyArray<EntryObject>>;
|
||||
lookupAsync(hostname: string, options: LookupOptions): Promise<EntryObject>;
|
||||
lookupAsync(hostname: string): Promise<EntryObject>;
|
||||
lookupAsync(hostname: string, family: IPFamily): Promise<EntryObject>;
|
||||
/**
|
||||
* An asynchronous function which returns cached DNS lookup entries. This is the base for `lookupAsync(hostname, options)` and `lookup(hostname, options, callback)`.
|
||||
*/
|
||||
query(hostname: string): Promise<ReadonlyArray<EntryObject>>;
|
||||
/**
|
||||
* An asynchronous function which makes a new DNS lookup query and updates the database. This is used by `query(hostname, family)` if no entry in the database is present. Returns an array of objects with `address`, `family`, `ttl` and `expires` properties.
|
||||
*/
|
||||
queryAndCache(hostname: string): Promise<ReadonlyArray<EntryObject>>;
|
||||
/**
|
||||
* Attaches itself to an Agent instance.
|
||||
*/
|
||||
install(agent: Agent): void;
|
||||
/**
|
||||
* Removes itself from an Agent instance.
|
||||
*/
|
||||
uninstall(agent: Agent): void;
|
||||
/**
|
||||
* Updates interface info. For example, you need to run this when you plug or unplug your WiFi driver.
|
||||
*
|
||||
* **Note:** Running `updateInterfaceInfo()` will trigger `clear()` only on network interface removal.
|
||||
*/
|
||||
updateInterfaceInfo(): void;
|
||||
/**
|
||||
* Clears the cache for the given hostname. If the hostname argument is not present, the entire cache will be emptied.
|
||||
*/
|
||||
clear(hostname?: string): void;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
let Declaration = require('../declaration')
|
||||
|
||||
class BreakProps extends Declaration {
|
||||
/**
|
||||
* Change name for -webkit- and -moz- prefix
|
||||
*/
|
||||
prefixed (prop, prefix) {
|
||||
return `${prefix}column-${prop}`
|
||||
}
|
||||
|
||||
/**
|
||||
* Return property name by final spec
|
||||
*/
|
||||
normalize (prop) {
|
||||
if (prop.includes('inside')) {
|
||||
return 'break-inside'
|
||||
}
|
||||
if (prop.includes('before')) {
|
||||
return 'break-before'
|
||||
}
|
||||
return 'break-after'
|
||||
}
|
||||
|
||||
/**
|
||||
* Change prefixed value for avoid-column and avoid-page
|
||||
*/
|
||||
set (decl, prefix) {
|
||||
if (
|
||||
(decl.prop === 'break-inside' && decl.value === 'avoid-column') ||
|
||||
decl.value === 'avoid-page'
|
||||
) {
|
||||
decl.value = 'avoid'
|
||||
}
|
||||
return super.set(decl, prefix)
|
||||
}
|
||||
|
||||
/**
|
||||
* Don’t prefix some values
|
||||
*/
|
||||
insert (decl, prefix, prefixes) {
|
||||
if (decl.prop !== 'break-inside') {
|
||||
return super.insert(decl, prefix, prefixes)
|
||||
}
|
||||
if (/region/i.test(decl.value) || /page/i.test(decl.value)) {
|
||||
return undefined
|
||||
}
|
||||
return super.insert(decl, prefix, prefixes)
|
||||
}
|
||||
}
|
||||
|
||||
BreakProps.names = [
|
||||
'break-inside',
|
||||
'page-break-inside',
|
||||
'column-break-inside',
|
||||
'break-before',
|
||||
'page-break-before',
|
||||
'column-break-before',
|
||||
'break-after',
|
||||
'page-break-after',
|
||||
'column-break-after'
|
||||
]
|
||||
|
||||
module.exports = BreakProps
|
||||
@@ -0,0 +1 @@
|
||||
import 'rxjs-compat/add/operator/buffer';
|
||||
@@ -0,0 +1 @@
|
||||
import 'rxjs-compat/add/operator/defaultIfEmpty';
|
||||
@@ -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.00218,"97":0,"98":0,"99":0,"100":0.00218,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0.00436,"108":0.07187,"109":0.03267,"110":0,"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,"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.00218,"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.00218,"67":0.00436,"68":0,"69":0.00218,"70":0,"71":0,"72":0,"73":0,"74":0.00436,"75":0.00218,"76":0,"77":0,"78":0,"79":0.00218,"80":0,"81":0.00436,"83":0,"84":0,"85":0,"86":0,"87":0.01089,"88":0,"89":0.00218,"90":0.00436,"91":0.00436,"92":0,"93":0.00218,"94":0,"95":0.00218,"96":0.00436,"97":0,"98":0,"99":0.00436,"100":0.01307,"101":0.00436,"102":0.00218,"103":0.0196,"104":0.01742,"105":0.02396,"106":0.00871,"107":0.07187,"108":1.99505,"109":1.38521,"110":0.00218,"111":0.00653,"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,"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.00218,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0.00436,"66":0.00653,"67":0.01089,"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.00871,"94":0.0392,"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,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0.00218,"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,"103":0.00436,"104":0.00436,"105":0.00218,"106":0.00218,"107":0.0196,"108":0.16771,"109":0.08276},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.00436,"14":0.00653,"15":0,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0.01525,"13.1":0.00436,"14.1":0.02396,"15.1":0.00218,"15.2-15.3":0.01307,"15.4":0.00653,"15.5":0.01089,"15.6":0.03267,"16.0":0.0196,"16.1":0.00871,"16.2":0.02178,"16.3":0.00218},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,"7.0-7.1":0.00455,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00911,"10.0-10.2":0,"10.3":0.00364,"11.0-11.2":0.00911,"11.3-11.4":0,"12.0-12.1":0.00911,"12.2-12.5":0.29684,"13.0-13.1":0.00273,"13.2":0.0428,"13.3":0.02276,"13.4-13.7":0.0601,"14.0-14.4":0.30867,"14.5-14.8":0.3369,"15.0-15.1":0.15206,"15.2-15.3":0.17756,"15.4":0.21762,"15.5":0.38516,"15.6":0.63465,"16.0":1.45322,"16.1":2.06511,"16.2":1.72912,"16.3":0.1211},P:{"4":0.29889,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.11337,"8.2":0,"9.2":0.02061,"10.1":0.02061,"11.1-11.2":0.13399,"12.0":0,"13.0":0.03092,"14.0":0.04123,"15.0":0.03092,"16.0":0.1546,"17.0":0.03092,"18.0":0.13399,"19.0":0.65962},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.00218,"5.5":0},J:{"7":0,"10":0},N:{"10":0,"11":0},R:{_:"0"},M:{"0":0.01564},Q:{"13.1":0},O:{"0":2.62819},H:{"0":0.6887},L:{"0":81.42632},S:{"2.5":0}};
|
||||
@@ -0,0 +1,9 @@
|
||||
export { default as v1 } from './v1.js';
|
||||
export { default as v3 } from './v3.js';
|
||||
export { default as v4 } from './v4.js';
|
||||
export { default as v5 } from './v5.js';
|
||||
export { default as NIL } from './nil.js';
|
||||
export { default as version } from './version.js';
|
||||
export { default as validate } from './validate.js';
|
||||
export { default as stringify } from './stringify.js';
|
||||
export { default as parse } from './parse.js';
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"timer.js","sources":["../../../src/internal/observable/timer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAqDlD,MAAM,UAAU,KAAK,CAAC,UAAyB,CAAC,EAC1B,iBAA0C,EAC1C,SAAyB;IAC7C,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC;IAChB,IAAI,SAAS,CAAC,iBAAiB,CAAC,EAAE;QAChC,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC;KAC1E;SAAM,IAAI,WAAW,CAAC,iBAAiB,CAAC,EAAE;QACzC,SAAS,GAAG,iBAAwB,CAAC;KACtC;IAED,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE;QAC3B,SAAS,GAAG,KAAK,CAAC;KACnB;IAED,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE;QACjC,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC;YAC5B,CAAC,CAAE,OAAkB;YACrB,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC;QAEjC,OAAO,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;YACvC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU;SAC7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAQD,SAAS,QAAQ,CAAoC,KAAiB;IACpE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC5C,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAEvB,IAAI,UAAU,CAAC,MAAM,EAAE;QACrB,OAAO;KACR;SAAM,IAAI,MAAM,KAAK,CAAC,CAAC,EAAE;QACxB,OAAO,UAAU,CAAC,QAAQ,EAAE,CAAC;KAC9B;IAED,KAAK,CAAC,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;IACxB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
||||
@@ -0,0 +1,108 @@
|
||||
'use strict';
|
||||
const EventEmitter = require('events');
|
||||
const getStream = require('get-stream');
|
||||
const is = require('@sindresorhus/is');
|
||||
const PCancelable = require('p-cancelable');
|
||||
const requestAsEventEmitter = require('./request-as-event-emitter');
|
||||
const {HTTPError, ParseError, ReadError} = require('./errors');
|
||||
const {options: mergeOptions} = require('./merge');
|
||||
const {reNormalize} = require('./normalize-arguments');
|
||||
|
||||
const asPromise = options => {
|
||||
const proxy = new EventEmitter();
|
||||
|
||||
const promise = new PCancelable((resolve, reject, onCancel) => {
|
||||
const emitter = requestAsEventEmitter(options);
|
||||
|
||||
onCancel(emitter.abort);
|
||||
|
||||
emitter.on('response', async response => {
|
||||
proxy.emit('response', response);
|
||||
|
||||
const stream = is.null(options.encoding) ? getStream.buffer(response) : getStream(response, options);
|
||||
|
||||
let data;
|
||||
try {
|
||||
data = await stream;
|
||||
} catch (error) {
|
||||
reject(new ReadError(error, options));
|
||||
return;
|
||||
}
|
||||
|
||||
const limitStatusCode = options.followRedirect ? 299 : 399;
|
||||
|
||||
response.body = data;
|
||||
|
||||
try {
|
||||
for (const [index, hook] of Object.entries(options.hooks.afterResponse)) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
response = await hook(response, updatedOptions => {
|
||||
updatedOptions = reNormalize(mergeOptions(options, {
|
||||
...updatedOptions,
|
||||
retry: 0,
|
||||
throwHttpErrors: false
|
||||
}));
|
||||
|
||||
// Remove any further hooks for that request, because we we'll call them anyway.
|
||||
// The loop continues. We don't want duplicates (asPromise recursion).
|
||||
updatedOptions.hooks.afterResponse = options.hooks.afterResponse.slice(0, index);
|
||||
|
||||
return asPromise(updatedOptions);
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
const {statusCode} = response;
|
||||
|
||||
if (options.json && response.body) {
|
||||
try {
|
||||
response.body = JSON.parse(response.body);
|
||||
} catch (error) {
|
||||
if (statusCode >= 200 && statusCode < 300) {
|
||||
const parseError = new ParseError(error, statusCode, options, data);
|
||||
Object.defineProperty(parseError, 'response', {value: response});
|
||||
reject(parseError);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (statusCode !== 304 && (statusCode < 200 || statusCode > limitStatusCode)) {
|
||||
const error = new HTTPError(response, options);
|
||||
Object.defineProperty(error, 'response', {value: response});
|
||||
if (emitter.retry(error) === false) {
|
||||
if (options.throwHttpErrors) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
resolve(response);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
resolve(response);
|
||||
});
|
||||
|
||||
emitter.once('error', reject);
|
||||
[
|
||||
'request',
|
||||
'redirect',
|
||||
'uploadProgress',
|
||||
'downloadProgress'
|
||||
].forEach(event => emitter.on(event, (...args) => proxy.emit(event, ...args)));
|
||||
});
|
||||
|
||||
promise.on = (name, fn) => {
|
||||
proxy.on(name, fn);
|
||||
return promise;
|
||||
};
|
||||
|
||||
return promise;
|
||||
};
|
||||
|
||||
module.exports = asPromise;
|
||||
@@ -0,0 +1,5 @@
|
||||
import { ZipOperator } from '../observable/zip';
|
||||
export function zipAll(project) {
|
||||
return (source) => source.lift(new ZipOperator(project));
|
||||
}
|
||||
//# sourceMappingURL=zipAll.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/operators/buffer"));
|
||||
//# sourceMappingURL=buffer.js.map
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F BC","520":"G A B"},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","8":"C K","388":"L H M N O"},C:{"1":"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":"CC tB DC EC","132":"0 1 2 3 I u J E F G A B C K L H M N O v w x y z"},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":"I u","132":"0 J E F G A B C K L H M N O v w x y z"},E:{"1":"sB 6B 7B 8B NC","2":"GC","8":"I u zB HC","520":"J E F G A B C IC JC KC 0B qB","1028":"K rB 1B","7172":"L","8196":"H LC MC 2B 3B 4B 5B"},F:{"1":"0 1 2 3 4 5 6 7 8 9 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 OC PC QC","132":"B C H RC qB 9B SC rB"},G:{"2":"F zB TC AC UC VC WC XC YC ZC aC bC cC dC eC","1028":"fC gC hC iC jC","3076":"kC lC mC 2B 3B 4B 5B sB 6B 7B 8B"},H:{"2":"nC"},I:{"1":"D","2":"oC pC","132":"tB I 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:{"8":"A B"},O:{"1":"uC"},P:{"1":"vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C","132":"I"},Q:{"1":"1B"},R:{"1":"8C"},S:{"1":"9C"}},B:6,C:"WebM video format"};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"18.5.2\";\n","import { Octokit as Core } from \"@octokit/core\";\nimport { requestLog } from \"@octokit/plugin-request-log\";\nimport { paginateRest } from \"@octokit/plugin-paginate-rest\";\nimport { legacyRestEndpointMethods } from \"@octokit/plugin-rest-endpoint-methods\";\nimport { VERSION } from \"./version\";\nexport const Octokit = Core.plugin(requestLog, legacyRestEndpointMethods, paginateRest).defaults({\n userAgent: `octokit-rest.js/${VERSION}`,\n});\n"],"names":["VERSION","Octokit","Core","plugin","requestLog","legacyRestEndpointMethods","paginateRest","defaults","userAgent"],"mappings":";;;;;;;;;AAAO,MAAMA,OAAO,GAAG,mBAAhB;;MCKMC,OAAO,GAAGC,YAAI,CAACC,MAAL,CAAYC,2BAAZ,EAAwBC,mDAAxB,EAAmDC,+BAAnD,EAAiEC,QAAjE,CAA0E;AAC7FC,EAAAA,SAAS,EAAG,mBAAkBR,OAAQ;AADuD,CAA1E,CAAhB;;;;"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"scheduled.js","sources":["../../src/internal/scheduled/scheduled.ts"],"names":[],"mappings":";;AAAA,2DAA0D;AAC1D,qDAAoD;AACpD,iDAAgD;AAChD,uDAAsD;AAEtD,mEAAkE;AAClE,+CAA8C;AAC9C,mDAAkD;AAClD,iDAAgD;AAahD,SAAgB,SAAS,CAAI,KAAyB,EAAE,SAAwB;IAC9E,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,IAAI,yCAAmB,CAAC,KAAK,CAAC,EAAE;YAC9B,OAAO,uCAAkB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;SAC7C;aAAM,IAAI,qBAAS,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,iCAAe,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;SAC1C;aAAM,IAAI,yBAAW,CAAC,KAAK,CAAC,EAAE;YAC7B,OAAO,6BAAa,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;SACxC;aAAO,IAAI,uBAAU,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC1D,OAAO,mCAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;SAC3C;KACF;IAED,MAAM,IAAI,SAAS,CAAC,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI,KAAK,CAAC,GAAG,oBAAoB,CAAC,CAAC;AACxF,CAAC;AAdD,8BAcC"}
|
||||
@@ -0,0 +1,5 @@
|
||||
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
||||
export function hostReportError(err) {
|
||||
setTimeout(function () { throw err; }, 0);
|
||||
}
|
||||
//# sourceMappingURL=hostReportError.js.map
|
||||
@@ -0,0 +1,35 @@
|
||||
# is-unicode-supported
|
||||
|
||||
> Detect whether the terminal supports Unicode
|
||||
|
||||
This can be useful to decide whether to use Unicode characters or fallback ASCII characters in command-line output.
|
||||
|
||||
Note that the check is quite naive. It just assumes all non-Windows terminals support Unicode and hard-codes which Windows terminals that do support Unicode. However, I have been using this logic in some popular packages for years without problems.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install is-unicode-supported
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const isUnicodeSupported = require('is-unicode-supported');
|
||||
|
||||
isUnicodeSupported();
|
||||
//=> true
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### isUnicodeSupported()
|
||||
|
||||
Returns a `boolean` for whether the terminal supports Unicode.
|
||||
|
||||
## Related
|
||||
|
||||
- [is-interactive](https://github.com/sindresorhus/is-interactive) - Check if stdout or stderr is interactive
|
||||
- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color
|
||||
- [figures](https://github.com/sindresorhus/figures) - Unicode symbols with Windows fallbacks
|
||||
- [log-symbols](https://github.com/sindresorhus/log-symbols) - Colored symbols for various log levels
|
||||
Reference in New Issue
Block a user