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 @@
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.01927,"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.00385,"33":0,"34":0.02698,"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.00385,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0.00385,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0.00385,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.01927,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0.04239,"89":0,"90":0,"91":0.02698,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0.00385,"100":0.00771,"101":0,"102":0.01156,"103":0.01156,"104":0,"105":0.00385,"106":0.00771,"107":0.02312,"108":0.42009,"109":0.22353,"110":0.01156,"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.00385,"39":0,"40":0.00385,"41":0,"42":0,"43":0.00385,"44":0,"45":0,"46":0.00385,"47":0,"48":0,"49":0.00771,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0.00385,"62":0,"63":0.02698,"64":0,"65":0.00385,"66":0,"67":0.00385,"68":0,"69":0,"70":0.00771,"71":0,"72":0,"73":0.00385,"74":0.00385,"75":0.00771,"76":0,"77":0.00771,"78":0.00385,"79":0.01156,"80":0.00771,"81":0.06937,"83":0.00385,"84":0,"85":0.01156,"86":0.00385,"87":0.00771,"88":0.00771,"89":0.01542,"90":0.00771,"91":0.00771,"92":0.01542,"93":0.00771,"94":0.00385,"95":0.02312,"96":0.01927,"97":0.00771,"98":0.03469,"99":0.03854,"100":0.01156,"101":0.00771,"102":0.08093,"103":0.08479,"104":0.04239,"105":0.04625,"106":0.03854,"107":0.20812,"108":4.15461,"109":4.08139,"110":0.00385,"111":0,"112":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0.00385,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0.00771,"62":0,"63":0.00771,"64":0.00385,"65":0,"66":0.03469,"67":0.05781,"68":0,"69":0,"70":0,"71":0,"72":0.00385,"73":0.00385,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0.00385,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0.00771,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.03854,"94":0.30832,"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.00385,"13":0.00771,"14":0.00385,"15":0.00385,"16":0.00385,"17":0.00385,"18":0.01927,"79":0,"80":0.00771,"81":0,"83":0,"84":0.00771,"85":0,"86":0,"87":0,"88":0,"89":0.00385,"90":0.00771,"91":0,"92":0.02698,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0.00385,"101":0,"102":0,"103":0.00771,"104":0.00385,"105":0.00771,"106":0.01927,"107":0.06166,"108":0.85559,"109":0.94423},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0.01927,"15":0.01156,_:"0","3.1":0,"3.2":0,"5.1":0.00385,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0,"13.1":0.01927,"14.1":0.01927,"15.1":0.00385,"15.2-15.3":0.02312,"15.4":0.04625,"15.5":0.02698,"15.6":0.08479,"16.0":0.01156,"16.1":0.04625,"16.2":0.05781,"16.3":0.00385},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00907,"5.0-5.1":0.00453,"6.0-6.1":0.00076,"7.0-7.1":0.11106,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.02493,"10.0-10.2":0,"10.3":0.14355,"11.0-11.2":0.00227,"11.3-11.4":0.07026,"12.0-12.1":0.02871,"12.2-12.5":0.39137,"13.0-13.1":0.00076,"13.2":0.00302,"13.3":0.0136,"13.4-13.7":0.08084,"14.0-14.4":0.15866,"14.5-14.8":0.12693,"15.0-15.1":0.08311,"15.2-15.3":0.14355,"15.4":0.13373,"15.5":0.27426,"15.6":0.80766,"16.0":1.09477,"16.1":1.69693,"16.2":1.19072,"16.3":0.11862},P:{"4":0.33752,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.37843,"8.2":0.01023,"9.2":0,"10.1":0.02046,"11.1-11.2":0.02046,"12.0":0.03068,"13.0":0.05114,"14.0":0.11251,"15.0":0.01023,"16.0":0.09205,"17.0":0.06137,"18.0":0.11251,"19.0":1.47281},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00476,"4.4":0,"4.4.3-4.4.4":0.09148},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.04239,"5.5":0},J:{"7":0,"10":0.00615},N:{"10":0,"11":0},R:{_:"0"},M:{"0":0.23969},Q:{"13.1":0},O:{"0":1.09399},H:{"0":0.94262},L:{"0":73.1835},S:{"2.5":0.06146}};

View File

