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={A:{A:{"2":"J E F G A B BC"},B:{"2":"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:{"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 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 DC EC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB 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:{"2":"I u J E F G A B C K L H GC zB HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC"},F:{"2":"0 1 2 3 4 5 6 7 8 9 G 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"},G:{"2":"F zB TC AC UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B"},H:{"2":"nC"},I:{"2":"tB I D oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"2":"A B C e qB 9B rB"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"uC"},P:{"2":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"2":"1B"},R:{"2":"8C"},S:{"2":"9C"}},B:7,C:"Decorators"};

View File

@@ -0,0 +1,111 @@
{
"name": "release-it",
"version": "14.6.1",
"description": "Generic CLI tool to automate versioning and package publishing related tasks.",
"keywords": [
"build",
"changelog",
"commit",
"distribution",
"git",
"github",
"gitlab",
"interactive",
"ci",
"npm",
"publish",
"push",
"release",
"release-it",
"repository",
"script",
"shell",
"tag",
"tool",
"version",
"semver",
"plugin"
],
"repository": {
"type": "git",
"url": "https://github.com/release-it/release-it.git"
},
"homepage": "https://github.com/release-it/release-it#readme",
"bugs": "https://github.com/release-it/release-it/issues",
"bin": {
"release-it": "bin/release-it.js"
},
"main": "./lib/index.js",
"files": [
"bin",
"config",
"lib",
"test"
],
"scripts": {
"lint": "eslint lib test",
"format": "prettier --write \"{lib,test}/**/*.js\"",
"test": "ava",
"coverage": "nyc --reporter=lcov --reporter=html --config=config/.codecov.yml npm test",
"codecov": "nyc --reporter=json --config=config/.codecov.yml npm test && codecov -f coverage/coverage-final.json",
"readme": "markdown-toc README.md -i --maxdepth=2 --bullets=-",
"release": "./bin/release-it.js"
},
"author": {
"email": "lars@webpro.nl",
"name": "Lars Kappert"
},
"license": "MIT",
"dependencies": {
"@iarna/toml": "2.2.5",
"@octokit/rest": "18.5.2",
"async-retry": "1.3.1",
"chalk": "4.1.0",
"cosmiconfig": "7.0.0",
"debug": "4.3.1",
"deprecated-obj": "2.0.0",
"execa": "5.0.0",
"find-up": "5.0.0",
"form-data": "4.0.0",
"git-url-parse": "11.4.4",
"globby": "11.0.3",
"got": "11.8.2",
"import-cwd": "3.0.0",
"inquirer": "8.0.0",
"is-ci": "3.0.0",
"lodash": "4.17.21",
"mime-types": "2.1.30",
"ora": "5.4.0",
"os-name": "4.0.0",
"parse-json": "5.2.0",
"semver": "7.3.5",
"shelljs": "0.8.4",
"update-notifier": "5.1.0",
"url-join": "4.0.1",
"uuid": "8.3.2",
"yaml": "1.10.2",
"yargs-parser": "20.2.7"
},
"devDependencies": {
"@octokit/request-error": "2.0.5",
"ava": "3.15.0",
"codecov": "3.8.1",
"eslint": "7.23.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-ava": "12.0.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-prettier": "3.3.1",
"markdown-toc": "1.2.0",
"mock-fs": "4.13.0",
"mock-stdio": "1.0.3",
"nock": "13.0.11",
"nyc": "15.1.0",
"prettier": "2.2.1",
"proxyquire": "2.1.3",
"sinon": "10.0.1",
"strip-ansi": "6.0.0"
},
"engines": {
"node": ">=10"
}
}

View File

@@ -0,0 +1 @@
{"name":"printj","version":"1.1.2","files":{"package.json":{"checkedAt":1678887830462,"integrity":"sha512-mEt0Nt5Vvc0BqQU4VUTsJkz8vjxwfqTfvUJZTAFSaU47l+pDuEaoUo8QGSeSvA6b78iBjjCfbHp4k5Kzkr/yDA==","mode":420,"size":1133},"LICENSE":{"checkedAt":1678887830462,"integrity":"sha512-qM0vN+bMRu0/eQkerDpImnypAGjgin5Dkib9FZoE7YZZ/NslOVm4jL37AsTGTsms7GfVXfI0TlAdLaWkdXofBg==","mode":420,"size":589},"printj.js":{"checkedAt":1678887830466,"integrity":"sha512-k4neZcWZbhFeXP2cxo+xydO+cR55x77wcdKfUmK8BX0eSljClii6zFsGrvF7D53dGvufsrrOj3JKRIFrl2OlBA==","mode":420,"size":18517},"dist/LICENSE":{"checkedAt":1678887830462,"integrity":"sha512-qM0vN+bMRu0/eQkerDpImnypAGjgin5Dkib9FZoE7YZZ/NslOVm4jL37AsTGTsms7GfVXfI0TlAdLaWkdXofBg==","mode":420,"size":589},"dist/printj.js":{"checkedAt":1678887830466,"integrity":"sha512-k4neZcWZbhFeXP2cxo+xydO+cR55x77wcdKfUmK8BX0eSljClii6zFsGrvF7D53dGvufsrrOj3JKRIFrl2OlBA==","mode":420,"size":18517},"types/tslint.json":{"checkedAt":1678887830456,"integrity":"sha512-I032+3RC2qXI6qgca4YV8c921zasGQaDl5ARm9FMgsjuTZoFh2Nm1nwKJuae5r2FAtLRaKv6U+Qef9+t/Q5i8A==","mode":420,"size":261},"README.md":{"checkedAt":1678887830488,"integrity":"sha512-7R0Gw3719ezvUfiPoEJiKqbdK3Uj2DWWhnIlMlKKzTSEPlENwH+6lY4czytJpmZOuazv19yUFZWiXyXCWBQq0Q==","mode":420,"size":43749},"bin/printj.njs":{"checkedAt":1678887830488,"integrity":"sha512-Na9fSpCiqZ7H56+EaW5fvsQdr+SAUl1YD9PnHjS99inTpVL4Fjn98BEOjp38rrAE/tzXms3xdr8rtF1+lyfILQ==","mode":493,"size":2325},"dist/printj.min.js":{"checkedAt":1678887830500,"integrity":"sha512-IFriw4idHk+ccPNJ3qEMlULQkwnOTvEVxggTTdl/3LD8cm5dfhylpp4ZbuNzJSfKzYYeLdLMcJUSjjTVwst8lA==","mode":420,"size":11796},"dist/printj.min.map":{"checkedAt":1678887830505,"integrity":"sha512-HfpPtIv/kNSRjuR96RouguCu2O0zLpv0myNqOii+gcmIB82HCxNDK4MEqGNIR+UwCRWKngjUnAQoWESdChsnRw==","mode":420,"size":15259},"types/index.d.ts":{"checkedAt":1678887830505,"integrity":"sha512-qKZhU9hDDnR4rM6C6ItbzfbHutlR4glyda12NLOT8fZqFHdLMf13gS1Omv5ZpwxK0JL3ar+KMjGg0sGf9Q99Og==","mode":420,"size":384},"types/tsconfig.json":{"checkedAt":1678887830505,"integrity":"sha512-ej6M1aBk0L6vOXieZmi0VwKqh+O4nNfZcXa5YaGWEeuuP1vnTDIJDsnFIuOt8zIv+fHuBibmGEu814fWPLmaSQ==","mode":420,"size":352}}}

View File

@@ -0,0 +1,72 @@
# cli-width
Get stdout window width, with four fallbacks, `tty`, `output.columns`, a custom environment variable and then a default.
[![npm version](https://badge.fury.io/js/cli-width.svg)](http://badge.fury.io/js/cli-width)
[![Build Status](https://travis-ci.org/knownasilya/cli-width.svg)](https://travis-ci.org/knownasilya/cli-width)
[![Coverage Status](https://coveralls.io/repos/knownasilya/cli-width/badge.svg?branch=master&service=github)](https://coveralls.io/github/knownasilya/cli-width?branch=master)
Tested against NodeJS v10+
## Usage
```
npm install --save cli-width
```
```js
"use strict";
const cliWidth = require("cli-width");
cliWidth(); // maybe 204 :)
```
You can also set the `CLI_WIDTH` environment variable.
If none of the methods are supported, and the environment variable isn't set,
the default width value is going to be `0`, that can be changed using the configurable `options`.
## API
### cliWidth([options])
`cliWidth` can be configured using an `options` parameter, the possible properties are:
- **defaultWidth**\<number\> Defines a default value to be used if none of the methods are available, defaults to `0`
- **output**\<object\> A stream to be used to read width values from, defaults to `process.stdout`
- **tty**\<object\> TTY module to try to read width from as a fallback, defaults to `require('tty')`
### Examples
Defining both a default width value and a stream output to try to read from:
```js
const cliWidth = require("cli-width");
const ttys = require("ttys");
cliWidth({
defaultWidth: 80,
output: ttys.output,
});
```
Defines a different tty module to read width from:
```js
const cliWidth = require("cli-width");
const ttys = require("ttys");
cliWidth({
tty: ttys,
});
```
## Tests
```bash
npm install
npm test
```
Coverage can be generated with `npm run coverage`.

View File

@@ -0,0 +1,3 @@
/** PURE_IMPORTS_START PURE_IMPORTS_END */
export var observable = /*@__PURE__*/ (function () { return typeof Symbol === 'function' && Symbol.observable || '@@observable'; })();
//# sourceMappingURL=observable.js.map

View File

@@ -0,0 +1,15 @@
import { Observable } from '../Observable';
import { subscribeToIterable } from '../util/subscribeToIterable';
import { scheduleIterable } from '../scheduled/scheduleIterable';
export function fromIterable(input, scheduler) {
if (!input) {
throw new Error('Iterable cannot be null');
}
if (!scheduler) {
return new Observable(subscribeToIterable(input));
}
else {
return scheduleIterable(input, scheduler);
}
}
//# sourceMappingURL=fromIterable.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["export const VERSION = \"18.5.2\";\n","import { Octokit as Core } from \"@octokit/core\";\nimport { requestLog } from \"@octokit/plugin-request-log\";\nimport { paginateRest } from \"@octokit/plugin-paginate-rest\";\nimport { legacyRestEndpointMethods } from \"@octokit/plugin-rest-endpoint-methods\";\nimport { VERSION } from \"./version\";\nexport const Octokit = Core.plugin(requestLog, legacyRestEndpointMethods, paginateRest).defaults({\n userAgent: `octokit-rest.js/${VERSION}`,\n});\n"],"names":["Core"],"mappings":";;;;;AAAO,MAAM,OAAO,GAAG,mBAAmB;;ACK9B,MAAC,OAAO,GAAGA,SAAI,CAAC,MAAM,CAAC,UAAU,EAAE,yBAAyB,EAAE,YAAY,CAAC,CAAC,QAAQ,CAAC;AACjG,IAAI,SAAS,EAAE,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC,CAAC;;;;"}

View File

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

View File

@@ -0,0 +1,53 @@
'use strict';
const lazy = (mod, fn, id) => mod === undefined ? fn(id) : mod;
module.exports = fn => {
return id => {
let mod;
return function () {
if (arguments.length === 0) {
mod = lazy(mod, fn, id);
return mod;
}
const ret = {};
[].forEach.call(arguments, prop => {
Object.defineProperty(ret, prop, {
get: () => {
mod = lazy(mod, fn, id);
if (typeof mod[prop] === 'function') {
return function () {
return mod[prop].apply(mod, arguments);
};
}
return mod[prop];
}
});
});
return ret;
};
};
};
module.exports.proxy = fn => {
return id => {
let mod;
const handler = {
get: (target, property) => {
mod = lazy(mod, fn, id);
return Reflect.get(mod, property);
},
apply: (target, thisArg, argumentsList) => {
mod = lazy(mod, fn, id);
return Reflect.apply(mod, thisArg, argumentsList);
}
};
return new Proxy(() => {}, handler);
};
};

View File

@@ -0,0 +1,51 @@
# is-interactive [![Build Status](https://travis-ci.com/sindresorhus/is-interactive.svg?branch=master)](https://travis-ci.com/sindresorhus/is-interactive)
> Check if stdout or stderr is [interactive](https://unix.stackexchange.com/a/43389/7678)
It checks that the stream is [TTY](https://jameshfisher.com/2017/12/09/what-is-a-tty/), not a dumb terminal, and not running in a CI.
This can be useful to decide whether to present interactive UI or animations in the terminal.
## Install
```
$ npm install is-interactive
```
## Usage
```js
const isInteractive = require('is-interactive');
isInteractive();
//=> true
```
## API
### isInteractive(options?)
#### options
Type: `object`
##### stream
Type: [`stream.Writable`](https://nodejs.org/api/stream.html#stream_class_stream_writable)<br>
Default: [`process.stdout`](https://nodejs.org/api/process.html#process_process_stdout)
The stream to check.
## FAQ
#### Why are you not using [`ci-info`](https://github.com/watson/ci-info) for the CI check?
It's silly to have to detect individual CIs. They should identify themselves with the `CI` environment variable, and most do just that. A manually maintained list of detections will easily get out of date. And if a package using `ci-info` doesn't update to the latest version all the time, they will not support certain CIs. It also creates unpredictability as you might assume a CI is not supported and then suddenly it gets supported and you didn't account for that. In addition, some of the manual detections are loose and might cause false-positives which could create hard-to-debug bugs.
#### Why does this even exist? It's just a few lines.
It's not about the number of lines, but rather discoverability and documentation. A lot of people wouldn't even know they need this. Feel free to copy-paste the code if you don't want the dependency. You might also want to read [this blog post](https://blog.sindresorhus.com/small-focused-modules-9238d977a92a).

View File

@@ -0,0 +1,130 @@
{
"name": "got",
"version": "11.8.2",
"description": "Human-friendly and powerful HTTP request library for Node.js",
"license": "MIT",
"repository": "sindresorhus/got",
"funding": "https://github.com/sindresorhus/got?sponsor=1",
"main": "dist/source",
"engines": {
"node": ">=10.19.0"
},
"scripts": {
"test": "xo && npm run build && nyc --reporter=html --reporter=text ava",
"release": "np",
"build": "del-cli dist && tsc",
"prepare": "npm run build"
},
"files": [
"dist/source"
],
"keywords": [
"http",
"https",
"http2",
"get",
"got",
"url",
"uri",
"request",
"simple",
"curl",
"wget",
"fetch",
"net",
"network",
"gzip",
"brotli",
"requests",
"human-friendly",
"axios",
"superagent",
"node-fetch",
"ky"
],
"dependencies": {
"@sindresorhus/is": "^4.0.0",
"@szmarczak/http-timer": "^4.0.5",
"@types/cacheable-request": "^6.0.1",
"@types/responselike": "^1.0.0",
"cacheable-lookup": "^5.0.3",
"cacheable-request": "^7.0.1",
"decompress-response": "^6.0.0",
"http2-wrapper": "^1.0.0-beta.5.2",
"lowercase-keys": "^2.0.0",
"p-cancelable": "^2.0.0",
"responselike": "^2.0.0"
},
"devDependencies": {
"@ava/typescript": "^1.1.1",
"@sindresorhus/tsconfig": "^0.7.0",
"@sinonjs/fake-timers": "^6.0.1",
"@types/benchmark": "^1.0.33",
"@types/express": "^4.17.7",
"@types/node": "^14.14.0",
"@types/node-fetch": "^2.5.7",
"@types/pem": "^1.9.5",
"@types/pify": "^3.0.2",
"@types/request": "^2.48.5",
"@types/sinon": "^9.0.5",
"@types/tough-cookie": "^4.0.0",
"ava": "^3.11.1",
"axios": "^0.20.0",
"benchmark": "^2.1.4",
"coveralls": "^3.1.0",
"create-test-server": "^3.0.1",
"del-cli": "^3.0.1",
"delay": "^4.4.0",
"express": "^4.17.1",
"form-data": "^3.0.0",
"get-stream": "^6.0.0",
"nock": "^13.0.4",
"node-fetch": "^2.6.0",
"np": "^6.4.0",
"nyc": "^15.1.0",
"p-event": "^4.2.0",
"pem": "^1.14.4",
"pify": "^5.0.0",
"sinon": "^9.0.3",
"slow-stream": "0.0.4",
"tempy": "^1.0.0",
"to-readable-stream": "^2.1.0",
"tough-cookie": "^4.0.0",
"typescript": "4.0.3",
"xo": "^0.34.1"
},
"types": "dist/source",
"sideEffects": false,
"ava": {
"files": [
"test/*"
],
"timeout": "1m",
"typescript": {
"rewritePaths": {
"test/": "dist/test/"
}
}
},
"nyc": {
"extension": [
".ts"
],
"exclude": [
"**/test/**"
]
},
"xo": {
"ignores": [
"documentation/examples/*"
],
"rules": {
"@typescript-eslint/no-empty-function": "off",
"node/prefer-global/url": "off",
"node/prefer-global/url-search-params": "off",
"import/no-anonymous-default-export": "off",
"@typescript-eslint/no-implicit-any-catch": "off"
}
},
"runkitExampleFilename": "./documentation/examples/runkit-example.js"
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"publishLast.js","sources":["../../src/internal/operators/publishLast.ts"],"names":[],"mappings":";;AACA,gDAA+C;AAC/C,yCAAwC;AA8DxC,SAAgB,WAAW;IACzB,OAAO,UAAC,MAAqB,IAAK,OAAA,qBAAS,CAAC,IAAI,2BAAY,EAAK,CAAC,CAAC,MAAM,CAAC,EAAxC,CAAwC,CAAC;AAC7E,CAAC;AAFD,kCAEC"}

View File

@@ -0,0 +1,390 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var isPlainObject = require('is-plain-object');
var universalUserAgent = require('universal-user-agent');
function lowercaseKeys(object) {
if (!object) {
return {};
}
return Object.keys(object).reduce((newObj, key) => {
newObj[key.toLowerCase()] = object[key];
return newObj;
}, {});
}
function mergeDeep(defaults, options) {
const result = Object.assign({}, defaults);
Object.keys(options).forEach(key => {
if (isPlainObject.isPlainObject(options[key])) {
if (!(key in defaults)) Object.assign(result, {
[key]: options[key]
});else result[key] = mergeDeep(defaults[key], options[key]);
} else {
Object.assign(result, {
[key]: options[key]
});
}
});
return result;
}
function removeUndefinedProperties(obj) {
for (const key in obj) {
if (obj[key] === undefined) {
delete obj[key];
}
}
return obj;
}
function merge(defaults, route, options) {
if (typeof route === "string") {
let [method, url] = route.split(" ");
options = Object.assign(url ? {
method,
url
} : {
url: method
}, options);
} else {
options = Object.assign({}, route);
} // lowercase header names before merging with defaults to avoid duplicates
options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging
removeUndefinedProperties(options);
removeUndefinedProperties(options.headers);
const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
if (defaults && defaults.mediaType.previews.length) {
mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
}
mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
return mergedOptions;
}
function addQueryParameters(url, parameters) {
const separator = /\?/.test(url) ? "&" : "?";
const names = Object.keys(parameters);
if (names.length === 0) {
return url;
}
return url + separator + names.map(name => {
if (name === "q") {
return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
}
return `${name}=${encodeURIComponent(parameters[name])}`;
}).join("&");
}
const urlVariableRegex = /\{[^}]+\}/g;
function removeNonChars(variableName) {
return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
}
function extractUrlVariableNames(url) {
const matches = url.match(urlVariableRegex);
if (!matches) {
return [];
}
return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
}
function omit(object, keysToOmit) {
return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
obj[key] = object[key];
return obj;
}, {});
}
// Based on https://github.com/bramstein/url-template, licensed under BSD
// TODO: create separate package.
//
// Copyright (c) 2012-2014, Bram Stein
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. The name of the author may not be used to endorse or promote products
// derived from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* istanbul ignore file */
function encodeReserved(str) {
return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
if (!/%[0-9A-Fa-f]/.test(part)) {
part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
}
return part;
}).join("");
}
function encodeUnreserved(str) {
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
});
}
function encodeValue(operator, value, key) {
value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
if (key) {
return encodeUnreserved(key) + "=" + value;
} else {
return value;
}
}
function isDefined(value) {
return value !== undefined && value !== null;
}
function isKeyOperator(operator) {
return operator === ";" || operator === "&" || operator === "?";
}
function getValues(context, operator, key, modifier) {
var value = context[key],
result = [];
if (isDefined(value) && value !== "") {
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
value = value.toString();
if (modifier && modifier !== "*") {
value = value.substring(0, parseInt(modifier, 10));
}
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
} else {
if (modifier === "*") {
if (Array.isArray(value)) {
value.filter(isDefined).forEach(function (value) {
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
});
} else {
Object.keys(value).forEach(function (k) {
if (isDefined(value[k])) {
result.push(encodeValue(operator, value[k], k));
}
});
}
} else {
const tmp = [];
if (Array.isArray(value)) {
value.filter(isDefined).forEach(function (value) {
tmp.push(encodeValue(operator, value));
});
} else {
Object.keys(value).forEach(function (k) {
if (isDefined(value[k])) {
tmp.push(encodeUnreserved(k));
tmp.push(encodeValue(operator, value[k].toString()));
}
});
}
if (isKeyOperator(operator)) {
result.push(encodeUnreserved(key) + "=" + tmp.join(","));
} else if (tmp.length !== 0) {
result.push(tmp.join(","));
}
}
}
} else {
if (operator === ";") {
if (isDefined(value)) {
result.push(encodeUnreserved(key));
}
} else if (value === "" && (operator === "&" || operator === "?")) {
result.push(encodeUnreserved(key) + "=");
} else if (value === "") {
result.push("");
}
}
return result;
}
function parseUrl(template) {
return {
expand: expand.bind(null, template)
};
}
function expand(template, context) {
var operators = ["+", "#", ".", "/", ";", "?", "&"];
return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
if (expression) {
let operator = "";
const values = [];
if (operators.indexOf(expression.charAt(0)) !== -1) {
operator = expression.charAt(0);
expression = expression.substr(1);
}
expression.split(/,/g).forEach(function (variable) {
var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
});
if (operator && operator !== "+") {
var separator = ",";
if (operator === "?") {
separator = "&";
} else if (operator !== "#") {
separator = operator;
}
return (values.length !== 0 ? operator : "") + values.join(separator);
} else {
return values.join(",");
}
} else {
return encodeReserved(literal);
}
});
}
function parse(options) {
// https://fetch.spec.whatwg.org/#methods
let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}");
let headers = Object.assign({}, options.headers);
let body;
let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
const urlVariableNames = extractUrlVariableNames(url);
url = parseUrl(url).expand(parameters);
if (!/^http/.test(url)) {
url = options.baseUrl + url;
}
const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
const remainingParameters = omit(parameters, omittedParameters);
const isBinaryRequest = /application\/octet-stream/i.test(headers.accept);
if (!isBinaryRequest) {
if (options.mediaType.format) {
// e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
}
if (options.mediaType.previews.length) {
const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
return `application/vnd.github.${preview}-preview${format}`;
}).join(",");
}
} // for GET/HEAD requests, set URL query parameters from remaining parameters
// for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
if (["GET", "HEAD"].includes(method)) {
url = addQueryParameters(url, remainingParameters);
} else {
if ("data" in remainingParameters) {
body = remainingParameters.data;
} else {
if (Object.keys(remainingParameters).length) {
body = remainingParameters;
} else {
headers["content-length"] = 0;
}
}
} // default content-type for JSON if body is set
if (!headers["content-type"] && typeof body !== "undefined") {
headers["content-type"] = "application/json; charset=utf-8";
} // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
// fetch does not allow to set `content-length` header, but we can set body to an empty string
if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
body = "";
} // Only return body/request keys if present
return Object.assign({
method,
url,
headers
}, typeof body !== "undefined" ? {
body
} : null, options.request ? {
request: options.request
} : null);
}
function endpointWithDefaults(defaults, route, options) {
return parse(merge(defaults, route, options));
}
function withDefaults(oldDefaults, newDefaults) {
const DEFAULTS = merge(oldDefaults, newDefaults);
const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
return Object.assign(endpoint, {
DEFAULTS,
defaults: withDefaults.bind(null, DEFAULTS),
merge: merge.bind(null, DEFAULTS),
parse
});
}
const VERSION = "6.0.12";
const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
// So we use RequestParameters and add method as additional required property.
const DEFAULTS = {
method: "GET",
baseUrl: "https://api.github.com",
headers: {
accept: "application/vnd.github.v3+json",
"user-agent": userAgent
},
mediaType: {
format: "",
previews: []
}
};
const endpoint = withDefaults(null, DEFAULTS);
exports.endpoint = endpoint;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"2":"C K L H M N O","1028":"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:{"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 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 DC EC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB","1028":"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:{"2":"I u J E F G A B C K L H GC zB HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC"},F:{"2":"0 1 2 3 4 5 6 7 8 9 G 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 OC PC QC RC qB 9B SC rB","1028":"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"},G:{"2":"F zB TC AC UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B"},H:{"2":"nC"},I:{"1":"D","2":"oC sC tC","132":"tB I pC qC rC AC"},J:{"2":"E A"},K:{"1":"e","2":"A B C qB 9B rB"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"uC"},P:{"1":"yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C","132":"I","516":"vC wC xC"},Q:{"1":"1B"},R:{"1":"8C"},S:{"260":"9C"}},B:7,C:"Network Information API"};

