new license file version [CI SKIP]

This commit is contained in:
2023-03-15 13:43:57 +00:00
parent d8a3063735
commit 00359d25c1
5600 changed files with 523898 additions and 2 deletions

View File

@@ -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/repeat"));
//# sourceMappingURL=repeat.js.map

View File

@@ -0,0 +1,53 @@
// Main entrypoint for libraries using yargs-parser in Node.js
// CJS and ESM environments:
import { format } from 'util';
import { readFileSync } from 'fs';
import { normalize, resolve } from 'path';
import { camelCase, decamelize, looksLikeNumber } from './string-utils.js';
import { YargsParser } from './yargs-parser.js';
// See https://github.com/yargs/yargs-parser#supported-nodejs-versions for our
// version support policy. The YARGS_MIN_NODE_VERSION is used for testing only.
const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION)
? Number(process.env.YARGS_MIN_NODE_VERSION)
: 10;
if (process && process.version) {
const major = Number(process.version.match(/v([^.]+)/)[1]);
if (major < minNodeVersion) {
throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
}
}
// Creates a yargs-parser instance using Node.js standard libraries:
const env = process ? process.env : {};
const parser = new YargsParser({
cwd: process.cwd,
env: () => {
return env;
},
format,
normalize,
resolve,
// TODO: figure out a way to combine ESM and CJS coverage, such that
// we can exercise all the lines below:
require: (path) => {
if (typeof require !== 'undefined') {
return require(path);
}
else if (path.match(/\.json$/)) {
return readFileSync(path, 'utf8');
}
else {
throw Error('only .json config files are supported in ESM');
}
}
});
const yargsParser = function Parser(args, opts) {
const result = parser.parse(args.slice(), opts);
return result.argv;
};
yargsParser.detailed = function (args, opts) {
return parser.parse(args.slice(), opts);
};
yargsParser.camelCase = camelCase;
yargsParser.decamelize = decamelize;
yargsParser.looksLikeNumber = looksLikeNumber;
export default yargsParser;

View File

@@ -0,0 +1,60 @@
// Packages
var retrier = require('retry');
function retry(fn, opts) {
function run(resolve, reject) {
var options = opts || {};
// Default `randomize` to true
if (!('randomize' in options)) {
options.randomize = true;
}
var op = retrier.operation(options);
// We allow the user to abort retrying
// this makes sense in the cases where
// knowledge is obtained that retrying
// would be futile (e.g.: auth errors)
function bail(err) {
reject(err || new Error('Aborted'));
}
function onError(err, num) {
if (err.bail) {
bail(err);
return;
}
if (!op.retry(err)) {
reject(op.mainError());
} else if (options.onRetry) {
options.onRetry(err, num);
}
}
function runAttempt(num) {
var val;
try {
val = fn(bail, num);
} catch (err) {
onError(err, num);
return;
}
Promise.resolve(val)
.then(resolve)
.catch(function catchIt(err) {
onError(err, num);
});
}
op.attempt(runAttempt);
}
return new Promise(run);
}
module.exports = retry;

View File

@@ -0,0 +1,5 @@
import { concat as concatStatic } from '../observable/concat';
export function concat(...observables) {
return (source) => source.lift.call(concatStatic(source, ...observables));
}
//# sourceMappingURL=concat.js.map

View File

@@ -0,0 +1,2 @@
declare const _default: (message: string) => void;
export default _default;

View File

@@ -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":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q 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 EC","2":"CC tB DC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q 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 J E"},E:{"1":"J E F G A B C K L H HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","2":"I GC zB","132":"u"},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":"F UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B","2":"zB TC AC"},H:{"2":"nC"},I:{"1":"tB I D rC AC sC tC","2":"oC pC qC"},J:{"1":"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:1,C:"async attribute for external scripts"};

View File

@@ -0,0 +1 @@
{"version":3,"file":"repeat.js","sources":["../../src/add/operator/repeat.ts"],"names":[],"mappings":";;AAAA,2CAAyC"}

View File

@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("rxjs-compat/add/operator/max");
//# sourceMappingURL=max.js.map

View File

@@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var combineLatest_1 = require("../observable/combineLatest");
function combineAll(project) {
return function (source) { return source.lift(new combineLatest_1.CombineLatestOperator(project)); };
}
exports.combineAll = combineAll;
//# sourceMappingURL=combineAll.js.map

View File

