new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"zip.js","sources":["../../src/internal/operators/zip.ts"],"names":[],"mappings":";;AAAA,yCAAqD;AAsCrD,SAAgB,GAAG;IAAO,qBAA4E;SAA5E,UAA4E,EAA5E,qBAA4E,EAA5E,IAA4E;QAA5E,gCAA4E;;IACpG,OAAO,SAAS,mBAAmB,CAAC,MAAqB;QACvD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,gBAAI,MAAM,SAAK,WAAW,GAAE,CAAC;IAChE,CAAC,CAAC;AACJ,CAAC;AAJD,kBAIC"}
|
||||
@@ -0,0 +1,83 @@
|
||||
/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
|
||||
import * as tslib_1 from "tslib";
|
||||
import { OuterSubscriber } from '../OuterSubscriber';
|
||||
import { subscribeToResult } from '../util/subscribeToResult';
|
||||
export function withLatestFrom() {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
return function (source) {
|
||||
var project;
|
||||
if (typeof args[args.length - 1] === 'function') {
|
||||
project = args.pop();
|
||||
}
|
||||
var observables = args;
|
||||
return source.lift(new WithLatestFromOperator(observables, project));
|
||||
};
|
||||
}
|
||||
var WithLatestFromOperator = /*@__PURE__*/ (function () {
|
||||
function WithLatestFromOperator(observables, project) {
|
||||
this.observables = observables;
|
||||
this.project = project;
|
||||
}
|
||||
WithLatestFromOperator.prototype.call = function (subscriber, source) {
|
||||
return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project));
|
||||
};
|
||||
return WithLatestFromOperator;
|
||||
}());
|
||||
var WithLatestFromSubscriber = /*@__PURE__*/ (function (_super) {
|
||||
tslib_1.__extends(WithLatestFromSubscriber, _super);
|
||||
function WithLatestFromSubscriber(destination, observables, project) {
|
||||
var _this = _super.call(this, destination) || this;
|
||||
_this.observables = observables;
|
||||
_this.project = project;
|
||||
_this.toRespond = [];
|
||||
var len = observables.length;
|
||||
_this.values = new Array(len);
|
||||
for (var i = 0; i < len; i++) {
|
||||
_this.toRespond.push(i);
|
||||
}
|
||||
for (var i = 0; i < len; i++) {
|
||||
var observable = observables[i];
|
||||
_this.add(subscribeToResult(_this, observable, undefined, i));
|
||||
}
|
||||
return _this;
|
||||
}
|
||||
WithLatestFromSubscriber.prototype.notifyNext = function (_outerValue, innerValue, outerIndex) {
|
||||
this.values[outerIndex] = innerValue;
|
||||
var toRespond = this.toRespond;
|
||||
if (toRespond.length > 0) {
|
||||
var found = toRespond.indexOf(outerIndex);
|
||||
if (found !== -1) {
|
||||
toRespond.splice(found, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
WithLatestFromSubscriber.prototype.notifyComplete = function () {
|
||||
};
|
||||
WithLatestFromSubscriber.prototype._next = function (value) {
|
||||
if (this.toRespond.length === 0) {
|
||||
var args = [value].concat(this.values);
|
||||
if (this.project) {
|
||||
this._tryProject(args);
|
||||
}
|
||||
else {
|
||||
this.destination.next(args);
|
||||
}
|
||||
}
|
||||
};
|
||||
WithLatestFromSubscriber.prototype._tryProject = function (args) {
|
||||
var result;
|
||||
try {
|
||||
result = this.project.apply(this, args);
|
||||
}
|
||||
catch (err) {
|
||||
this.destination.error(err);
|
||||
return;
|
||||
}
|
||||
this.destination.next(result);
|
||||
};
|
||||
return WithLatestFromSubscriber;
|
||||
}(OuterSubscriber));
|
||||
//# sourceMappingURL=withLatestFrom.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"ora","version":"5.4.0","files":{"license":{"checkedAt":1678887829613,"integrity":"sha512-0fM2/ycrxrltyaBKfQ748Ck23VlPUUBgNAR47ldf4B1V/HoXTfWBSk+vcshGKwEpmOynu4mOP5o+hyBfuRNa8g==","mode":420,"size":1117},"index.js":{"checkedAt":1678887830111,"integrity":"sha512-i3Pm/kIj1+8WI1r2vtwpdnM8kOgnQhalQTOJwgFgPHkbIkJq/MaBbeOyCpv78cJuakZdjgpl/zle1Px67vD2JQ==","mode":420,"size":8557},"package.json":{"checkedAt":1678887830111,"integrity":"sha512-k7aoM2lkDnr/Szoycy0ZChKrlQFvCEG/zvRx0yhcdd4OL/c6iYJDByQZmatUzjBPAdRjPXeSNbqPAY5LzuP35g==","mode":420,"size":1021},"readme.md":{"checkedAt":1678887830118,"integrity":"sha512-RfuckxbINTprfP9am85gU+t+0lgR9/cCYZUWA9KInBpgnCWe5ryXRhUlvCG8wpM4/6Dolr5k/Tdz8+qVMUJIpg==","mode":420,"size":6419},"index.d.ts":{"checkedAt":1678887830118,"integrity":"sha512-Bwpn50oCTwFTlHyIv1IkChJ0/77/q31mMgnFenMVdaJrWgvbiqgX9xlGTwWrBomPAU7rkJQY3rFgnKGV0iyf0g==","mode":420,"size":6138}}}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"27":0.00807,"52":0.04037,"54":0.02826,"66":0.00404,"68":0.00404,"72":0.00404,"73":0.00807,"78":0.01615,"79":0.00404,"80":0.00404,"81":0.00807,"86":0.00404,"88":0.01211,"90":0.00404,"91":0.04037,"97":0.00404,"99":0.01211,"100":0.00807,"102":0.04037,"103":0.00807,"104":0.01615,"105":0.01211,"106":0.02019,"107":0.03633,"108":0.89218,"109":0.53288,"110":0.00404,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 55 56 57 58 59 60 61 62 63 64 65 67 69 70 71 74 75 76 77 82 83 84 85 87 89 92 93 94 95 96 98 101 111 3.5 3.6"},D:{"38":0.01615,"47":0.00807,"49":0.07267,"53":0.00404,"55":0.00404,"58":0.00404,"63":0.00404,"65":0.00807,"66":0.01211,"68":0.01211,"69":0.00807,"70":0.00807,"71":0.00807,"72":0.01211,"73":0.00404,"74":0.02019,"75":0.01211,"76":0.01211,"77":0.01211,"78":0.01211,"79":0.12515,"80":0.02019,"81":0.02422,"83":0.02826,"84":0.03633,"85":0.06056,"86":0.04844,"87":0.06863,"88":0.02019,"89":0.02019,"90":0.05652,"91":0.30278,"92":0.06459,"93":0.05248,"94":0.05652,"95":0.01615,"96":0.03633,"97":0.03633,"98":0.02826,"99":0.03633,"100":0.04844,"101":0.0323,"102":0.04441,"103":0.13322,"104":0.0767,"105":0.10093,"106":0.10093,"107":0.26241,"108":13.35036,"109":13.45532,"110":0.01615,"111":0.00807,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 39 40 41 42 43 44 45 46 48 50 51 52 54 56 57 59 60 61 62 64 67 112"},F:{"28":0.00807,"36":0.00404,"79":0.00404,"85":0.00807,"92":0.00807,"93":2.26879,"94":1.55021,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 86 87 88 89 90 91 9.5-9.6 10.5 10.6 11.1 11.5 11.6 12.1","10.0-10.1":0},B:{"15":0.03633,"18":0.00807,"84":0.00404,"85":0.00404,"92":0.01211,"104":0.00404,"105":0.00807,"106":0.00807,"107":0.08074,"108":1.36451,"109":1.48158,_:"12 13 14 16 17 79 80 81 83 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103"},E:{"4":0,"14":0.02019,"15":0.00404,_:"0 5 6 7 8 9 10 11 12 13 3.1 3.2 5.1 6.1 7.1 10.1 11.1","9.1":0.0323,"12.1":0.00404,"13.1":0.0323,"14.1":0.05652,"15.1":0.00807,"15.2-15.3":0.00807,"15.4":0.02019,"15.5":0.04037,"15.6":0.16955,"16.0":0.02826,"16.1":0.10496,"16.2":0.16955,"16.3":0.01211},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.00394,"6.0-6.1":0.00079,"7.0-7.1":0.00315,"8.1-8.4":0,"9.0-9.2":0.00079,"9.3":0.02602,"10.0-10.2":0.00079,"10.3":0.02129,"11.0-11.2":0.01025,"11.3-11.4":0.0268,"12.0-12.1":0.01183,"12.2-12.5":0.16477,"13.0-13.1":0.00631,"13.2":0.00394,"13.3":0.01261,"13.4-13.7":0.04178,"14.0-14.4":0.0883,"14.5-14.8":0.24203,"15.0-15.1":0.04336,"15.2-15.3":0.06465,"15.4":0.08909,"15.5":0.20498,"15.6":0.8538,"16.0":1.09741,"16.1":2.44867,"16.2":1.60511,"16.3":0.13087},P:{"4":0.14573,_:"5.0-5.4 6.2-6.4 8.2 9.2 10.1 12.0","7.2-7.4":0.18737,"11.1-11.2":0.03123,"13.0":0.03123,"14.0":0.03123,"15.0":0.02082,"16.0":0.05205,"17.0":0.12491,"18.0":0.09369,"19.0":1.69676},I:{"0":0,"3":0,"4":0.00226,"2.1":0,"2.2":0,"2.3":0,"4.1":0.00226,"4.2-4.3":0.00451,"4.4":0,"4.4.3-4.4.4":0.03272},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"8":0.00843,"9":0.00843,"11":0.08004,_:"6 7 10 5.5"},J:{"7":0,"10":0},N:{_:"10 11"},H:{"0":0.19759},L:{"0":50.47781},S:{"2.5":0},R:{_:"0"},M:{"0":0.14311},Q:{"13.1":0},O:{"0":0.05367}};
|
||||
@@ -0,0 +1,81 @@
|
||||
declare const xdgBasedir: {
|
||||
/**
|
||||
Directory for user-specific data files.
|
||||
|
||||
@example
|
||||
```js
|
||||
import xdgBasedir = require('xdg-basedir');
|
||||
|
||||
xdgBasedir.data;
|
||||
//=> '/home/sindresorhus/.local/share'
|
||||
```
|
||||
*/
|
||||
readonly data?: string;
|
||||
|
||||
/**
|
||||
Directory for user-specific configuration files.
|
||||
|
||||
@example
|
||||
```js
|
||||
import xdgBasedir = require('xdg-basedir');
|
||||
|
||||
xdgBasedir.config;
|
||||
//=> '/home/sindresorhus/.config'
|
||||
```
|
||||
*/
|
||||
readonly config?: string;
|
||||
|
||||
/**
|
||||
Directory for user-specific non-essential data files.
|
||||
|
||||
@example
|
||||
```js
|
||||
import xdgBasedir = require('xdg-basedir');
|
||||
|
||||
xdgBasedir.cache;
|
||||
//=> '/home/sindresorhus/.cache'
|
||||
```
|
||||
*/
|
||||
readonly cache?: string;
|
||||
|
||||
/**
|
||||
Directory for user-specific non-essential runtime files and other file objects (such as sockets, named pipes, etc).
|
||||
|
||||
@example
|
||||
```js
|
||||
import xdgBasedir = require('xdg-basedir');
|
||||
|
||||
xdgBasedir.runtime;
|
||||
//=> '/run/user/sindresorhus'
|
||||
```
|
||||
*/
|
||||
readonly runtime?: string;
|
||||
|
||||
/**
|
||||
Preference-ordered array of base directories to search for data files in addition to `.data`.
|
||||
|
||||
@example
|
||||
```js
|
||||
import xdgBasedir = require('xdg-basedir');
|
||||
|
||||
xdgBasedir.dataDirs
|
||||
//=> ['/home/sindresorhus/.local/share', '/usr/local/share/', '/usr/share/']
|
||||
```
|
||||
*/
|
||||
readonly dataDirs: readonly string[];
|
||||
|
||||
/**
|
||||
Preference-ordered array of base directories to search for configuration files in addition to `.config`.
|
||||
|
||||
@example
|
||||
```js
|
||||
import xdgBasedir = require('xdg-basedir');
|
||||
|
||||
xdgBasedir.configDirs;
|
||||
//=> ['/home/sindresorhus/.config', '/etc/xdg']
|
||||
```
|
||||
*/
|
||||
readonly configDirs: readonly string[];
|
||||
};
|
||||
|
||||
export = xdgBasedir;
|
||||
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
require("rxjs-compat/add/operator/mergeAll");
|
||||
//# sourceMappingURL=mergeAll.js.map
|
||||
@@ -0,0 +1,19 @@
|
||||
/** PURE_IMPORTS_START _SubscriptionLog PURE_IMPORTS_END */
|
||||
import { SubscriptionLog } from './SubscriptionLog';
|
||||
var SubscriptionLoggable = /*@__PURE__*/ (function () {
|
||||
function SubscriptionLoggable() {
|
||||
this.subscriptions = [];
|
||||
}
|
||||
SubscriptionLoggable.prototype.logSubscribedFrame = function () {
|
||||
this.subscriptions.push(new SubscriptionLog(this.scheduler.now()));
|
||||
return this.subscriptions.length - 1;
|
||||
};
|
||||
SubscriptionLoggable.prototype.logUnsubscribedFrame = function (index) {
|
||||
var subscriptionLogs = this.subscriptions;
|
||||
var oldSubscriptionLog = subscriptionLogs[index];
|
||||
subscriptionLogs[index] = new SubscriptionLog(oldSubscriptionLog.subscribedFrame, this.scheduler.now());
|
||||
};
|
||||
return SubscriptionLoggable;
|
||||
}());
|
||||
export { SubscriptionLoggable };
|
||||
//# sourceMappingURL=SubscriptionLoggable.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"@octokit/request-error","version":"2.1.0","files":{"LICENSE":{"checkedAt":1678887829389,"integrity":"sha512-EHJOahlMp1lwtBt4Za3avDrfUOnQEDTeZ9T/SbhQwf90Vo/Mr5DW3QqyL+0w2phUaGj/PoEizqq/4IOQcYBr4w==","mode":420,"size":1081},"dist-src/types.js":{"checkedAt":1678887829276,"integrity":"sha512-TuHIj4w/TkzTTLbAAzm/nW0Db/St469J6HHMiWa4THKdi3VJKsxkE8mmZKwApXlYIjrBPEIp2oxi6+alPk94Pw==","mode":420,"size":11},"dist-src/index.js":{"checkedAt":1678887829485,"integrity":"sha512-w7cEsMReMxQU1J9kKxNZWg9b+Ftk7vXb6FYUYhpmuXf6nOPGPFF8nJe8ZmGi1ohJhBgOx4eqvmE+2+c66rKAwQ==","mode":420,"size":2530},"dist-node/index.js":{"checkedAt":1678887829481,"integrity":"sha512-PRlM2i/7XmiO4HSVimPJN1O8UJCzYHv3aOFAU8QmelVtFhwQHeEtPSutNMt9LOCHBtXJGyR9FEH+7OHzTs0DUg==","mode":420,"size":2577},"dist-web/index.js":{"checkedAt":1678887829485,"integrity":"sha512-R1E+CWZfvi6ATb5CkzPVeSvsPRfi2DY3asqg0hedQT6JSqdUSsv0obeXlWhxn1z5XC2KgjKm1exPyTjoDXu2xA==","mode":420,"size":2584},"package.json":{"checkedAt":1678887829481,"integrity":"sha512-oilK8gKXWNpQJE2mRxHGpYOIjHMi5QqY5QlPQ9ohhyq6Eh05/mz3NI5xtvKT63632yEm/dlInW4qfgnqKlBtMQ==","mode":420,"size":1136},"dist-web/index.js.map":{"checkedAt":1678887829489,"integrity":"sha512-smqNlqlt1FebTbqiv8votmzQUIdlCTOZ5dKhJsrrjmASbDEFLYQIWRkO7rRusphJFww1m/s2VJOUfV8svbotPg==","mode":420,"size":4511},"dist-node/index.js.map":{"checkedAt":1678887829485,"integrity":"sha512-WnMQDxz/VCc9XnkkIGWwjopkDRYgATLYwgjkdhWXao5U5wRXfAfTZOLFeeF0kVn9GHIS65kxyQM/TzquuCW26Q==","mode":420,"size":4702},"dist-types/index.d.ts":{"checkedAt":1678887829489,"integrity":"sha512-qzKZjOnhnlLDGogvC70a86T2nJrVyC9SCTmqS4WUNgM+MzgwZ6oy2FQFojxiloixldZuwEaIL1PzwE2Dp6yMQA==","mode":420,"size":917},"README.md":{"checkedAt":1678887829485,"integrity":"sha512-9r+1FFeyIUKixCWrOj2ZwBlfjVR8GDaQPfXzsSMYYVyygb0/RjZsu0bDuEp/ncomoh80QMGPxpoxRtfto5xLQw==","mode":420,"size":1554},"dist-types/types.d.ts":{"checkedAt":1678887829485,"integrity":"sha512-LfIaoENouyadJBP6MjICdjYzBCshV8nursx86R5OPgSDN49j9rUcffD4VrdSkOB8AhR1euvMyUmstohBHCZ3sg==","mode":420,"size":311}}}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"G A B BC","8":"J E F"},B:{"2":"C K L H M N O P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t"},C:{"2":"0 1 2 3 4 5 6 7 8 9 CC tB I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB DC EC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB","2":"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","130":"EB FB GB HB IB JB KB LB MB NB OB PB QB"},E:{"1":"I u J E F G A B C K L H zB HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","2":"GC"},F:{"1":"0 G B C H M N O v w x y z OC PC QC RC qB 9B SC rB","2":"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","130":"1 2 3 4 5 6 7 8 9 AB BB CB"},G:{"1":"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:{"258":"nC"},I:{"1":"tB I rC AC sC tC","2":"D oC pC qC"},J:{"1":"E A"},K:{"1":"A B C qB 9B rB","2":"e"},L:{"130":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"uC"},P:{"1":"I","130":"vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"2":"1B"},R:{"130":"8C"},S:{"2":"9C"}},B:2,C:"SVG fonts"};
|
||||
@@ -0,0 +1,322 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { Notification } from '../Notification';
|
||||
import { ColdObservable } from './ColdObservable';
|
||||
import { HotObservable } from './HotObservable';
|
||||
import { SubscriptionLog } from './SubscriptionLog';
|
||||
import { VirtualTimeScheduler, VirtualAction } from '../scheduler/VirtualTimeScheduler';
|
||||
import { AsyncScheduler } from '../scheduler/AsyncScheduler';
|
||||
const defaultMaxFrame = 750;
|
||||
export class TestScheduler extends VirtualTimeScheduler {
|
||||
constructor(assertDeepEqual) {
|
||||
super(VirtualAction, defaultMaxFrame);
|
||||
this.assertDeepEqual = assertDeepEqual;
|
||||
this.hotObservables = [];
|
||||
this.coldObservables = [];
|
||||
this.flushTests = [];
|
||||
this.runMode = false;
|
||||
}
|
||||
createTime(marbles) {
|
||||
const indexOf = marbles.indexOf('|');
|
||||
if (indexOf === -1) {
|
||||
throw new Error('marble diagram for time should have a completion marker "|"');
|
||||
}
|
||||
return indexOf * TestScheduler.frameTimeFactor;
|
||||
}
|
||||
createColdObservable(marbles, values, error) {
|
||||
if (marbles.indexOf('^') !== -1) {
|
||||
throw new Error('cold observable cannot have subscription offset "^"');
|
||||
}
|
||||
if (marbles.indexOf('!') !== -1) {
|
||||
throw new Error('cold observable cannot have unsubscription marker "!"');
|
||||
}
|
||||
const messages = TestScheduler.parseMarbles(marbles, values, error, undefined, this.runMode);
|
||||
const cold = new ColdObservable(messages, this);
|
||||
this.coldObservables.push(cold);
|
||||
return cold;
|
||||
}
|
||||
createHotObservable(marbles, values, error) {
|
||||
if (marbles.indexOf('!') !== -1) {
|
||||
throw new Error('hot observable cannot have unsubscription marker "!"');
|
||||
}
|
||||
const messages = TestScheduler.parseMarbles(marbles, values, error, undefined, this.runMode);
|
||||
const subject = new HotObservable(messages, this);
|
||||
this.hotObservables.push(subject);
|
||||
return subject;
|
||||
}
|
||||
materializeInnerObservable(observable, outerFrame) {
|
||||
const messages = [];
|
||||
observable.subscribe((value) => {
|
||||
messages.push({ frame: this.frame - outerFrame, notification: Notification.createNext(value) });
|
||||
}, (err) => {
|
||||
messages.push({ frame: this.frame - outerFrame, notification: Notification.createError(err) });
|
||||
}, () => {
|
||||
messages.push({ frame: this.frame - outerFrame, notification: Notification.createComplete() });
|
||||
});
|
||||
return messages;
|
||||
}
|
||||
expectObservable(observable, subscriptionMarbles = null) {
|
||||
const actual = [];
|
||||
const flushTest = { actual, ready: false };
|
||||
const subscriptionParsed = TestScheduler.parseMarblesAsSubscriptions(subscriptionMarbles, this.runMode);
|
||||
const subscriptionFrame = subscriptionParsed.subscribedFrame === Number.POSITIVE_INFINITY ?
|
||||
0 : subscriptionParsed.subscribedFrame;
|
||||
const unsubscriptionFrame = subscriptionParsed.unsubscribedFrame;
|
||||
let subscription;
|
||||
this.schedule(() => {
|
||||
subscription = observable.subscribe(x => {
|
||||
let value = x;
|
||||
if (x instanceof Observable) {
|
||||
value = this.materializeInnerObservable(value, this.frame);
|
||||
}
|
||||
actual.push({ frame: this.frame, notification: Notification.createNext(value) });
|
||||
}, (err) => {
|
||||
actual.push({ frame: this.frame, notification: Notification.createError(err) });
|
||||
}, () => {
|
||||
actual.push({ frame: this.frame, notification: Notification.createComplete() });
|
||||
});
|
||||
}, subscriptionFrame);
|
||||
if (unsubscriptionFrame !== Number.POSITIVE_INFINITY) {
|
||||
this.schedule(() => subscription.unsubscribe(), unsubscriptionFrame);
|
||||
}
|
||||
this.flushTests.push(flushTest);
|
||||
const { runMode } = this;
|
||||
return {
|
||||
toBe(marbles, values, errorValue) {
|
||||
flushTest.ready = true;
|
||||
flushTest.expected = TestScheduler.parseMarbles(marbles, values, errorValue, true, runMode);
|
||||
}
|
||||
};
|
||||
}
|
||||
expectSubscriptions(actualSubscriptionLogs) {
|
||||
const flushTest = { actual: actualSubscriptionLogs, ready: false };
|
||||
this.flushTests.push(flushTest);
|
||||
const { runMode } = this;
|
||||
return {
|
||||
toBe(marbles) {
|
||||
const marblesArray = (typeof marbles === 'string') ? [marbles] : marbles;
|
||||
flushTest.ready = true;
|
||||
flushTest.expected = marblesArray.map(marbles => TestScheduler.parseMarblesAsSubscriptions(marbles, runMode));
|
||||
}
|
||||
};
|
||||
}
|
||||
flush() {
|
||||
const hotObservables = this.hotObservables;
|
||||
while (hotObservables.length > 0) {
|
||||
hotObservables.shift().setup();
|
||||
}
|
||||
super.flush();
|
||||
this.flushTests = this.flushTests.filter(test => {
|
||||
if (test.ready) {
|
||||
this.assertDeepEqual(test.actual, test.expected);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
static parseMarblesAsSubscriptions(marbles, runMode = false) {
|
||||
if (typeof marbles !== 'string') {
|
||||
return new SubscriptionLog(Number.POSITIVE_INFINITY);
|
||||
}
|
||||
const len = marbles.length;
|
||||
let groupStart = -1;
|
||||
let subscriptionFrame = Number.POSITIVE_INFINITY;
|
||||
let unsubscriptionFrame = Number.POSITIVE_INFINITY;
|
||||
let frame = 0;
|
||||
for (let i = 0; i < len; i++) {
|
||||
let nextFrame = frame;
|
||||
const advanceFrameBy = (count) => {
|
||||
nextFrame += count * this.frameTimeFactor;
|
||||
};
|
||||
const c = marbles[i];
|
||||
switch (c) {
|
||||
case ' ':
|
||||
if (!runMode) {
|
||||
advanceFrameBy(1);
|
||||
}
|
||||
break;
|
||||
case '-':
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case '(':
|
||||
groupStart = frame;
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case ')':
|
||||
groupStart = -1;
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case '^':
|
||||
if (subscriptionFrame !== Number.POSITIVE_INFINITY) {
|
||||
throw new Error('found a second subscription point \'^\' in a ' +
|
||||
'subscription marble diagram. There can only be one.');
|
||||
}
|
||||
subscriptionFrame = groupStart > -1 ? groupStart : frame;
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case '!':
|
||||
if (unsubscriptionFrame !== Number.POSITIVE_INFINITY) {
|
||||
throw new Error('found a second subscription point \'^\' in a ' +
|
||||
'subscription marble diagram. There can only be one.');
|
||||
}
|
||||
unsubscriptionFrame = groupStart > -1 ? groupStart : frame;
|
||||
break;
|
||||
default:
|
||||
if (runMode && c.match(/^[0-9]$/)) {
|
||||
if (i === 0 || marbles[i - 1] === ' ') {
|
||||
const buffer = marbles.slice(i);
|
||||
const match = buffer.match(/^([0-9]+(?:\.[0-9]+)?)(ms|s|m) /);
|
||||
if (match) {
|
||||
i += match[0].length - 1;
|
||||
const duration = parseFloat(match[1]);
|
||||
const unit = match[2];
|
||||
let durationInMs;
|
||||
switch (unit) {
|
||||
case 'ms':
|
||||
durationInMs = duration;
|
||||
break;
|
||||
case 's':
|
||||
durationInMs = duration * 1000;
|
||||
break;
|
||||
case 'm':
|
||||
durationInMs = duration * 1000 * 60;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
advanceFrameBy(durationInMs / this.frameTimeFactor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new Error('there can only be \'^\' and \'!\' markers in a ' +
|
||||
'subscription marble diagram. Found instead \'' + c + '\'.');
|
||||
}
|
||||
frame = nextFrame;
|
||||
}
|
||||
if (unsubscriptionFrame < 0) {
|
||||
return new SubscriptionLog(subscriptionFrame);
|
||||
}
|
||||
else {
|
||||
return new SubscriptionLog(subscriptionFrame, unsubscriptionFrame);
|
||||
}
|
||||
}
|
||||
static parseMarbles(marbles, values, errorValue, materializeInnerObservables = false, runMode = false) {
|
||||
if (marbles.indexOf('!') !== -1) {
|
||||
throw new Error('conventional marble diagrams cannot have the ' +
|
||||
'unsubscription marker "!"');
|
||||
}
|
||||
const len = marbles.length;
|
||||
const testMessages = [];
|
||||
const subIndex = runMode ? marbles.replace(/^[ ]+/, '').indexOf('^') : marbles.indexOf('^');
|
||||
let frame = subIndex === -1 ? 0 : (subIndex * -this.frameTimeFactor);
|
||||
const getValue = typeof values !== 'object' ?
|
||||
(x) => x :
|
||||
(x) => {
|
||||
if (materializeInnerObservables && values[x] instanceof ColdObservable) {
|
||||
return values[x].messages;
|
||||
}
|
||||
return values[x];
|
||||
};
|
||||
let groupStart = -1;
|
||||
for (let i = 0; i < len; i++) {
|
||||
let nextFrame = frame;
|
||||
const advanceFrameBy = (count) => {
|
||||
nextFrame += count * this.frameTimeFactor;
|
||||
};
|
||||
let notification;
|
||||
const c = marbles[i];
|
||||
switch (c) {
|
||||
case ' ':
|
||||
if (!runMode) {
|
||||
advanceFrameBy(1);
|
||||
}
|
||||
break;
|
||||
case '-':
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case '(':
|
||||
groupStart = frame;
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case ')':
|
||||
groupStart = -1;
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case '|':
|
||||
notification = Notification.createComplete();
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case '^':
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
case '#':
|
||||
notification = Notification.createError(errorValue || 'error');
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
default:
|
||||
if (runMode && c.match(/^[0-9]$/)) {
|
||||
if (i === 0 || marbles[i - 1] === ' ') {
|
||||
const buffer = marbles.slice(i);
|
||||
const match = buffer.match(/^([0-9]+(?:\.[0-9]+)?)(ms|s|m) /);
|
||||
if (match) {
|
||||
i += match[0].length - 1;
|
||||
const duration = parseFloat(match[1]);
|
||||
const unit = match[2];
|
||||
let durationInMs;
|
||||
switch (unit) {
|
||||
case 'ms':
|
||||
durationInMs = duration;
|
||||
break;
|
||||
case 's':
|
||||
durationInMs = duration * 1000;
|
||||
break;
|
||||
case 'm':
|
||||
durationInMs = duration * 1000 * 60;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
advanceFrameBy(durationInMs / this.frameTimeFactor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
notification = Notification.createNext(getValue(c));
|
||||
advanceFrameBy(1);
|
||||
break;
|
||||
}
|
||||
if (notification) {
|
||||
testMessages.push({ frame: groupStart > -1 ? groupStart : frame, notification });
|
||||
}
|
||||
frame = nextFrame;
|
||||
}
|
||||
return testMessages;
|
||||
}
|
||||
run(callback) {
|
||||
const prevFrameTimeFactor = TestScheduler.frameTimeFactor;
|
||||
const prevMaxFrames = this.maxFrames;
|
||||
TestScheduler.frameTimeFactor = 1;
|
||||
this.maxFrames = Number.POSITIVE_INFINITY;
|
||||
this.runMode = true;
|
||||
AsyncScheduler.delegate = this;
|
||||
const helpers = {
|
||||
cold: this.createColdObservable.bind(this),
|
||||
hot: this.createHotObservable.bind(this),
|
||||
flush: this.flush.bind(this),
|
||||
expectObservable: this.expectObservable.bind(this),
|
||||
expectSubscriptions: this.expectSubscriptions.bind(this),
|
||||
};
|
||||
try {
|
||||
const ret = callback(helpers);
|
||||
this.flush();
|
||||
return ret;
|
||||
}
|
||||
finally {
|
||||
TestScheduler.frameTimeFactor = prevFrameTimeFactor;
|
||||
this.maxFrames = prevMaxFrames;
|
||||
this.runMode = false;
|
||||
AsyncScheduler.delegate = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=TestScheduler.js.map
|
||||
@@ -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/mergeAll"));
|
||||
//# sourceMappingURL=mergeAll.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"bl","version":"4.1.0","files":{"bl.js":{"checkedAt":1678887830560,"integrity":"sha512-3s1Fs2xGPziSUcVpDdPPi4ylgKC6000rxeScBGNMzLIVaulSUJBmGYL9/lgDG9pcBczVoL29IU1rU8/FfQ1DMg==","mode":420,"size":2043},"BufferList.js":{"checkedAt":1678887830560,"integrity":"sha512-H6/P8Dtt4AN152MgZkuzRkqTGurlywHTeJ9BMtw8QlyxcCJMqnxWbKf3qlbQG+HBw7DeejWM6waY0uLe7mzqOg==","mode":420,"size":9524},"test/convert.js":{"checkedAt":1678887830561,"integrity":"sha512-lDTbAdUquZEowjqMTb2G8FA/DNsdKebOJ5OMBBIULIMceWJ6b9Dr/WXe2uOkrG75vGY1NevvTAHkN8VGVd0snQ==","mode":420,"size":609},"test/indexOf.js":{"checkedAt":1678887830566,"integrity":"sha512-HIOOSI47yZ2H0arX0wElNmTWFZ4i70ejYuoqkTujK/bMgdDGpzOOk/7nvsu/ZCTJhlsdZSgCL4Xlb+zlj/kIYg==","mode":420,"size":15130},"test/isBufferList.js":{"checkedAt":1678887830566,"integrity":"sha512-a2tp7ligq4roe2Hpw+mLlvr991tAsqqaiEApg5+DQVKE14H6J4JSAJVLT0zPZ7QaJREIimJDJpjBcD8p45utlg==","mode":420,"size":564},"test/test.js":{"checkedAt":1678887830571,"integrity":"sha512-c12Qc+vEcHQGAfokjhW1NIXk7BMf0Y4DnRCQPlvWrNxY+Dp1zNrNw8WaZbQqITVvDQ0zSHDwaAeNjB2pv5CzGw==","mode":420,"size":21519},"LICENSE.md":{"checkedAt":1678887830582,"integrity":"sha512-4k1Ez9IFxeaCHnA/0exgoZCID06ta7JqvYaGu2bNSC3MlU5/n1hKSQi5nZws461OknTsdvKPQ9XgWFa4PAC7CA==","mode":420,"size":1216},"package.json":{"checkedAt":1678887830571,"integrity":"sha512-r9wXkw6y3d2fWRADdCVm8gViGJos4QuzxiZeya8YNWAwLr+aW0/+nkfHfINmkHJOEAHqNN7C9N0M/hCy7hzjpA==","mode":420,"size":964},"README.md":{"checkedAt":1678887830585,"integrity":"sha512-xaRLDjQcNvHuaebhxNOd/IZ8hUg1LzqEwvIOKvIhIsUjGT6l3PS03AamNctRgjbkbCVx4OqecGAVBsU3LGotDQ==","mode":420,"size":12657},".travis.yml":{"checkedAt":1678887830582,"integrity":"sha512-2UzCOKWlO4wy4Gw99paWNDlP/FUEjh/75JsZU0Ran8KUG0xnVUwA6IhgSEPV7dRGK/kFrs5jb8ADehjbu/RIiw==","mode":420,"size":201}}}
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/util/isObject';
|
||||
@@ -0,0 +1 @@
|
||||
import 'rxjs-compat/add/observable/if';
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"onErrorResumeNext.js","sources":["../../../src/internal/operators/onErrorResumeNext.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM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AC,AAPD,IAOC;AAED;IAAgD,uDAA2B;IACzE,qCAAsB,WAA0B,EAC5B,WAAwC;QAD5D,YAEE,kBAAM,WAAW,CAAC,SACnB;QAHqB,iBAAW,GAAX,WAAW,CAAe;QAC5B,iBAAW,GAAX,WAAW,CAA6B;;IAE5D,CAAC;IAED,iDAAW,GAAX;QACE,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAC/B,CAAC;IAED,oDAAc,GAAd;QACE,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAC/B,CAAC;IAES,4CAAM,GAAhB,UAAiB,GAAQ;QACvB,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7B,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAES,+CAAS,GAAnB;QACE,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7B,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAEO,2DAAqB,GAA7B;QACE,IAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACtC,IAAI,CAAC,CAAC,IAAI,EAAE;YACV,IAAM,eAAe,GAAG,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC;YACxD,IAAM,WAAW,GAAG,IAAI,CAAC,WAA2B,CAAC;YACrD,WAAW,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;YACjC,IAAM,iBAAiB,GAAG,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;YAIhE,IAAI,iBAAiB,KAAK,eAAe,EAAE;gBACzC,WAAW,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;aACpC;SACF;aAAM;YACL,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;SAC7B;IACH,CAAC;IACH,kCAAC;AAAD,CAAC,AAzCD,CAAgD,qBAAqB,GAyCpE"}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { MonoTypeOperatorFunction } from '../types';
|
||||
/**
|
||||
* Returns an Observable that skips the first `count` items emitted by the source Observable.
|
||||
*
|
||||
* 
|
||||
*
|
||||
* @param {Number} count - The number of times, items emitted by source Observable should be skipped.
|
||||
* @return {Observable} An Observable that skips values emitted by the source Observable.
|
||||
*
|
||||
* @method skip
|
||||
* @owner Observable
|
||||
*/
|
||||
export declare function skip<T>(count: number): MonoTypeOperatorFunction<T>;
|
||||
@@ -0,0 +1,102 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
}
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Subscriber_1 = require("../Subscriber");
|
||||
function bufferCount(bufferSize, startBufferEvery) {
|
||||
if (startBufferEvery === void 0) { startBufferEvery = null; }
|
||||
return function bufferCountOperatorFunction(source) {
|
||||
return source.lift(new BufferCountOperator(bufferSize, startBufferEvery));
|
||||
};
|
||||
}
|
||||
exports.bufferCount = bufferCount;
|
||||
var BufferCountOperator = (function () {
|
||||
function BufferCountOperator(bufferSize, startBufferEvery) {
|
||||
this.bufferSize = bufferSize;
|
||||
this.startBufferEvery = startBufferEvery;
|
||||
if (!startBufferEvery || bufferSize === startBufferEvery) {
|
||||
this.subscriberClass = BufferCountSubscriber;
|
||||
}
|
||||
else {
|
||||
this.subscriberClass = BufferSkipCountSubscriber;
|
||||
}
|
||||
}
|
||||
BufferCountOperator.prototype.call = function (subscriber, source) {
|
||||
return source.subscribe(new this.subscriberClass(subscriber, this.bufferSize, this.startBufferEvery));
|
||||
};
|
||||
return BufferCountOperator;
|
||||
}());
|
||||
var BufferCountSubscriber = (function (_super) {
|
||||
__extends(BufferCountSubscriber, _super);
|
||||
function BufferCountSubscriber(destination, bufferSize) {
|
||||
var _this = _super.call(this, destination) || this;
|
||||
_this.bufferSize = bufferSize;
|
||||
_this.buffer = [];
|
||||
return _this;
|
||||
}
|
||||
BufferCountSubscriber.prototype._next = function (value) {
|
||||
var buffer = this.buffer;
|
||||
buffer.push(value);
|
||||
if (buffer.length == this.bufferSize) {
|
||||
this.destination.next(buffer);
|
||||
this.buffer = [];
|
||||
}
|
||||
};
|
||||
BufferCountSubscriber.prototype._complete = function () {
|
||||
var buffer = this.buffer;
|
||||
if (buffer.length > 0) {
|
||||
this.destination.next(buffer);
|
||||
}
|
||||
_super.prototype._complete.call(this);
|
||||
};
|
||||
return BufferCountSubscriber;
|
||||
}(Subscriber_1.Subscriber));
|
||||
var BufferSkipCountSubscriber = (function (_super) {
|
||||
__extends(BufferSkipCountSubscriber, _super);
|
||||
function BufferSkipCountSubscriber(destination, bufferSize, startBufferEvery) {
|
||||
var _this = _super.call(this, destination) || this;
|
||||
_this.bufferSize = bufferSize;
|
||||
_this.startBufferEvery = startBufferEvery;
|
||||
_this.buffers = [];
|
||||
_this.count = 0;
|
||||
return _this;
|
||||
}
|
||||
BufferSkipCountSubscriber.prototype._next = function (value) {
|
||||
var _a = this, bufferSize = _a.bufferSize, startBufferEvery = _a.startBufferEvery, buffers = _a.buffers, count = _a.count;
|
||||
this.count++;
|
||||
if (count % startBufferEvery === 0) {
|
||||
buffers.push([]);
|
||||
}
|
||||
for (var i = buffers.length; i--;) {
|
||||
var buffer = buffers[i];
|
||||
buffer.push(value);
|
||||
if (buffer.length === bufferSize) {
|
||||
buffers.splice(i, 1);
|
||||
this.destination.next(buffer);
|
||||
}
|
||||
}
|
||||
};
|
||||
BufferSkipCountSubscriber.prototype._complete = function () {
|
||||
var _a = this, buffers = _a.buffers, destination = _a.destination;
|
||||
while (buffers.length > 0) {
|
||||
var buffer = buffers.shift();
|
||||
if (buffer.length > 0) {
|
||||
destination.next(buffer);
|
||||
}
|
||||
}
|
||||
_super.prototype._complete.call(this);
|
||||
};
|
||||
return BufferSkipCountSubscriber;
|
||||
}(Subscriber_1.Subscriber));
|
||||
//# sourceMappingURL=bufferCount.js.map
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"name": "@octokit/plugin-rest-endpoint-methods",
|
||||
"description": "Octokit plugin adding one method for all of api.github.com REST API endpoints",
|
||||
"version": "5.0.0",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"dist-*/",
|
||||
"bin/"
|
||||
],
|
||||
"pika": true,
|
||||
"sideEffects": false,
|
||||
"keywords": [
|
||||
"github",
|
||||
"api",
|
||||
"sdk",
|
||||
"toolkit"
|
||||
],
|
||||
"repository": "github:octokit/plugin-rest-endpoint-methods.js",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^6.13.0",
|
||||
"deprecation": "^2.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@octokit/core": ">=3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gimenete/type-writer": "^0.1.5",
|
||||
"@octokit/core": "^3.0.0",
|
||||
"@octokit/graphql": "^4.3.1",
|
||||
"@pika/pack": "^0.5.0",
|
||||
"@pika/plugin-build-node": "^0.9.0",
|
||||
"@pika/plugin-build-web": "^0.9.0",
|
||||
"@pika/plugin-ts-standard-pkg": "^0.9.0",
|
||||
"@types/fetch-mock": "^7.3.1",
|
||||
"@types/jest": "^26.0.0",
|
||||
"@types/node": "^14.0.4",
|
||||
"fetch-mock": "^9.0.0",
|
||||
"fs-extra": "^9.0.0",
|
||||
"jest": "^26.1.0",
|
||||
"lodash.camelcase": "^4.3.0",
|
||||
"lodash.set": "^4.3.2",
|
||||
"lodash.upperfirst": "^4.3.1",
|
||||
"mustache": "^4.0.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.0.1",
|
||||
"semantic-release": "^17.0.0",
|
||||
"semantic-release-plugin-update-version-in-files": "^1.0.0",
|
||||
"sort-keys": "^4.0.0",
|
||||
"string-to-jsdoc-comment": "^1.0.0",
|
||||
"ts-jest": "^26.1.3",
|
||||
"typescript": "^4.0.2"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"source": "dist-src/index.js",
|
||||
"types": "dist-types/index.d.ts",
|
||||
"main": "dist-node/index.js",
|
||||
"module": "dist-web/index.js"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"repeat.js","sources":["../src/operators/repeat.ts"],"names":[],"mappings":";;;;;AAAA,kDAA6C"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"skipWhile.js","sources":["../../src/internal/operators/skipWhile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,4CAA2C;AAe3C,SAAgB,SAAS,CAAI,SAA+C;IAC1E,OAAO,UAAC,MAAqB,IAAK,OAAA,MAAM,CAAC,IAAI,CAAC,IAAI,iBAAiB,CAAC,SAAS,CAAC,CAAC,EAA7C,CAA6C,CAAC;AAClF,CAAC;AAFD,8BAEC;AAED;IACE,2BAAoB,SAA+C;QAA/C,cAAS,GAAT,SAAS,CAAsC;IACnE,CAAC;IAED,gCAAI,GAAJ,UAAK,UAAyB,EAAE,MAAW;QACzC,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAC/E,CAAC;IACH,wBAAC;AAAD,CAAC,AAPD,IAOC;AAOD;IAAqC,uCAAa;IAIhD,6BAAY,WAA0B,EAClB,SAA+C;QADnE,YAEE,kBAAM,WAAW,CAAC,SACnB;QAFmB,eAAS,GAAT,SAAS,CAAsC;QAJ3D,cAAQ,GAAY,IAAI,CAAC;QACzB,WAAK,GAAW,CAAC,CAAC;;IAK1B,CAAC;IAES,mCAAK,GAAf,UAAgB,KAAQ;QACtB,IAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACrC,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;SAC9B;QAED,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACzB;IACH,CAAC;IAEO,8CAAgB,GAAxB,UAAyB,KAAQ;QAC/B,IAAI;YACF,IAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;YACnD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;SACjC;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SAC7B;IACH,CAAC;IACH,0BAAC;AAAD,CAAC,AA5BD,CAAqC,uBAAU,GA4B9C"}
|
||||
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isBase32;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var base32 = /^[A-Z2-7]+=*$/;
|
||||
|
||||
function isBase32(str) {
|
||||
(0, _assertString.default)(str);
|
||||
var len = str.length;
|
||||
|
||||
if (len % 8 === 0 && base32.test(str)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
||||
module.exports.default = exports.default;
|
||||
@@ -0,0 +1,3 @@
|
||||
import { ObservableInput, OperatorFunction } from '../types';
|
||||
export declare function exhaust<T>(): OperatorFunction<ObservableInput<T>, T>;
|
||||
export declare function exhaust<R>(): OperatorFunction<any, R>;
|
||||
@@ -0,0 +1,909 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var qs = require('../');
|
||||
var utils = require('../lib/utils');
|
||||
var iconv = require('iconv-lite');
|
||||
var SaferBuffer = require('safer-buffer').Buffer;
|
||||
var hasSymbols = require('has-symbols');
|
||||
var hasBigInt = typeof BigInt === 'function';
|
||||
|
||||
test('stringify()', function (t) {
|
||||
t.test('stringifies a querystring object', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b' }), 'a=b');
|
||||
st.equal(qs.stringify({ a: 1 }), 'a=1');
|
||||
st.equal(qs.stringify({ a: 1, b: 2 }), 'a=1&b=2');
|
||||
st.equal(qs.stringify({ a: 'A_Z' }), 'a=A_Z');
|
||||
st.equal(qs.stringify({ a: '€' }), 'a=%E2%82%AC');
|
||||
st.equal(qs.stringify({ a: '' }), 'a=%EE%80%80');
|
||||
st.equal(qs.stringify({ a: 'א' }), 'a=%D7%90');
|
||||
st.equal(qs.stringify({ a: '𐐷' }), 'a=%F0%90%90%B7');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies falsy values', function (st) {
|
||||
st.equal(qs.stringify(undefined), '');
|
||||
st.equal(qs.stringify(null), '');
|
||||
st.equal(qs.stringify(null, { strictNullHandling: true }), '');
|
||||
st.equal(qs.stringify(false), '');
|
||||
st.equal(qs.stringify(0), '');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies symbols', { skip: !hasSymbols() }, function (st) {
|
||||
st.equal(qs.stringify(Symbol.iterator), '');
|
||||
st.equal(qs.stringify([Symbol.iterator]), '0=Symbol%28Symbol.iterator%29');
|
||||
st.equal(qs.stringify({ a: Symbol.iterator }), 'a=Symbol%28Symbol.iterator%29');
|
||||
st.equal(
|
||||
qs.stringify({ a: [Symbol.iterator] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }),
|
||||
'a[]=Symbol%28Symbol.iterator%29'
|
||||
);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies bigints', { skip: !hasBigInt }, function (st) {
|
||||
var three = BigInt(3);
|
||||
var encodeWithN = function (value, defaultEncoder, charset) {
|
||||
var result = defaultEncoder(value, defaultEncoder, charset);
|
||||
return typeof value === 'bigint' ? result + 'n' : result;
|
||||
};
|
||||
st.equal(qs.stringify(three), '');
|
||||
st.equal(qs.stringify([three]), '0=3');
|
||||
st.equal(qs.stringify([three], { encoder: encodeWithN }), '0=3n');
|
||||
st.equal(qs.stringify({ a: three }), 'a=3');
|
||||
st.equal(qs.stringify({ a: three }, { encoder: encodeWithN }), 'a=3n');
|
||||
st.equal(
|
||||
qs.stringify({ a: [three] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }),
|
||||
'a[]=3'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify({ a: [three] }, { encodeValuesOnly: true, encoder: encodeWithN, arrayFormat: 'brackets' }),
|
||||
'a[]=3n'
|
||||
);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('adds query prefix', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('with query prefix, outputs blank string given an empty object', function (st) {
|
||||
st.equal(qs.stringify({}, { addQueryPrefix: true }), '');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies nested falsy values', function (st) {
|
||||
st.equal(qs.stringify({ a: { b: { c: null } } }), 'a%5Bb%5D%5Bc%5D=');
|
||||
st.equal(qs.stringify({ a: { b: { c: null } } }, { strictNullHandling: true }), 'a%5Bb%5D%5Bc%5D');
|
||||
st.equal(qs.stringify({ a: { b: { c: false } } }), 'a%5Bb%5D%5Bc%5D=false');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies a nested object', function (st) {
|
||||
st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');
|
||||
st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies a nested object with dots notation', function (st) {
|
||||
st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c');
|
||||
st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies an array value', function (st) {
|
||||
st.equal(
|
||||
qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' }),
|
||||
'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d',
|
||||
'indices => indices'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' }),
|
||||
'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d',
|
||||
'brackets => brackets'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma' }),
|
||||
'a=b%2Cc%2Cd',
|
||||
'comma => comma'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify({ a: ['b', 'c', 'd'] }),
|
||||
'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d',
|
||||
'default => indices'
|
||||
);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('omits nulls when asked', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b', c: null }, { skipNulls: true }), 'a=b');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('omits nested nulls when asked', function (st) {
|
||||
st.equal(qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), 'a%5Bb%5D=c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('omits array indices when asked', function (st) {
|
||||
st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies an array value with one item vs multiple items', function (st) {
|
||||
st.test('non-array item', function (s2t) {
|
||||
s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=c');
|
||||
s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=c');
|
||||
s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c');
|
||||
s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true }), 'a=c');
|
||||
|
||||
s2t.end();
|
||||
});
|
||||
|
||||
st.test('array with a single item', function (s2t) {
|
||||
s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c');
|
||||
s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c');
|
||||
s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c');
|
||||
s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a[]=c'); // so it parses back as an array
|
||||
s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true }), 'a[0]=c');
|
||||
|
||||
s2t.end();
|
||||
});
|
||||
|
||||
st.test('array with multiple items', function (s2t) {
|
||||
s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c&a[1]=d');
|
||||
s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c&a[]=d');
|
||||
s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c,d');
|
||||
s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true }), 'a[0]=c&a[1]=d');
|
||||
|
||||
s2t.end();
|
||||
});
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies a nested array value', function (st) {
|
||||
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[b][0]=c&a[b][1]=d');
|
||||
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[b][]=c&a[b][]=d');
|
||||
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a[b]=c,d');
|
||||
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true }), 'a[b][0]=c&a[b][1]=d');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies a nested array value with dots notation', function (st) {
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: { b: ['c', 'd'] } },
|
||||
{ allowDots: true, encodeValuesOnly: true, arrayFormat: 'indices' }
|
||||
),
|
||||
'a.b[0]=c&a.b[1]=d',
|
||||
'indices: stringifies with dots + indices'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: { b: ['c', 'd'] } },
|
||||
{ allowDots: true, encodeValuesOnly: true, arrayFormat: 'brackets' }
|
||||
),
|
||||
'a.b[]=c&a.b[]=d',
|
||||
'brackets: stringifies with dots + brackets'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: { b: ['c', 'd'] } },
|
||||
{ allowDots: true, encodeValuesOnly: true, arrayFormat: 'comma' }
|
||||
),
|
||||
'a.b=c,d',
|
||||
'comma: stringifies with dots + comma'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: { b: ['c', 'd'] } },
|
||||
{ allowDots: true, encodeValuesOnly: true }
|
||||
),
|
||||
'a.b[0]=c&a.b[1]=d',
|
||||
'default: stringifies with dots + indices'
|
||||
);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies an object inside an array', function (st) {
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices' }),
|
||||
'a%5B0%5D%5Bb%5D=c', // a[0][b]=c
|
||||
'indices => brackets'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets' }),
|
||||
'a%5B%5D%5Bb%5D=c', // a[][b]=c
|
||||
'brackets => brackets'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: 'c' }] }),
|
||||
'a%5B0%5D%5Bb%5D=c',
|
||||
'default => indices'
|
||||
);
|
||||
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices' }),
|
||||
'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1',
|
||||
'indices => indices'
|
||||
);
|
||||
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets' }),
|
||||
'a%5B%5D%5Bb%5D%5Bc%5D%5B%5D=1',
|
||||
'brackets => brackets'
|
||||
);
|
||||
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: { c: [1] } }] }),
|
||||
'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1',
|
||||
'default => indices'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies an array with mixed objects and primitives', function (st) {
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'indices' }),
|
||||
'a[0][b]=1&a[1]=2&a[2]=3',
|
||||
'indices => indices'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }),
|
||||
'a[][b]=1&a[]=2&a[]=3',
|
||||
'brackets => brackets'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'comma' }),
|
||||
'???',
|
||||
'brackets => brackets',
|
||||
{ skip: 'TODO: figure out what this should do' }
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true }),
|
||||
'a[0][b]=1&a[1]=2&a[2]=3',
|
||||
'default => indices'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies an object inside an array with dots notation', function (st) {
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: [{ b: 'c' }] },
|
||||
{ allowDots: true, encode: false, arrayFormat: 'indices' }
|
||||
),
|
||||
'a[0].b=c',
|
||||
'indices => indices'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: [{ b: 'c' }] },
|
||||
{ allowDots: true, encode: false, arrayFormat: 'brackets' }
|
||||
),
|
||||
'a[].b=c',
|
||||
'brackets => brackets'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: [{ b: 'c' }] },
|
||||
{ allowDots: true, encode: false }
|
||||
),
|
||||
'a[0].b=c',
|
||||
'default => indices'
|
||||
);
|
||||
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: [{ b: { c: [1] } }] },
|
||||
{ allowDots: true, encode: false, arrayFormat: 'indices' }
|
||||
),
|
||||
'a[0].b.c[0]=1',
|
||||
'indices => indices'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: [{ b: { c: [1] } }] },
|
||||
{ allowDots: true, encode: false, arrayFormat: 'brackets' }
|
||||
),
|
||||
'a[].b.c[]=1',
|
||||
'brackets => brackets'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: [{ b: { c: [1] } }] },
|
||||
{ allowDots: true, encode: false }
|
||||
),
|
||||
'a[0].b.c[0]=1',
|
||||
'default => indices'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('does not omit object keys when indices = false', function (st) {
|
||||
st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('uses indices notation for arrays when indices=true', function (st) {
|
||||
st.equal(qs.stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('uses indices notation for arrays when no arrayFormat is specified', function (st) {
|
||||
st.equal(qs.stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('uses indices notation for arrays when no arrayFormat=indices', function (st) {
|
||||
st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('uses repeat notation for arrays when no arrayFormat=repeat', function (st) {
|
||||
st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('uses brackets notation for arrays when no arrayFormat=brackets', function (st) {
|
||||
st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies a complicated object', function (st) {
|
||||
st.equal(qs.stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies an empty value', function (st) {
|
||||
st.equal(qs.stringify({ a: '' }), 'a=');
|
||||
st.equal(qs.stringify({ a: null }, { strictNullHandling: true }), 'a');
|
||||
|
||||
st.equal(qs.stringify({ a: '', b: '' }), 'a=&b=');
|
||||
st.equal(qs.stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b=');
|
||||
|
||||
st.equal(qs.stringify({ a: { b: '' } }), 'a%5Bb%5D=');
|
||||
st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D');
|
||||
st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D=');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies an empty array in different arrayFormat', function (st) {
|
||||
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false }), 'b[0]=&c=c');
|
||||
// arrayFormat default
|
||||
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices' }), 'b[0]=&c=c');
|
||||
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets' }), 'b[]=&c=c');
|
||||
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat' }), 'b=&c=c');
|
||||
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma' }), 'b=&c=c');
|
||||
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', commaRoundTrip: true }), 'b[]=&c=c');
|
||||
// with strictNullHandling
|
||||
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', strictNullHandling: true }), 'b[0]&c=c');
|
||||
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', strictNullHandling: true }), 'b[]&c=c');
|
||||
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', strictNullHandling: true }), 'b&c=c');
|
||||
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true }), 'b&c=c');
|
||||
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true, commaRoundTrip: true }), 'b[]&c=c');
|
||||
// with skipNulls
|
||||
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', skipNulls: true }), 'c=c');
|
||||
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', skipNulls: true }), 'c=c');
|
||||
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', skipNulls: true }), 'c=c');
|
||||
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', skipNulls: true }), 'c=c');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies a null object', { skip: !Object.create }, function (st) {
|
||||
var obj = Object.create(null);
|
||||
obj.a = 'b';
|
||||
st.equal(qs.stringify(obj), 'a=b');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('returns an empty string for invalid input', function (st) {
|
||||
st.equal(qs.stringify(undefined), '');
|
||||
st.equal(qs.stringify(false), '');
|
||||
st.equal(qs.stringify(null), '');
|
||||
st.equal(qs.stringify(''), '');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies an object with a null object as a child', { skip: !Object.create }, function (st) {
|
||||
var obj = { a: Object.create(null) };
|
||||
|
||||
obj.a.b = 'c';
|
||||
st.equal(qs.stringify(obj), 'a%5Bb%5D=c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('drops keys with a value of undefined', function (st) {
|
||||
st.equal(qs.stringify({ a: undefined }), '');
|
||||
|
||||
st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), 'a%5Bc%5D');
|
||||
st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), 'a%5Bc%5D=');
|
||||
st.equal(qs.stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D=');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('url encodes values', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies a date', function (st) {
|
||||
var now = new Date();
|
||||
var str = 'a=' + encodeURIComponent(now.toISOString());
|
||||
st.equal(qs.stringify({ a: now }), str);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies the weird object from qs', function (st) {
|
||||
st.equal(qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('skips properties that are part of the object prototype', function (st) {
|
||||
Object.prototype.crash = 'test';
|
||||
st.equal(qs.stringify({ a: 'b' }), 'a=b');
|
||||
st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');
|
||||
delete Object.prototype.crash;
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies boolean values', function (st) {
|
||||
st.equal(qs.stringify({ a: true }), 'a=true');
|
||||
st.equal(qs.stringify({ a: { b: true } }), 'a%5Bb%5D=true');
|
||||
st.equal(qs.stringify({ b: false }), 'b=false');
|
||||
st.equal(qs.stringify({ b: { c: false } }), 'b%5Bc%5D=false');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies buffer values', function (st) {
|
||||
st.equal(qs.stringify({ a: SaferBuffer.from('test') }), 'a=test');
|
||||
st.equal(qs.stringify({ a: { b: SaferBuffer.from('test') } }), 'a%5Bb%5D=test');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies an object using an alternative delimiter', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('does not blow up when Buffer global is missing', function (st) {
|
||||
var tempBuffer = global.Buffer;
|
||||
delete global.Buffer;
|
||||
var result = qs.stringify({ a: 'b', c: 'd' });
|
||||
global.Buffer = tempBuffer;
|
||||
st.equal(result, 'a=b&c=d');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('does not crash when parsing circular references', function (st) {
|
||||
var a = {};
|
||||
a.b = a;
|
||||
|
||||
st['throws'](
|
||||
function () { qs.stringify({ 'foo[bar]': 'baz', 'foo[baz]': a }); },
|
||||
/RangeError: Cyclic object value/,
|
||||
'cyclic values throw'
|
||||
);
|
||||
|
||||
var circular = {
|
||||
a: 'value'
|
||||
};
|
||||
circular.a = circular;
|
||||
st['throws'](
|
||||
function () { qs.stringify(circular); },
|
||||
/RangeError: Cyclic object value/,
|
||||
'cyclic values throw'
|
||||
);
|
||||
|
||||
var arr = ['a'];
|
||||
st.doesNotThrow(
|
||||
function () { qs.stringify({ x: arr, y: arr }); },
|
||||
'non-cyclic values do not throw'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('non-circular duplicated references can still work', function (st) {
|
||||
var hourOfDay = {
|
||||
'function': 'hour_of_day'
|
||||
};
|
||||
|
||||
var p1 = {
|
||||
'function': 'gte',
|
||||
arguments: [hourOfDay, 0]
|
||||
};
|
||||
var p2 = {
|
||||
'function': 'lte',
|
||||
arguments: [hourOfDay, 23]
|
||||
};
|
||||
|
||||
st.equal(
|
||||
qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true }),
|
||||
'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('selects properties when filter=array', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b');
|
||||
st.equal(qs.stringify({ a: 1 }, { filter: [] }), '');
|
||||
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' },
|
||||
{ filter: ['a', 'b', 0, 2], arrayFormat: 'indices' }
|
||||
),
|
||||
'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3',
|
||||
'indices => indices'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' },
|
||||
{ filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' }
|
||||
),
|
||||
'a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3',
|
||||
'brackets => brackets'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' },
|
||||
{ filter: ['a', 'b', 0, 2] }
|
||||
),
|
||||
'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3',
|
||||
'default => indices'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('supports custom representations when filter=function', function (st) {
|
||||
var calls = 0;
|
||||
var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } };
|
||||
var filterFunc = function (prefix, value) {
|
||||
calls += 1;
|
||||
if (calls === 1) {
|
||||
st.equal(prefix, '', 'prefix is empty');
|
||||
st.equal(value, obj);
|
||||
} else if (prefix === 'c') {
|
||||
return void 0;
|
||||
} else if (value instanceof Date) {
|
||||
st.equal(prefix, 'e[f]');
|
||||
return value.getTime();
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
st.equal(qs.stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000');
|
||||
st.equal(calls, 5);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('can disable uri encoding', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b');
|
||||
st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c');
|
||||
st.equal(qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), 'a=b&c');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('can sort the keys', function (st) {
|
||||
var sort = function (a, b) {
|
||||
return a.localeCompare(b);
|
||||
};
|
||||
st.equal(qs.stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y');
|
||||
st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('can sort the keys at depth 3 or more too', function (st) {
|
||||
var sort = function (a, b) {
|
||||
return a.localeCompare(b);
|
||||
};
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' },
|
||||
{ sort: sort, encode: false }
|
||||
),
|
||||
'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' },
|
||||
{ sort: null, encode: false }
|
||||
),
|
||||
'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b'
|
||||
);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('can stringify with custom encoding', function (st) {
|
||||
st.equal(qs.stringify({ 県: '大阪府', '': '' }, {
|
||||
encoder: function (str) {
|
||||
if (str.length === 0) {
|
||||
return '';
|
||||
}
|
||||
var buf = iconv.encode(str, 'shiftjis');
|
||||
var result = [];
|
||||
for (var i = 0; i < buf.length; ++i) {
|
||||
result.push(buf.readUInt8(i).toString(16));
|
||||
}
|
||||
return '%' + result.join('%');
|
||||
}
|
||||
}), '%8c%a7=%91%e5%8d%e3%95%7b&=');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('receives the default encoder as a second argument', function (st) {
|
||||
st.plan(2);
|
||||
qs.stringify({ a: 1 }, {
|
||||
encoder: function (str, defaultEncoder) {
|
||||
st.equal(defaultEncoder, utils.encode);
|
||||
}
|
||||
});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('throws error with wrong encoder', function (st) {
|
||||
st['throws'](function () {
|
||||
qs.stringify({}, { encoder: 'string' });
|
||||
}, new TypeError('Encoder has to be a function.'));
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('can use custom encoder for a buffer object', { skip: typeof Buffer === 'undefined' }, function (st) {
|
||||
st.equal(qs.stringify({ a: SaferBuffer.from([1]) }, {
|
||||
encoder: function (buffer) {
|
||||
if (typeof buffer === 'string') {
|
||||
return buffer;
|
||||
}
|
||||
return String.fromCharCode(buffer.readUInt8(0) + 97);
|
||||
}
|
||||
}), 'a=b');
|
||||
|
||||
st.equal(qs.stringify({ a: SaferBuffer.from('a b') }, {
|
||||
encoder: function (buffer) {
|
||||
return buffer;
|
||||
}
|
||||
}), 'a=a b');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('serializeDate option', function (st) {
|
||||
var date = new Date();
|
||||
st.equal(
|
||||
qs.stringify({ a: date }),
|
||||
'a=' + date.toISOString().replace(/:/g, '%3A'),
|
||||
'default is toISOString'
|
||||
);
|
||||
|
||||
var mutatedDate = new Date();
|
||||
mutatedDate.toISOString = function () {
|
||||
throw new SyntaxError();
|
||||
};
|
||||
st['throws'](function () {
|
||||
mutatedDate.toISOString();
|
||||
}, SyntaxError);
|
||||
st.equal(
|
||||
qs.stringify({ a: mutatedDate }),
|
||||
'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'),
|
||||
'toISOString works even when method is not locally present'
|
||||
);
|
||||
|
||||
var specificDate = new Date(6);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: specificDate },
|
||||
{ serializeDate: function (d) { return d.getTime() * 7; } }
|
||||
),
|
||||
'a=42',
|
||||
'custom serializeDate function called'
|
||||
);
|
||||
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: [date] },
|
||||
{
|
||||
serializeDate: function (d) { return d.getTime(); },
|
||||
arrayFormat: 'comma'
|
||||
}
|
||||
),
|
||||
'a=' + date.getTime(),
|
||||
'works with arrayFormat comma'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: [date] },
|
||||
{
|
||||
serializeDate: function (d) { return d.getTime(); },
|
||||
arrayFormat: 'comma',
|
||||
commaRoundTrip: true
|
||||
}
|
||||
),
|
||||
'a%5B%5D=' + date.getTime(),
|
||||
'works with arrayFormat comma'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('RFC 1738 serialization', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c');
|
||||
st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d');
|
||||
st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC1738 }), 'a+b=a+b');
|
||||
|
||||
st.equal(qs.stringify({ 'foo(ref)': 'bar' }, { format: qs.formats.RFC1738 }), 'foo(ref)=bar');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('RFC 3986 spaces serialization', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC3986 }), 'a=b%20c');
|
||||
st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC3986 }), 'a%20b=c%20d');
|
||||
st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC3986 }), 'a%20b=a%20b');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('Backward compatibility to RFC 3986', function (st) {
|
||||
st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c');
|
||||
st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }), 'a%20b=a%20b');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('Edge cases and unknown formats', function (st) {
|
||||
['UFO1234', false, 1234, null, {}, []].forEach(function (format) {
|
||||
st['throws'](
|
||||
function () {
|
||||
qs.stringify({ a: 'b c' }, { format: format });
|
||||
},
|
||||
new TypeError('Unknown format option provided.')
|
||||
);
|
||||
});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('encodeValuesOnly', function (st) {
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] },
|
||||
{ encodeValuesOnly: true }
|
||||
),
|
||||
'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h'
|
||||
);
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }
|
||||
),
|
||||
'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h'
|
||||
);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('encodeValuesOnly - strictNullHandling', function (st) {
|
||||
st.equal(
|
||||
qs.stringify(
|
||||
{ a: { b: null } },
|
||||
{ encodeValuesOnly: true, strictNullHandling: true }
|
||||
),
|
||||
'a[b]'
|
||||
);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('throws if an invalid charset is specified', function (st) {
|
||||
st['throws'](function () {
|
||||
qs.stringify({ a: 'b' }, { charset: 'foobar' });
|
||||
}, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'));
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('respects a charset of iso-8859-1', function (st) {
|
||||
st.equal(qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }), '%E6=%E6');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('encodes unrepresentable chars as numeric entities in iso-8859-1 mode', function (st) {
|
||||
st.equal(qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }), 'a=%26%239786%3B');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('respects an explicit charset of utf-8 (the default)', function (st) {
|
||||
st.equal(qs.stringify({ a: 'æ' }, { charset: 'utf-8' }), 'a=%C3%A6');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('adds the right sentinel when instructed to and the charset is utf-8', function (st) {
|
||||
st.equal(qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' }), 'utf8=%E2%9C%93&a=%C3%A6');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('adds the right sentinel when instructed to and the charset is iso-8859-1', function (st) {
|
||||
st.equal(qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }), 'utf8=%26%2310003%3B&a=%E6');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('does not mutate the options argument', function (st) {
|
||||
var options = {};
|
||||
qs.stringify({}, options);
|
||||
st.deepEqual(options, {});
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('strictNullHandling works with custom filter', function (st) {
|
||||
var filter = function (prefix, value) {
|
||||
return value;
|
||||
};
|
||||
|
||||
var options = { strictNullHandling: true, filter: filter };
|
||||
st.equal(qs.stringify({ key: null }, options), 'key');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('strictNullHandling works with null serializeDate', function (st) {
|
||||
var serializeDate = function () {
|
||||
return null;
|
||||
};
|
||||
var options = { strictNullHandling: true, serializeDate: serializeDate };
|
||||
var date = new Date();
|
||||
st.equal(qs.stringify({ key: date }, options), 'key');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('allows for encoding keys and values differently', function (st) {
|
||||
var encoder = function (str, defaultEncoder, charset, type) {
|
||||
if (type === 'key') {
|
||||
return defaultEncoder(str, defaultEncoder, charset, type).toLowerCase();
|
||||
}
|
||||
if (type === 'value') {
|
||||
return defaultEncoder(str, defaultEncoder, charset, type).toUpperCase();
|
||||
}
|
||||
throw 'this should never happen! type: ' + type;
|
||||
};
|
||||
|
||||
st.deepEqual(qs.stringify({ KeY: 'vAlUe' }, { encoder: encoder }), 'key=VALUE');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('objects inside arrays', function (st) {
|
||||
var obj = { a: { b: { c: 'd', e: 'f' } } };
|
||||
var withArray = { a: { b: [{ c: 'd', e: 'f' }] } };
|
||||
|
||||
st.equal(qs.stringify(obj, { encode: false }), 'a[b][c]=d&a[b][e]=f', 'no array, no arrayFormat');
|
||||
st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'bracket' }), 'a[b][c]=d&a[b][e]=f', 'no array, bracket');
|
||||
st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'indices' }), 'a[b][c]=d&a[b][e]=f', 'no array, indices');
|
||||
st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'comma' }), 'a[b][c]=d&a[b][e]=f', 'no array, comma');
|
||||
|
||||
st.equal(qs.stringify(withArray, { encode: false }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, no arrayFormat');
|
||||
st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'bracket' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, bracket');
|
||||
st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'indices' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, indices');
|
||||
st.equal(
|
||||
qs.stringify(withArray, { encode: false, arrayFormat: 'comma' }),
|
||||
'???',
|
||||
'array, comma',
|
||||
{ skip: 'TODO: figure out what this should do' }
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('stringifies sparse arrays', function (st) {
|
||||
/* eslint no-sparse-arrays: 0 */
|
||||
st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true }), 'a[1]=2&a[4]=1');
|
||||
st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true }), 'a[1][b][2][c]=1');
|
||||
st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true }), 'a[1][2][3][c]=1');
|
||||
st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true }), 'a[1][2][3][c][1]=1');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"timeoutWith.js","sources":["../../src/internal/oper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