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,20 @@
import { Observable } from '../Observable';
import { Subscription } from '../Subscription';
export function scheduleArray(input, scheduler) {
return new Observable(subscriber => {
const sub = new Subscription();
let i = 0;
sub.add(scheduler.schedule(function () {
if (i === input.length) {
subscriber.complete();
return;
}
subscriber.next(input[i++]);
if (!subscriber.closed) {
sub.add(this.schedule());
}
}));
return sub;
});
}
//# sourceMappingURL=scheduleArray.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isObservable.js","sources":["../../../src/internal/util/isObservable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAO3C,MAAM,UAAU,YAAY,CAAI,GAAQ;IACtC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,YAAY,UAAU,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,KAAK,UAAU,IAAI,OAAO,GAAG,CAAC,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC;AACzH,CAAC"}

View File

@@ -0,0 +1,113 @@
# mime-types
[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][ci-image]][ci-url]
[![Test Coverage][coveralls-image]][coveralls-url]
The ultimate javascript content-type utility.
Similar to [the `mime@1.x` module](https://www.npmjs.com/package/mime), except:
- __No fallbacks.__ Instead of naively returning the first available type,
`mime-types` simply returns `false`, so do
`var type = mime.lookup('unrecognized') || 'application/octet-stream'`.
- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`.
- No `.define()` functionality
- Bug fixes for `.lookup(path)`
Otherwise, the API is compatible with `mime` 1.x.
## Install
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
```sh
$ npm install mime-types
```
## Adding Types
All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db),
so open a PR there if you'd like to add mime types.
## API
```js
var mime = require('mime-types')
```
All functions return `false` if input is invalid or not found.
### mime.lookup(path)
Lookup the content-type associated with a file.
```js
mime.lookup('json') // 'application/json'
mime.lookup('.md') // 'text/markdown'
mime.lookup('file.html') // 'text/html'
mime.lookup('folder/file.js') // 'application/javascript'
mime.lookup('folder/.htaccess') // false
mime.lookup('cats') // false
```
### mime.contentType(type)
Create a full content-type header given a content-type or extension.
When given an extension, `mime.lookup` is used to get the matching
content-type, otherwise the given content-type is used. Then if the
content-type does not already have a `charset` parameter, `mime.charset`
is used to get the default charset and add to the returned content-type.
```js
mime.contentType('markdown') // 'text/x-markdown; charset=utf-8'
mime.contentType('file.json') // 'application/json; charset=utf-8'
mime.contentType('text/html') // 'text/html; charset=utf-8'
mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1'
// from a full path
mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8'
```
### mime.extension(type)
Get the default extension for a content-type.
```js
mime.extension('application/octet-stream') // 'bin'
```
### mime.charset(type)
Lookup the implied default charset of a content-type.
```js
mime.charset('text/markdown') // 'UTF-8'
```
### var type = mime.types[extension]
A map of content-types by extension.
### [extensions...] = mime.extensions[type]
A map of extensions by content-type.
## License
[MIT](LICENSE)
[ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci
[ci-url]: https://github.com/jshttp/mime-types/actions?query=workflow%3Aci
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master
[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master
[node-version-image]: https://badgen.net/npm/node/mime-types
[node-version-url]: https://nodejs.org/en/download
[npm-downloads-image]: https://badgen.net/npm/dm/mime-types
[npm-url]: https://npmjs.org/package/mime-types
[npm-version-image]: https://badgen.net/npm/v/mime-types

View File

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

View File

@@ -0,0 +1,44 @@
/** PURE_IMPORTS_START tslib,_innerSubscribe PURE_IMPORTS_END */
import * as tslib_1 from "tslib";
import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';
export function sample(notifier) {
return function (source) { return source.lift(new SampleOperator(notifier)); };
}
var SampleOperator = /*@__PURE__*/ (function () {
function SampleOperator(notifier) {
this.notifier = notifier;
}
SampleOperator.prototype.call = function (subscriber, source) {
var sampleSubscriber = new SampleSubscriber(subscriber);
var subscription = source.subscribe(sampleSubscriber);
subscription.add(innerSubscribe(this.notifier, new SimpleInnerSubscriber(sampleSubscriber)));
return subscription;
};
return SampleOperator;
}());
var SampleSubscriber = /*@__PURE__*/ (function (_super) {
tslib_1.__extends(SampleSubscriber, _super);
function SampleSubscriber() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.hasValue = false;
return _this;
}
SampleSubscriber.prototype._next = function (value) {
this.value = value;
this.hasValue = true;
};
SampleSubscriber.prototype.notifyNext = function () {
this.emitValue();
};
SampleSubscriber.prototype.notifyComplete = function () {
this.emitValue();
};
SampleSubscriber.prototype.emitValue = function () {
if (this.hasValue) {
this.hasValue = false;
this.destination.next(this.value);
}
};
return SampleSubscriber;
}(SimpleOuterSubscriber));
//# sourceMappingURL=sample.js.map

View File

@@ -0,0 +1,40 @@
import { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';
export function skipUntil(notifier) {
return (source) => source.lift(new SkipUntilOperator(notifier));
}
class SkipUntilOperator {
constructor(notifier) {
this.notifier = notifier;
}
call(destination, source) {
return source.subscribe(new SkipUntilSubscriber(destination, this.notifier));
}
}
class SkipUntilSubscriber extends SimpleOuterSubscriber {
constructor(destination, notifier) {
super(destination);
this.hasValue = false;
const innerSubscriber = new SimpleInnerSubscriber(this);
this.add(innerSubscriber);
this.innerSubscription = innerSubscriber;
const innerSubscription = innerSubscribe(notifier, innerSubscriber);
if (innerSubscription !== innerSubscriber) {
this.add(innerSubscription);
this.innerSubscription = innerSubscription;
}
}
_next(value) {
if (this.hasValue) {
super._next(value);
}
}
notifyNext() {
this.hasValue = true;
if (this.innerSubscription) {
this.innerSubscription.unsubscribe();
}
}
notifyComplete() {
}
}
//# sourceMappingURL=skipUntil.js.map

View File

@@ -0,0 +1,23 @@
import { Subscriber } from './Subscriber';
import { InnerSubscriber } from './InnerSubscriber';
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
export class OuterSubscriber<T, R> extends Subscriber<T> {
notifyNext(outerValue: T, innerValue: R,
outerIndex: number, innerIndex: number,
innerSub: InnerSubscriber<T, R>): void {
this.destination.next(innerValue);
}
notifyError(error: any, innerSub: InnerSubscriber<T, R>): void {
this.destination.error(error);
}
notifyComplete(innerSub: InnerSubscriber<T, R>): void {
this.destination.complete();
}
}

View File

@@ -0,0 +1,41 @@
import { Observable } from '../Observable';
import { noop } from '../util/noop';
/**
* An Observable that emits no items to the Observer and never completes.
*
* ![](never.png)
*
* A simple Observable that emits neither values nor errors nor the completion
* notification. It can be used for testing purposes or for composing with other
* Observables. Please note that by never emitting a complete notification, this
* Observable keeps the subscription from being disposed automatically.
* Subscriptions need to be manually disposed.
*
* ## Example
* ### Emit the number 7, then never emit anything else (not even complete)
* ```ts
* import { NEVER } from 'rxjs';
* import { startWith } from 'rxjs/operators';
*
* function info() {
* console.log('Will not be called');
* }
* const result = NEVER.pipe(startWith(7));
* result.subscribe(x => console.log(x), info, info);
*
* ```
*
* @see {@link Observable}
* @see {@link index/EMPTY}
* @see {@link of}
* @see {@link throwError}
*/
export const NEVER = new Observable<never>(noop);
/**
* @deprecated Deprecated in favor of using {@link NEVER} constant.
*/
export function never () {
return NEVER;
}

View File

@@ -0,0 +1 @@
{"name":"yargs-parser","version":"20.2.9","files":{"browser.js":{"checkedAt":1678887829195,"integrity":"sha512-rhNCfaGOAHQijN6nrA4SJu7eMl3KbmUScRG3ukZJKjOFZZJpwdeeD4IvKkFa/LfDZS3XLxqV6ya64r4BmhhlUA==","mode":420,"size":1016},"build/lib/index.js":{"checkedAt":1678887829188,"integrity":"sha512-VZLtdW9Rpo4WkQmb+pC7dskScyDLKKEQrTBNuKlzOfTZfKH6kMc67+uLOaLLeuWz3MwYN5cVvnbZB+1qYxZ/2g==","mode":420,"size":2128},"build/lib/string-utils.js":{"checkedAt":1678887829199,"integrity":"sha512-pzTucZdZAXQLltn56eTq5MbsbN5kDCqu6zsIb/is1/EzwGOOeGxiVL0hF8WLv2MCd5d6kkLlMXFdtFEfBFuWgQ==","mode":420,"size":2084},"build/lib/tokenize-arg-string.js":{"checkedAt":1678887829199,"integrity":"sha512-qxR/K+kYoVDhENZxq9op9SSXQixIdsyiHobgdbKBw/yJESp8Yp5l+TB4aYUWpk5GqFwpTQvEZBqLRo/QC5zFdw==","mode":420,"size":1092},"build/lib/yargs-parser-types.js":{"checkedAt":1678887829199,"integrity":"sha512-1jjk4I++yNtfDGtnOnsAj4+BtxMSA6QMNe3tFEj83sUUSJKuIJ0tkFpFDXHWooy70upAXcJje8vK0WFALELmFg==","mode":420,"size":425},"build/index.cjs":{"checkedAt":1678887829200,"integrity":"sha512-R5I00YTFLQuShFKdLq57NjBTKQ9Q7lR5o4iquMNHMkg3H3GkgsH8AA4AWvf22bUS4PnRkBJpQ/EsYu2w4H3W7w==","mode":420,"size":42313},"package.json":{"checkedAt":1678887829208,"integrity":"sha512-2Vj+G1PvEE8s/y7lByG/5IAuLt+cGgWAwoWseDSEg/UHtN6lVcAL8OfGXD8tKKksdlFnv0/DouYSJudPrzKoxA==","mode":420,"size":2393},"build/lib/yargs-parser.js":{"checkedAt":1678887829208,"integrity":"sha512-7NqyLYsjwRp5Et9Rf/Jvpzwf+/PBi9Bg0cp/CGHZg7lnmnqqDuhlOx/D5Y38WeoSKeEZ4Pf7mpLQF09NOik7sg==","mode":420,"size":46398},"CHANGELOG.md":{"checkedAt":1678887829213,"integrity":"sha512-fiCMcDV1P6nxaRU5Z+5Hds1asuzoFVsVortnm4SzrRBys1kPcZQo69NCe7Q56UC5GoZmMYuFCgH5jDx7muMpGQ==","mode":420,"size":13921},"LICENSE.txt":{"checkedAt":1678887829236,"integrity":"sha512-EToPsaeTn1m/hKKaWONJhwqjvIWvra5CjWMax+yCWLrIN1/jFSLwPkhN68ViQwYDuut9KCVnGRQKJuxayn6RBA==","mode":420,"size":731},"README.md":{"checkedAt":1678887829236,"integrity":"sha512-vsRTUCi4oOvBIN0DwUGltZkHk/d+kVWEJ4Xlu/OAGtJSoS1kI+h8+Ah5DGGOclcbWpug5mmlz2AVZ6BKyfIDIA==","mode":420,"size":11916}}}

View File

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

View File

@@ -0,0 +1 @@
{"name":"cli-boxes","version":"2.2.1","files":{"license":{"checkedAt":1678887829613,"integrity":"sha512-0fM2/ycrxrltyaBKfQ748Ck23VlPUUBgNAR47ldf4B1V/HoXTfWBSk+vcshGKwEpmOynu4mOP5o+hyBfuRNa8g==","mode":420,"size":1117},"index.js":{"checkedAt":1678887830219,"integrity":"sha512-+iodmoyVwzsu1qH4Q5A79e9WiitaIbomv7FitITNnyI1gCVXc7vXExp9Wk2LBeQNAJWB65WQFFgK9H+QUKvISw==","mode":420,"size":167},"readme.md":{"checkedAt":1678887830214,"integrity":"sha512-4lWEbZDEVm+/eA+IrJMW71H0NQmuwvhTedIqHJFgErGpeURQx9TeUqcfvU89gWAB5NM3R6lhWVIukwSuAH8XJg==","mode":420,"size":1580},"package.json":{"checkedAt":1678887830214,"integrity":"sha512-aPJHK1Yr3u6D2XMBxQyhN7+IidTKNEzMAAoJS+v88SFp21dMoJXkkiwXXUbH42KRfmZmBqZDgI6oR6ElBaMbVg==","mode":420,"size":692},"index.d.ts":{"checkedAt":1678887830214,"integrity":"sha512-w1bQG205U3oiY/wF9gy/l4f24Li/OTBuBFycQxZJabEV51QtWykszu1GO3sUr4iy6byJ2UH5dfqLHDAFRR3/lA==","mode":420,"size":1545},"boxes.json":{"checkedAt":1678887830214,"integrity":"sha512-T6+yLVuJsD8JLzHoJsF6/GW9OrZaGMOXdMACaloah5jNNht7xif3xlWV97AI5VjPaNvz8yUuBk9jAxB5H2dmfQ==","mode":420,"size":1037}}}

View File

@@ -0,0 +1,9 @@
/** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */
import { reduce } from './reduce';
export function max(comparer) {
var max = (typeof comparer === 'function')
? function (x, y) { return comparer(x, y) > 0 ? x : y; }
: function (x, y) { return x > y ? x : y; };
return reduce(max);
}
//# sourceMappingURL=max.js.map

View File

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

View File

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

View File

@@ -0,0 +1,50 @@
# is-ci
Returns `true` if the current environment is a Continuous Integration
server.
Please [open an issue](https://github.com/watson/is-ci/issues) if your
CI server isn't properly detected :)
[![npm](https://img.shields.io/npm/v/is-ci.svg)](https://www.npmjs.com/package/is-ci)
[![Build status](https://travis-ci.org/watson/is-ci.svg?branch=master)](https://travis-ci.org/watson/is-ci)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)
## Installation
```bash
npm install is-ci --save
```
## Programmatic Usage
```js
const isCI = require('is-ci')
if (isCI) {
console.log('The code is running on a CI server')
}
```
## CLI Usage
For CLI usage you need to have the `is-ci` executable in your `PATH`.
There's a few ways to do that:
- Either install the module globally using `npm install is-ci -g`
- Or add the module as a dependency to your app in which case it can be
used inside your package.json scripts as is
- Or provide the full path to the executable, e.g.
`./node_modules/.bin/is-ci`
```bash
is-ci && echo "This is a CI server"
```
## Supported CI tools
Refer to [ci-info](https://github.com/watson/ci-info#supported-ci-tools) docs for all supported CI's
## License
[MIT](LICENSE)

View File

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

View File

@@ -0,0 +1,7 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("rxjs-compat/operators/ignoreElements"));
//# sourceMappingURL=ignoreElements.js.map

View File

@@ -0,0 +1,28 @@
# is-yarn-global
[![](https://img.shields.io/travis/LitoMore/is-yarn-global/master.svg)](https://travis-ci.org/LitoMore/is-yarn-global)
[![](https://img.shields.io/npm/v/is-yarn-global.svg)](https://www.npmjs.com/package/is-yarn-global)
[![](https://img.shields.io/npm/l/is-yarn-global.svg)](https://github.com/LitoMore/is-yarn-global/blob/master/LICENSE)
[![](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
Check if installed by yarn globally without any `fs` calls
## Install
```bash
$ npm install is-yarn-global
```
## Usage
Just require it in your package.
```javascript
const isYarnGlobal = require('is-yarn-global');
console.log(isYarnGlobal());
```
## License
MIT © [LitoMore](https://github.com/LitoMore)

View File

@@ -0,0 +1,137 @@
// Type definitions for cacheable-request 6.0
// Project: https://github.com/lukechilds/cacheable-request#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Paul Melnikow <https://github.com/paulmelnikow>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="node" />
import { request, RequestOptions, ClientRequest, ServerResponse } from 'http';
import { URL } from 'url';
import { EventEmitter } from 'events';
import { Store } from 'keyv';
import { Options as CacheSemanticsOptions } from 'http-cache-semantics';
import ResponseLike = require('responselike');
export = CacheableRequest;
declare const CacheableRequest: CacheableRequest;
type RequestFn = typeof request;
interface CacheableRequest {
new (requestFn: RequestFn, storageAdapter?: string | CacheableRequest.StorageAdapter): (
opts: string | URL | (RequestOptions & CacheSemanticsOptions),
cb?: (response: ServerResponse | ResponseLike) => void
) => CacheableRequest.Emitter;
RequestError: typeof RequestErrorCls;
CacheError: typeof CacheErrorCls;
}
declare namespace CacheableRequest {
type StorageAdapter = Store<any>;
interface Options {
/**
* If the cache should be used. Setting this to `false` will completely bypass the cache for the current request.
* @default true
*/
cache?: boolean | undefined;
/**
* If set to `true` once a cached resource has expired it is deleted and will have to be re-requested.
*
* If set to `false`, after a cached resource's TTL expires it is kept in the cache and will be revalidated
* on the next request with `If-None-Match`/`If-Modified-Since` headers.
* @default false
*/
strictTtl?: boolean | undefined;
/**
* Limits TTL. The `number` represents milliseconds.
* @default undefined
*/
maxTtl?: number | undefined;
/**
* When set to `true`, if the DB connection fails we will automatically fallback to a network request.
* DB errors will still be emitted to notify you of the problem even though the request callback may succeed.
* @default false
*/
automaticFailover?: boolean | undefined;
/**
* Forces refreshing the cache. If the response could be retrieved from the cache, it will perform a
* new request and override the cache instead.
* @default false
*/
forceRefresh?: boolean | undefined;
}
interface Emitter extends EventEmitter {
addListener(event: 'request', listener: (request: ClientRequest) => void): this;
addListener(
event: 'response',
listener: (response: ServerResponse | ResponseLike) => void
): this;
addListener(event: 'error', listener: (error: RequestError | CacheError) => void): this;
on(event: 'request', listener: (request: ClientRequest) => void): this;
on(event: 'response', listener: (response: ServerResponse | ResponseLike) => void): this;
on(event: 'error', listener: (error: RequestError | CacheError) => void): this;
once(event: 'request', listener: (request: ClientRequest) => void): this;
once(event: 'response', listener: (response: ServerResponse | ResponseLike) => void): this;
once(event: 'error', listener: (error: RequestError | CacheError) => void): this;
prependListener(event: 'request', listener: (request: ClientRequest) => void): this;
prependListener(
event: 'response',
listener: (response: ServerResponse | ResponseLike) => void
): this;
prependListener(event: 'error', listener: (error: RequestError | CacheError) => void): this;
prependOnceListener(event: 'request', listener: (request: ClientRequest) => void): this;
prependOnceListener(
event: 'response',
listener: (response: ServerResponse | ResponseLike) => void
): this;
prependOnceListener(
event: 'error',
listener: (error: RequestError | CacheError) => void
): this;
removeListener(event: 'request', listener: (request: ClientRequest) => void): this;
removeListener(
event: 'response',
listener: (response: ServerResponse | ResponseLike) => void
): this;
removeListener(event: 'error', listener: (error: RequestError | CacheError) => void): this;
off(event: 'request', listener: (request: ClientRequest) => void): this;
off(event: 'response', listener: (response: ServerResponse | ResponseLike) => void): this;
off(event: 'error', listener: (error: RequestError | CacheError) => void): this;
removeAllListeners(event?: 'request' | 'response' | 'error'): this;
listeners(event: 'request'): Array<(request: ClientRequest) => void>;
listeners(event: 'response'): Array<(response: ServerResponse | ResponseLike) => void>;
listeners(event: 'error'): Array<(error: RequestError | CacheError) => void>;
rawListeners(event: 'request'): Array<(request: ClientRequest) => void>;
rawListeners(event: 'response'): Array<(response: ServerResponse | ResponseLike) => void>;
rawListeners(event: 'error'): Array<(error: RequestError | CacheError) => void>;
emit(event: 'request', request: ClientRequest): boolean;
emit(event: 'response', response: ServerResponse | ResponseLike): boolean;
emit(event: 'error', error: RequestError | CacheError): boolean;
eventNames(): Array<'request' | 'response' | 'error'>;
listenerCount(type: 'request' | 'response' | 'error'): number;
}
type RequestError = RequestErrorCls;
type CacheError = CacheErrorCls;
}
declare class RequestErrorCls extends Error {
readonly name: 'RequestError';
constructor(error: Error);
}
declare class CacheErrorCls extends Error {
readonly name: 'CacheError';
constructor(error: Error);
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"TimeoutError.js","sources":["../../../src/internal/util/TimeoutError.ts"],"names":[],"mappings":"AAOA,IAAM,gBAAgB,GAAG,CAAC;IACxB,SAAS,gBAAgB;QACvB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,sBAAsB,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gBAAgB,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAE5D,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC,EAAE,CAAC;AASL,MAAM,CAAC,IAAM,YAAY,GAAqB,gBAAuB,CAAC"}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"A B","2":"J E BC","132":"F G"},B:{"1":"C K L H M N O P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","2":"CC tB DC EC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC"},E:{"1":"I u J E F G A B C K L H GC zB HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d qB 9B SC rB","2":"G OC PC QC RC"},G:{"1":"zB TC AC UC","513":"F 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:{"4097":"nC"},I:{"1025":"tB I D oC pC qC rC AC sC tC"},J:{"258":"E A"},K:{"2":"A","258":"B C qB 9B rB","1025":"e"},L:{"1025":"D"},M:{"2049":"D"},N:{"258":"A B"},O:{"258":"uC"},P:{"1025":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"1":"1B"},R:{"1025":"8C"},S:{"1":"9C"}},B:1,C:"Basic console logging functions"};