View File

@@ -0,0 +1,5 @@
import assertString from './util/assertString';
export default function isBoolean(str) {
assertString(str);
return ['true', 'false', '1', '0'].indexOf(str) >= 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.00598,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0.11958,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0.00598,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0.00598,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.01196,"79":0,"80":0.00598,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0.00598,"87":0.00598,"88":0.0299,"89":0,"90":0,"91":0.00598,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0.00598,"98":0.00598,"99":0.00598,"100":0,"101":0,"102":0.07773,"103":0.00598,"104":0.00598,"105":0.17339,"106":0.01794,"107":0.03587,"108":2.62478,"109":1.59639,"110":0.00598,"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.06577,"35":0,"36":0,"37":0,"38":0.06577,"39":0.05381,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0.07773,"48":0,"49":0.20927,"50":0,"51":0,"52":0,"53":0.00598,"54":0,"55":0,"56":0.01794,"57":0.00598,"58":0.01196,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0.00598,"69":0,"70":0.00598,"71":0,"72":0,"73":0,"74":0,"75":0.00598,"76":0.00598,"77":0.01196,"78":0,"79":0.06577,"80":0.01196,"81":0.0299,"83":0.01196,"84":0.01196,"85":0.01196,"86":0.01794,"87":0.02392,"88":0.01794,"89":0.0299,"90":0.01196,"91":0.14948,"92":0.0299,"93":0.01794,"94":0.00598,"95":0.01196,"96":0.01196,"97":0.00598,"98":0.01196,"99":0.00598,"100":0.02392,"101":0.01794,"102":0.09566,"103":0.05979,"104":0.02392,"105":0.04185,"106":0.06577,"107":0.08969,"108":11.04919,"109":10.98342,"110":0.00598,"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.05381,"26":0,"27":0,"28":0.00598,"29":0,"30":0,"31":0.42451,"32":0,"33":0,"34":0,"35":0,"36":0.00598,"37":0,"38":0,"39":0,"40":0.3707,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0.2571,"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.01196,"74":0,"75":0,"76":0,"77":0.00598,"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.26308,"94":0.5979,"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.08969,"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,"98":0,"99":0,"100":0,"101":0,"102":0.00598,"103":0,"104":0.02392,"105":0,"106":0.00598,"107":0.02392,"108":1.09416,"109":1.06426},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.00598,"14":0.02392,"15":0.00598,_:"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.01196,"13.1":0.0299,"14.1":0.05979,"15.1":0.01196,"15.2-15.3":0.00598,"15.4":0.01794,"15.5":0.04185,"15.6":0.2272,"16.0":0.0299,"16.1":0.10164,"16.2":0.17937,"16.3":0.01794},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.43415,"8.1-8.4":0.00241,"9.0-9.2":0,"9.3":0.06753,"10.0-10.2":0,"10.3":0.07959,"11.0-11.2":0.00362,"11.3-11.4":0.01085,"12.0-12.1":0.00844,"12.2-12.5":0.31717,"13.0-13.1":0.01206,"13.2":0.00482,"13.3":0.01327,"13.4-13.7":0.0603,"14.0-14.4":0.11577,"14.5-14.8":0.34732,"15.0-15.1":0.08201,"15.2-15.3":0.1013,"15.4":0.1423,"15.5":0.32079,"15.6":1.19631,"16.0":1.34827,"16.1":3.53709,"16.2":2.63141,"16.3":0.2822},P:{"4":0.16813,"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.02102,"12.0":0.01051,"13.0":0.04203,"14.0":0.02102,"15.0":0.01051,"16.0":0.04203,"17.0":0.03152,"18.0":0.07356,"19.0":1.48162},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0.0679,"4.2-4.3":0.0679,"4.4":0,"4.4.3-4.4.4":1.15434},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.03587,"5.5":0},J:{"7":0,"10":0},N:{"10":0,"11":0},R:{_:"0"},M:{"0":0.19703},Q:{"13.1":0},O:{"0":0.08444},H:{"0":0.24364},L:{"0":48.86863},S:{"2.5":0}};