@@ -0,0 +1,64 @@
import stringify from './stringify.js';
import parse from './parse.js';
function stringToBytes(str) {
str = unescape(encodeURIComponent(str)); // UTF8 escape
var bytes = [];
for (var i = 0; i < str.length; ++i) {
bytes.push(str.charCodeAt(i));
}
return bytes;
}
export var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
export var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
export default function (name, version, hashfunc) {
function generateUUID(value, namespace, buf, offset) {
if (typeof value === 'string') {
value = stringToBytes(value);
}
if (typeof namespace === 'string') {
namespace = parse(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])`
var 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 (var i = 0; i < 16; ++i) {
buf[offset + i] = bytes[i];
}
return buf;
}
return stringify(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 @@
{"version":3,"file":"OuterSubscriber.js","sources":["../src/internal/OuterSubscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA0C;AAQ1C;IAA2C,mCAAa;IAAxD;;IAcA,CAAC;IAbC,oCAAU,GAAV,UAAW,UAAa,EAAE,UAAa,EAC5B,UAAkB,EAAE,UAAkB,EACtC,QAA+B;QACxC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC;IAED,qCAAW,GAAX,UAAY,KAAU,EAAE,QAA+B;QACrD,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IAED,wCAAc,GAAd,UAAe,QAA+B;QAC5C,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;IAC9B,CAAC;IACH,sBAAC;AAAD,CAAC,AAdD,CAA2C,uBAAU,GAcpD;AAdY,0CAAe"}

View File

@@ -0,0 +1,83 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var Subscriber_1 = require("../Subscriber");
function scan(accumulator, seed) {
var hasSeed = false;
if (arguments.length >= 2) {
hasSeed = true;
}
return function scanOperatorFunction(source) {
return source.lift(new ScanOperator(accumulator, seed, hasSeed));
};
}
exports.scan = scan;
var ScanOperator = (function () {
function ScanOperator(accumulator, seed, hasSeed) {
if (hasSeed === void 0) { hasSeed = false; }
this.accumulator = accumulator;
this.seed = seed;
this.hasSeed = hasSeed;
}
ScanOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed));
};
return ScanOperator;
}());
var ScanSubscriber = (function (_super) {
__extends(ScanSubscriber, _super);
function ScanSubscriber(destination, accumulator, _seed, hasSeed) {
var _this = _super.call(this, destination) || this;
_this.accumulator = accumulator;
_this._seed = _seed;
_this.hasSeed = hasSeed;
_this.index = 0;
return _this;
}
Object.defineProperty(ScanSubscriber.prototype, "seed", {
get: function () {
return this._seed;
},
set: function (value) {
this.hasSeed = true;
this._seed = value;
},
enumerable: true,
configurable: true
});
ScanSubscriber.prototype._next = function (value) {
if (!this.hasSeed) {
this.seed = value;
this.destination.next(value);
}
else {
return this._tryNext(value);
}
};
ScanSubscriber.prototype._tryNext = function (value) {
var index = this.index++;
var result;
try {
result = this.accumulator(this.seed, value, index);
}
catch (err) {
this.destination.error(err);
}
this.seed = result;
this.destination.next(result);
};
return ScanSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=scan.js.map

View File

@@ -0,0 +1,70 @@
'use strict'
let LazyResult = require('./lazy-result')
let Root = require('./root')
class Processor {
constructor(plugins = []) {
this.version = '8.2.10'
this.plugins = this.normalize(plugins)
}
use(plugin) {
this.plugins = this.plugins.concat(this.normalize([plugin]))
return this
}
process(css, opts = {}) {
if (
this.plugins.length === 0 &&
opts.parser === opts.stringifier &&
!opts.hideNothingWarning
) {
if (process.env.NODE_ENV !== 'production') {
if (typeof console !== 'undefined' && console.warn) {
console.warn(
'You did not set any plugins, parser, or stringifier. ' +
'Right now, PostCSS does nothing. Pick plugins for your case ' +
'on https://www.postcss.parts/ and use them in postcss.config.js.'
)
}
}
}
return new LazyResult(this, css, opts)
}
normalize(plugins) {
let normalized = []
for (let i of plugins) {
if (i.postcss === true) {
i = i()
} else if (i.postcss) {
i = i.postcss
}
if (typeof i === 'object' && Array.isArray(i.plugins)) {
normalized = normalized.concat(i.plugins)
} else if (typeof i === 'object' && i.postcssPlugin) {
normalized.push(i)
} else if (typeof i === 'function') {
normalized.push(i)
} else if (typeof i === 'object' && (i.parse || i.stringify)) {
if (process.env.NODE_ENV !== 'production') {
throw new Error(
'PostCSS syntaxes cannot be used as plugins. Instead, please use ' +
'one of the syntax/parser/stringifier options as outlined ' +
'in your PostCSS runner documentation.'
)
}
} else {
throw new Error(i + ' is not a PostCSS plugin')
}
}
return normalized
}
}
module.exports = Processor
Processor.default = Processor
Root.registerProcessor(Processor)

View File

@@ -0,0 +1,145 @@
'use strict';
var _ = {
last: require('lodash/last'),
flatten: require('lodash/flatten'),
};
var util = require('./readline');
var cliWidth = require('cli-width');
var stripAnsi = require('strip-ansi');
var stringWidth = require('string-width');
function height(content) {
return content.split('\n').length;
}
function lastLine(content) {
return _.last(content.split('\n'));
}
class ScreenManager {
constructor(rl) {
// These variables are keeping information to allow correct prompt re-rendering
this.height = 0;
this.extraLinesUnderPrompt = 0;
this.rl = rl;
}
render(content, bottomContent) {
this.rl.output.unmute();
this.clean(this.extraLinesUnderPrompt);
/**
* Write message to screen and setPrompt to control backspace
*/
var promptLine = lastLine(content);
var rawPromptLine = stripAnsi(promptLine);
// Remove the rl.line from our prompt. We can't rely on the content of
// rl.line (mainly because of the password prompt), so just rely on it's
// length.
var prompt = rawPromptLine;
if (this.rl.line.length) {
prompt = prompt.slice(0, -this.rl.line.length);
}
this.rl.setPrompt(prompt);
// SetPrompt will change cursor position, now we can get correct value
var cursorPos = this.rl._getCursorPos();
var width = this.normalizedCliWidth();
content = this.forceLineReturn(content, width);
if (bottomContent) {
bottomContent = this.forceLineReturn(bottomContent, width);
}
// Manually insert an extra line if we're at the end of the line.
// This prevent the cursor from appearing at the beginning of the
// current line.
if (rawPromptLine.length % width === 0) {
content += '\n';
}
var fullContent = content + (bottomContent ? '\n' + bottomContent : '');
this.rl.output.write(fullContent);
/**
* Re-adjust the cursor at the correct position.
*/
// We need to consider parts of the prompt under the cursor as part of the bottom
// content in order to correctly cleanup and re-render.
var promptLineUpDiff = Math.floor(rawPromptLine.length / width) - cursorPos.rows;
var bottomContentHeight =
promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);
if (bottomContentHeight > 0) {
util.up(this.rl, bottomContentHeight);
}
// Reset cursor at the beginning of the line
util.left(this.rl, stringWidth(lastLine(fullContent)));
// Adjust cursor on the right
if (cursorPos.cols > 0) {
util.right(this.rl, cursorPos.cols);
}
/**
* Set up state for next re-rendering
*/
this.extraLinesUnderPrompt = bottomContentHeight;
this.height = height(fullContent);
this.rl.output.mute();
}
clean(extraLines) {
if (extraLines > 0) {
util.down(this.rl, extraLines);
}
util.clearLine(this.rl, this.height);
}
done() {
this.rl.setPrompt('');
this.rl.output.unmute();
this.rl.output.write('\n');
}
releaseCursor() {
if (this.extraLinesUnderPrompt > 0) {
util.down(this.rl, this.extraLinesUnderPrompt);
}
}
normalizedCliWidth() {
var width = cliWidth({
defaultWidth: 80,
output: this.rl.output,
});
return width;
}
breakLines(lines, width) {
// Break lines who're longer than the cli width so we can normalize the natural line
// returns behavior across terminals.
width = width || this.normalizedCliWidth();
var regex = new RegExp('(?:(?:\\033[[0-9;]*m)*.?){1,' + width + '}', 'g');
return lines.map((line) => {
var chunk = line.match(regex);
// Last match is always empty
chunk.pop();
return chunk || '';
});
}
forceLineReturn(content, width) {
width = width || this.normalizedCliWidth();
return _.flatten(this.breakLines(content.split('\n'), width)).join('\n');
}
}
module.exports = ScreenManager;

View File

@@ -0,0 +1,216 @@
declare namespace normalizeUrl {
interface Options {
/**
@default 'http:'
*/
readonly defaultProtocol?: string;
/**
Prepends `defaultProtocol` to the URL if it's protocol-relative.
@default true
@example
```
normalizeUrl('//sindresorhus.com:80/');
//=> 'http://sindresorhus.com'
normalizeUrl('//sindresorhus.com:80/', {normalizeProtocol: false});
//=> '//sindresorhus.com'
```
*/
readonly normalizeProtocol?: boolean;
/**
Normalizes `https:` URLs to `http:`.
@default false
@example
```
normalizeUrl('https://sindresorhus.com:80/');
//=> 'https://sindresorhus.com'
normalizeUrl('https://sindresorhus.com:80/', {forceHttp: true});
//=> 'http://sindresorhus.com'
```
*/
readonly forceHttp?: boolean;
/**
Normalizes `http:` URLs to `https:`.
This option can't be used with the `forceHttp` option at the same time.
@default false
@example
```
normalizeUrl('https://sindresorhus.com:80/');
//=> 'https://sindresorhus.com'
normalizeUrl('http://sindresorhus.com:80/', {forceHttps: true});
//=> 'https://sindresorhus.com'
```
*/
readonly forceHttps?: boolean;
/**
Strip the [authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) part of a URL.
@default true
@example
```
normalizeUrl('user:password@sindresorhus.com');
//=> 'https://sindresorhus.com'
normalizeUrl('user:password@sindresorhus.com', {stripAuthentication: false});
//=> 'https://user:password@sindresorhus.com'
```
*/
readonly stripAuthentication?: boolean;
/**
Removes hash from the URL.
@default false
@example
```
normalizeUrl('sindresorhus.com/about.html#contact');
//=> 'http://sindresorhus.com/about.html#contact'
normalizeUrl('sindresorhus.com/about.html#contact', {stripHash: true});
//=> 'http://sindresorhus.com/about.html'
```
*/
readonly stripHash?: boolean;
/**
Removes HTTP(S) protocol from an URL `http://sindresorhus.com` → `sindresorhus.com`.
@default false
@example
```
normalizeUrl('https://sindresorhus.com');
//=> 'https://sindresorhus.com'
normalizeUrl('sindresorhus.com', {stripProtocol: true});
//=> 'sindresorhus.com'
```
*/
readonly stripProtocol?: boolean;
/**
Removes `www.` from the URL.
@default true
@example
```
normalizeUrl('http://www.sindresorhus.com');
//=> 'http://sindresorhus.com'
normalizeUrl('http://www.sindresorhus.com', {stripWWW: false});
//=> 'http://www.sindresorhus.com'
```
*/
readonly stripWWW?: boolean;
/**
Removes query parameters that matches any of the provided strings or regexes.
@default [/^utm_\w+/i]
@example
```
normalizeUrl('www.sindresorhus.com?foo=bar&ref=test_ref', {
removeQueryParameters: ['ref']
});
//=> 'http://sindresorhus.com/?foo=bar'
```
*/
readonly removeQueryParameters?: ReadonlyArray<RegExp | string>;
/**
Removes trailing slash.
__Note__: Trailing slash is always removed if the URL doesn't have a pathname.
@default true
@example
```
normalizeUrl('http://sindresorhus.com/redirect/');
//=> 'http://sindresorhus.com/redirect'
normalizeUrl('http://sindresorhus.com/redirect/', {removeTrailingSlash: false});
//=> 'http://sindresorhus.com/redirect/'
normalizeUrl('http://sindresorhus.com/', {removeTrailingSlash: false});
//=> 'http://sindresorhus.com'
```
*/
readonly removeTrailingSlash?: boolean;
/**
Removes the default directory index file from path that matches any of the provided strings or regexes.
When `true`, the regex `/^index\.[a-z]+$/` is used.
@default false
@example
```
normalizeUrl('www.sindresorhus.com/foo/default.php', {
removeDirectoryIndex: [/^default\.[a-z]+$/]
});
//=> 'http://sindresorhus.com/foo'
```
*/
readonly removeDirectoryIndex?: ReadonlyArray<RegExp | string>;
/**
Sorts the query parameters alphabetically by key.
@default true
@example
```
normalizeUrl('www.sindresorhus.com?b=two&a=one&c=three', {
sortQueryParameters: false
});
//=> 'http://sindresorhus.com/?b=two&a=one&c=three'
```
*/
readonly sortQueryParameters?: boolean;
}
}
declare const normalizeUrl: {
/**
[Normalize](https://en.wikipedia.org/wiki/URL_normalization) a URL.
@param url - URL to normalize, including [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs).
@example
```
import normalizeUrl = require('normalize-url');
normalizeUrl('sindresorhus.com');
//=> 'http://sindresorhus.com'
normalizeUrl('HTTP://xn--xample-hva.com:80/?b=bar&a=foo');
//=> 'http://êxample.com/?a=foo&b=bar'
```
*/
(url: string, options?: normalizeUrl.Options): string;
// TODO: Remove this for the next major release, refactor the whole definition to:
// declare function normalizeUrl(url: string, options?: normalizeUrl.Options): string;
// export = normalizeUrl;
default: typeof normalizeUrl;
};
export = normalizeUrl;

