new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"distinctUntilKeyChanged.js","sources":["../../src/add/operator/distinctUntilKeyChanged.ts"],"names":[],"mappings":";;AAAA,4DAA0D"}
|
||||
@@ -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 DC EC","194":"oB pB P Q R wB S T U V W X Y Z a b","257":"c d f g h i j k l m n o p q r s D t xB yB"},D:{"1":"U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","2":"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"},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","1281":"NC","1796":"6B 7B 8B"},F:{"1":"jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d","2":"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 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","1281":"sB 6B 7B 8B"},H:{"2":"nC"},I:{"1":"D","2":"tB I oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"1":"e","2":"A B C qB 9B rB"},L:{"1":"D"},M:{"257":"D"},N:{"2":"A B"},O:{"2":"uC"},P:{"1":"3C 4C sB 5C 6C 7C","2":"I vC wC xC yC zC 0B 0C 1C 2C"},Q:{"2":"1B"},R:{"1":"8C"},S:{"2":"9C"}},B:6,C:"AVIF image format"};
|
||||
@@ -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/dom/AjaxObservable"));
|
||||
//# sourceMappingURL=AjaxObservable.js.map
|
||||
@@ -0,0 +1,107 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Observable_1 = require("../Observable");
|
||||
var AsyncSubject_1 = require("../AsyncSubject");
|
||||
var map_1 = require("../operators/map");
|
||||
var canReportError_1 = require("../util/canReportError");
|
||||
var isArray_1 = require("../util/isArray");
|
||||
var isScheduler_1 = require("../util/isScheduler");
|
||||
function bindCallback(callbackFunc, resultSelector, scheduler) {
|
||||
if (resultSelector) {
|
||||
if (isScheduler_1.isScheduler(resultSelector)) {
|
||||
scheduler = resultSelector;
|
||||
}
|
||||
else {
|
||||
return function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
return bindCallback(callbackFunc, scheduler).apply(void 0, args).pipe(map_1.map(function (args) { return isArray_1.isArray(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
|
||||
};
|
||||
}
|
||||
}
|
||||
return function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var context = this;
|
||||
var subject;
|
||||
var params = {
|
||||
context: context,
|
||||
subject: subject,
|
||||
callbackFunc: callbackFunc,
|
||||
scheduler: scheduler,
|
||||
};
|
||||
return new Observable_1.Observable(function (subscriber) {
|
||||
if (!scheduler) {
|
||||
if (!subject) {
|
||||
subject = new AsyncSubject_1.AsyncSubject();
|
||||
var handler = function () {
|
||||
var innerArgs = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
innerArgs[_i] = arguments[_i];
|
||||
}
|
||||
subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
|
||||
subject.complete();
|
||||
};
|
||||
try {
|
||||
callbackFunc.apply(context, args.concat([handler]));
|
||||
}
|
||||
catch (err) {
|
||||
if (canReportError_1.canReportError(subject)) {
|
||||
subject.error(err);
|
||||
}
|
||||
else {
|
||||
console.warn(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
return subject.subscribe(subscriber);
|
||||
}
|
||||
else {
|
||||
var state = {
|
||||
args: args, subscriber: subscriber, params: params,
|
||||
};
|
||||
return scheduler.schedule(dispatch, 0, state);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
exports.bindCallback = bindCallback;
|
||||
function dispatch(state) {
|
||||
var _this = this;
|
||||
var self = this;
|
||||
var args = state.args, subscriber = state.subscriber, params = state.params;
|
||||
var callbackFunc = params.callbackFunc, context = params.context, scheduler = params.scheduler;
|
||||
var subject = params.subject;
|
||||
if (!subject) {
|
||||
subject = params.subject = new AsyncSubject_1.AsyncSubject();
|
||||
var handler = function () {
|
||||
var innerArgs = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
innerArgs[_i] = arguments[_i];
|
||||
}
|
||||
var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
|
||||
_this.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject }));
|
||||
};
|
||||
try {
|
||||
callbackFunc.apply(context, args.concat([handler]));
|
||||
}
|
||||
catch (err) {
|
||||
subject.error(err);
|
||||
}
|
||||
}
|
||||
this.add(subject.subscribe(subscriber));
|
||||
}
|
||||
function dispatchNext(state) {
|
||||
var value = state.value, subject = state.subject;
|
||||
subject.next(value);
|
||||
subject.complete();
|
||||
}
|
||||
function dispatchError(state) {
|
||||
var err = state.err, subject = state.subject;
|
||||
subject.error(err);
|
||||
}
|
||||
//# sourceMappingURL=bindCallback.js.map
|
||||
@@ -0,0 +1,46 @@
|
||||
let flexSpec = require('./flex-spec')
|
||||
let Declaration = require('../declaration')
|
||||
|
||||
class AlignItems extends Declaration {
|
||||
/**
|
||||
* Change property name for 2009 and 2012 specs
|
||||
*/
|
||||
prefixed (prop, prefix) {
|
||||
let spec
|
||||
;[spec, prefix] = flexSpec(prefix)
|
||||
if (spec === 2009) {
|
||||
return prefix + 'box-align'
|
||||
}
|
||||
if (spec === 2012) {
|
||||
return prefix + 'flex-align'
|
||||
}
|
||||
return super.prefixed(prop, prefix)
|
||||
}
|
||||
|
||||
/**
|
||||
* Return property name by final spec
|
||||
*/
|
||||
normalize () {
|
||||
return 'align-items'
|
||||
}
|
||||
|
||||
/**
|
||||
* Change value for 2009 and 2012 specs
|
||||
*/
|
||||
set (decl, prefix) {
|
||||
let spec = flexSpec(prefix)[0]
|
||||
if (spec === 2009 || spec === 2012) {
|
||||
decl.value = AlignItems.oldValues[decl.value] || decl.value
|
||||
}
|
||||
return super.set(decl, prefix)
|
||||
}
|
||||
}
|
||||
|
||||
AlignItems.names = ['align-items', 'flex-align', 'box-align']
|
||||
|
||||
AlignItems.oldValues = {
|
||||
'flex-end': 'end',
|
||||
'flex-start': 'start'
|
||||
}
|
||||
|
||||
module.exports = AlignItems
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"toSubscriber.js","sources":["../../../src/internal/util/toSubscriber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,aAAa,CAAC;AAGrD,MAAM,UAAU,YAAY,CAC1B,cAA0D,EAC1D,KAA4B,EAC5B,QAAqB;IAErB,IAAI,cAAc,EAAE;QAClB,IAAI,cAAc,YAAY,UAAU,EAAE;YACxC,OAAwB,cAAe,CAAC;SACzC;QAED,IAAI,cAAc,CAAC,kBAAkB,CAAC,EAAE;YACtC,OAAO,cAAc,CAAC,kBAAkB,CAAC,EAAE,CAAC;SAC7C;KACF;IAED,IAAI,CAAC,cAAc,IAAI,CAAC,KAAK,IAAI,CAAC,QAAQ,EAAE;QAC1C,OAAO,IAAI,UAAU,CAAC,aAAa,CAAC,CAAC;KACtC;IAED,OAAO,IAAI,UAAU,CAAC,cAAc,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AACzD,CAAC"}
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/interfaces';
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Immediate.js","sources":["../../../src/internal/util/Immediate.ts"],"names":[],"mappings":"AAAA,IAAI,UAAU,GAAG,CAAC,CAAC;AACnB,IAAM,QAAQ,GAAG,CAAC,cAAM,OAAA,OAAO,CAAC,OAAO,EAAE,EAAjB,CAAiB,CAAC,EAAE,CAAC;AAC7C,IAAM,aAAa,GAA2B,EAAE,CAAC;AAOjD,SAAS,kBAAkB,CAAC,MAAc;IACxC,IAAI,MAAM,IAAI,aAAa,EAAE;QAC3B,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAKD,MAAM,CAAC,IAAM,SAAS,GAAG;IACvB,YAAY,EAAZ,UAAa,EAAc;QACzB,IAAM,MAAM,GAAG,UAAU,EAAE,CAAC;QAC5B,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;QAC7B,QAAQ,CAAC,IAAI,CAAC,cAAM,OAAA,kBAAkB,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAlC,CAAkC,CAAC,CAAC;QACxD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,cAAc,EAAd,UAAe,MAAc;QAC3B,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC;AAKF,MAAM,CAAC,IAAM,SAAS,GAAG;IACvB,OAAO;QACL,OAAO,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC;IAC3C,CAAC;CACF,CAAC"}
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/operators/onErrorResumeNext';
|
||||
@@ -0,0 +1,92 @@
|
||||
import { async } from '../scheduler/async';
|
||||
import { isDate } from '../util/isDate';
|
||||
import { Operator } from '../Operator';
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { Observable } from '../Observable';
|
||||
import { TimeoutError } from '../util/TimeoutError';
|
||||
import { MonoTypeOperatorFunction, SchedulerAction, SchedulerLike, TeardownLogic } from '../types';
|
||||
import { timeoutWith } from './timeoutWith';
|
||||
import { throwError } from '../observable/throwError';
|
||||
|
||||
/**
|
||||
*
|
||||
* Errors if Observable does not emit a value in given time span.
|
||||
*
|
||||
* <span class="informal">Timeouts on Observable that doesn't emit values fast enough.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* `timeout` operator accepts as an argument either a number or a Date.
|
||||
*
|
||||
* If number was provided, it returns an Observable that behaves like a source
|
||||
* Observable, unless there is a period of time where there is no value emitted.
|
||||
* So if you provide `100` as argument and first value comes after 50ms from
|
||||
* the moment of subscription, this value will be simply re-emitted by the resulting
|
||||
* Observable. If however after that 100ms passes without a second value being emitted,
|
||||
* stream will end with an error and source Observable will be unsubscribed.
|
||||
* These checks are performed throughout whole lifecycle of Observable - from the moment
|
||||
* it was subscribed to, until it completes or errors itself. Thus every value must be
|
||||
* emitted within specified period since previous value.
|
||||
*
|
||||
* If provided argument was Date, returned Observable behaves differently. It throws
|
||||
* if Observable did not complete before provided Date. This means that periods between
|
||||
* emission of particular values do not matter in this case. If Observable did not complete
|
||||
* before provided Date, source Observable will be unsubscribed. Other than that, resulting
|
||||
* stream behaves just as source Observable.
|
||||
*
|
||||
* `timeout` accepts also a Scheduler as a second parameter. It is used to schedule moment (or moments)
|
||||
* when returned Observable will check if source stream emitted value or completed.
|
||||
*
|
||||
* ## Examples
|
||||
* Check if ticks are emitted within certain timespan
|
||||
* ```ts
|
||||
* import { interval } from 'rxjs';
|
||||
* import { timeout } from 'rxjs/operators';
|
||||
*
|
||||
* const seconds = interval(1000);
|
||||
*
|
||||
* seconds.pipe(timeout(1100)) // Let's use bigger timespan to be safe,
|
||||
* // since `interval` might fire a bit later then scheduled.
|
||||
* .subscribe(
|
||||
* value => console.log(value), // Will emit numbers just as regular `interval` would.
|
||||
* err => console.log(err), // Will never be called.
|
||||
* );
|
||||
*
|
||||
* seconds.pipe(timeout(900))
|
||||
* .subscribe(
|
||||
* value => console.log(value), // Will never be called.
|
||||
* err => console.log(err), // Will emit error before even first value is emitted,
|
||||
* // since it did not arrive within 900ms period.
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
* Use Date to check if Observable completed
|
||||
* ```ts
|
||||
* import { interval } from 'rxjs';
|
||||
* import { timeout } from 'rxjs/operators';
|
||||
*
|
||||
* const seconds = interval(1000);
|
||||
*
|
||||
* seconds.pipe(
|
||||
* timeout(new Date("December 17, 2020 03:24:00")),
|
||||
* )
|
||||
* .subscribe(
|
||||
* value => console.log(value), // Will emit values as regular `interval` would
|
||||
* // until December 17, 2020 at 03:24:00.
|
||||
* err => console.log(err) // On December 17, 2020 at 03:24:00 it will emit an error,
|
||||
* // since Observable did not complete by then.
|
||||
* );
|
||||
* ```
|
||||
* @see {@link timeoutWith}
|
||||
*
|
||||
* @param {number|Date} due Number specifying period within which Observable must emit values
|
||||
* or Date specifying before when Observable should complete
|
||||
* @param {SchedulerLike} [scheduler] Scheduler controlling when timeout checks occur.
|
||||
* @return {Observable<T>} Observable that mirrors behaviour of source, unless timeout checks fail.
|
||||
* @method timeout
|
||||
* @owner Observable
|
||||
*/
|
||||
export function timeout<T>(due: number | Date,
|
||||
scheduler: SchedulerLike = async): MonoTypeOperatorFunction<T> {
|
||||
return timeoutWith(due, throwError(new TimeoutError()), scheduler);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import {Except} from './except';
|
||||
import {Simplify} from './simplify';
|
||||
|
||||
/**
|
||||
Create a type that strips `readonly` from all or some of an object's keys. Inverse of `Readonly<T>`.
|
||||
|
||||
This can be used to [store and mutate options within a class](https://github.com/sindresorhus/pageres/blob/4a5d05fca19a5fbd2f53842cbf3eb7b1b63bddd2/source/index.ts#L72), [edit `readonly` objects within tests](https://stackoverflow.com/questions/50703834), [construct a `readonly` object within a function](https://github.com/Microsoft/TypeScript/issues/24509), or to define a single model where the only thing that changes is whether or not some of the keys are mutable.
|
||||
|
||||
@example
|
||||
```
|
||||
import {Mutable} from 'type-fest';
|
||||
|
||||
type Foo = {
|
||||
readonly a: number;
|
||||
readonly b: readonly string[]; // To show that only the mutability status of the properties, not their values, are affected.
|
||||
readonly c: boolean;
|
||||
};
|
||||
|
||||
const mutableFoo: Mutable<Foo> = {a: 1, b: ['2']};
|
||||
mutableFoo.a = 3;
|
||||
mutableFoo.b[0] = 'new value'; // Will still fail as the value of property "b" is still a readonly type.
|
||||
mutableFoo.b = ['something']; // Will work as the "b" property itself is no longer readonly.
|
||||
|
||||
type SomeMutable = Mutable<Foo, 'b' | 'c'>;
|
||||
// type SomeMutable = {
|
||||
// readonly a: number;
|
||||
// b: readonly string[]; // It's now mutable. The type of the property remains unaffected.
|
||||
// c: boolean; // It's now mutable.
|
||||
// }
|
||||
```
|
||||
*/
|
||||
export type Mutable<BaseType, Keys extends keyof BaseType = keyof BaseType> =
|
||||
Simplify<
|
||||
// Pick just the keys that are not mutable from the base type.
|
||||
Except<BaseType, Keys> &
|
||||
// Pick the keys that should be mutable from the base type and make them mutable by removing the `readonly` modifier from the key.
|
||||
{-readonly [KeyType in keyof Pick<BaseType, Keys>]: Pick<BaseType, Keys>[KeyType]}
|
||||
>;
|
||||
@@ -0,0 +1,263 @@
|
||||
'use strict';
|
||||
|
||||
var utils = require('./utils');
|
||||
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
var isArray = Array.isArray;
|
||||
|
||||
var defaults = {
|
||||
allowDots: false,
|
||||
allowPrototypes: false,
|
||||
allowSparse: false,
|
||||
arrayLimit: 20,
|
||||
charset: 'utf-8',
|
||||
charsetSentinel: false,
|
||||
comma: false,
|
||||
decoder: utils.decode,
|
||||
delimiter: '&',
|
||||
depth: 5,
|
||||
ignoreQueryPrefix: false,
|
||||
interpretNumericEntities: false,
|
||||
parameterLimit: 1000,
|
||||
parseArrays: true,
|
||||
plainObjects: false,
|
||||
strictNullHandling: false
|
||||
};
|
||||
|
||||
var interpretNumericEntities = function (str) {
|
||||
return str.replace(/&#(\d+);/g, function ($0, numberStr) {
|
||||
return String.fromCharCode(parseInt(numberStr, 10));
|
||||
});
|
||||
};
|
||||
|
||||
var parseArrayValue = function (val, options) {
|
||||
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
|
||||
return val.split(',');
|
||||
}
|
||||
|
||||
return val;
|
||||
};
|
||||
|
||||
// This is what browsers will submit when the ✓ character occurs in an
|
||||
// application/x-www-form-urlencoded body and the encoding of the page containing
|
||||
// the form is iso-8859-1, or when the submitted form has an accept-charset
|
||||
// attribute of iso-8859-1. Presumably also with other charsets that do not contain
|
||||
// the ✓ character, such as us-ascii.
|
||||
var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')
|
||||
|
||||
// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
|
||||
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
|
||||
|
||||
var parseValues = function parseQueryStringValues(str, options) {
|
||||
var obj = {};
|
||||
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
||||
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
||||
var parts = cleanStr.split(options.delimiter, limit);
|
||||
var skipIndex = -1; // Keep track of where the utf8 sentinel was found
|
||||
var i;
|
||||
|
||||
var charset = options.charset;
|
||||
if (options.charsetSentinel) {
|
||||
for (i = 0; i < parts.length; ++i) {
|
||||
if (parts[i].indexOf('utf8=') === 0) {
|
||||
if (parts[i] === charsetSentinel) {
|
||||
charset = 'utf-8';
|
||||
} else if (parts[i] === isoSentinel) {
|
||||
charset = 'iso-8859-1';
|
||||
}
|
||||
skipIndex = i;
|
||||
i = parts.length; // The eslint settings do not allow break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < parts.length; ++i) {
|
||||
if (i === skipIndex) {
|
||||
continue;
|
||||
}
|
||||
var part = parts[i];
|
||||
|
||||
var bracketEqualsPos = part.indexOf(']=');
|
||||
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
||||
|
||||
var key, val;
|
||||
if (pos === -1) {
|
||||
key = options.decoder(part, defaults.decoder, charset, 'key');
|
||||
val = options.strictNullHandling ? null : '';
|
||||
} else {
|
||||
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
||||
val = utils.maybeMap(
|
||||
parseArrayValue(part.slice(pos + 1), options),
|
||||
function (encodedVal) {
|
||||
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
||||
val = interpretNumericEntities(val);
|
||||
}
|
||||
|
||||
if (part.indexOf('[]=') > -1) {
|
||||
val = isArray(val) ? [val] : val;
|
||||
}
|
||||
|
||||
if (has.call(obj, key)) {
|
||||
obj[key] = utils.combine(obj[key], val);
|
||||
} else {
|
||||
obj[key] = val;
|
||||
}
|
||||
}
|
||||
|
||||
return obj;
|
||||
};
|
||||
|
||||
var parseObject = function (chain, val, options, valuesParsed) {
|
||||
var leaf = valuesParsed ? val : parseArrayValue(val, options);
|
||||
|
||||
for (var i = chain.length - 1; i >= 0; --i) {
|
||||
var obj;
|
||||
var root = chain[i];
|
||||
|
||||
if (root === '[]' && options.parseArrays) {
|
||||
obj = [].concat(leaf);
|
||||
} else {
|
||||
obj = options.plainObjects ? Object.create(null) : {};
|
||||
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
||||
var index = parseInt(cleanRoot, 10);
|
||||
if (!options.parseArrays && cleanRoot === '') {
|
||||
obj = { 0: leaf };
|
||||
} else if (
|
||||
!isNaN(index)
|
||||
&& root !== cleanRoot
|
||||
&& String(index) === cleanRoot
|
||||
&& index >= 0
|
||||
&& (options.parseArrays && index <= options.arrayLimit)
|
||||
) {
|
||||
obj = [];
|
||||
obj[index] = leaf;
|
||||
} else if (cleanRoot !== '__proto__') {
|
||||
obj[cleanRoot] = leaf;
|
||||
}
|
||||
}
|
||||
|
||||
leaf = obj;
|
||||
}
|
||||
|
||||
return leaf;
|
||||
};
|
||||
|
||||
var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
|
||||
if (!givenKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Transform dot notation to bracket notation
|
||||
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
||||
|
||||
// The regex chunks
|
||||
|
||||
var brackets = /(\[[^[\]]*])/;
|
||||
var child = /(\[[^[\]]*])/g;
|
||||
|
||||
// Get the parent
|
||||
|
||||
var segment = options.depth > 0 && brackets.exec(key);
|
||||
var parent = segment ? key.slice(0, segment.index) : key;
|
||||
|
||||
// Stash the parent if it exists
|
||||
|
||||
var keys = [];
|
||||
if (parent) {
|
||||
// If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
|
||||
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
||||
if (!options.allowPrototypes) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
keys.push(parent);
|
||||
}
|
||||
|
||||
// Loop through children appending to the array until we hit depth
|
||||
|
||||
var i = 0;
|
||||
while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
|
||||
i += 1;
|
||||
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
||||
if (!options.allowPrototypes) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
keys.push(segment[1]);
|
||||
}
|
||||
|
||||
// If there's a remainder, just add whatever is left
|
||||
|
||||
if (segment) {
|
||||
keys.push('[' + key.slice(segment.index) + ']');
|
||||
}
|
||||
|
||||
return parseObject(keys, val, options, valuesParsed);
|
||||
};
|
||||
|
||||
var normalizeParseOptions = function normalizeParseOptions(opts) {
|
||||
if (!opts) {
|
||||
return defaults;
|
||||
}
|
||||
|
||||
if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
|
||||
throw new TypeError('Decoder has to be a function.');
|
||||
}
|
||||
|
||||
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
||||
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
||||
}
|
||||
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
||||
|
||||
return {
|
||||
allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
|
||||
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
||||
allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
|
||||
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
||||
charset: charset,
|
||||
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
||||
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
||||
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
||||
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
||||
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
||||
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
||||
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
||||
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
||||
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
||||
parseArrays: opts.parseArrays !== false,
|
||||
plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
|
||||
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = function (str, opts) {
|
||||
var options = normalizeParseOptions(opts);
|
||||
|
||||
if (str === '' || str === null || typeof str === 'undefined') {
|
||||
return options.plainObjects ? Object.create(null) : {};
|
||||
}
|
||||
|
||||
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
||||
var obj = options.plainObjects ? Object.create(null) : {};
|
||||
|
||||
// Iterate over the keys and setup the new object
|
||||
|
||||
var keys = Object.keys(tempObj);
|
||||
for (var i = 0; i < keys.length; ++i) {
|
||||
var key = keys[i];
|
||||
var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
|
||||
obj = utils.merge(obj, newObj, options);
|
||||
}
|
||||
|
||||
if (options.allowSparse === true) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
return utils.compact(obj);
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"identity.js","sources":["../src/util/identity.ts"],"names":[],"mappings":";;;;;AAAA,+CAA0C"}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E BC","132":"F G A B"},B:{"1":"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","132":"C K L H M N O"},C:{"2":"CC tB I u J E F G A B C K L H M N O DC EC","132":"0 1 2 3 4 5 6 7 8 9 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"},D:{"1":"0 1 2 3 4 5 6 7 8 9 H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB 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","16":"I u J E F G A B C K L"},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:{"1":"0 1 2 3 4 5 6 7 8 9 H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d","132":"G B C 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:{"16":"nC"},I:{"16":"tB I D oC pC qC rC AC sC tC"},J:{"16":"E A"},K:{"1":"e","16":"A B C qB 9B rB"},L:{"1":"D"},M:{"132":"D"},N:{"258":"A B"},O:{"1":"uC"},P:{"1":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"1":"1B"},R:{"1":"8C"},S:{"132":"9C"}},B:5,C:"CSS Paged Media (@page)"};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"1":"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","2":"C K L 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 UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB DC EC","132":"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"},D:{"1":"oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","2":"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","66":"mB nB"},E:{"1":"NC","2":"I u J E F G A B C K GC zB HC IC JC KC 0B qB rB","322":"L H 1B LC MC 2B","580":"3B 4B 5B sB 6B 7B 8B"},F:{"1":"cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d","2":"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 OC PC QC RC qB 9B SC rB","66":"aB bB"},G:{"2":"F zB TC AC UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC","322":"jC kC lC mC 2B","580":"3B 4B 5B sB 6B 7B 8B"},H:{"2":"nC"},I:{"1":"D","2":"tB I oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"1":"e","2":"A B C qB 9B rB"},L:{"1":"D"},M:{"132":"D"},N:{"2":"A B"},O:{"1":"uC"},P:{"1":"1C 2C 3C 4C sB 5C 6C 7C","2":"I vC wC xC yC zC 0B 0C"},Q:{"1":"1B"},R:{"1":"8C"},S:{"2":"9C"}},B:1,C:"Lazy loading via attribute for images & iframes"};
|
||||
@@ -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.00375,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0.00751,"62":0,"63":0,"64":0,"65":0,"66":0.00375,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0.00375,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0.00375,"89":0.00375,"90":0,"91":0.00751,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0.11637,"99":0.00751,"100":0.00375,"101":0,"102":0.00751,"103":0.03003,"104":0.00375,"105":0.00375,"106":0,"107":0.01126,"108":0.37915,"109":0.25527,"110":0,"111":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.00751,"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.00375,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0.00375,"41":0,"42":0,"43":0.01126,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0.00751,"56":0.00375,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0.00375,"64":0.00375,"65":0,"66":0,"67":0.00375,"68":0.00375,"69":0.03003,"70":0.01126,"71":0.00375,"72":0.03003,"73":0,"74":0.05256,"75":0,"76":0.00375,"77":0,"78":0,"79":0.00751,"80":0.01126,"81":0.16893,"83":0.01502,"84":0.00375,"85":0.00375,"86":0.00375,"87":0.06382,"88":0.00751,"89":0,"90":0.00751,"91":0.01502,"92":0.01502,"93":0.00375,"94":0.05631,"95":0.00751,"96":0.01126,"97":0.00751,"98":0.03003,"99":0.01126,"100":0.00375,"101":0.00751,"102":0.01502,"103":0.04505,"104":0.03003,"105":0.02252,"106":0.06382,"107":0.0488,"108":2.66159,"109":2.79673,"110":0.00375,"111":0,"112":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0.00375,"27":0,"28":0.00375,"29":0,"30":0,"31":0,"32":0,"33":0.00375,"34":0,"35":0.01502,"36":0,"37":0.00375,"38":0.01502,"39":0,"40":0,"41":0,"42":0.00375,"43":0,"44":0,"45":0,"46":0.02628,"47":0,"48":0,"49":0,"50":0.00375,"51":0.00751,"52":0,"53":0,"54":0.00375,"55":0.00375,"56":0.00375,"57":0.00375,"58":0.04505,"60":0.10887,"62":0,"63":0.16142,"64":0.10511,"65":0.04505,"66":0.0901,"67":0.01126,"68":0,"69":0,"70":0,"71":0,"72":0.01877,"73":0.00751,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0.00375,"80":0.01126,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0.00751,"87":0,"88":0,"89":0,"90":0,"91":0.00375,"92":0,"93":0.01877,"94":0.41669,"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.00751},B:{"12":0.00375,"13":0,"14":0.00375,"15":0.00375,"16":0,"17":0,"18":0.02252,"79":0,"80":0,"81":0,"83":0,"84":0.00375,"85":0,"86":0,"87":0,"88":0.01126,"89":0.01877,"90":0.00375,"91":0.00375,"92":0.07508,"93":0,"94":0,"95":0,"96":0.00375,"97":0,"98":0,"99":0,"100":0.00375,"101":0,"102":0,"103":0.00375,"104":0,"105":0.00751,"106":0.00751,"107":0.02628,"108":0.52181,"109":0.55184},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0.00375,"15":0,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0.00375,"13.1":0.01502,"14.1":0.00751,"15.1":0,"15.2-15.3":0,"15.4":0,"15.5":0.00375,"15.6":0.01877,"16.0":0.00375,"16.1":0.00751,"16.2":0.01126,"16.3":0.00375},G:{"8":0.00919,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.00552,"6.0-6.1":0.00184,"7.0-7.1":0.01655,"8.1-8.4":0.00643,"9.0-9.2":0,"9.3":0.05515,"10.0-10.2":0,"10.3":0.52578,"11.0-11.2":0.00368,"11.3-11.4":0.00092,"12.0-12.1":0.02758,"12.2-12.5":1.94318,"13.0-13.1":0.07905,"13.2":0.00184,"13.3":0.04688,"13.4-13.7":0.23899,"14.0-14.4":0.60575,"14.5-14.8":0.47247,"15.0-15.1":0.16178,"15.2-15.3":0.22704,"15.4":0.36032,"15.5":0.4982,"15.6":0.57358,"16.0":0.58645,"16.1":0.94401,"16.2":0.93298,"16.3":0.09743},P:{"4":0.4196,"5.0-5.4":0.02047,"6.2-6.4":0,"7.2-7.4":0.18421,"8.2":0.01023,"9.2":0.4196,"10.1":0,"11.1-11.2":0.04094,"12.0":0.02047,"13.0":0.02047,"14.0":0.11257,"15.0":0.02047,"16.0":0.07164,"17.0":0.07164,"18.0":0.0614,"19.0":0.70615},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0.00099,"4.2-4.3":0.00248,"4.4":0,"4.4.3-4.4.4":0.09653},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.01877,"5.5":0},J:{"7":0,"10":0.01249},N:{"10":0,"11":0},R:{_:"0"},M:{"0":0.36851},Q:{"13.1":0.00625},O:{"0":0.3123},H:{"0":5.93696},L:{"0":68.63411},S:{"2.5":0.89942}};
|
||||
@@ -0,0 +1,48 @@
|
||||
/** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async PURE_IMPORTS_END */
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { async } from '../scheduler/async';
|
||||
export function sampleTime(period, scheduler) {
|
||||
if (scheduler === void 0) {
|
||||
scheduler = async;
|
||||
}
|
||||
return function (source) { return source.lift(new SampleTimeOperator(period, scheduler)); };
|
||||
}
|
||||
var SampleTimeOperator = /*@__PURE__*/ (function () {
|
||||
function SampleTimeOperator(period, scheduler) {
|
||||
this.period = period;
|
||||
this.scheduler = scheduler;
|
||||
}
|
||||
SampleTimeOperator.prototype.call = function (subscriber, source) {
|
||||
return source.subscribe(new SampleTimeSubscriber(subscriber, this.period, this.scheduler));
|
||||
};
|
||||
return SampleTimeOperator;
|
||||
}());
|
||||
var SampleTimeSubscriber = /*@__PURE__*/ (function (_super) {
|
||||
tslib_1.__extends(SampleTimeSubscriber, _super);
|
||||
function SampleTimeSubscriber(destination, period, scheduler) {
|
||||
var _this = _super.call(this, destination) || this;
|
||||
_this.period = period;
|
||||
_this.scheduler = scheduler;
|
||||
_this.hasValue = false;
|
||||
_this.add(scheduler.schedule(dispatchNotification, period, { subscriber: _this, period: period }));
|
||||
return _this;
|
||||
}
|
||||
SampleTimeSubscriber.prototype._next = function (value) {
|
||||
this.lastValue = value;
|
||||
this.hasValue = true;
|
||||
};
|
||||
SampleTimeSubscriber.prototype.notifyNext = function () {
|
||||
if (this.hasValue) {
|
||||
this.hasValue = false;
|
||||
this.destination.next(this.lastValue);
|
||||
}
|
||||
};
|
||||
return SampleTimeSubscriber;
|
||||
}(Subscriber));
|
||||
function dispatchNotification(state) {
|
||||
var subscriber = state.subscriber, period = state.period;
|
||||
subscriber.notifyNext();
|
||||
this.schedule(state, period);
|
||||
}
|
||||
//# sourceMappingURL=sampleTime.js.map
|
||||
Reference in New Issue
Block a user