View File

@@ -0,0 +1 @@
{"version":3,"file":"timeout.js","sources":["../../src/internal/operators/timeout.ts"],"names":[],"mappings":";;AAAA,4CAA2C;AAK3C,qDAAoD;AAEpD,6CAA4C;AAC5C,uDAAsD;AAgFtD,SAAgB,OAAO,CAAI,GAAkB,EAClB,SAAgC;IAAhC,0BAAA,EAAA,YAA2B,aAAK;IACzD,OAAO,yBAAW,CAAC,GAAG,EAAE,uBAAU,CAAC,IAAI,2BAAY,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;AACrE,CAAC;AAHD,0BAGC"}

View File

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

View File

@@ -0,0 +1,77 @@
import { Subscriber } from '../../Subscriber';
import { AjaxResponse } from './AjaxObservable';
/**
* @see {@link ajax}
*
* @interface
* @name AjaxRequest
* @noimport true
*/
export class AjaxRequestDoc {
/**
* @type {string}
*/
url: string = '';
/**
* @type {number}
*/
body: any = 0;
/**
* @type {string}
*/
user: string = '';
/**
* @type {boolean}
*/
async: boolean = false;
/**
* @type {string}
*/
method: string = '';
/**
* @type {Object}
*/
headers: Object = null;
/**
* @type {number}
*/
timeout: number = 0;
/**
* @type {string}
*/
password: string = '';
/**
* @type {boolean}
*/
hasContent: boolean = false;
/**
* @type {boolean}
*/
crossDomain: boolean = false;
/**
* @type {boolean}
*/
withCredentials: boolean = false;
/**
* @return {XMLHttpRequest}
*/
createXHR(): XMLHttpRequest {
return null;
}
/**
* @type {Subscriber}
*/
progressSubscriber: Subscriber<any> = null;
/**
* @param {AjaxResponse} response
* @return {T}
*/
resultSelector<T>(response: AjaxResponse): T {
return null;
}
/**
* @type {string}
*/
responseType: string = '';
}