@@ -0,0 +1,78 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
exports.URL = exports.DNS = void 0;
var _stringify = _interopRequireDefault(require("./stringify.js"));
var _parse = _interopRequireDefault(require("./parse.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function stringToBytes(str) {
str = unescape(encodeURIComponent(str)); // UTF8 escape
const bytes = [];
for (let i = 0; i < str.length; ++i) {
bytes.push(str.charCodeAt(i));
}
return bytes;
}
const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
exports.DNS = DNS;
const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
exports.URL = URL;
function _default(name, version, hashfunc) {
function generateUUID(value, namespace, buf, offset) {
if (typeof value === 'string') {
value = stringToBytes(value);
}
if (typeof namespace === 'string') {
namespace = (0, _parse.default)(namespace);
}
if (namespace.length !== 16) {
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
} // Compute hash of namespace and value, Per 4.3
// Future: Use spread syntax when supported on all platforms, e.g. `bytes =
// hashfunc([...namespace, ... value])`
let bytes = new Uint8Array(16 + value.length);
bytes.set(namespace);
bytes.set(value, namespace.length);
bytes = hashfunc(bytes);
bytes[6] = bytes[6] & 0x0f | version;
bytes[8] = bytes[8] & 0x3f | 0x80;
if (buf) {
offset = offset || 0;
for (let i = 0; i < 16; ++i) {
buf[offset + i] = bytes[i];
}
return buf;
}
return (0, _stringify.default)(bytes);
} // Function#name is not settable on some platforms (#270)
try {
generateUUID.name = name; // eslint-disable-next-line no-empty
} catch (err) {} // For CommonJS default export support
generateUUID.DNS = DNS;
generateUUID.URL = URL;
return generateUUID;
}

View File

@@ -0,0 +1,155 @@
/** PURE_IMPORTS_START tslib,_Subject,_scheduler_async,_Subscriber,_util_isNumeric,_util_isScheduler PURE_IMPORTS_END */
import * as tslib_1 from "tslib";
import { Subject } from '../Subject';
import { async } from '../scheduler/async';
import { Subscriber } from '../Subscriber';
import { isNumeric } from '../util/isNumeric';
import { isScheduler } from '../util/isScheduler';
export function windowTime(windowTimeSpan) {
var scheduler = async;
var windowCreationInterval = null;
var maxWindowSize = Number.POSITIVE_INFINITY;
if (isScheduler(arguments[3])) {
scheduler = arguments[3];
}
if (isScheduler(arguments[2])) {
scheduler = arguments[2];
}
else if (isNumeric(arguments[2])) {
maxWindowSize = Number(arguments[2]);
}
if (isScheduler(arguments[1])) {
scheduler = arguments[1];
}
else if (isNumeric(arguments[1])) {
windowCreationInterval = Number(arguments[1]);
}
return function windowTimeOperatorFunction(source) {
return source.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler));
};
}
var WindowTimeOperator = /*@__PURE__*/ (function () {
function WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
this.windowTimeSpan = windowTimeSpan;
this.windowCreationInterval = windowCreationInterval;
this.maxWindowSize = maxWindowSize;
this.scheduler = scheduler;
}
WindowTimeOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.maxWindowSize, this.scheduler));
};
return WindowTimeOperator;
}());
var CountedSubject = /*@__PURE__*/ (function (_super) {
tslib_1.__extends(CountedSubject, _super);
function CountedSubject() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._numberOfNextedValues = 0;
return _this;
}
CountedSubject.prototype.next = function (value) {
this._numberOfNextedValues++;
_super.prototype.next.call(this, value);
};
Object.defineProperty(CountedSubject.prototype, "numberOfNextedValues", {
get: function () {
return this._numberOfNextedValues;
},
enumerable: true,
configurable: true
});
return CountedSubject;
}(Subject));
var WindowTimeSubscriber = /*@__PURE__*/ (function (_super) {
tslib_1.__extends(WindowTimeSubscriber, _super);
function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
var _this = _super.call(this, destination) || this;
_this.destination = destination;
_this.windowTimeSpan = windowTimeSpan;
_this.windowCreationInterval = windowCreationInterval;
_this.maxWindowSize = maxWindowSize;
_this.scheduler = scheduler;
_this.windows = [];
var window = _this.openWindow();
if (windowCreationInterval !== null && windowCreationInterval >= 0) {
var closeState = { subscriber: _this, window: window, context: null };
var creationState = { windowTimeSpan: windowTimeSpan, windowCreationInterval: windowCreationInterval, subscriber: _this, scheduler: scheduler };
_this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState));
_this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState));
}
else {
var timeSpanOnlyState = { subscriber: _this, window: window, windowTimeSpan: windowTimeSpan };
_this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState));
}
return _this;
}
WindowTimeSubscriber.prototype._next = function (value) {
var windows = this.windows;
var len = windows.length;
for (var i = 0; i < len; i++) {
var window_1 = windows[i];
if (!window_1.closed) {
window_1.next(value);
if (window_1.numberOfNextedValues >= this.maxWindowSize) {
this.closeWindow(window_1);
}
}
}
};
WindowTimeSubscriber.prototype._error = function (err) {
var windows = this.windows;
while (windows.length > 0) {
windows.shift().error(err);
}
this.destination.error(err);
};
WindowTimeSubscriber.prototype._complete = function () {
var windows = this.windows;
while (windows.length > 0) {
var window_2 = windows.shift();
if (!window_2.closed) {
window_2.complete();
}
}
this.destination.complete();
};
WindowTimeSubscriber.prototype.openWindow = function () {
var window = new CountedSubject();
this.windows.push(window);
var destination = this.destination;
destination.next(window);
return window;
};
WindowTimeSubscriber.prototype.closeWindow = function (window) {
window.complete();
var windows = this.windows;
windows.splice(windows.indexOf(window), 1);
};
return WindowTimeSubscriber;
}(Subscriber));
function dispatchWindowTimeSpanOnly(state) {
var subscriber = state.subscriber, windowTimeSpan = state.windowTimeSpan, window = state.window;
if (window) {
subscriber.closeWindow(window);
}
state.window = subscriber.openWindow();
this.schedule(state, windowTimeSpan);
}
function dispatchWindowCreation(state) {
var windowTimeSpan = state.windowTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler, windowCreationInterval = state.windowCreationInterval;
var window = subscriber.openWindow();
var action = this;
var context = { action: action, subscription: null };
var timeSpanState = { subscriber: subscriber, window: window, context: context };
context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState);
action.add(context.subscription);
action.schedule(state, windowCreationInterval);
}
function dispatchWindowClose(state) {
var subscriber = state.subscriber, window = state.window, context = state.context;
if (context && context.action && context.subscription) {
context.action.remove(context.subscription);
}
subscriber.closeWindow(window);
}
//# sourceMappingURL=windowTime.js.map

