new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
export { audit } from './audit';
|
||||
export { auditTime } from './auditTime';
|
||||
export { buffer } from './buffer';
|
||||
export { bufferCount } from './bufferCount';
|
||||
export { bufferTime } from './bufferTime';
|
||||
export { bufferToggle } from './bufferToggle';
|
||||
export { bufferWhen } from './bufferWhen';
|
||||
export { catchError } from './catchError';
|
||||
export { combineAll } from './combineAll';
|
||||
export { combineLatest } from './combineLatest';
|
||||
export { concat } from './concat';
|
||||
export { concatAll } from './concatAll';
|
||||
export { concatMap } from './concatMap';
|
||||
export { concatMapTo } from './concatMapTo';
|
||||
export { count } from './count';
|
||||
export { debounce } from './debounce';
|
||||
export { debounceTime } from './debounceTime';
|
||||
export { defaultIfEmpty } from './defaultIfEmpty';
|
||||
export { delay } from './delay';
|
||||
export { delayWhen } from './delayWhen';
|
||||
export { dematerialize } from './dematerialize';
|
||||
export { distinct } from './distinct';
|
||||
export { distinctUntilChanged } from './distinctUntilChanged';
|
||||
export { distinctUntilKeyChanged } from './distinctUntilKeyChanged';
|
||||
export { elementAt } from './elementAt';
|
||||
export { every } from './every';
|
||||
export { exhaust } from './exhaust';
|
||||
export { exhaustMap } from './exhaustMap';
|
||||
export { expand } from './expand';
|
||||
export { filter } from './filter';
|
||||
export { finalize } from './finalize';
|
||||
export { find } from './find';
|
||||
export { findIndex } from './findIndex';
|
||||
export { first } from './first';
|
||||
export { groupBy } from './groupBy';
|
||||
export { ignoreElements } from './ignoreElements';
|
||||
export { isEmpty } from './isEmpty';
|
||||
export { last } from './last';
|
||||
export { map } from './map';
|
||||
export { mapTo } from './mapTo';
|
||||
export { materialize } from './materialize';
|
||||
export { max } from './max';
|
||||
export { merge } from './merge';
|
||||
export { mergeAll } from './mergeAll';
|
||||
export { mergeMap } from './mergeMap';
|
||||
export { mergeMap as flatMap } from './mergeMap';
|
||||
export { mergeMapTo } from './mergeMapTo';
|
||||
export { mergeScan } from './mergeScan';
|
||||
export { min } from './min';
|
||||
export { multicast } from './multicast';
|
||||
export { observeOn } from './observeOn';
|
||||
export { onErrorResumeNext } from './onErrorResumeNext';
|
||||
export { pairwise } from './pairwise';
|
||||
export { partition } from './partition';
|
||||
export { pluck } from './pluck';
|
||||
export { publish } from './publish';
|
||||
export { publishBehavior } from './publishBehavior';
|
||||
export { publishLast } from './publishLast';
|
||||
export { publishReplay } from './publishReplay';
|
||||
export { race } from './race';
|
||||
export { reduce } from './reduce';
|
||||
export { repeat } from './repeat';
|
||||
export { repeatWhen } from './repeatWhen';
|
||||
export { retry } from './retry';
|
||||
export { retryWhen } from './retryWhen';
|
||||
export { refCount } from './refCount';
|
||||
export { sample } from './sample';
|
||||
export { sampleTime } from './sampleTime';
|
||||
export { scan } from './scan';
|
||||
export { sequenceEqual } from './sequenceEqual';
|
||||
export { share } from './share';
|
||||
export { shareReplay } from './shareReplay';
|
||||
export { single } from './single';
|
||||
export { skip } from './skip';
|
||||
export { skipLast } from './skipLast';
|
||||
export { skipUntil } from './skipUntil';
|
||||
export { skipWhile } from './skipWhile';
|
||||
export { startWith } from './startWith';
|
||||
export { subscribeOn } from './subscribeOn';
|
||||
export { switchAll } from './switchAll';
|
||||
export { switchMap } from './switchMap';
|
||||
export { switchMapTo } from './switchMapTo';
|
||||
export { take } from './take';
|
||||
export { takeLast } from './takeLast';
|
||||
export { takeUntil } from './takeUntil';
|
||||
export { takeWhile } from './takeWhile';
|
||||
export { tap } from './tap';
|
||||
export { throttle } from './throttle';
|
||||
export { throttleTime } from './throttleTime';
|
||||
export { timeInterval } from './timeInterval';
|
||||
export { timeout } from './timeout';
|
||||
export { timeoutWith } from './timeoutWith';
|
||||
export { timestamp } from './timestamp';
|
||||
export { toArray } from './toArray';
|
||||
export { window } from './window';
|
||||
export { windowCount } from './windowCount';
|
||||
export { windowTime } from './windowTime';
|
||||
export { windowToggle } from './windowToggle';
|
||||
export { windowWhen } from './windowWhen';
|
||||
export { withLatestFrom } from './withLatestFrom';
|
||||
export { zip } from './zip';
|
||||
export { zipAll } from './zipAll';
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -0,0 +1,22 @@
|
||||
import Node from './shared/Node';
|
||||
import PendingBlock from './PendingBlock';
|
||||
import ThenBlock from './ThenBlock';
|
||||
import CatchBlock from './CatchBlock';
|
||||
import Expression from './shared/Expression';
|
||||
import Component from '../Component';
|
||||
import TemplateScope from './shared/TemplateScope';
|
||||
import { TemplateNode } from '../../interfaces';
|
||||
import { Context } from './shared/Context';
|
||||
import { Node as ESTreeNode } from 'estree';
|
||||
export default class AwaitBlock extends Node {
|
||||
type: 'AwaitBlock';
|
||||
expression: Expression;
|
||||
then_contexts: Context[];
|
||||
catch_contexts: Context[];
|
||||
then_node: ESTreeNode | null;
|
||||
catch_node: ESTreeNode | null;
|
||||
pending: PendingBlock;
|
||||
then: ThenBlock;
|
||||
catch: CatchBlock;
|
||||
constructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode);
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* String consisting of an optional HTTP method and relative path or absolute URL. Examples: `'/orgs/{org}'`, `'PUT /orgs/{org}'`, `GET https://example.com/foo/bar`
|
||||
*/
|
||||
export declare type Route = string;
|
||||
@@ -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/observable/FromObservable"));
|
||||
//# sourceMappingURL=FromObservable.js.map
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/operators/findIndex';
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/util/TimeoutError';
|
||||
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
|
||||
exports = module.exports = cliWidth;
|
||||
|
||||
function normalizeOpts(options) {
|
||||
let defaultOpts = {
|
||||
defaultWidth: 0,
|
||||
output: process.stdout,
|
||||
tty: require("tty"),
|
||||
};
|
||||
|
||||
if (!options) {
|
||||
return defaultOpts;
|
||||
}
|
||||
|
||||
Object.keys(defaultOpts).forEach(function (key) {
|
||||
if (!options[key]) {
|
||||
options[key] = defaultOpts[key];
|
||||
}
|
||||
});
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
function cliWidth(options) {
|
||||
let opts = normalizeOpts(options);
|
||||
|
||||
if (opts.output.getWindowSize) {
|
||||
return opts.output.getWindowSize()[0] || opts.defaultWidth;
|
||||
}
|
||||
|
||||
if (opts.tty.getWindowSize) {
|
||||
return opts.tty.getWindowSize()[1] || opts.defaultWidth;
|
||||
}
|
||||
|
||||
if (opts.output.columns) {
|
||||
return opts.output.columns;
|
||||
}
|
||||
|
||||
if (process.env.CLI_WIDTH) {
|
||||
let width = parseInt(process.env.CLI_WIDTH, 10);
|
||||
|
||||
if (!isNaN(width) && width !== 0) {
|
||||
return width;
|
||||
}
|
||||
}
|
||||
|
||||
return opts.defaultWidth;
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
let Prefixer = require('./prefixer')
|
||||
let OldValue = require('./old-value')
|
||||
let vendor = require('./vendor')
|
||||
let utils = require('./utils')
|
||||
|
||||
class Value extends Prefixer {
|
||||
/**
|
||||
* Clone decl for each prefixed values
|
||||
*/
|
||||
static save (prefixes, decl) {
|
||||
let prop = decl.prop
|
||||
let result = []
|
||||
|
||||
for (let prefix in decl._autoprefixerValues) {
|
||||
let value = decl._autoprefixerValues[prefix]
|
||||
|
||||
if (value === decl.value) {
|
||||
continue
|
||||
}
|
||||
|
||||
let item
|
||||
let propPrefix = vendor.prefix(prop)
|
||||
|
||||
if (propPrefix === '-pie-') {
|
||||
continue
|
||||
}
|
||||
|
||||
if (propPrefix === prefix) {
|
||||
item = decl.value = value
|
||||
result.push(item)
|
||||
continue
|
||||
}
|
||||
|
||||
let prefixed = prefixes.prefixed(prop, prefix)
|
||||
let rule = decl.parent
|
||||
|
||||
if (!rule.every(i => i.prop !== prefixed)) {
|
||||
result.push(item)
|
||||
continue
|
||||
}
|
||||
|
||||
let trimmed = value.replace(/\s+/, ' ')
|
||||
let already = rule.some(
|
||||
i => i.prop === decl.prop && i.value.replace(/\s+/, ' ') === trimmed
|
||||
)
|
||||
|
||||
if (already) {
|
||||
result.push(item)
|
||||
continue
|
||||
}
|
||||
|
||||
let cloned = this.clone(decl, { value })
|
||||
item = decl.parent.insertBefore(decl, cloned)
|
||||
|
||||
result.push(item)
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* Is declaration need to be prefixed
|
||||
*/
|
||||
check (decl) {
|
||||
let value = decl.value
|
||||
if (!value.includes(this.name)) {
|
||||
return false
|
||||
}
|
||||
|
||||
return !!value.match(this.regexp())
|
||||
}
|
||||
|
||||
/**
|
||||
* Lazy regexp loading
|
||||
*/
|
||||
regexp () {
|
||||
return this.regexpCache || (this.regexpCache = utils.regexp(this.name))
|
||||
}
|
||||
|
||||
/**
|
||||
* Add prefix to values in string
|
||||
*/
|
||||
replace (string, prefix) {
|
||||
return string.replace(this.regexp(), `$1${prefix}$2`)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get value with comments if it was not changed
|
||||
*/
|
||||
value (decl) {
|
||||
if (decl.raws.value && decl.raws.value.value === decl.value) {
|
||||
return decl.raws.value.raw
|
||||
} else {
|
||||
return decl.value
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save values with next prefixed token
|
||||
*/
|
||||
add (decl, prefix) {
|
||||
if (!decl._autoprefixerValues) {
|
||||
decl._autoprefixerValues = {}
|
||||
}
|
||||
let value = decl._autoprefixerValues[prefix] || this.value(decl)
|
||||
|
||||
let before
|
||||
do {
|
||||
before = value
|
||||
value = this.replace(value, prefix)
|
||||
if (value === false) return
|
||||
} while (value !== before)
|
||||
|
||||
decl._autoprefixerValues[prefix] = value
|
||||
}
|
||||
|
||||
/**
|
||||
* Return function to fast find prefixed value
|
||||
*/
|
||||
old (prefix) {
|
||||
return new OldValue(this.name, prefix + this.name)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Value
|
||||
@@ -0,0 +1,36 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { isArray } from '../util/isArray';
|
||||
import { MonoTypeOperatorFunction, OperatorFunction } from '../types';
|
||||
import { race as raceStatic } from '../observable/race';
|
||||
|
||||
/* tslint:disable:max-line-length */
|
||||
/** @deprecated Deprecated in favor of static race. */
|
||||
export function race<T>(observables: Array<Observable<T>>): MonoTypeOperatorFunction<T>;
|
||||
/** @deprecated Deprecated in favor of static race. */
|
||||
export function race<T, R>(observables: Array<Observable<T>>): OperatorFunction<T, R>;
|
||||
/** @deprecated Deprecated in favor of static race. */
|
||||
export function race<T>(...observables: Array<Observable<T> | Array<Observable<T>>>): MonoTypeOperatorFunction<T>;
|
||||
/** @deprecated Deprecated in favor of static race. */
|
||||
export function race<T, R>(...observables: Array<Observable<any> | Array<Observable<any>>>): OperatorFunction<T, R>;
|
||||
/* tslint:enable:max-line-length */
|
||||
|
||||
/**
|
||||
* Returns an Observable that mirrors the first source Observable to emit a next,
|
||||
* error or complete notification from the combination of this Observable and supplied Observables.
|
||||
* @param {...Observables} ...observables Sources used to race for which Observable emits first.
|
||||
* @return {Observable} An Observable that mirrors the output of the first Observable to emit an item.
|
||||
* @method race
|
||||
* @owner Observable
|
||||
* @deprecated Deprecated in favor of static {@link race}.
|
||||
*/
|
||||
export function race<T>(...observables: (Observable<T> | Observable<T>[])[]): MonoTypeOperatorFunction<T> {
|
||||
return function raceOperatorFunction(source: Observable<T>) {
|
||||
// if the only argument is an array, it was most likely called with
|
||||
// `pair([obs1, obs2, ...])`
|
||||
if (observables.length === 1 && isArray(observables[0])) {
|
||||
observables = observables[0] as Observable<T>[];
|
||||
}
|
||||
|
||||
return source.lift.call(raceStatic(source, ...(observables as Observable<T>[])));
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
'use strict';
|
||||
/**
|
||||
* `password` type prompt
|
||||
*/
|
||||
|
||||
var chalk = require('chalk');
|
||||
var { map, takeUntil } = require('rxjs/operators');
|
||||
var Base = require('./base');
|
||||
var observe = require('../utils/events');
|
||||
|
||||
function mask(input, maskChar) {
|
||||
input = String(input);
|
||||
maskChar = typeof maskChar === 'string' ? maskChar : '*';
|
||||
if (input.length === 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return new Array(input.length + 1).join(maskChar);
|
||||
}
|
||||
|
||||
class PasswordPrompt extends Base {
|
||||
/**
|
||||
* Start the Inquiry session
|
||||
* @param {Function} cb Callback when prompt is done
|
||||
* @return {this}
|
||||
*/
|
||||
|
||||
_run(cb) {
|
||||
this.done = cb;
|
||||
|
||||
var events = observe(this.rl);
|
||||
|
||||
// Once user confirm (enter key)
|
||||
var submit = events.line.pipe(map(this.filterInput.bind(this)));
|
||||
|
||||
var validation = this.handleSubmitEvents(submit);
|
||||
validation.success.forEach(this.onEnd.bind(this));
|
||||
validation.error.forEach(this.onError.bind(this));
|
||||
|
||||
events.keypress
|
||||
.pipe(takeUntil(validation.success))
|
||||
.forEach(this.onKeypress.bind(this));
|
||||
|
||||
// Init
|
||||
this.render();
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the prompt to screen
|
||||
* @return {PasswordPrompt} self
|
||||
*/
|
||||
|
||||
render(error) {
|
||||
var message = this.getQuestion();
|
||||
var bottomContent = '';
|
||||
|
||||
if (this.status === 'answered') {
|
||||
message += this.opt.mask
|
||||
? chalk.cyan(mask(this.answer, this.opt.mask))
|
||||
: chalk.italic.dim('[hidden]');
|
||||
} else if (this.opt.mask) {
|
||||
message += mask(this.rl.line || '', this.opt.mask);
|
||||
} else {
|
||||
message += chalk.italic.dim('[input is hidden] ');
|
||||
}
|
||||
|
||||
if (error) {
|
||||
bottomContent = '\n' + chalk.red('>> ') + error;
|
||||
}
|
||||
|
||||
this.screen.render(message, bottomContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* When user press `enter` key
|
||||
*/
|
||||
|
||||
filterInput(input) {
|
||||
if (!input) {
|
||||
return this.opt.default == null ? '' : this.opt.default;
|
||||
}
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
onEnd(state) {
|
||||
this.status = 'answered';
|
||||
this.answer = state.value;
|
||||
|
||||
// Re-render prompt
|
||||
this.render();
|
||||
|
||||
this.screen.done();
|
||||
this.done(state.value);
|
||||
}
|
||||
|
||||
onError(state) {
|
||||
this.render(state.isValid);
|
||||
}
|
||||
|
||||
onKeypress() {
|
||||
// If user press a key, just clear the default value
|
||||
if (this.opt.default) {
|
||||
this.opt.default = undefined;
|
||||
}
|
||||
|
||||
this.render();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = PasswordPrompt;
|
||||
@@ -0,0 +1,20 @@
|
||||
let Selector = require('../selector')
|
||||
|
||||
class Fullscreen extends Selector {
|
||||
/**
|
||||
* Return different selectors depend on prefix
|
||||
*/
|
||||
prefixed (prefix) {
|
||||
if (prefix === '-webkit-') {
|
||||
return ':-webkit-full-screen'
|
||||
}
|
||||
if (prefix === '-moz-') {
|
||||
return ':-moz-full-screen'
|
||||
}
|
||||
return `:${prefix}fullscreen`
|
||||
}
|
||||
}
|
||||
|
||||
Fullscreen.names = [':fullscreen']
|
||||
|
||||
module.exports = Fullscreen
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"AsyncSubject.js","sources":["../../src/internal/AsyncSubject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,MAAM,OAAO,YAAgB,SAAQ,OAAU;IAA/C;;QACU,UAAK,GAAM,IAAI,CAAC;QAChB,YAAO,GAAY,KAAK,CAAC;QACzB,iBAAY,GAAY,KAAK,CAAC;IAmCxC,CAAC;IAhCC,UAAU,CAAC,UAA2B;QACpC,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACnC,OAAO,YAAY,CAAC,KAAK,CAAC;SAC3B;aAAM,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,OAAO,EAAE;YAC5C,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC5B,UAAU,CAAC,QAAQ,EAAE,CAAC;YACtB,OAAO,YAAY,CAAC,KAAK,CAAC;SAC3B;QACD,OAAO,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,CAAC,KAAQ;QACX,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;SACrB;IACH,CAAC;IAED,KAAK,CAAC,KAAU;QACd,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACtB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACpB;IACH,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACxB;QACD,KAAK,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC;CACF"}
|
||||
@@ -0,0 +1,505 @@
|
||||
<!--
|
||||
-- This file is auto-generated from README_js.md. Changes should be made there.
|
||||
-->
|
||||
|
||||
# uuid [](https://github.com/uuidjs/uuid/actions?query=workflow%3ACI) [](https://github.com/uuidjs/uuid/actions?query=workflow%3ABrowser)
|
||||
|
||||
For the creation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDs
|
||||
|
||||
- **Complete** - Support for RFC4122 version 1, 3, 4, and 5 UUIDs
|
||||
- **Cross-platform** - Support for ...
|
||||
- CommonJS, [ECMAScript Modules](#ecmascript-modules) and [CDN builds](#cdn-builds)
|
||||
- Node 8, 10, 12, 14
|
||||
- Chrome, Safari, Firefox, Edge, IE 11 browsers
|
||||
- Webpack and rollup.js module bundlers
|
||||
- [React Native / Expo](#react-native--expo)
|
||||
- **Secure** - Cryptographically-strong random values
|
||||
- **Small** - Zero-dependency, small footprint, plays nice with "tree shaking" packagers
|
||||
- **CLI** - Includes the [`uuid` command line](#command-line) utility
|
||||
|
||||
**Upgrading from `uuid@3.x`?** Your code is probably okay, but check out [Upgrading From `uuid@3.x`](#upgrading-from-uuid3x) for details.
|
||||
|
||||
## Quickstart
|
||||
|
||||
To create a random UUID...
|
||||
|
||||
**1. Install**
|
||||
|
||||
```shell
|
||||
npm install uuid
|
||||
```
|
||||
|
||||
**2. Create a UUID** (ES6 module syntax)
|
||||
|
||||
```javascript
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'
|
||||
```
|
||||
|
||||
... or using CommonJS syntax:
|
||||
|
||||
```javascript
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
|
||||
```
|
||||
|
||||
For timestamp UUIDs, namespace UUIDs, and other options read on ...
|
||||
|
||||
## API Summary
|
||||
|
||||
| | | |
|
||||
| --- | --- | --- |
|
||||
| [`uuid.NIL`](#uuidnil) | The nil UUID string (all zeros) | New in `uuid@8.3` |
|
||||
| [`uuid.parse()`](#uuidparsestr) | Convert UUID string to array of bytes | New in `uuid@8.3` |
|
||||
| [`uuid.stringify()`](#uuidstringifyarr-offset) | Convert array of bytes to UUID string | New in `uuid@8.3` |
|
||||
| [`uuid.v1()`](#uuidv1options-buffer-offset) | Create a version 1 (timestamp) UUID | |
|
||||
| [`uuid.v3()`](#uuidv3name-namespace-buffer-offset) | Create a version 3 (namespace w/ MD5) UUID | |
|
||||
| [`uuid.v4()`](#uuidv4options-buffer-offset) | Create a version 4 (random) UUID | |
|
||||
| [`uuid.v5()`](#uuidv5name-namespace-buffer-offset) | Create a version 5 (namespace w/ SHA-1) UUID | |
|
||||
| [`uuid.validate()`](#uuidvalidatestr) | Test a string to see if it is a valid UUID | New in `uuid@8.3` |
|
||||
| [`uuid.version()`](#uuidversionstr) | Detect RFC version of a UUID | New in `uuid@8.3` |
|
||||
|
||||
## API
|
||||
|
||||
### uuid.NIL
|
||||
|
||||
The nil UUID string (all zeros).
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
import { NIL as NIL_UUID } from 'uuid';
|
||||
|
||||
NIL_UUID; // ⇨ '00000000-0000-0000-0000-000000000000'
|
||||
```
|
||||
|
||||
### uuid.parse(str)
|
||||
|
||||
Convert UUID string to array of bytes
|
||||
|
||||
| | |
|
||||
| --------- | ---------------------------------------- |
|
||||
| `str` | A valid UUID `String` |
|
||||
| _returns_ | `Uint8Array[16]` |
|
||||
| _throws_ | `TypeError` if `str` is not a valid UUID |
|
||||
|
||||
Note: Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
import { parse as uuidParse } from 'uuid';
|
||||
|
||||
// Parse a UUID
|
||||
const bytes = uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b');
|
||||
|
||||
// Convert to hex strings to show byte order (for documentation purposes)
|
||||
[...bytes].map((v) => v.toString(16).padStart(2, '0')); // ⇨
|
||||
// [
|
||||
// '6e', 'c0', 'bd', '7f',
|
||||
// '11', 'c0', '43', 'da',
|
||||
// '97', '5e', '2a', '8a',
|
||||
// 'd9', 'eb', 'ae', '0b'
|
||||
// ]
|
||||
```
|
||||
|
||||
### uuid.stringify(arr[, offset])
|
||||
|
||||
Convert array of bytes to UUID string
|
||||
|
||||
| | |
|
||||
| -------------- | ---------------------------------------------------------------------------- |
|
||||
| `arr` | `Array`-like collection of 16 values (starting from `offset`) between 0-255. |
|
||||
| [`offset` = 0] | `Number` Starting index in the Array |
|
||||
| _returns_ | `String` |
|
||||
| _throws_ | `TypeError` if a valid UUID string cannot be generated |
|
||||
|
||||
Note: Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
import { stringify as uuidStringify } from 'uuid';
|
||||
|
||||
const uuidBytes = [
|
||||
0x6e,
|
||||
0xc0,
|
||||
0xbd,
|
||||
0x7f,
|
||||
0x11,
|
||||
0xc0,
|
||||
0x43,
|
||||
0xda,
|
||||
0x97,
|
||||
0x5e,
|
||||
0x2a,
|
||||
0x8a,
|
||||
0xd9,
|
||||
0xeb,
|
||||
0xae,
|
||||
0x0b,
|
||||
];
|
||||
|
||||
uuidStringify(uuidBytes); // ⇨ '6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'
|
||||
```
|
||||
|
||||
### uuid.v1([options[, buffer[, offset]]])
|
||||
|
||||
Create an RFC version 1 (timestamp) UUID
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| [`options`] | `Object` with one or more of the following properties: |
|
||||
| [`options.node` ] | RFC "node" field as an `Array[6]` of byte values (per 4.1.6) |
|
||||
| [`options.clockseq`] | RFC "clock sequence" as a `Number` between 0 - 0x3fff |
|
||||
| [`options.msecs`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) |
|
||||
| [`options.nsecs`] | RFC "timestamp" field (`Number` of nanseconds to add to `msecs`, should be 0-10,000) |
|
||||
| [`options.random`] | `Array` of 16 random bytes (0-255) |
|
||||
| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
|
||||
| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
|
||||
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
|
||||
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
|
||||
| _throws_ | `Error` if more than 10M UUIDs/sec are requested |
|
||||
|
||||
Note: The default [node id](https://tools.ietf.org/html/rfc4122#section-4.1.6) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process.
|
||||
|
||||
Note: `options.random` and `options.rng` are only meaningful on the very first call to `v1()`, where they may be passed to initialize the internal `node` and `clockseq` fields.
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
import { v1 as uuidv1 } from 'uuid';
|
||||
|
||||
uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-8bad-9b1deb4d3b7d'
|
||||
```
|
||||
|
||||
Example using `options`:
|
||||
|
||||
```javascript
|
||||
import { v1 as uuidv1 } from 'uuid';
|
||||
|
||||
const v1options = {
|
||||
node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
|
||||
clockseq: 0x1234,
|
||||
msecs: new Date('2011-11-01').getTime(),
|
||||
nsecs: 5678,
|
||||
};
|
||||
uuidv1(v1options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab'
|
||||
```
|
||||
|
||||
### uuid.v3(name, namespace[, buffer[, offset]])
|
||||
|
||||
Create an RFC version 3 (namespace w/ MD5) UUID
|
||||
|
||||
API is identical to `v5()`, but uses "v3" instead.
|
||||
|
||||
⚠️ Note: Per the RFC, "_If backward compatibility is not an issue, SHA-1 [Version 5] is preferred_."
|
||||
|
||||
### uuid.v4([options[, buffer[, offset]]])
|
||||
|
||||
Create an RFC version 4 (random) UUID
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| [`options`] | `Object` with one or more of the following properties: |
|
||||
| [`options.random`] | `Array` of 16 random bytes (0-255) |
|
||||
| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) |
|
||||
| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
|
||||
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
|
||||
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
|
||||
```
|
||||
|
||||
Example using predefined `random` values:
|
||||
|
||||
```javascript
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
const v4options = {
|
||||
random: [
|
||||
0x10,
|
||||
0x91,
|
||||
0x56,
|
||||
0xbe,
|
||||
0xc4,
|
||||
0xfb,
|
||||
0xc1,
|
||||
0xea,
|
||||
0x71,
|
||||
0xb4,
|
||||
0xef,
|
||||
0xe1,
|
||||
0x67,
|
||||
0x1c,
|
||||
0x58,
|
||||
0x36,
|
||||
],
|
||||
};
|
||||
uuidv4(v4options); // ⇨ '109156be-c4fb-41ea-b1b4-efe1671c5836'
|
||||
```
|
||||
|
||||
### uuid.v5(name, namespace[, buffer[, offset]])
|
||||
|
||||
Create an RFC version 5 (namespace w/ SHA-1) UUID
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| `name` | `String \| Array` |
|
||||
| `namespace` | `String \| Array[16]` Namespace UUID |
|
||||
| [`buffer`] | `Array \| Buffer` If specified, uuid will be written here in byte-form, starting at `offset` |
|
||||
| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` |
|
||||
| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` |
|
||||
|
||||
Note: The RFC `DNS` and `URL` namespaces are available as `v5.DNS` and `v5.URL`.
|
||||
|
||||
Example with custom namespace:
|
||||
|
||||
```javascript
|
||||
import { v5 as uuidv5 } from 'uuid';
|
||||
|
||||
// Define a custom namespace. Readers, create your own using something like
|
||||
// https://www.uuidgenerator.net/
|
||||
const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341';
|
||||
|
||||
uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681'
|
||||
```
|
||||
|
||||
Example with RFC `URL` namespace:
|
||||
|
||||
```javascript
|
||||
import { v5 as uuidv5 } from 'uuid';
|
||||
|
||||
uuidv5('https://www.w3.org/', uuidv5.URL); // ⇨ 'c106a26a-21bb-5538-8bf2-57095d1976c1'
|
||||
```
|
||||
|
||||
### uuid.validate(str)
|
||||
|
||||
Test a string to see if it is a valid UUID
|
||||
|
||||
| | |
|
||||
| --------- | --------------------------------------------------- |
|
||||
| `str` | `String` to validate |
|
||||
| _returns_ | `true` if string is a valid UUID, `false` otherwise |
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
import { validate as uuidValidate } from 'uuid';
|
||||
|
||||
uuidValidate('not a UUID'); // ⇨ false
|
||||
uuidValidate('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ true
|
||||
```
|
||||
|
||||
Using `validate` and `version` together it is possible to do per-version validation, e.g. validate for only v4 UUIds.
|
||||
|
||||
```javascript
|
||||
import { version as uuidVersion } from 'uuid';
|
||||
import { validate as uuidValidate } from 'uuid';
|
||||
|
||||
function uuidValidateV4(uuid) {
|
||||
return uuidValidate(uuid) && uuidVersion(uuid) === 4;
|
||||
}
|
||||
|
||||
const v1Uuid = 'd9428888-122b-11e1-b85c-61cd3cbb3210';
|
||||
const v4Uuid = '109156be-c4fb-41ea-b1b4-efe1671c5836';
|
||||
|
||||
uuidValidateV4(v4Uuid); // ⇨ true
|
||||
uuidValidateV4(v1Uuid); // ⇨ false
|
||||
```
|
||||
|
||||
### uuid.version(str)
|
||||
|
||||
Detect RFC version of a UUID
|
||||
|
||||
| | |
|
||||
| --------- | ---------------------------------------- |
|
||||
| `str` | A valid UUID `String` |
|
||||
| _returns_ | `Number` The RFC version of the UUID |
|
||||
| _throws_ | `TypeError` if `str` is not a valid UUID |
|
||||
|
||||
Example:
|
||||
|
||||
```javascript
|
||||
import { version as uuidVersion } from 'uuid';
|
||||
|
||||
uuidVersion('45637ec4-c85f-11ea-87d0-0242ac130003'); // ⇨ 1
|
||||
uuidVersion('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ 4
|
||||
```
|
||||
|
||||
## Command Line
|
||||
|
||||
UUIDs can be generated from the command line using `uuid`.
|
||||
|
||||
```shell
|
||||
$ uuid
|
||||
ddeb27fb-d9a0-4624-be4d-4615062daed4
|
||||
```
|
||||
|
||||
The default is to generate version 4 UUIDS, however the other versions are supported. Type `uuid --help` for details:
|
||||
|
||||
```shell
|
||||
$ uuid --help
|
||||
|
||||
Usage:
|
||||
uuid
|
||||
uuid v1
|
||||
uuid v3 <name> <namespace uuid>
|
||||
uuid v4
|
||||
uuid v5 <name> <namespace uuid>
|
||||
uuid --help
|
||||
|
||||
Note: <namespace uuid> may be "URL" or "DNS" to use the corresponding UUIDs
|
||||
defined by RFC4122
|
||||
```
|
||||
|
||||
## ECMAScript Modules
|
||||
|
||||
This library comes with [ECMAScript Modules](https://www.ecma-international.org/ecma-262/6.0/#sec-modules) (ESM) support for Node.js versions that support it ([example](./examples/node-esmodules/)) as well as bundlers like [rollup.js](https://rollupjs.org/guide/en/#tree-shaking) ([example](./examples/browser-rollup/)) and [webpack](https://webpack.js.org/guides/tree-shaking/) ([example](./examples/browser-webpack/)) (targeting both, Node.js and browser environments).
|
||||
|
||||
```javascript
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
|
||||
```
|
||||
|
||||
To run the examples you must first create a dist build of this library in the module root:
|
||||
|
||||
```shell
|
||||
npm run build
|
||||
```
|
||||
|
||||
## CDN Builds
|
||||
|
||||
### ECMAScript Modules
|
||||
|
||||
To load this module directly into modern browsers that [support loading ECMAScript Modules](https://caniuse.com/#feat=es6-module) you can make use of [jspm](https://jspm.org/):
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { v4 as uuidv4 } from 'https://jspm.dev/uuid';
|
||||
console.log(uuidv4()); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
|
||||
</script>
|
||||
```
|
||||
|
||||
### UMD
|
||||
|
||||
To load this module directly into older browsers you can use the [UMD (Universal Module Definition)](https://github.com/umdjs/umd) builds from any of the following CDNs:
|
||||
|
||||
**Using [UNPKG](https://unpkg.com/uuid@latest/dist/umd/)**:
|
||||
|
||||
```html
|
||||
<script src="https://unpkg.com/uuid@latest/dist/umd/uuidv4.min.js"></script>
|
||||
```
|
||||
|
||||
**Using [jsDelivr](https://cdn.jsdelivr.net/npm/uuid@latest/dist/umd/)**:
|
||||
|
||||
```html
|
||||
<script src="https://cdn.jsdelivr.net/npm/uuid@latest/dist/umd/uuidv4.min.js"></script>
|
||||
```
|
||||
|
||||
**Using [cdnjs](https://cdnjs.com/libraries/uuid)**:
|
||||
|
||||
```html
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/uuid/8.1.0/uuidv4.min.js"></script>
|
||||
```
|
||||
|
||||
These CDNs all provide the same [`uuidv4()`](#uuidv4options-buffer-offset) method:
|
||||
|
||||
```html
|
||||
<script>
|
||||
uuidv4(); // ⇨ '55af1e37-0734-46d8-b070-a1e42e4fc392'
|
||||
</script>
|
||||
```
|
||||
|
||||
Methods for the other algorithms ([`uuidv1()`](#uuidv1options-buffer-offset), [`uuidv3()`](#uuidv3name-namespace-buffer-offset) and [`uuidv5()`](#uuidv5name-namespace-buffer-offset)) are available from the files `uuidv1.min.js`, `uuidv3.min.js` and `uuidv5.min.js` respectively.
|
||||
|
||||
## "getRandomValues() not supported"
|
||||
|
||||
This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill:
|
||||
|
||||
### React Native / Expo
|
||||
|
||||
1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme)
|
||||
1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point:
|
||||
|
||||
```javascript
|
||||
import 'react-native-get-random-values';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
```
|
||||
|
||||
Note: If you are using Expo, you must be using at least `react-native-get-random-values@1.5.0` and `expo@39.0.0`.
|
||||
|
||||
### Web Workers / Service Workers (Edge <= 18)
|
||||
|
||||
[In Edge <= 18, Web Crypto is not supported in Web Workers or Service Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if you find one, please).
|
||||
|
||||
## Upgrading From `uuid@7.x`
|
||||
|
||||
### Only Named Exports Supported When Using with Node.js ESM
|
||||
|
||||
`uuid@7.x` did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in Node.js ESM consequently imported the CommonJS source with a default export. This library now comes with true Node.js ESM support and only provides named exports.
|
||||
|
||||
Instead of doing:
|
||||
|
||||
```javascript
|
||||
import uuid from 'uuid';
|
||||
uuid.v4();
|
||||
```
|
||||
|
||||
you will now have to use the named exports:
|
||||
|
||||
```javascript
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
uuidv4();
|
||||
```
|
||||
|
||||
### Deep Requires No Longer Supported
|
||||
|
||||
Deep requires like `require('uuid/v4')` [which have been deprecated in `uuid@7.x`](#deep-requires-now-deprecated) are no longer supported.
|
||||
|
||||
## Upgrading From `uuid@3.x`
|
||||
|
||||
"_Wait... what happened to `uuid@4.x` - `uuid@6.x`?!?_"
|
||||
|
||||
In order to avoid confusion with RFC [version 4](#uuidv4options-buffer-offset) and [version 5](#uuidv5name-namespace-buffer-offset) UUIDs, and a possible [version 6](http://gh.peabody.io/uuidv6/), releases 4 thru 6 of this module have been skipped.
|
||||
|
||||
### Deep Requires Now Deprecated
|
||||
|
||||
`uuid@3.x` encouraged the use of deep requires to minimize the bundle size of browser builds:
|
||||
|
||||
```javascript
|
||||
const uuidv4 = require('uuid/v4'); // <== NOW DEPRECATED!
|
||||
uuidv4();
|
||||
```
|
||||
|
||||
As of `uuid@7.x` this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax:
|
||||
|
||||
```javascript
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
uuidv4();
|
||||
```
|
||||
|
||||
... or for CommonJS:
|
||||
|
||||
```javascript
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
uuidv4();
|
||||
```
|
||||
|
||||
### Default Export Removed
|
||||
|
||||
`uuid@3.x` was exporting the Version 4 UUID method as a default export:
|
||||
|
||||
```javascript
|
||||
const uuid = require('uuid'); // <== REMOVED!
|
||||
```
|
||||
|
||||
This usage pattern was already discouraged in `uuid@3.x` and has been removed in `uuid@7.x`.
|
||||
|
||||
----
|
||||
Markdown generated from [README_js.md](README_js.md) by [](https://github.com/broofa/runmd)
|
||||
@@ -0,0 +1,67 @@
|
||||
class OldSelector {
|
||||
constructor (selector, prefix) {
|
||||
this.prefix = prefix
|
||||
this.prefixed = selector.prefixed(this.prefix)
|
||||
this.regexp = selector.regexp(this.prefix)
|
||||
|
||||
this.prefixeds = selector
|
||||
.possible()
|
||||
.map(x => [selector.prefixed(x), selector.regexp(x)])
|
||||
|
||||
this.unprefixed = selector.name
|
||||
this.nameRegexp = selector.regexp()
|
||||
}
|
||||
|
||||
/**
|
||||
* Is rule a hack without unprefixed version bottom
|
||||
*/
|
||||
isHack (rule) {
|
||||
let index = rule.parent.index(rule) + 1
|
||||
let rules = rule.parent.nodes
|
||||
|
||||
while (index < rules.length) {
|
||||
let before = rules[index].selector
|
||||
if (!before) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (before.includes(this.unprefixed) && before.match(this.nameRegexp)) {
|
||||
return false
|
||||
}
|
||||
|
||||
let some = false
|
||||
for (let [string, regexp] of this.prefixeds) {
|
||||
if (before.includes(string) && before.match(regexp)) {
|
||||
some = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (!some) {
|
||||
return true
|
||||
}
|
||||
|
||||
index += 1
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* Does rule contain an unnecessary prefixed selector
|
||||
*/
|
||||
check (rule) {
|
||||
if (!rule.selector.includes(this.prefixed)) {
|
||||
return false
|
||||
}
|
||||
if (!rule.selector.match(this.regexp)) {
|
||||
return false
|
||||
}
|
||||
if (this.isHack(rule)) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = OldSelector
|
||||
@@ -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.00515,"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.00515,"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.01546,"53":0,"54":0.01031,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0.00515,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.06185,"79":0,"80":0,"81":0,"82":0,"83":0.00515,"84":0,"85":0,"86":0,"87":0.01031,"88":0.00515,"89":0,"90":0,"91":0.00515,"92":0,"93":0.00515,"94":0.03092,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.02577,"103":0.03608,"104":0.00515,"105":0.01031,"106":0.03092,"107":0.04639,"108":0.86072,"109":0.48963,"110":0.00515,"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.01546,"26":0.00515,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0.01546,"35":0,"36":0,"37":0,"38":0.05154,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0.00515,"45":0,"46":0,"47":0.00515,"48":0,"49":0.02062,"50":0,"51":0,"52":0.00515,"53":0.00515,"54":0,"55":0.00515,"56":0.00515,"57":0,"58":0,"59":0.01546,"60":0.03608,"61":0,"62":0.00515,"63":0,"64":0,"65":0.00515,"66":0.01031,"67":0.02062,"68":0.00515,"69":0.14431,"70":0.00515,"71":0,"72":0.00515,"73":0.00515,"74":0.01031,"75":0.00515,"76":0.01031,"77":0.00515,"78":0.00515,"79":0.06185,"80":0.01031,"81":0.01031,"83":0.01031,"84":0.01031,"85":0.03092,"86":0.134,"87":0.04123,"88":0.01031,"89":0.00515,"90":0.00515,"91":0.01031,"92":0.01546,"93":0.01546,"94":0.01031,"95":0.01031,"96":0.03092,"97":0.03608,"98":0.02062,"99":0.05154,"100":0.03092,"101":0.04639,"102":0.03608,"103":0.20616,"104":0.07731,"105":0.11339,"106":0.09277,"107":0.35563,"108":6.87544,"109":5.87041,"110":0.00515,"111":0.00515,"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.00515,"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.02062,"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.00515,"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.01546,"90":0,"91":0,"92":0.00515,"93":0.23193,"94":0.22678,"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.00515,"16":0,"17":0,"18":0.00515,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0.00515,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.00515,"93":0,"94":0,"95":0.00515,"96":0,"97":0,"98":0,"99":0.00515,"100":0.00515,"101":0,"102":0.01031,"103":0.00515,"104":0.01546,"105":0.01546,"106":0.01031,"107":0.07731,"108":1.71113,"109":1.55135},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0.00515,"13":0.03092,"14":0.1237,"15":0.02577,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0.00515,"10.1":0,"11.1":0.00515,"12.1":0.04639,"13.1":0.15977,"14.1":0.35047,"15.1":0.04639,"15.2-15.3":0.04639,"15.4":0.11854,"15.5":0.2577,"15.6":1.64413,"16.0":0.13916,"16.1":0.47417,"16.2":0.90195,"16.3":0.05669},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.02588,"6.0-6.1":0.02156,"7.0-7.1":0.01725,"8.1-8.4":0.02588,"9.0-9.2":0.02156,"9.3":0.25445,"10.0-10.2":0.01294,"10.3":0.29758,"11.0-11.2":0.06038,"11.3-11.4":0.10351,"12.0-12.1":0.06038,"12.2-12.5":1.33695,"13.0-13.1":0.03019,"13.2":0.01725,"13.3":0.09057,"13.4-13.7":0.2027,"14.0-14.4":0.61241,"14.5-14.8":1.44908,"15.0-15.1":0.31914,"15.2-15.3":0.42265,"15.4":0.56928,"15.5":1.11269,"15.6":5.72732,"16.0":4.51113,"16.1":14.76682,"16.2":8.14245,"16.3":0.51322},P:{"4":0.23231,"5.0-5.4":0.03168,"6.2-6.4":0,"7.2-7.4":0,"8.2":0,"9.2":0.01056,"10.1":0,"11.1-11.2":0.01056,"12.0":0.01056,"13.0":0.04224,"14.0":0.03168,"15.0":0.02112,"16.0":0.06336,"17.0":0.06336,"18.0":0.11615,"19.0":2.78771},I:{"0":0,"3":0,"4":0.00968,"2.1":0,"2.2":0.01451,"2.3":0.00726,"4.1":0.00968,"4.2-4.3":0.01935,"4.4":0,"4.4.3-4.4.4":0.07015},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0.02996,"9":0.02996,"10":0.00999,"11":0.08987,"5.5":0},J:{"7":0,"10":0},N:{"10":0,"11":0},R:{_:"0"},M:{"0":0.46037},Q:{"13.1":0.00485},O:{"0":0.05815},H:{"0":0.16516},L:{"0":27.63058},S:{"2.5":0}};
|
||||
@@ -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/throwIfEmpty"));
|
||||
//# sourceMappingURL=throwIfEmpty.js.map
|
||||
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function isFunction(x) {
|
||||
return typeof x === 'function';
|
||||
}
|
||||
exports.isFunction = isFunction;
|
||||
//# sourceMappingURL=isFunction.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isEmpty.js","sources":["../../../src/internal/operators/isEmpty.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAgE3C,MAAM,UAAU,OAAO;IACrB,OAAO,UAAC,MAAqB,IAAK,OAAA,MAAM,CAAC,IAAI,CAAC,IAAI,eAAe,EAAE,CAAC,EAAlC,CAAkC,CAAC;AACvE,CAAC;AAED;IAAA;IAIA,CAAC;IAHC,8BAAI,GAAJ,UAAM,QAA6B,EAAE,MAAW;QAC9C,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3D,CAAC;IACH,sBAAC;AAAD,CAAC,AAJD,IAIC;AAOD;IAAgC,6CAAe;IAC7C,2BAAY,WAAgC;eAC1C,kBAAM,WAAW,CAAC;IACpB,CAAC;IAEO,0CAAc,GAAtB,UAAuB,OAAgB;QACrC,IAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QAErC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,WAAW,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;IAES,iCAAK,GAAf,UAAgB,KAAc;QAC5B,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAES,qCAAS,GAAnB;QACE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IACH,wBAAC;AAAD,CAAC,AAnBD,CAAgC,UAAU,GAmBzC"}
|
||||
@@ -0,0 +1,391 @@
|
||||
"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 root_1 = require("../../util/root");
|
||||
var Observable_1 = require("../../Observable");
|
||||
var Subscriber_1 = require("../../Subscriber");
|
||||
var map_1 = require("../../operators/map");
|
||||
function getCORSRequest() {
|
||||
if (root_1.root.XMLHttpRequest) {
|
||||
return new root_1.root.XMLHttpRequest();
|
||||
}
|
||||
else if (!!root_1.root.XDomainRequest) {
|
||||
return new root_1.root.XDomainRequest();
|
||||
}
|
||||
else {
|
||||
throw new Error('CORS is not supported by your browser');
|
||||
}
|
||||
}
|
||||
function getXMLHttpRequest() {
|
||||
if (root_1.root.XMLHttpRequest) {
|
||||
return new root_1.root.XMLHttpRequest();
|
||||
}
|
||||
else {
|
||||
var progId = void 0;
|
||||
try {
|
||||
var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'];
|
||||
for (var i = 0; i < 3; i++) {
|
||||
try {
|
||||
progId = progIds[i];
|
||||
if (new root_1.root.ActiveXObject(progId)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
}
|
||||
}
|
||||
return new root_1.root.ActiveXObject(progId);
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error('XMLHttpRequest is not supported by your browser');
|
||||
}
|
||||
}
|
||||
}
|
||||
function ajaxGet(url, headers) {
|
||||
if (headers === void 0) { headers = null; }
|
||||
return new AjaxObservable({ method: 'GET', url: url, headers: headers });
|
||||
}
|
||||
exports.ajaxGet = ajaxGet;
|
||||
function ajaxPost(url, body, headers) {
|
||||
return new AjaxObservable({ method: 'POST', url: url, body: body, headers: headers });
|
||||
}
|
||||
exports.ajaxPost = ajaxPost;
|
||||
function ajaxDelete(url, headers) {
|
||||
return new AjaxObservable({ method: 'DELETE', url: url, headers: headers });
|
||||
}
|
||||
exports.ajaxDelete = ajaxDelete;
|
||||
function ajaxPut(url, body, headers) {
|
||||
return new AjaxObservable({ method: 'PUT', url: url, body: body, headers: headers });
|
||||
}
|
||||
exports.ajaxPut = ajaxPut;
|
||||
function ajaxPatch(url, body, headers) {
|
||||
return new AjaxObservable({ method: 'PATCH', url: url, body: body, headers: headers });
|
||||
}
|
||||
exports.ajaxPatch = ajaxPatch;
|
||||
var mapResponse = map_1.map(function (x, index) { return x.response; });
|
||||
function ajaxGetJSON(url, headers) {
|
||||
return mapResponse(new AjaxObservable({
|
||||
method: 'GET',
|
||||
url: url,
|
||||
responseType: 'json',
|
||||
headers: headers
|
||||
}));
|
||||
}
|
||||
exports.ajaxGetJSON = ajaxGetJSON;
|
||||
var AjaxObservable = (function (_super) {
|
||||
__extends(AjaxObservable, _super);
|
||||
function AjaxObservable(urlOrRequest) {
|
||||
var _this = _super.call(this) || this;
|
||||
var request = {
|
||||
async: true,
|
||||
createXHR: function () {
|
||||
return this.crossDomain ? getCORSRequest() : getXMLHttpRequest();
|
||||
},
|
||||
crossDomain: true,
|
||||
withCredentials: false,
|
||||
headers: {},
|
||||
method: 'GET',
|
||||
responseType: 'json',
|
||||
timeout: 0
|
||||
};
|
||||
if (typeof urlOrRequest === 'string') {
|
||||
request.url = urlOrRequest;
|
||||
}
|
||||
else {
|
||||
for (var prop in urlOrRequest) {
|
||||
if (urlOrRequest.hasOwnProperty(prop)) {
|
||||
request[prop] = urlOrRequest[prop];
|
||||
}
|
||||
}
|
||||
}
|
||||
_this.request = request;
|
||||
return _this;
|
||||
}
|
||||
AjaxObservable.prototype._subscribe = function (subscriber) {
|
||||
return new AjaxSubscriber(subscriber, this.request);
|
||||
};
|
||||
AjaxObservable.create = (function () {
|
||||
var create = function (urlOrRequest) {
|
||||
return new AjaxObservable(urlOrRequest);
|
||||
};
|
||||
create.get = ajaxGet;
|
||||
create.post = ajaxPost;
|
||||
create.delete = ajaxDelete;
|
||||
create.put = ajaxPut;
|
||||
create.patch = ajaxPatch;
|
||||
create.getJSON = ajaxGetJSON;
|
||||
return create;
|
||||
})();
|
||||
return AjaxObservable;
|
||||
}(Observable_1.Observable));
|
||||
exports.AjaxObservable = AjaxObservable;
|
||||
var AjaxSubscriber = (function (_super) {
|
||||
__extends(AjaxSubscriber, _super);
|
||||
function AjaxSubscriber(destination, request) {
|
||||
var _this = _super.call(this, destination) || this;
|
||||
_this.request = request;
|
||||
_this.done = false;
|
||||
var headers = request.headers = request.headers || {};
|
||||
if (!request.crossDomain && !_this.getHeader(headers, 'X-Requested-With')) {
|
||||
headers['X-Requested-With'] = 'XMLHttpRequest';
|
||||
}
|
||||
var contentTypeHeader = _this.getHeader(headers, 'Content-Type');
|
||||
if (!contentTypeHeader && !(root_1.root.FormData && request.body instanceof root_1.root.FormData) && typeof request.body !== 'undefined') {
|
||||
headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
|
||||
}
|
||||
request.body = _this.serializeBody(request.body, _this.getHeader(request.headers, 'Content-Type'));
|
||||
_this.send();
|
||||
return _this;
|
||||
}
|
||||
AjaxSubscriber.prototype.next = function (e) {
|
||||
this.done = true;
|
||||
var _a = this, xhr = _a.xhr, request = _a.request, destination = _a.destination;
|
||||
var result;
|
||||
try {
|
||||
result = new AjaxResponse(e, xhr, request);
|
||||
}
|
||||
catch (err) {
|
||||
return destination.error(err);
|
||||
}
|
||||
destination.next(result);
|
||||
};
|
||||
AjaxSubscriber.prototype.send = function () {
|
||||
var _a = this, request = _a.request, _b = _a.request, user = _b.user, method = _b.method, url = _b.url, async = _b.async, password = _b.password, headers = _b.headers, body = _b.body;
|
||||
try {
|
||||
var xhr = this.xhr = request.createXHR();
|
||||
this.setupEvents(xhr, request);
|
||||
if (user) {
|
||||
xhr.open(method, url, async, user, password);
|
||||
}
|
||||
else {
|
||||
xhr.open(method, url, async);
|
||||
}
|
||||
if (async) {
|
||||
xhr.timeout = request.timeout;
|
||||
xhr.responseType = request.responseType;
|
||||
}
|
||||
if ('withCredentials' in xhr) {
|
||||
xhr.withCredentials = !!request.withCredentials;
|
||||
}
|
||||
this.setHeaders(xhr, headers);
|
||||
if (body) {
|
||||
xhr.send(body);
|
||||
}
|
||||
else {
|
||||
xhr.send();
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
this.error(err);
|
||||
}
|
||||
};
|
||||
AjaxSubscriber.prototype.serializeBody = function (body, contentType) {
|
||||
if (!body || typeof body === 'string') {
|
||||
return body;
|
||||
}
|
||||
else if (root_1.root.FormData && body instanceof root_1.root.FormData) {
|
||||
return body;
|
||||
}
|
||||
if (contentType) {
|
||||
var splitIndex = contentType.indexOf(';');
|
||||
if (splitIndex !== -1) {
|
||||
contentType = contentType.substring(0, splitIndex);
|
||||
}
|
||||
}
|
||||
switch (contentType) {
|
||||
case 'application/x-www-form-urlencoded':
|
||||
return Object.keys(body).map(function (key) { return encodeURIComponent(key) + "=" + encodeURIComponent(body[key]); }).join('&');
|
||||
case 'application/json':
|
||||
return JSON.stringify(body);
|
||||
default:
|
||||
return body;
|
||||
}
|
||||
};
|
||||
AjaxSubscriber.prototype.setHeaders = function (xhr, headers) {
|
||||
for (var key in headers) {
|
||||
if (headers.hasOwnProperty(key)) {
|
||||
xhr.setRequestHeader(key, headers[key]);
|
||||
}
|
||||
}
|
||||
};
|
||||
AjaxSubscriber.prototype.getHeader = function (headers, headerName) {
|
||||
for (var key in headers) {
|
||||
if (key.toLowerCase() === headerName.toLowerCase()) {
|
||||
return headers[key];
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
AjaxSubscriber.prototype.setupEvents = function (xhr, request) {
|
||||
var progressSubscriber = request.progressSubscriber;
|
||||
function xhrTimeout(e) {
|
||||
var _a = xhrTimeout, subscriber = _a.subscriber, progressSubscriber = _a.progressSubscriber, request = _a.request;
|
||||
if (progressSubscriber) {
|
||||
progressSubscriber.error(e);
|
||||
}
|
||||
var error;
|
||||
try {
|
||||
error = new exports.AjaxTimeoutError(this, request);
|
||||
}
|
||||
catch (err) {
|
||||
error = err;
|
||||
}
|
||||
subscriber.error(error);
|
||||
}
|
||||
xhr.ontimeout = xhrTimeout;
|
||||
xhrTimeout.request = request;
|
||||
xhrTimeout.subscriber = this;
|
||||
xhrTimeout.progressSubscriber = progressSubscriber;
|
||||
if (xhr.upload && 'withCredentials' in xhr) {
|
||||
if (progressSubscriber) {
|
||||
var xhrProgress_1;
|
||||
xhrProgress_1 = function (e) {
|
||||
var progressSubscriber = xhrProgress_1.progressSubscriber;
|
||||
progressSubscriber.next(e);
|
||||
};
|
||||
if (root_1.root.XDomainRequest) {
|
||||
xhr.onprogress = xhrProgress_1;
|
||||
}
|
||||
else {
|
||||
xhr.upload.onprogress = xhrProgress_1;
|
||||
}
|
||||
xhrProgress_1.progressSubscriber = progressSubscriber;
|
||||
}
|
||||
var xhrError_1;
|
||||
xhrError_1 = function (e) {
|
||||
var _a = xhrError_1, progressSubscriber = _a.progressSubscriber, subscriber = _a.subscriber, request = _a.request;
|
||||
if (progressSubscriber) {
|
||||
progressSubscriber.error(e);
|
||||
}
|
||||
var error;
|
||||
try {
|
||||
error = new exports.AjaxError('ajax error', this, request);
|
||||
}
|
||||
catch (err) {
|
||||
error = err;
|
||||
}
|
||||
subscriber.error(error);
|
||||
};
|
||||
xhr.onerror = xhrError_1;
|
||||
xhrError_1.request = request;
|
||||
xhrError_1.subscriber = this;
|
||||
xhrError_1.progressSubscriber = progressSubscriber;
|
||||
}
|
||||
function xhrReadyStateChange(e) {
|
||||
return;
|
||||
}
|
||||
xhr.onreadystatechange = xhrReadyStateChange;
|
||||
xhrReadyStateChange.subscriber = this;
|
||||
xhrReadyStateChange.progressSubscriber = progressSubscriber;
|
||||
xhrReadyStateChange.request = request;
|
||||
function xhrLoad(e) {
|
||||
var _a = xhrLoad, subscriber = _a.subscriber, progressSubscriber = _a.progressSubscriber, request = _a.request;
|
||||
if (this.readyState === 4) {
|
||||
var status_1 = this.status === 1223 ? 204 : this.status;
|
||||
var response = (this.responseType === 'text' ? (this.response || this.responseText) : this.response);
|
||||
if (status_1 === 0) {
|
||||
status_1 = response ? 200 : 0;
|
||||
}
|
||||
if (status_1 < 400) {
|
||||
if (progressSubscriber) {
|
||||
progressSubscriber.complete();
|
||||
}
|
||||
subscriber.next(e);
|
||||
subscriber.complete();
|
||||
}
|
||||
else {
|
||||
if (progressSubscriber) {
|
||||
progressSubscriber.error(e);
|
||||
}
|
||||
var error = void 0;
|
||||
try {
|
||||
error = new exports.AjaxError('ajax error ' + status_1, this, request);
|
||||
}
|
||||
catch (err) {
|
||||
error = err;
|
||||
}
|
||||
subscriber.error(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
xhr.onload = xhrLoad;
|
||||
xhrLoad.subscriber = this;
|
||||
xhrLoad.progressSubscriber = progressSubscriber;
|
||||
xhrLoad.request = request;
|
||||
};
|
||||
AjaxSubscriber.prototype.unsubscribe = function () {
|
||||
var _a = this, done = _a.done, xhr = _a.xhr;
|
||||
if (!done && xhr && xhr.readyState !== 4 && typeof xhr.abort === 'function') {
|
||||
xhr.abort();
|
||||
}
|
||||
_super.prototype.unsubscribe.call(this);
|
||||
};
|
||||
return AjaxSubscriber;
|
||||
}(Subscriber_1.Subscriber));
|
||||
exports.AjaxSubscriber = AjaxSubscriber;
|
||||
var AjaxResponse = (function () {
|
||||
function AjaxResponse(originalEvent, xhr, request) {
|
||||
this.originalEvent = originalEvent;
|
||||
this.xhr = xhr;
|
||||
this.request = request;
|
||||
this.status = xhr.status;
|
||||
this.responseType = xhr.responseType || request.responseType;
|
||||
this.response = parseXhrResponse(this.responseType, xhr);
|
||||
}
|
||||
return AjaxResponse;
|
||||
}());
|
||||
exports.AjaxResponse = AjaxResponse;
|
||||
var AjaxErrorImpl = (function () {
|
||||
function AjaxErrorImpl(message, xhr, request) {
|
||||
Error.call(this);
|
||||
this.message = message;
|
||||
this.name = 'AjaxError';
|
||||
this.xhr = xhr;
|
||||
this.request = request;
|
||||
this.status = xhr.status;
|
||||
this.responseType = xhr.responseType || request.responseType;
|
||||
this.response = parseXhrResponse(this.responseType, xhr);
|
||||
return this;
|
||||
}
|
||||
AjaxErrorImpl.prototype = Object.create(Error.prototype);
|
||||
return AjaxErrorImpl;
|
||||
})();
|
||||
exports.AjaxError = AjaxErrorImpl;
|
||||
function parseJson(xhr) {
|
||||
if ('response' in xhr) {
|
||||
return xhr.responseType ? xhr.response : JSON.parse(xhr.response || xhr.responseText || 'null');
|
||||
}
|
||||
else {
|
||||
return JSON.parse(xhr.responseText || 'null');
|
||||
}
|
||||
}
|
||||
function parseXhrResponse(responseType, xhr) {
|
||||
switch (responseType) {
|
||||
case 'json':
|
||||
return parseJson(xhr);
|
||||
case 'xml':
|
||||
return xhr.responseXML;
|
||||
case 'text':
|
||||
default:
|
||||
return ('response' in xhr) ? xhr.response : xhr.responseText;
|
||||
}
|
||||
}
|
||||
function AjaxTimeoutErrorImpl(xhr, request) {
|
||||
exports.AjaxError.call(this, 'ajax timeout', xhr, request);
|
||||
this.name = 'AjaxTimeoutError';
|
||||
return this;
|
||||
}
|
||||
exports.AjaxTimeoutError = AjaxTimeoutErrorImpl;
|
||||
//# sourceMappingURL=AjaxObservable.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"partition.js","sources":["../../../src/internal/operators/partition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAoDlC,MAAM,UAAU,SAAS,CAAI,SAA+C,EAC/C,OAAa;IACxC,OAAO,UAAC,MAAqB,IAAK,OAAA;QAChC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC;QAClC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAQ,CAAC,CAAC,MAAM,CAAC;KACb,EAHD,CAGC,CAAC;AACtC,CAAC"}
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/operator/subscribeOn';
|
||||
@@ -0,0 +1,35 @@
|
||||
// TODO: Remove this when we target TypeScript >=3.5.
|
||||
type _Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
|
||||
|
||||
/**
|
||||
Create a type that requires exactly one of the given keys and disallows more. The remaining keys are kept as is.
|
||||
|
||||
Use-cases:
|
||||
- Creating interfaces for components that only need one of the keys to display properly.
|
||||
- Declaring generic keys in a single place for a single use-case that gets narrowed down via `RequireExactlyOne`.
|
||||
|
||||
The caveat with `RequireExactlyOne` is that TypeScript doesn't always know at compile time every key that will exist at runtime. Therefore `RequireExactlyOne` can't do anything to prevent extra keys it doesn't know about.
|
||||
|
||||
@example
|
||||
```
|
||||
import {RequireExactlyOne} from 'type-fest';
|
||||
|
||||
type Responder = {
|
||||
text: () => string;
|
||||
json: () => string;
|
||||
secure: boolean;
|
||||
};
|
||||
|
||||
const responder: RequireExactlyOne<Responder, 'text' | 'json'> = {
|
||||
// Adding a `text` key here would cause a compile error.
|
||||
|
||||
json: () => '{"message": "ok"}',
|
||||
secure: true
|
||||
};
|
||||
```
|
||||
*/
|
||||
export type RequireExactlyOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> =
|
||||
{[Key in KeysType]: (
|
||||
Required<Pick<ObjectType, Key>> &
|
||||
Partial<Record<Exclude<KeysType, Key>, never>>
|
||||
)}[KeysType] & _Omit<ObjectType, KeysType>;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isPromise.js","sources":["../src/util/isPromise.ts"],"names":[],"mappings":";;;;;AAAA,gDAA2C"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"mapTo.js","sources":["../../../src/internal/operators/mapTo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAoC3C,MAAM,UAAU,KAAK,CAAO,KAAQ;IAClC,OAAO,CAAC,MAAqB,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,aAAa;IAIjB,YAAY,KAAQ;QAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,IAAI,CAAC,UAAyB,EAAE,MAAW;QACzC,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACvE,CAAC;CACF;AAOD,MAAM,eAAsB,SAAQ,UAAa;IAI/C,YAAY,WAA0B,EAAE,KAAQ;QAC9C,KAAK,CAAC,WAAW,CAAC,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAES,KAAK,CAAC,CAAI;QAClB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;CACF"}
|
||||
@@ -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/util/isDate"));
|
||||
//# sourceMappingURL=isDate.js.map
|
||||
Reference in New Issue
Block a user