View File

@@ -0,0 +1,47 @@
let Declaration = require('../declaration')
class GridEnd extends Declaration {
/**
* Change repeating syntax for IE
*/
insert (decl, prefix, prefixes, result) {
if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes)
let clonedDecl = this.clone(decl)
let startProp = decl.prop.replace(/end$/, 'start')
let spanProp = prefix + decl.prop.replace(/end$/, 'span')
if (decl.parent.some(i => i.prop === spanProp)) {
return undefined
}
clonedDecl.prop = spanProp
if (decl.value.includes('span')) {
clonedDecl.value = decl.value.replace(/span\s/i, '')
} else {
let startDecl
decl.parent.walkDecls(startProp, d => {
startDecl = d
})
if (startDecl) {
let value = Number(decl.value) - Number(startDecl.value) + ''
clonedDecl.value = value
} else {
decl.warn(
result,
`Can not prefix ${decl.prop} (${startProp} is not found)`
)
}
}
decl.cloneBefore(clonedDecl)
return undefined
}
}
GridEnd.names = ['grid-row-end', 'grid-column-end']
module.exports = GridEnd

View File

@@ -0,0 +1,5 @@
import { AsyncAction } from './AsyncAction';
import { AsyncScheduler } from './AsyncScheduler';
export declare class AnimationFrameScheduler extends AsyncScheduler {
flush(action?: AsyncAction<any>): void;
}