View File

@@ -0,0 +1,110 @@
import { Operator } from '../Operator';
import { Observable } from '../Observable';
import { Subscriber } from '../Subscriber';
import { OperatorFunction, MonoTypeOperatorFunction, TeardownLogic } from '../types';
export function takeWhile<T, S extends T>(predicate: (value: T, index: number) => value is S): OperatorFunction<T, S>;
export function takeWhile<T, S extends T>(predicate: (value: T, index: number) => value is S, inclusive: false): OperatorFunction<T, S>;
export function takeWhile<T>(predicate: (value: T, index: number) => boolean, inclusive?: boolean): MonoTypeOperatorFunction<T>;
/**
* Emits values emitted by the source Observable so long as each value satisfies
* the given `predicate`, and then completes as soon as this `predicate` is not
* satisfied.
*
* <span class="informal">Takes values from the source only while they pass the
* condition given. When the first value does not satisfy, it completes.</span>
*
* ![](takeWhile.png)
*
* `takeWhile` subscribes and begins mirroring the source Observable. Each value
* emitted on the source is given to the `predicate` function which returns a
* boolean, representing a condition to be satisfied by the source values. The
* output Observable emits the source values until such time as the `predicate`
* returns false, at which point `takeWhile` stops mirroring the source
* Observable and completes the output Observable.
*
* ## Example
* Emit click events only while the clientX property is greater than 200
* ```ts
* import { fromEvent } from 'rxjs';
* import { takeWhile } from 'rxjs/operators';
*
* const clicks = fromEvent(document, 'click');
* const result = clicks.pipe(takeWhile(ev => ev.clientX > 200));
* result.subscribe(x => console.log(x));
* ```
*
* @see {@link take}
* @see {@link takeLast}
* @see {@link takeUntil}
* @see {@link skip}
*
* @param {function(value: T, index: number): boolean} predicate A function that
* evaluates a value emitted by the source Observable and returns a boolean.
* Also takes the (zero-based) index as the second argument.
* @param {boolean} inclusive When set to `true` the value that caused
* `predicate` to return `false` will also be emitted.
* @return {Observable<T>} An Observable that emits the values from the source
* Observable so long as each value satisfies the condition defined by the
* `predicate`, then completes.
* @method takeWhile
* @owner Observable
*/
export function takeWhile<T>(
predicate: (value: T, index: number) => boolean,
inclusive = false): MonoTypeOperatorFunction<T> {
return (source: Observable<T>) =>
source.lift(new TakeWhileOperator(predicate, inclusive));
}
class TakeWhileOperator<T> implements Operator<T, T> {
constructor(
private predicate: (value: T, index: number) => boolean,
private inclusive: boolean) {}
call(subscriber: Subscriber<T>, source: any): TeardownLogic {
return source.subscribe(
new TakeWhileSubscriber(subscriber, this.predicate, this.inclusive));
}
}
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
class TakeWhileSubscriber<T> extends Subscriber<T> {
private index: number = 0;
constructor(
destination: Subscriber<T>,
private predicate: (value: T, index: number) => boolean,
private inclusive: boolean) {
super(destination);
}
protected _next(value: T): void {
const destination = this.destination;
let result: boolean;
try {
result = this.predicate(value, this.index++);
} catch (err) {
destination.error(err);
return;
}
this.nextOrComplete(value, result);
}
private nextOrComplete(value: T, predicateResult: boolean): void {
const destination = this.destination;
if (Boolean(predicateResult)) {
destination.next(value);
} else {
if (this.inclusive) {
destination.next(value);
}
destination.complete();
}
}
}

View File

@@ -0,0 +1,73 @@
const { EOL } = require('os');
const got = require('got');
const { v4: uuidv4 } = require('uuid');
const osName = require('os-name');
const isCi = require('is-ci');
const debug = require('debug')('release-it:metrics');
const pkg = require('../package.json');
const noop = Promise.resolve();
const cast = value => (value ? 1 : 0);
const cid = uuidv4();
const payload = config => ({
v: 1,
tid: 'UA-108828841-1',
cid,
cd1: pkg.version,
cd2: process.version,
cd3: osName(),
cd4: cast(!config.isCI),
cd5: cast(config.isDryRun),
cd6: cast(config.isVerbose),
cd7: cast(config.isDebug),
cd8: null,
cd9: config.preReleaseId,
cd11: cast(isCi),
cd12: cast(config.git.tag),
cd13: cast(config.npm.publish),
cd14: cast(config.github.release),
cd15: config.increment,
cd16: cast(config.gitlab.release)
});
class Metrics {
constructor({ isEnabled = true, request = got } = {}) {
this.isEnabled = isEnabled;
this.request = request;
}
send(payload) {
return !this.isEnabled
? noop
: this.request('http://www.google-analytics.com/collect', {
timeout: 300,
retries: 0,
method: 'POST',
form: payload
})
.then(res => {
const { url, statusCode, statusMessage } = res;
debug({ url, statusCode, statusMessage, payload: new URLSearchParams(payload).toString() });
})
.catch(debug);
}
trackEvent(action, config) {
return this.send(
Object.assign(config ? payload(config) : {}, {
t: 'event',
ec: 'session',
ea: action
})
);
}
trackException(err) {
return this.send({
t: 'exception',
exd: err.toString().split(EOL)[0]
});
}
}
module.exports = Metrics;