View File

@@ -0,0 +1,409 @@
# graphql.js
> GitHub GraphQL API client for browsers and Node
[![@latest](https://img.shields.io/npm/v/@octokit/graphql.svg)](https://www.npmjs.com/package/@octokit/graphql)
[![Build Status](https://github.com/octokit/graphql.js/workflows/Test/badge.svg)](https://github.com/octokit/graphql.js/actions?query=workflow%3ATest+branch%3Amaster)
<!-- toc -->
- [Usage](#usage)
- [Send a simple query](#send-a-simple-query)
- [Authentication](#authentication)
- [Variables](#variables)
- [Pass query together with headers and variables](#pass-query-together-with-headers-and-variables)
- [Use with GitHub Enterprise](#use-with-github-enterprise)
- [Use custom `@octokit/request` instance](#use-custom-octokitrequest-instance)
- [TypeScript](#typescript)
- [Additional Types](#additional-types)
- [Errors](#errors)
- [Partial responses](#partial-responses)
- [Writing tests](#writing-tests)
- [License](#license)
<!-- tocstop -->
## Usage
<table>
<tbody valign=top align=left>
<tr><th>
Browsers
</th><td width=100%>
Load `@octokit/graphql` directly from [cdn.skypack.dev](https://cdn.skypack.dev)
```html
<script type="module">
import { graphql } from "https://cdn.skypack.dev/@octokit/graphql";
</script>
```
</td></tr>
<tr><th>
Node
</th><td>
Install with <code>npm install @octokit/graphql</code>
```js
const { graphql } = require("@octokit/graphql");
// or: import { graphql } from "@octokit/graphql";
```
</td></tr>
</tbody>
</table>
### Send a simple query
```js
const { repository } = await graphql(
`
{
repository(owner: "octokit", name: "graphql.js") {
issues(last: 3) {
edges {
node {
title
}
}
}
}
}
`,
{
headers: {
authorization: `token secret123`,
},
}
);
```
### Authentication
The simplest way to authenticate a request is to set the `Authorization` header, e.g. to a [personal access token](https://github.com/settings/tokens/).
```js
const graphqlWithAuth = graphql.defaults({
headers: {
authorization: `token secret123`,
},
});
const { repository } = await graphqlWithAuth(`
{
repository(owner: "octokit", name: "graphql.js") {
issues(last: 3) {
edges {
node {
title
}
}
}
}
}
`);
```
For more complex authentication strategies such as GitHub Apps or Basic, we recommend the according authentication library exported by [`@octokit/auth`](https://github.com/octokit/auth.js).
```js
const { createAppAuth } = require("@octokit/auth-app");
const auth = createAppAuth({
id: process.env.APP_ID,
privateKey: process.env.PRIVATE_KEY,
installationId: 123,
});
const graphqlWithAuth = graphql.defaults({
request: {
hook: auth.hook,
},
});
const { repository } = await graphqlWithAuth(
`{
repository(owner: "octokit", name: "graphql.js") {
issues(last: 3) {
edges {
node {
title
}
}
}
}
}`
);
```
### Variables
⚠️ Do not use [template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) in the query strings as they make your code vulnerable to query injection attacks (see [#2](https://github.com/octokit/graphql.js/issues/2)). Use variables instead:
```js
const { lastIssues } = await graphql(
`
query lastIssues($owner: String!, $repo: String!, $num: Int = 3) {
repository(owner: $owner, name: $repo) {
issues(last: $num) {
edges {
node {
title
}
}
}
}
}
`,
{
owner: "octokit",
repo: "graphql.js",
headers: {
authorization: `token secret123`,
},
}
);
```
### Pass query together with headers and variables
```js
const { graphql } = require("@octokit/graphql");
const { lastIssues } = await graphql({
query: `query lastIssues($owner: String!, $repo: String!, $num: Int = 3) {
repository(owner:$owner, name:$repo) {
issues(last:$num) {
edges {
node {
title
}
}
}
}
}`,
owner: "octokit",
repo: "graphql.js",
headers: {
authorization: `token secret123`,
},
});
```
### Use with GitHub Enterprise
```js
let { graphql } = require("@octokit/graphql");
graphql = graphql.defaults({
baseUrl: "https://github-enterprise.acme-inc.com/api",
headers: {
authorization: `token secret123`,
},
});
const { repository } = await graphql(`
{
repository(owner: "acme-project", name: "acme-repo") {
issues(last: 3) {
edges {
node {
title
}
}
}
}
}
`);
```
### Use custom `@octokit/request` instance
```js
const { request } = require("@octokit/request");
const { withCustomRequest } = require("@octokit/graphql");
let requestCounter = 0;
const myRequest = request.defaults({
headers: {
authentication: "token secret123",
},
request: {
hook(request, options) {
requestCounter++;
return request(options);
},
},
});
const myGraphql = withCustomRequest(myRequest);
await request("/");
await myGraphql(`
{
repository(owner: "acme-project", name: "acme-repo") {
issues(last: 3) {
edges {
node {
title
}
}
}
}
}
`);
// requestCounter is now 2
```
## TypeScript
`@octokit/graphql` is exposing proper types for its usage with TypeScript projects.
### Additional Types
Additionally, `GraphQlQueryResponseData` has been exposed to users:
```ts
import type { GraphQlQueryResponseData } from "@octokit/graphql";
```
## Errors
In case of a GraphQL error, `error.message` is set to a combined message describing all errors returned by the endpoint.
All errors can be accessed at `error.errors`. `error.request` has the request options such as query, variables and headers set for easier debugging.
```js
let { graphql, GraphqlResponseError } = require("@octokit/graphql");
graphqlt = graphql.defaults({
headers: {
authorization: `token secret123`,
},
});
const query = `{
viewer {
bioHtml
}
}`;
try {
const result = await graphql(query);
} catch (error) {
if (error instanceof GraphqlResponseError) {
// do something with the error, allowing you to detect a graphql response error,
// compared to accidentally catching unrelated errors.
// server responds with an object like the following (as an example)
// class GraphqlResponseError {
// "headers": {
// "status": "403",
// },
// "data": null,
// "errors": [{
// "message": "Field 'bioHtml' doesn't exist on type 'User'",
// "locations": [{
// "line": 3,
// "column": 5
// }]
// }]
// }
console.log("Request failed:", error.request); // { query, variables: {}, headers: { authorization: 'token secret123' } }
console.log(error.message); // Field 'bioHtml' doesn't exist on type 'User'
} else {
// handle non-GraphQL error
}
}
```
## Partial responses
A GraphQL query may respond with partial data accompanied by errors. In this case we will throw an error but the partial data will still be accessible through `error.data`
```js
let { graphql } = require("@octokit/graphql");
graphql = graphql.defaults({
headers: {
authorization: `token secret123`,
},
});
const query = `{
repository(name: "probot", owner: "probot") {
name
ref(qualifiedName: "master") {
target {
... on Commit {
history(first: 25, after: "invalid cursor") {
nodes {
message
}
}
}
}
}
}
}`;
try {
const result = await graphql(query);
} catch (error) {
// server responds with
// {
// "data": {
// "repository": {
// "name": "probot",
// "ref": null
// }
// },
// "errors": [
// {
// "type": "INVALID_CURSOR_ARGUMENTS",
// "path": [
// "repository",
// "ref",
// "target",
// "history"
// ],
// "locations": [
// {
// "line": 7,
// "column": 11
// }
// ],
// "message": "`invalid cursor` does not appear to be a valid cursor."
// }
// ]
// }
console.log("Request failed:", error.request); // { query, variables: {}, headers: { authorization: 'token secret123' } }
console.log(error.message); // `invalid cursor` does not appear to be a valid cursor.
console.log(error.data); // { repository: { name: 'probot', ref: null } }
}
```
## Writing tests
You can pass a replacement for [the built-in fetch implementation](https://github.com/bitinn/node-fetch) as `request.fetch` option. For example, using [fetch-mock](http://www.wheresrhys.co.uk/fetch-mock/) works great to write tests
```js
const assert = require("assert");
const fetchMock = require("fetch-mock/es5/server");
const { graphql } = require("@octokit/graphql");
graphql("{ viewer { login } }", {
headers: {
authorization: "token secret123",
},
request: {
fetch: fetchMock
.sandbox()
.post("https://api.github.com/graphql", (url, options) => {
assert.strictEqual(options.headers.authorization, "token secret123");
assert.strictEqual(
options.body,
'{"query":"{ viewer { login } }"}',
"Sends correct query"
);
return { data: {} };
}),
},
});
```
## License
[MIT](LICENSE)

View File

@@ -0,0 +1 @@
{"name":"normalize-url","version":"4.5.1","files":{"license":{"checkedAt":1678887829653,"integrity":"sha512-nIst73auX/5NY2Fmv5Y116vWnNrEv4GaIUX3lpZG05rpXJY2S8EX+fpUS5hRjClCM0VdT2Za9DDHXXB5jdSrEw==","mode":420,"size":1109},"index.js":{"checkedAt":1678887830330,"integrity":"sha512-8bzHlk+OYT5mVOgg8JBGFek/RAh0SsgukIWsJ7AID1t6QW9wBiRAzmOmi57yyQXVVXbeu38lAUpbVheHH2tSxw==","mode":420,"size":6046},"package.json":{"checkedAt":1678887830330,"integrity":"sha512-F/oZTKNESmH7NHfoH2NDekPM6Bcaw3gzQ+O45NH2p7kBliEyvY8A4Ahf4GToe5q1w1L5IcBK9ezYd64HPhkyFg==","mode":420,"size":707},"readme.md":{"checkedAt":1678887830330,"integrity":"sha512-xEqvcPFO4a7MHKI1EtKirt+NyJmRJyzHCLuHK7UUrZFGgCeGX5F3e6o/byBdSnHyUq5b/NFNu/KtNfFKwtqsDg==","mode":420,"size":5291},"index.d.ts":{"checkedAt":1678887830333,"integrity":"sha512-9UHLSj1/YjmSSQUWPlJbpfqJZwHz4xzUlxUOUp6ipWYOMgxqaNjLZaSdgVH6J/AQNOgvqOdtrBNmk60scJ/c9w==","mode":420,"size":4952}}}

View File

@@ -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.03512,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.00585,"103":0,"104":0,"105":0.02341,"106":0.00585,"107":0.01756,"108":1.57446,"109":0.75504,"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,"48":0,"49":0.70821,"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.00585,"70":0.00585,"71":0,"72":0,"73":0,"74":0.01756,"75":0,"76":0,"77":0,"78":0,"79":0.02927,"80":0.00585,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0.00585,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.43898,"94":0,"95":0.02341,"96":0.05853,"97":0.00585,"98":0,"99":0,"100":0,"101":0,"102":0,"103":1.38716,"104":0.00585,"105":0.04097,"106":0.01171,"107":0.04682,"108":8.65073,"109":7.19919,"110":0,"111":0,"112":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0.01171,"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.00585,"91":0,"92":0,"93":0.01171,"94":0.47995,"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.01756,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0.01171,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0.00585,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0.00585,"104":0.01756,"105":0,"106":0.01171,"107":0.02927,"108":4.21416,"109":3.40645},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0.02927,"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.06438,"13.1":0.04097,"14.1":0.04097,"15.1":0.01171,"15.2-15.3":0,"15.4":0.00585,"15.5":0.06438,"15.6":0.11121,"16.0":0,"16.1":0.04682,"16.2":0.05853,"16.3":0.01756},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.02978,"8.1-8.4":0,"9.0-9.2":0.01489,"9.3":0.02234,"10.0-10.2":0,"10.3":0.02234,"11.0-11.2":0,"11.3-11.4":0.00745,"12.0-12.1":0.02234,"12.2-12.5":0.49733,"13.0-13.1":0.01489,"13.2":0,"13.3":0.00745,"13.4-13.7":0.05212,"14.0-14.4":0.2308,"14.5-14.8":0.85469,"15.0-15.1":0.14146,"15.2-15.3":0.05212,"15.4":2.06227,"15.5":1.03188,"15.6":1.12717,"16.0":1.86274,"16.1":2.90802,"16.2":2.52237,"16.3":0.23675},P:{"4":0,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.12806,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0.02134,"12.0":0,"13.0":0,"14.0":0.2241,"15.0":0,"16.0":0.06403,"17.0":0.02134,"18.0":0.60828,"19.0":1.33395},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":1.98322},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.01756,"5.5":0},J:{"7":0,"10":0},N:{"10":0,"11":0},R:{_:"0"},M:{"0":0.02074},Q:{"13.1":0},O:{"0":0.12026},H:{"0":0.9776},L:{"0":48.54136},S:{"2.5":0}};

View File

@@ -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.00666,"48":0,"49":0,"50":0,"51":0,"52":0.01333,"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.01999,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0.02665,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0.00666,"98":0,"99":0,"100":0,"101":0.00666,"102":0.01999,"103":0.02665,"104":0.00666,"105":0.01999,"106":0.01333,"107":0.01999,"108":0.91949,"109":0.5397,"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.00666,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.03332,"50":0,"51":0,"52":0.01999,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0.00666,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0.01333,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0.01999,"77":0,"78":0.00666,"79":0.03332,"80":0.00666,"81":0.00666,"83":0.00666,"84":0.00666,"85":0.01999,"86":0.00666,"87":0.04664,"88":0.00666,"89":0.01999,"90":0.01999,"91":0.01999,"92":0.02665,"93":0.08662,"94":0.01999,"95":0.00666,"96":0.01333,"97":0.01999,"98":0.01999,"99":0.03332,"100":0.03998,"101":0.01333,"102":0.01999,"103":0.25986,"104":0.05997,"105":0.11327,"106":0.08662,"107":0.60633,"108":15.39153,"109":12.63971,"110":0.00666,"111":0,"112":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0.00666,"74":0,"75":0.00666,"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.01333,"90":0,"91":0,"92":0.00666,"93":0.58634,"94":0.44642,"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,"90":0,"91":0,"92":0.01999,"93":0,"94":0,"95":0,"96":0,"97":0.00666,"98":0,"99":0,"100":0.00666,"101":0.00666,"102":0.03332,"103":0.00666,"104":0.01333,"105":0.01333,"106":0.01333,"107":0.08662,"108":2.75182,"109":2.78513},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0.00666,"13":0.00666,"14":0.1799,"15":0.03998,_:"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.02665,"13.1":0.13992,"14.1":0.43976,"15.1":0.07329,"15.2-15.3":0.0533,"15.4":0.14659,"15.5":0.25986,"15.6":1.50584,"16.0":0.19989,"16.1":0.63299,"16.2":0.99945,"16.3":0.09328},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.02986,"8.1-8.4":0,"9.0-9.2":0.01866,"9.3":0.06345,"10.0-10.2":0,"10.3":0.13437,"11.0-11.2":0.00373,"11.3-11.4":0.02613,"12.0-12.1":0.0112,"12.2-12.5":0.53,"13.0-13.1":0,"13.2":0.00373,"13.3":0.01493,"13.4-13.7":0.07465,"14.0-14.4":0.26127,"14.5-14.8":1.06374,"15.0-15.1":0.23141,"15.2-15.3":0.31352,"15.4":0.36578,"15.5":0.95923,"15.6":5.04995,"16.0":4.90812,"16.1":13.52251,"16.2":7.3715,"16.3":0.61958},P:{"4":0.04108,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0.01027,"12.0":0,"13.0":0,"14.0":0.01027,"15.0":0,"16.0":0.02054,"17.0":0.01027,"18.0":0.02054,"19.0":1.46876},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0.00633,"4.2-4.3":0.019,"4.4":0,"4.4.3-4.4.4":0.10136},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0.0546,"8":0.04095,"9":0,"10":0.00683,"11":0.17746,"5.5":0},J:{"7":0,"10":0},N:{"10":0,"11":0},R:{_:"0"},M:{"0":0.24694},Q:{"13.1":0},O:{"0":0.01001},H:{"0":0.11057},L:{"0":17.32174},S:{"2.5":0}};

View File

@@ -0,0 +1 @@
{"version":3,"file":"timer.js","sources":["../../src/add/observable/timer.ts"],"names":[],"mappings":";;AAAA,4CAA0C"}

View File

@@ -0,0 +1,13 @@
import Component from '../Component';
import TemplateScope from './shared/TemplateScope';
import Node from './shared/Node';
import Let from './Let';
import { INode } from './interfaces';
export default class DefaultSlotTemplate extends Node {
type: 'SlotTemplate';
scope: TemplateScope;
children: INode[];
lets: Let[];
slot_template_name: string;
constructor(component: Component, parent: INode, scope: TemplateScope, info: any, lets: Let[], children: INode[]);
}

View File

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

View File

@@ -0,0 +1,89 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var Subscriber_1 = require("../Subscriber");
var noop_1 = require("../util/noop");
var isFunction_1 = require("../util/isFunction");
function tap(nextOrObserver, error, complete) {
return function tapOperatorFunction(source) {
return source.lift(new DoOperator(nextOrObserver, error, complete));
};
}
exports.tap = tap;
var DoOperator = (function () {
function DoOperator(nextOrObserver, error, complete) {
this.nextOrObserver = nextOrObserver;
this.error = error;
this.complete = complete;
}
DoOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete));
};
return DoOperator;
}());
var TapSubscriber = (function (_super) {
__extends(TapSubscriber, _super);
function TapSubscriber(destination, observerOrNext, error, complete) {
var _this = _super.call(this, destination) || this;
_this._tapNext = noop_1.noop;
_this._tapError = noop_1.noop;
_this._tapComplete = noop_1.noop;
_this._tapError = error || noop_1.noop;
_this._tapComplete = complete || noop_1.noop;
if (isFunction_1.isFunction(observerOrNext)) {
_this._context = _this;
_this._tapNext = observerOrNext;
}
else if (observerOrNext) {
_this._context = observerOrNext;
_this._tapNext = observerOrNext.next || noop_1.noop;
_this._tapError = observerOrNext.error || noop_1.noop;
_this._tapComplete = observerOrNext.complete || noop_1.noop;
}
return _this;
}
TapSubscriber.prototype._next = function (value) {
try {
this._tapNext.call(this._context, value);
}
catch (err) {
this.destination.error(err);
return;
}
this.destination.next(value);
};
TapSubscriber.prototype._error = function (err) {
try {
this._tapError.call(this._context, err);
}
catch (err) {
this.destination.error(err);
return;
}
this.destination.error(err);
};
TapSubscriber.prototype._complete = function () {
try {
this._tapComplete.call(this._context);
}
catch (err) {
this.destination.error(err);
return;
}
return this.destination.complete();
};
return TapSubscriber;
}(Subscriber_1.Subscriber));
//# sourceMappingURL=tap.js.map

View File

@@ -0,0 +1,6 @@
import { of } from './of';
import { concatAll } from '../operators/concatAll';
export function concat(...observables) {
return concatAll()(of(...observables));
}
//# sourceMappingURL=concat.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"fetch.js","sources":["../../../../src/internal/observable/dom/fetch.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AA8F7C,MAAM,UAAU,SAAS,CACvB,KAAuB,EACvB,gBAEM;IAFN,iCAAA,EAAA,qBAEM;IAEE,IAAA,oCAAQ,EAAE,qDAAO,CAAsB;IAC/C,OAAO,IAAI,UAAU,CAAe,UAAA,UAAU;QAC5C,IAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;QACzC,IAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QACjC,IAAI,SAAS,GAAG,IAAI,CAAC;QACrB,IAAI,YAAY,GAAG,KAAK,CAAC;QAEzB,IAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;QACxC,YAAY,CAAC,GAAG,CAAC;YACf,YAAY,GAAG,IAAI,CAAC;YACpB,IAAI,SAAS,EAAE;gBACb,UAAU,CAAC,KAAK,EAAE,CAAC;aACpB;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,iBAA8B,CAAC;QACnC,IAAI,IAAI,EAAE;YAER,IAAI,IAAI,CAAC,MAAM,EAAE;gBACf,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;oBACvB,UAAU,CAAC,KAAK,EAAE,CAAC;iBACpB;qBAAM;oBACL,IAAM,aAAW,GAAG,IAAI,CAAC,MAAM,CAAC;oBAChC,IAAM,oBAAkB,GAAG;wBACzB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;4BACnB,UAAU,CAAC,KAAK,EAAE,CAAC;yBACpB;oBACH,CAAC,CAAC;oBACF,aAAW,CAAC,gBAAgB,CAAC,OAAO,EAAE,oBAAkB,CAAC,CAAC;oBAC1D,YAAY,CAAC,GAAG,CAAC,cAAM,OAAA,aAAW,CAAC,mBAAmB,CAAC,OAAO,EAAE,oBAAkB,CAAC,EAA5D,CAA4D,CAAC,CAAC;iBACtF;aACF;YAGD,iBAAiB,wBAAQ,IAAI,IAAE,MAAM,QAAA,GAAE,CAAC;SACzC;aAAM;YACL,iBAAiB,GAAG,EAAE,MAAM,QAAA,EAAE,CAAC;SAChC;QAED,KAAK,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,IAAI,CAAC,UAAA,QAAQ;YAC3C,IAAI,QAAQ,EAAE;gBACZ,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CACjD,UAAA,KAAK,IAAI,OAAA,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAtB,CAAsB,EAC/B,UAAA,GAAG;oBACD,SAAS,GAAG,KAAK,CAAC;oBAClB,IAAI,CAAC,YAAY,EAAE;wBAEjB,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;qBACvB;gBACH,CAAC,EACD;oBACE,SAAS,GAAG,KAAK,CAAC;oBAClB,UAAU,CAAC,QAAQ,EAAE,CAAC;gBACxB,CAAC,CACF,CAAC,CAAC;aACJ;iBAAM;gBACL,SAAS,GAAG,KAAK,CAAC;gBAClB,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAC1B,UAAU,CAAC,QAAQ,EAAE,CAAC;aACvB;QACH,CAAC,CAAC,CAAC,KAAK,CAAC,UAAA,GAAG;YACV,SAAS,GAAG,KAAK,CAAC;YAClB,IAAI,CAAC,YAAY,EAAE;gBAEjB,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACvB;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,YAAY,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC"}

View File

@@ -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.0064,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0.18554,"104":0,"105":0,"106":0.0064,"107":0,"108":1.01088,"109":0.24952,"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,"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.05758,"64":0,"65":0.0064,"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.39028,"80":0.0064,"81":0,"83":0.03839,"84":0,"85":0.0064,"86":0,"87":0.03839,"88":0,"89":0.0064,"90":0,"91":0.43506,"92":0,"93":0.06398,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0.02559,"101":0,"102":0.0128,"103":0.14715,"104":0.0128,"105":0.01919,"106":0.09597,"107":0.23673,"108":12.84718,"109":8.81005,"110":0.0128,"111":0,"112":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0.0128,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"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.01919,"93":0.3263,"94":1.36917,"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,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0.01919,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0.0064,"107":0.05758,"108":3.74283,"109":3.30137},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.627,"14":0.43506,"15":0.02559,_:"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.0064,"13.1":0.02559,"14.1":1.49713,"15.1":0.0128,"15.2-15.3":0.03839,"15.4":0.08957,"15.5":0.08957,"15.6":0.67819,"16.0":0.06398,"16.1":0.24312,"16.2":0.46066,"16.3":0.0128},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,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.06817,"10.0-10.2":0,"10.3":0.23435,"11.0-11.2":0.10439,"11.3-11.4":0.01704,"12.0-12.1":0.03835,"12.2-12.5":1.56163,"13.0-13.1":0.05752,"13.2":0,"13.3":0.10865,"13.4-13.7":0.09161,"14.0-14.4":1.34432,"14.5-14.8":0.20666,"15.0-15.1":0.83301,"15.2-15.3":0.03622,"15.4":0.21305,"15.5":0.82023,"15.6":3.53657,"16.0":2.78452,"16.1":5.39008,"16.2":2.85269,"16.3":0.27909},P:{"4":0.35678,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0.01049,"12.0":0,"13.0":0,"14.0":0.01049,"15.0":0,"16.0":0.01049,"17.0":0.06296,"18.0":0.07345,"19.0":4.55415},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.86952},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.01919,"5.5":0},J:{"7":0,"10":0},N:{"10":0,"11":0},R:{_:"0"},M:{"0":0.34939},Q:{"13.1":0},O:{"0":0.02161},H:{"0":0.1671},L:{"0":31.43728},S:{"2.5":0}};

View File

@@ -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.02413,"53":0,"54":0,"55":0,"56":0.00402,"57":0,"58":0,"59":0.00402,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0.00402,"68":0.00402,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.02011,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0.00804,"89":0.00402,"90":0,"91":0.00804,"92":0,"93":0,"94":0.00402,"95":0.00402,"96":0,"97":0.00402,"98":0.00402,"99":0.00402,"100":0.00402,"101":0.00402,"102":0.03218,"103":0.00402,"104":0.00804,"105":0.02815,"106":0.00804,"107":0.01609,"108":0.60732,"109":0.38611,"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.00402,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.02815,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0.00402,"61":0,"62":0,"63":0.00402,"64":0.00402,"65":0.00402,"66":0.02011,"67":0.00402,"68":0.00402,"69":0,"70":0.00402,"71":0,"72":0,"73":0.00402,"74":0.00402,"75":0.00804,"76":0.00402,"77":0.00402,"78":0.00402,"79":0.04826,"80":0.00402,"81":0.01207,"83":0.00804,"84":0.00804,"85":0.00804,"86":0.01207,"87":0.02413,"88":0.00804,"89":0.00804,"90":0.01609,"91":0.02011,"92":0.02413,"93":0.01609,"94":0.02413,"95":0.01207,"96":0.01207,"97":0.01207,"98":0.06033,"99":0.01207,"100":0.02011,"101":0.01609,"102":0.02011,"103":0.09653,"104":0.01609,"105":0.04424,"106":0.04022,"107":0.10055,"108":4.88673,"109":4.98326,"110":0.00402,"111":0,"112":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0.00402,"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.00402,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0.00804,"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.06435,"93":0.366,"94":0.28556,"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.00402,"18":0.00402,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0.00402,"91":0,"92":0.00402,"93":0,"94":0,"95":0.00402,"96":0,"97":0,"98":0,"99":0,"100":0.00402,"101":0,"102":0,"103":0.00402,"104":0.00402,"105":0.00402,"106":0.00402,"107":0.02413,"108":0.68374,"109":0.71592},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.00804,"14":0.04022,"15":0.00804,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0.00402,"10.1":0,"11.1":0.00402,"12.1":0.01207,"13.1":0.05631,"14.1":0.09653,"15.1":0.01609,"15.2-15.3":0.01207,"15.4":0.04022,"15.5":0.08446,"15.6":0.34589,"16.0":0.04022,"16.1":0.15686,"16.2":0.28958,"16.3":0.02011},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.00566,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.08676,"10.0-10.2":0,"10.3":0.10374,"11.0-11.2":0.00943,"11.3-11.4":0.04527,"12.0-12.1":0.0132,"12.2-12.5":0.42439,"13.0-13.1":0.01132,"13.2":0.00566,"13.3":0.02641,"13.4-13.7":0.0811,"14.0-14.4":0.24143,"14.5-14.8":0.57151,"15.0-15.1":0.13203,"15.2-15.3":0.19616,"15.4":0.26218,"15.5":0.5998,"15.6":1.99367,"16.0":2.45389,"16.1":6.43746,"16.2":3.90812,"16.3":0.29424},P:{"4":0.12314,"5.0-5.4":0.01026,"6.2-6.4":0,"7.2-7.4":0.02052,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0.03078,"12.0":0.01026,"13.0":0.04105,"14.0":0.03078,"15.0":0.02052,"16.0":0.05131,"17.0":0.05131,"18.0":0.10261,"19.0":2.11386},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0.02435,"4.2-4.3":0.01826,"4.4":0,"4.4.3-4.4.4":0.12174},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0.00427,"9":0,"10":0,"11":0.0641,"5.5":0},J:{"7":0,"10":0},N:{"10":0,"11":0},H:{"0":0.19243},L:{"0":61.51521},S:{"2.5":0},R:{_:"0"},M:{"0":0.26303},Q:{"13.1":0},O:{"0":0.02989}};