View File

@@ -0,0 +1,282 @@
import { Subject } from '../Subject';
import { Operator } from '../Operator';
import { async } from '../scheduler/async';
import { Subscriber } from '../Subscriber';
import { Observable } from '../Observable';
import { Subscription } from '../Subscription';
import { isNumeric } from '../util/isNumeric';
import { isScheduler } from '../util/isScheduler';
import { OperatorFunction, SchedulerLike, SchedulerAction } from '../types';
/**
* Branch out the source Observable values as a nested Observable periodically
* in time.
*
* <span class="informal">It's like {@link bufferTime}, but emits a nested
* Observable instead of an array.</span>
*
* ![](windowTime.png)
*
* Returns an Observable that emits windows of items it collects from the source
* Observable. The output Observable starts a new window periodically, as
* determined by the `windowCreationInterval` argument. It emits each window
* after a fixed timespan, specified by the `windowTimeSpan` argument. When the
* source Observable completes or encounters an error, the output Observable
* emits the current window and propagates the notification from the source
* Observable. If `windowCreationInterval` is not provided, the output
* Observable starts a new window when the previous window of duration
* `windowTimeSpan` completes. If `maxWindowCount` is provided, each window
* will emit at most fixed number of values. Window will complete immediately
* after emitting last value and next one still will open as specified by
* `windowTimeSpan` and `windowCreationInterval` arguments.
*
* ## Examples
* In every window of 1 second each, emit at most 2 click events
* ```ts
* import { fromEvent } from 'rxjs';
* import { windowTime, map, mergeAll, take } from 'rxjs/operators';
*
* const clicks = fromEvent(document, 'click');
* const result = clicks.pipe(
* windowTime(1000),
* map(win => win.pipe(take(2))), // each window has at most 2 emissions
* mergeAll(), // flatten the Observable-of-Observables
* );
* result.subscribe(x => console.log(x));
* ```
*
* Every 5 seconds start a window 1 second long, and emit at most 2 click events per window
* ```ts
* import { fromEvent } from 'rxjs';
* import { windowTime, map, mergeAll, take } from 'rxjs/operators';
*
* const clicks = fromEvent(document, 'click');
* const result = clicks.pipe(
* windowTime(1000, 5000),
* map(win => win.pipe(take(2))), // each window has at most 2 emissions
* mergeAll(), // flatten the Observable-of-Observables
* );
* result.subscribe(x => console.log(x));
* ```
*
* Same as example above but with maxWindowCount instead of take
* ```ts
* import { fromEvent } from 'rxjs';
* import { windowTime, mergeAll } from 'rxjs/operators';
*
* const clicks = fromEvent(document, 'click');
* const result = clicks.pipe(
* windowTime(1000, 5000, 2), // each window has still at most 2 emissions
* mergeAll(), // flatten the Observable-of-Observables
* );
* result.subscribe(x => console.log(x));
* ```
*
* @see {@link window}
* @see {@link windowCount}
* @see {@link windowToggle}
* @see {@link windowWhen}
* @see {@link bufferTime}
*
* @param {number} windowTimeSpan The amount of time to fill each window.
* @param {number} [windowCreationInterval] The interval at which to start new
* windows.
* @param {number} [maxWindowSize=Number.POSITIVE_INFINITY] Max number of
* values each window can emit before completion.
* @param {SchedulerLike} [scheduler=async] The scheduler on which to schedule the
* intervals that determine window boundaries.
* @return {Observable<Observable<T>>} An observable of windows, which in turn
* are Observables.
* @method windowTime
* @owner Observable
*/
export function windowTime<T>(windowTimeSpan: number,
scheduler?: SchedulerLike): OperatorFunction<T, Observable<T>>;
export function windowTime<T>(windowTimeSpan: number,
windowCreationInterval: number,
scheduler?: SchedulerLike): OperatorFunction<T, Observable<T>>;
export function windowTime<T>(windowTimeSpan: number,
windowCreationInterval: number,
maxWindowSize: number,
scheduler?: SchedulerLike): OperatorFunction<T, Observable<T>>;
export function windowTime<T>(windowTimeSpan: number): OperatorFunction<T, Observable<T>> {
let scheduler: SchedulerLike = async;
let windowCreationInterval: number = null;
let maxWindowSize: number = 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: Observable<T>) {
return source.lift(new WindowTimeOperator<T>(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler));
};
}
class WindowTimeOperator<T> implements Operator<T, Observable<T>> {
constructor(private windowTimeSpan: number,
private windowCreationInterval: number | null,
private maxWindowSize: number,
private scheduler: SchedulerLike) {
}
call(subscriber: Subscriber<Observable<T>>, source: any): any {
return source.subscribe(new WindowTimeSubscriber(
subscriber, this.windowTimeSpan, this.windowCreationInterval, this.maxWindowSize, this.scheduler
));
}
}
interface CreationState<T> {
windowTimeSpan: number;
windowCreationInterval: number;
subscriber: WindowTimeSubscriber<T>;
scheduler: SchedulerLike;
}
interface TimeSpanOnlyState<T> {
window: CountedSubject<T>;
windowTimeSpan: number;
subscriber: WindowTimeSubscriber<T>;
}
interface CloseWindowContext<T> {
action: SchedulerAction<CreationState<T>>;
subscription: Subscription;
}
interface CloseState<T> {
subscriber: WindowTimeSubscriber<T>;
window: CountedSubject<T>;
context: CloseWindowContext<T>;
}
class CountedSubject<T> extends Subject<T> {
private _numberOfNextedValues: number = 0;
next(value?: T): void {
this._numberOfNextedValues++;
super.next(value);
}
get numberOfNextedValues(): number {
return this._numberOfNextedValues;
}
}
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
class WindowTimeSubscriber<T> extends Subscriber<T> {
private windows: CountedSubject<T>[] = [];
constructor(protected destination: Subscriber<Observable<T>>,
private windowTimeSpan: number,
private windowCreationInterval: number | null,
private maxWindowSize: number,
private scheduler: SchedulerLike) {
super(destination);
const window = this.openWindow();
if (windowCreationInterval !== null && windowCreationInterval >= 0) {
const closeState: CloseState<T> = { subscriber: this, window, context: <any>null };
const creationState: CreationState<T> = { windowTimeSpan, windowCreationInterval, subscriber: this, scheduler };
this.add(scheduler.schedule<CloseState<T>>(dispatchWindowClose, windowTimeSpan, closeState));
this.add(scheduler.schedule<CreationState<T>>(dispatchWindowCreation, windowCreationInterval, creationState));
} else {
const timeSpanOnlyState: TimeSpanOnlyState<T> = { subscriber: this, window, windowTimeSpan };
this.add(scheduler.schedule<TimeSpanOnlyState<T>>(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState));
}
}
protected _next(value: T): void {
const windows = this.windows;
const len = windows.length;
for (let i = 0; i < len; i++) {
const window = windows[i];
if (!window.closed) {
window.next(value);
if (window.numberOfNextedValues >= this.maxWindowSize) {
this.closeWindow(window);
}
}
}
}
protected _error(err: any): void {
const windows = this.windows;
while (windows.length > 0) {
windows.shift().error(err);
}
this.destination.error(err);
}
protected _complete(): void {
const windows = this.windows;
while (windows.length > 0) {
const window = windows.shift();
if (!window.closed) {
window.complete();
}
}
this.destination.complete();
}
public openWindow(): CountedSubject<T> {
const window = new CountedSubject<T>();
this.windows.push(window);
const destination = this.destination;
destination.next(window);
return window;
}
public closeWindow(window: CountedSubject<T>): void {
window.complete();
const windows = this.windows;
windows.splice(windows.indexOf(window), 1);
}
}
function dispatchWindowTimeSpanOnly<T>(this: SchedulerAction<TimeSpanOnlyState<T>>, state: TimeSpanOnlyState<T>): void {
const { subscriber, windowTimeSpan, window } = state;
if (window) {
subscriber.closeWindow(window);
}
state.window = subscriber.openWindow();
this.schedule(state, windowTimeSpan);
}
function dispatchWindowCreation<T>(this: SchedulerAction<CreationState<T>>, state: CreationState<T>): void {
const { windowTimeSpan, subscriber, scheduler, windowCreationInterval } = state;
const window = subscriber.openWindow();
const action = this;
let context: CloseWindowContext<T> = { action, subscription: <any>null };
const timeSpanState: CloseState<T> = { subscriber, window, context };
context.subscription = scheduler.schedule<CloseState<T>>(dispatchWindowClose, windowTimeSpan, timeSpanState);
action.add(context.subscription);
action.schedule(state, windowCreationInterval);
}
function dispatchWindowClose<T>(state: CloseState<T>): void {
const { subscriber, window, context } = state;
if (context && context.action && context.subscription) {
context.action.remove(context.subscription);
}
subscriber.closeWindow(window);
}