View File

@@ -0,0 +1 @@
{"version":3,"file":"of.js","sources":["../../src/internal/observable/of.ts"],"names":[],"mappings":";;AACA,mDAAkD;AAClD,yCAAwC;AAExC,4DAA2D;AAiG3D,SAAgB,EAAE;IAAI,cAAiC;SAAjC,UAAiC,EAAjC,qBAAiC,EAAjC,IAAiC;QAAjC,yBAAiC;;IACrD,IAAI,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAkB,CAAC;IACvD,IAAI,yBAAW,CAAC,SAAS,CAAC,EAAE;QAC1B,IAAI,CAAC,GAAG,EAAE,CAAC;QACX,OAAO,6BAAa,CAAC,IAAW,EAAE,SAAS,CAAC,CAAC;KAC9C;SAAM;QACL,OAAO,qBAAS,CAAC,IAAW,CAAC,CAAC;KAC/B;AACH,CAAC;AARD,gBAQC"}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"J E F G A B","16":"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":"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 7 8 9 CC tB I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB DC EC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q 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"},E:{"1":"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":"0 1 2 3 4 5 6 7 8 9 B C H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d OC PC QC RC qB 9B SC rB","16":"G"},G:{"1":"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:{"1":"nC"},I:{"1":"tB I D qC rC AC sC tC","16":"oC pC"},J:{"1":"E A"},K:{"1":"A B C e qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"1":"A B"},O:{"1":"uC"},P:{"1":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"1":"1B"},R:{"1":"8C"},S:{"1":"9C"}},B:1,C:"Element.insertAdjacentElement() & Element.insertAdjacentText()"};

View File