View File

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

View File

@@ -0,0 +1,142 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getExtensionDescription = getExtensionDescription;
exports.ExplorerBase = void 0;
var _path = _interopRequireDefault(require("path"));
var _loaders = require("./loaders");
var _getPropertyByPath = require("./getPropertyByPath");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
class ExplorerBase {
constructor(options) {
if (options.cache === true) {
this.loadCache = new Map();
this.searchCache = new Map();
}
this.config = options;
this.validateConfig();
}
clearLoadCache() {
if (this.loadCache) {
this.loadCache.clear();
}
}
clearSearchCache() {
if (this.searchCache) {
this.searchCache.clear();
}
}
clearCaches() {
this.clearLoadCache();
this.clearSearchCache();
}
validateConfig() {
const config = this.config;
config.searchPlaces.forEach(place => {
const loaderKey = _path.default.extname(place) || 'noExt';
const loader = config.loaders[loaderKey];
if (!loader) {
throw new Error(`No loader specified for ${getExtensionDescription(place)}, so searchPlaces item "${place}" is invalid`);
}
if (typeof loader !== 'function') {
throw new Error(`loader for ${getExtensionDescription(place)} is not a function (type provided: "${typeof loader}"), so searchPlaces item "${place}" is invalid`);
}
});
}
shouldSearchStopWithResult(result) {
if (result === null) return false;
if (result.isEmpty && this.config.ignoreEmptySearchPlaces) return false;
return true;
}
nextDirectoryToSearch(currentDir, currentResult) {
if (this.shouldSearchStopWithResult(currentResult)) {
return null;
}
const nextDir = nextDirUp(currentDir);
if (nextDir === currentDir || currentDir === this.config.stopDir) {
return null;
}
return nextDir;
}
loadPackageProp(filepath, content) {
const parsedContent = _loaders.loaders.loadJson(filepath, content);
const packagePropValue = (0, _getPropertyByPath.getPropertyByPath)(parsedContent, this.config.packageProp);
return packagePropValue || null;
}
getLoaderEntryForFile(filepath) {
if (_path.default.basename(filepath) === 'package.json') {
const loader = this.loadPackageProp.bind(this);
return loader;
}
const loaderKey = _path.default.extname(filepath) || 'noExt';
const loader = this.config.loaders[loaderKey];
if (!loader) {
throw new Error(`No loader specified for ${getExtensionDescription(filepath)}`);
}
return loader;
}
loadedContentToCosmiconfigResult(filepath, loadedContent) {
if (loadedContent === null) {
return null;
}
if (loadedContent === undefined) {
return {
filepath,
config: undefined,
isEmpty: true
};
}
return {
config: loadedContent,
filepath
};
}
validateFilePath(filepath) {
if (!filepath) {
throw new Error('load must pass a non-empty string');
}
}
}
exports.ExplorerBase = ExplorerBase;
function nextDirUp(dir) {
return _path.default.dirname(dir);
}
function getExtensionDescription(filepath) {
const ext = _path.default.extname(filepath);
return ext ? `extension "${ext}"` : 'files without extensions';
}
//# sourceMappingURL=ExplorerBase.js.map