@@ -0,0 +1,293 @@
<h1 align="center">
<br>
<br>
<img width="320" src="media/logo.svg" alt="Chalk">
<br>
<br>
<br>
</h1>
> Terminal string styling done right
[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) ![TypeScript-ready](https://img.shields.io/npm/types/chalk.svg) [![run on repl.it](https://repl.it/badge/github/chalk/chalk)](https://repl.it/github/chalk/chalk)
<img src="https://cdn.jsdelivr.net/gh/chalk/ansi-styles@8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900">
## Highlights
- Expressive API
- Highly performant
- Ability to nest styles
- [256/Truecolor color support](#256-and-truecolor-color-support)
- Auto-detects color support
- Doesn't extend `String.prototype`
- Clean and focused
- Actively maintained
- [Used by ~50,000 packages](https://www.npmjs.com/browse/depended/chalk) as of January 1, 2020
## Install
```console
$ npm install chalk
```
## Usage
```js
const chalk = require('chalk');
console.log(chalk.blue('Hello world!'));
```
Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
```js
const chalk = require('chalk');
const log = console.log;
// Combine styled and normal strings
log(chalk.blue('Hello') + ' World' + chalk.red('!'));
// Compose multiple styles using the chainable API
log(chalk.blue.bgRed.bold('Hello world!'));
// Pass in multiple arguments
log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'));
// Nest styles
log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!'));
// Nest styles of the same type even (color, underline, background)
log(chalk.green(
'I am a green line ' +
chalk.blue.underline.bold('with a blue substring') +
' that becomes green again!'
));
// ES2015 template literal
log(`
CPU: ${chalk.red('90%')}
RAM: ${chalk.green('40%')}
DISK: ${chalk.yellow('70%')}
`);
// ES2015 tagged template literal
log(chalk`
CPU: {red ${cpu.totalPercent}%}
RAM: {green ${ram.used / ram.total * 100}%}
DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
`);
// Use RGB colors in terminal emulators that support it.
log(chalk.keyword('orange')('Yay for orange colored text!'));
log(chalk.rgb(123, 45, 67).underline('Underlined reddish color'));
log(chalk.hex('#DEADED').bold('Bold gray!'));
```
Easily define your own themes:
```js
const chalk = require('chalk');
const error = chalk.bold.red;
const warning = chalk.keyword('orange');
console.log(error('Error!'));
console.log(warning('Warning!'));
```
Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args):
```js
const name = 'Sindre';
console.log(chalk.green('Hello %s'), name);
//=> 'Hello Sindre'
```
## API
### chalk.`<style>[.<style>...](string, [string...])`
Example: `chalk.red.bold.underline('Hello', 'world');`
Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
Multiple arguments will be separated by space.
### chalk.level
Specifies the level of color support.
Color support is automatically detected, but you can override it by setting the `level` property. You should however only do this in your own code as it applies globally to all Chalk consumers.
If you need to change this in a reusable module, create a new instance:
```js
const ctx = new chalk.Instance({level: 0});
```
| Level | Description |
| :---: | :--- |
| `0` | All colors disabled |
| `1` | Basic color support (16 colors) |
| `2` | 256 color support |
| `3` | Truecolor support (16 million colors) |
### chalk.supportsColor
Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.
Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
### chalk.stderr and chalk.stderr.supportsColor
`chalk.stderr` contains a separate instance configured with color support detected for `stderr` stream instead of `stdout`. Override rules from `chalk.supportsColor` apply to this too. `chalk.stderr.supportsColor` is exposed for convenience.
## Styles
### Modifiers
- `reset` - Resets the current color chain.
- `bold` - Make text bold.
- `dim` - Emitting only a small amount of light.
- `italic` - Make text italic. *(Not widely supported)*
- `underline` - Make text underline. *(Not widely supported)*
- `inverse`- Inverse background and foreground colors.
- `hidden` - Prints the text, but makes it invisible.
- `strikethrough` - Puts a horizontal line through the center of the text. *(Not widely supported)*
- `visible`- Prints the text only when Chalk has a color level > 0. Can be useful for things that are purely cosmetic.
### Colors
- `black`
- `red`
- `green`
- `yellow`
- `blue`
- `magenta`
- `cyan`
- `white`
- `blackBright` (alias: `gray`, `grey`)
- `redBright`
- `greenBright`
- `yellowBright`
- `blueBright`
- `magentaBright`
- `cyanBright`
- `whiteBright`
### Background colors
- `bgBlack`
- `bgRed`
- `bgGreen`
- `bgYellow`
- `bgBlue`
- `bgMagenta`
- `bgCyan`
- `bgWhite`
- `bgBlackBright` (alias: `bgGray`, `bgGrey`)
- `bgRedBright`
- `bgGreenBright`
- `bgYellowBright`
- `bgBlueBright`
- `bgMagentaBright`
- `bgCyanBright`
- `bgWhiteBright`
## Tagged template literal
Chalk can be used as a [tagged template literal](https://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals).
```js
const chalk = require('chalk');
const miles = 18;
const calculateFeet = miles => miles * 5280;
console.log(chalk`
There are {bold 5280 feet} in a mile.
In {bold ${miles} miles}, there are {green.bold ${calculateFeet(miles)} feet}.
`);
```
Blocks are delimited by an opening curly brace (`{`), a style, some content, and a closing curly brace (`}`).
Template styles are chained exactly like normal Chalk styles. The following three statements are equivalent:
```js
console.log(chalk.bold.rgb(10, 100, 200)('Hello!'));
console.log(chalk.bold.rgb(10, 100, 200)`Hello!`);
console.log(chalk`{bold.rgb(10,100,200) Hello!}`);
```
Note that function styles (`rgb()`, `hsl()`, `keyword()`, etc.) may not contain spaces between parameters.
All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped.
## 256 and Truecolor color support
Chalk supports 256 colors and [Truecolor](https://gist.github.com/XVilka/8346728) (16 million colors) on supported terminal apps.
Colors are downsampled from 16 million RGB values to an ANSI color format that is supported by the terminal emulator (or by specifying `{level: n}` as a Chalk option). For example, Chalk configured to run at level 1 (basic color support) will downsample an RGB value of #FF0000 (red) to 31 (ANSI escape for red).
Examples:
- `chalk.hex('#DEADED').underline('Hello, world!')`
- `chalk.keyword('orange')('Some orange text')`
- `chalk.rgb(15, 100, 204).inverse('Hello!')`
Background versions of these models are prefixed with `bg` and the first level of the module capitalized (e.g. `keyword` for foreground colors and `bgKeyword` for background colors).
- `chalk.bgHex('#DEADED').underline('Hello, world!')`
- `chalk.bgKeyword('orange')('Some orange text')`
- `chalk.bgRgb(15, 100, 204).inverse('Hello!')`
The following color models can be used:
- [`rgb`](https://en.wikipedia.org/wiki/RGB_color_model) - Example: `chalk.rgb(255, 136, 0).bold('Orange!')`
- [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')`
- [`keyword`](https://www.w3.org/wiki/CSS/Properties/color/keywords) (CSS keywords) - Example: `chalk.keyword('orange').bold('Orange!')`
- [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')`
- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsv(32, 100, 100).bold('Orange!')`
- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hwb(32, 0, 50).bold('Orange!')`
- [`ansi`](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) - Example: `chalk.ansi(31).bgAnsi(93)('red on yellowBright')`
- [`ansi256`](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) - Example: `chalk.bgAnsi256(194)('Honeydew, more or less')`
## Windows
If you're on Windows, do yourself a favor and use [Windows Terminal](https://github.com/microsoft/terminal) instead of `cmd.exe`.
## Origin story
[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative.
## chalk for enterprise
Available as part of the Tidelift Subscription.
The maintainers of chalk and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-chalk?utm_source=npm-chalk&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
## Related
- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color
- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Strip ANSI escape codes from a stream
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes
- [color-convert](https://github.com/qix-/color-convert) - Converts colors between different models
- [chalk-animation](https://github.com/bokub/chalk-animation) - Animate strings in the terminal
- [gradient-string](https://github.com/bokub/gradient-string) - Apply color gradients to strings
- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings
- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)

View File

@@ -0,0 +1,85 @@
import {UpperCaseCharacters, WordSeparators} from '../source/utilities';
/**
Unlike a simpler split, this one includes the delimiter splitted on in the resulting array literal. This is to enable splitting on, for example, upper-case characters.
*/
export type SplitIncludingDelimiters<Source extends string, Delimiter extends string> =
Source extends '' ? [] :
Source extends `${infer FirstPart}${Delimiter}${infer SecondPart}` ?
(
Source extends `${FirstPart}${infer UsedDelimiter}${SecondPart}`
? UsedDelimiter extends Delimiter
? Source extends `${infer FirstPart}${UsedDelimiter}${infer SecondPart}`
? [...SplitIncludingDelimiters<FirstPart, Delimiter>, UsedDelimiter, ...SplitIncludingDelimiters<SecondPart, Delimiter>]
: never
: never
: never
) :
[Source];
/**
Format a specific part of the splitted string literal that `StringArrayToDelimiterCase<>` fuses together, ensuring desired casing.
@see StringArrayToDelimiterCase
*/
type StringPartToDelimiterCase<StringPart extends string, UsedWordSeparators extends string, UsedUpperCaseCharacters extends string, Delimiter extends string> =
StringPart extends UsedWordSeparators ? Delimiter :
StringPart extends UsedUpperCaseCharacters ? `${Delimiter}${Lowercase<StringPart>}` :
StringPart;
/**
Takes the result of a splitted string literal and recursively concatenates it together into the desired casing.
It receives `UsedWordSeparators` and `UsedUpperCaseCharacters` as input to ensure it's fully encapsulated.
@see SplitIncludingDelimiters
*/
type StringArrayToDelimiterCase<Parts extends any[], UsedWordSeparators extends string, UsedUpperCaseCharacters extends string, Delimiter extends string> =
Parts extends [`${infer FirstPart}`, ...infer RemainingParts]
? `${StringPartToDelimiterCase<FirstPart, UsedWordSeparators, UsedUpperCaseCharacters, Delimiter>}${StringArrayToDelimiterCase<RemainingParts, UsedWordSeparators, UsedUpperCaseCharacters, Delimiter>}`
: '';
/**
Convert a string literal to a custom string delimiter casing.
This can be useful when, for example, converting a camel-cased object property to an oddly cased one.
@see KebabCase
@see SnakeCase
@example
```
import {DelimiterCase} from 'type-fest';
// Simple
const someVariable: DelimiterCase<'fooBar', '#'> = 'foo#bar';
// Advanced
type OddlyCasedProps<T> = {
[K in keyof T as DelimiterCase<K, '#'>]: T[K]
};
interface SomeOptions {
dryRun: boolean;
includeFile: string;
foo: number;
}
const rawCliOptions: OddlyCasedProps<SomeOptions> = {
'dry#run': true,
'include#file': 'bar.js',
foo: 123
};
```
*/
export type DelimiterCase<Value, Delimiter extends string> = Value extends string
? StringArrayToDelimiterCase<
SplitIncludingDelimiters<Value, WordSeparators | UpperCaseCharacters>,
WordSeparators,
UpperCaseCharacters,
Delimiter
>
: Value;

View File

@@ -0,0 +1,57 @@
{
"name": "@octokit/core",
"description": "Extendable client for GitHub's REST & GraphQL APIs",
"version": "3.6.0",
"license": "MIT",
"files": [
"dist-*/",
"bin/"
],
"pika": true,
"sideEffects": false,
"keywords": [
"octokit",
"github",
"api",
"sdk",
"toolkit"
],
"repository": "github:octokit/core.js",
"dependencies": {
"@octokit/auth-token": "^2.4.4",
"@octokit/graphql": "^4.5.8",
"@octokit/request": "^5.6.3",
"@octokit/request-error": "^2.0.5",
"@octokit/types": "^6.0.3",
"before-after-hook": "^2.2.0",
"universal-user-agent": "^6.0.0"
},
"devDependencies": {
"@octokit/auth": "^3.0.1",
"@pika/pack": "^0.5.0",
"@pika/plugin-build-node": "^0.9.0",
"@pika/plugin-build-web": "^0.9.0",
"@pika/plugin-ts-standard-pkg": "^0.9.0",
"@types/fetch-mock": "^7.3.1",
"@types/jest": "^27.0.0",
"@types/lolex": "^5.1.0",
"@types/node": "^14.0.4",
"fetch-mock": "^9.0.0",
"http-proxy-agent": "^5.0.0",
"jest": "^27.0.0",
"lolex": "^6.0.0",
"prettier": "2.4.1",
"proxy": "^1.0.1",
"semantic-release": "^18.0.0",
"semantic-release-plugin-update-version-in-files": "^1.0.0",
"ts-jest": "^27.0.0",
"typescript": "^4.0.2"
},
"publishConfig": {
"access": "public"
},
"source": "dist-src/index.js",
"types": "dist-types/index.d.ts",
"main": "dist-node/index.js",
"module": "dist-web/index.js"
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"combineLatest.js","sources":["../../../src/internal/observable/combineLatest.ts"],"names":[],"mappings":"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"}

View File

@@ -0,0 +1,4 @@
/**
* Relative or absolute URL. Examples: `'/orgs/{org}'`, `https://example.com/foo/bar`
*/
export declare type Url = string;

View File

@@ -0,0 +1 @@
module.exports={C:{"33":0.00483,"47":0.00965,"52":0.08685,"57":0.02413,"66":0.00483,"68":0.02413,"69":0.00483,"75":0.00965,"78":0.04825,"80":0.00965,"81":0.00483,"88":0.01448,"91":0.00965,"92":0.00483,"98":0.00483,"99":0.02413,"101":0.00483,"102":0.1158,"103":0.01448,"104":0.01448,"105":0.00965,"106":0.03378,"107":0.08685,"108":3.03975,"109":1.82868,"110":0.00965,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 34 35 36 37 38 39 40 41 42 43 44 45 46 48 49 50 51 53 54 55 56 58 59 60 61 62 63 64 65 67 70 71 72 73 74 76 77 79 82 83 84 85 86 87 89 90 93 94 95 96 97 100 111 3.5 3.6"},D:{"34":0.00965,"38":0.06755,"47":0.01448,"49":0.08685,"53":0.02413,"63":0.08203,"68":0.03378,"69":0.0193,"70":0.0193,"71":0.02413,"72":0.03378,"73":0.00965,"74":0.02895,"75":0.0193,"76":0.0193,"77":0.0193,"78":0.0386,"79":0.386,"80":0.0386,"81":0.05308,"83":0.04343,"84":0.03378,"85":0.06273,"86":0.06273,"87":0.07238,"88":0.04343,"89":0.05308,"90":0.1158,"91":0.09168,"92":0.10133,"93":0.13028,"94":0.11098,"95":0.02413,"96":0.0193,"97":0.13993,"98":0.00965,"99":0.0193,"100":0.02895,"101":0.00965,"102":0.01448,"103":0.10615,"104":0.02895,"105":0.1158,"106":0.0579,"107":0.20748,"108":13.5679,"109":13.2591,"110":0.00483,"111":0.00483,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 35 36 37 39 40 41 42 43 44 45 46 48 50 51 52 54 55 56 57 58 59 60 61 62 64 65 66 67 112"},F:{"28":0.04343,"36":0.0193,"40":0.00483,"46":0.01448,"55":0.00483,"79":0.00965,"85":0.04343,"90":0.06755,"91":0.01448,"92":0.0193,"93":1.11458,"94":2.22915,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 37 38 39 41 42 43 44 45 47 48 49 50 51 52 53 54 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 86 87 88 89 9.5-9.6 10.5 10.6 11.1 11.5 11.6 12.1","10.0-10.1":0},B:{"18":0.00965,"80":0.00965,"81":0.00965,"83":0.00965,"84":0.00965,"85":0.00965,"86":0.00965,"87":0.00483,"88":0.00483,"89":0.00965,"90":0.00483,"91":0.01448,"92":0.00965,"101":0.00483,"103":0.00483,"105":0.00965,"106":0.01448,"107":0.08203,"108":2.22915,"109":2.13265,_:"12 13 14 15 16 17 79 93 94 95 96 97 98 99 100 102 104"},E:{"4":0,"13":0.00483,"14":0.0772,"15":0.02413,_:"0 5 6 7 8 9 10 11 12 3.1 3.2 5.1 6.1 7.1 10.1","9.1":0.13993,"11.1":0.00483,"12.1":0.00965,"13.1":0.0772,"14.1":0.14958,"15.1":0.03378,"15.2-15.3":0.02895,"15.4":0.06755,"15.5":0.12063,"15.6":0.44873,"16.0":0.08685,"16.1":0.34258,"16.2":0.6176,"16.3":0.06273},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.0152,"6.0-6.1":0,"7.0-7.1":0.0038,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.0266,"10.0-10.2":0,"10.3":0.06967,"11.0-11.2":0.01267,"11.3-11.4":0.00887,"12.0-12.1":0.00887,"12.2-12.5":0.1748,"13.0-13.1":0.0076,"13.2":0.0152,"13.3":0.0114,"13.4-13.7":0.05193,"14.0-14.4":0.12667,"14.5-14.8":0.3268,"15.0-15.1":0.08613,"15.2-15.3":0.11653,"15.4":0.1558,"15.5":0.32047,"15.6":1.09947,"16.0":1.84807,"16.1":4.06981,"16.2":2.97161,"16.3":0.33313},P:{"4":0.45618,"5.0-5.4":0.01037,"6.2-6.4":0,"7.2-7.4":0.01031,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0.02074,"12.0":0.01031,"13.0":0.02074,"14.0":0.02074,"15.0":0,"16.0":0.02074,"17.0":0.0311,"18.0":0.06221,"19.0":2.37421},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0.00398,"4.2-4.3":0.01592,"4.4":0,"4.4.3-4.4.4":0.05772},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"8":0.00483,"11":0.09168,_:"6 7 9 10 5.5"},J:{"7":0,"10":0},N:{"10":0,"11":0},S:{"2.5":0},R:{_:"0"},M:{"0":0.2691},Q:{"13.1":0},O:{"0":0.05175},H:{"0":0.46054},L:{"0":37.90568}};

View File

@@ -0,0 +1,78 @@
import { Subscriber } from './Subscriber';
import { Observable } from './Observable';
import { subscribeTo } from './util/subscribeTo';
export class SimpleInnerSubscriber extends Subscriber {
constructor(parent) {
super();
this.parent = parent;
}
_next(value) {
this.parent.notifyNext(value);
}
_error(error) {
this.parent.notifyError(error);
this.unsubscribe();
}
_complete() {
this.parent.notifyComplete();
this.unsubscribe();
}
}
export class ComplexInnerSubscriber extends Subscriber {
constructor(parent, outerValue, outerIndex) {
super();
this.parent = parent;
this.outerValue = outerValue;
this.outerIndex = outerIndex;
}
_next(value) {
this.parent.notifyNext(this.outerValue, value, this.outerIndex, this);
}
_error(error) {
this.parent.notifyError(error);
this.unsubscribe();
}
_complete() {
this.parent.notifyComplete(this);
this.unsubscribe();
}
}
export class SimpleOuterSubscriber extends Subscriber {
notifyNext(innerValue) {
this.destination.next(innerValue);
}
notifyError(err) {
this.destination.error(err);
}
notifyComplete() {
this.destination.complete();
}
}
export class ComplexOuterSubscriber extends Subscriber {
notifyNext(_outerValue, innerValue, _outerIndex, _innerSub) {
this.destination.next(innerValue);
}
notifyError(error) {
this.destination.error(error);
}
notifyComplete(_innerSub) {
this.destination.complete();
}
}
export function innerSubscribe(result, innerSubscriber) {
if (innerSubscriber.closed) {
return undefined;
}
if (result instanceof Observable) {
return result.subscribe(innerSubscriber);
}
let subscription;
try {
subscription = subscribeTo(result)(innerSubscriber);
}
catch (error) {
innerSubscriber.error(error);
}
return subscription;
}
//# sourceMappingURL=innerSubscribe.js.map

View File

@@ -0,0 +1,15 @@
language: node_js
node_js:
- "4"
before_install:
- pip install --user codecov
after_success:
- codecov --file coverage/lcov.info --disable search
# travis encrypt [subdomain]:[api token]@[room id]
# notifications:
# email: false
# campfire:
# rooms:
# secure: xyz
# on_failure: always
# on_success: always

View File

@@ -0,0 +1,38 @@
import { Observable } from '../Observable';
import { Operator } from '../Operator';
import { Subscriber } from '../Subscriber';
import { TeardownLogic, ObservableInput } from '../types';
import { OuterSubscriber } from '../OuterSubscriber';
export declare function race<A>(arg: [ObservableInput<A>]): Observable<A>;
export declare function race<A, B>(arg: [ObservableInput<A>, ObservableInput<B>]): Observable<A | B>;
export declare function race<A, B, C>(arg: [ObservableInput<A>, ObservableInput<B>, ObservableInput<C>]): Observable<A | B | C>;
export declare function race<A, B, C, D>(arg: [ObservableInput<A>, ObservableInput<B>, ObservableInput<C>, ObservableInput<D>]): Observable<A | B | C | D>;
export declare function race<A, B, C, D, E>(arg: [ObservableInput<A>, ObservableInput<B>, ObservableInput<C>, ObservableInput<D>, ObservableInput<E>]): Observable<A | B | C | D | E>;
export declare function race<T>(arg: ObservableInput<T>[]): Observable<T>;
export declare function race(arg: ObservableInput<any>[]): Observable<{}>;
export declare function race<A>(a: ObservableInput<A>): Observable<A>;
export declare function race<A, B>(a: ObservableInput<A>, b: ObservableInput<B>): Observable<A | B>;
export declare function race<A, B, C>(a: ObservableInput<A>, b: ObservableInput<B>, c: ObservableInput<C>): Observable<A | B | C>;
export declare function race<A, B, C, D>(a: ObservableInput<A>, b: ObservableInput<B>, c: ObservableInput<C>, d: ObservableInput<D>): Observable<A | B | C | D>;
export declare function race<A, B, C, D, E>(a: ObservableInput<A>, b: ObservableInput<B>, c: ObservableInput<C>, d: ObservableInput<D>, e: ObservableInput<E>): Observable<A | B | C | D | E>;
export declare function race<T>(observables: ObservableInput<T>[]): Observable<T>;
export declare function race(observables: ObservableInput<any>[]): Observable<{}>;
export declare function race<T>(...observables: ObservableInput<T>[]): Observable<T>;
export declare function race(...observables: ObservableInput<any>[]): Observable<{}>;
export declare class RaceOperator<T> implements Operator<T, T> {
call(subscriber: Subscriber<T>, source: any): TeardownLogic;
}
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
export declare class RaceSubscriber<T> extends OuterSubscriber<T, T> {
private hasFirst;
private observables;
private subscriptions;
constructor(destination: Subscriber<T>);
protected _next(observable: any): void;
protected _complete(): void;
notifyNext(_outerValue: T, innerValue: T, outerIndex: number): void;
}

View File

@@ -0,0 +1 @@
{"name":"@types/parse-json","version":"4.0.0","files":{"LICENSE":{"checkedAt":1678887829553,"integrity":"sha512-OA1NKix/qrKxxfRisVCbGmX70dPqjsRn88PFfBoDRzStaYjo80MtZWn8vDOnalp8LU4MLPJBnqCFq/O/53Wd/w==","mode":438,"size":1183},"index.d.ts":{"checkedAt":1678887829553,"integrity":"sha512-6UTviupjEu/cpFKWrroF9ryJ23jf0/XAKqUAOJKpwgmJ154A8cFLCTN5On5Csc7aoUqst+2v1EYeXVmd4Ol9Kw==","mode":438,"size":434},"README.md":{"checkedAt":1678887829553,"integrity":"sha512-BhtNEbyvMzeRKMGX/i75+ByVGwHGaPL/pGEIo/UkqbUrU6j987E4zdGdUfdFo4HRNVRkoHrgIe5lma3OhYNkHw==","mode":438,"size":496},"package.json":{"checkedAt":1678887829553,"integrity":"sha512-sm3aFcPlJIe9XoJ/NkTSdyDfqGLViEJqAekOwcR5zABPalJY2qSebrnLLlnRJQdxDfHcXCgzTgrYzpHFxqjF9w==","mode":438,"size":625}}}