项目原始demo,不改动
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
Это архивный репозиторий. Вы можете его клонировать или просматривать файлы, но не вносить изменения или открывать задачи/запросы на слияние.
 
 
 
 

738 строки
23 KiB

  1. (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
  2. 'use strict';
  3. var replace = String.prototype.replace;
  4. var percentTwenties = /%20/g;
  5. module.exports = {
  6. 'default': 'RFC3986',
  7. formatters: {
  8. RFC1738: function (value) {
  9. return replace.call(value, percentTwenties, '+');
  10. },
  11. RFC3986: function (value) {
  12. return value;
  13. }
  14. },
  15. RFC1738: 'RFC1738',
  16. RFC3986: 'RFC3986'
  17. };
  18. },{}],2:[function(require,module,exports){
  19. 'use strict';
  20. var stringify = require('./stringify');
  21. var parse = require('./parse');
  22. var formats = require('./formats');
  23. module.exports = {
  24. formats: formats,
  25. parse: parse,
  26. stringify: stringify
  27. };
  28. },{"./formats":1,"./parse":3,"./stringify":4}],3:[function(require,module,exports){
  29. 'use strict';
  30. var utils = require('./utils');
  31. var has = Object.prototype.hasOwnProperty;
  32. var defaults = {
  33. allowDots: false,
  34. allowPrototypes: false,
  35. arrayLimit: 20,
  36. charset: 'utf-8',
  37. charsetSentinel: false,
  38. decoder: utils.decode,
  39. delimiter: '&',
  40. depth: 5,
  41. ignoreQueryPrefix: false,
  42. interpretNumericEntities: false,
  43. parameterLimit: 1000,
  44. parseArrays: true,
  45. plainObjects: false,
  46. strictNullHandling: false
  47. };
  48. var interpretNumericEntities = function (str) {
  49. return str.replace(/&#(\d+);/g, function ($0, numberStr) {
  50. return String.fromCharCode(parseInt(numberStr, 10));
  51. });
  52. };
  53. // This is what browsers will submit when the ✓ character occurs in an
  54. // application/x-www-form-urlencoded body and the encoding of the page containing
  55. // the form is iso-8859-1, or when the submitted form has an accept-charset
  56. // attribute of iso-8859-1. Presumably also with other charsets that do not contain
  57. // the ✓ character, such as us-ascii.
  58. var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
  59. // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
  60. var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
  61. var parseValues = function parseQueryStringValues(str, options) {
  62. var obj = {};
  63. var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
  64. var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
  65. var parts = cleanStr.split(options.delimiter, limit);
  66. var skipIndex = -1; // Keep track of where the utf8 sentinel was found
  67. var i;
  68. var charset = options.charset;
  69. if (options.charsetSentinel) {
  70. for (i = 0; i < parts.length; ++i) {
  71. if (parts[i].indexOf('utf8=') === 0) {
  72. if (parts[i] === charsetSentinel) {
  73. charset = 'utf-8';
  74. } else if (parts[i] === isoSentinel) {
  75. charset = 'iso-8859-1';
  76. }
  77. skipIndex = i;
  78. i = parts.length; // The eslint settings do not allow break;
  79. }
  80. }
  81. }
  82. for (i = 0; i < parts.length; ++i) {
  83. if (i === skipIndex) {
  84. continue;
  85. }
  86. var part = parts[i];
  87. var bracketEqualsPos = part.indexOf(']=');
  88. var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
  89. var key, val;
  90. if (pos === -1) {
  91. key = options.decoder(part, defaults.decoder, charset);
  92. val = options.strictNullHandling ? null : '';
  93. } else {
  94. key = options.decoder(part.slice(0, pos), defaults.decoder, charset);
  95. val = options.decoder(part.slice(pos + 1), defaults.decoder, charset);
  96. }
  97. if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
  98. val = interpretNumericEntities(val);
  99. }
  100. if (has.call(obj, key)) {
  101. obj[key] = utils.combine(obj[key], val);
  102. } else {
  103. obj[key] = val;
  104. }
  105. }
  106. return obj;
  107. };
  108. var parseObject = function (chain, val, options) {
  109. var leaf = val;
  110. for (var i = chain.length - 1; i >= 0; --i) {
  111. var obj;
  112. var root = chain[i];
  113. if (root === '[]' && options.parseArrays) {
  114. obj = [].concat(leaf);
  115. } else {
  116. obj = options.plainObjects ? Object.create(null) : {};
  117. var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
  118. var index = parseInt(cleanRoot, 10);
  119. if (!options.parseArrays && cleanRoot === '') {
  120. obj = { 0: leaf };
  121. } else if (
  122. !isNaN(index)
  123. && root !== cleanRoot
  124. && String(index) === cleanRoot
  125. && index >= 0
  126. && (options.parseArrays && index <= options.arrayLimit)
  127. ) {
  128. obj = [];
  129. obj[index] = leaf;
  130. } else {
  131. obj[cleanRoot] = leaf;
  132. }
  133. }
  134. leaf = obj;
  135. }
  136. return leaf;
  137. };
  138. var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
  139. if (!givenKey) {
  140. return;
  141. }
  142. // Transform dot notation to bracket notation
  143. var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
  144. // The regex chunks
  145. var brackets = /(\[[^[\]]*])/;
  146. var child = /(\[[^[\]]*])/g;
  147. // Get the parent
  148. var segment = brackets.exec(key);
  149. var parent = segment ? key.slice(0, segment.index) : key;
  150. // Stash the parent if it exists
  151. var keys = [];
  152. if (parent) {
  153. // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
  154. if (!options.plainObjects && has.call(Object.prototype, parent)) {
  155. if (!options.allowPrototypes) {
  156. return;
  157. }
  158. }
  159. keys.push(parent);
  160. }
  161. // Loop through children appending to the array until we hit depth
  162. var i = 0;
  163. while ((segment = child.exec(key)) !== null && i < options.depth) {
  164. i += 1;
  165. if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
  166. if (!options.allowPrototypes) {
  167. return;
  168. }
  169. }
  170. keys.push(segment[1]);
  171. }
  172. // If there's a remainder, just add whatever is left
  173. if (segment) {
  174. keys.push('[' + key.slice(segment.index) + ']');
  175. }
  176. return parseObject(keys, val, options);
  177. };
  178. module.exports = function (str, opts) {
  179. var options = opts ? utils.assign({}, opts) : {};
  180. if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {
  181. throw new TypeError('Decoder has to be a function.');
  182. }
  183. options.ignoreQueryPrefix = options.ignoreQueryPrefix === true;
  184. options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;
  185. options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;
  186. options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;
  187. options.parseArrays = options.parseArrays !== false;
  188. options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;
  189. options.allowDots = typeof options.allowDots === 'undefined' ? defaults.allowDots : !!options.allowDots;
  190. options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;
  191. options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;
  192. options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;
  193. options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
  194. if (typeof options.charset !== 'undefined' && options.charset !== 'utf-8' && options.charset !== 'iso-8859-1') {
  195. throw new Error('The charset option must be either utf-8, iso-8859-1, or undefined');
  196. }
  197. if (typeof options.charset === 'undefined') {
  198. options.charset = defaults.charset;
  199. }
  200. if (str === '' || str === null || typeof str === 'undefined') {
  201. return options.plainObjects ? Object.create(null) : {};
  202. }
  203. var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
  204. var obj = options.plainObjects ? Object.create(null) : {};
  205. // Iterate over the keys and setup the new object
  206. var keys = Object.keys(tempObj);
  207. for (var i = 0; i < keys.length; ++i) {
  208. var key = keys[i];
  209. var newObj = parseKeys(key, tempObj[key], options);
  210. obj = utils.merge(obj, newObj, options);
  211. }
  212. return utils.compact(obj);
  213. };
  214. },{"./utils":5}],4:[function(require,module,exports){
  215. 'use strict';
  216. var utils = require('./utils');
  217. var formats = require('./formats');
  218. var arrayPrefixGenerators = {
  219. brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
  220. return prefix + '[]';
  221. },
  222. indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
  223. return prefix + '[' + key + ']';
  224. },
  225. repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
  226. return prefix;
  227. }
  228. };
  229. var isArray = Array.isArray;
  230. var push = Array.prototype.push;
  231. var pushToArray = function (arr, valueOrArray) {
  232. push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
  233. };
  234. var toISO = Date.prototype.toISOString;
  235. var defaults = {
  236. addQueryPrefix: false,
  237. allowDots: false,
  238. charset: 'utf-8',
  239. charsetSentinel: false,
  240. delimiter: '&',
  241. encode: true,
  242. encoder: utils.encode,
  243. encodeValuesOnly: false,
  244. // deprecated
  245. indices: false,
  246. serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
  247. return toISO.call(date);
  248. },
  249. skipNulls: false,
  250. strictNullHandling: false
  251. };
  252. var stringify = function stringify( // eslint-disable-line func-name-matching
  253. object,
  254. prefix,
  255. generateArrayPrefix,
  256. strictNullHandling,
  257. skipNulls,
  258. encoder,
  259. filter,
  260. sort,
  261. allowDots,
  262. serializeDate,
  263. formatter,
  264. encodeValuesOnly,
  265. charset
  266. ) {
  267. var obj = object;
  268. if (typeof filter === 'function') {
  269. obj = filter(prefix, obj);
  270. } else if (obj instanceof Date) {
  271. obj = serializeDate(obj);
  272. }
  273. if (obj === null) {
  274. if (strictNullHandling) {
  275. return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset) : prefix;
  276. }
  277. obj = '';
  278. }
  279. if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
  280. if (encoder) {
  281. var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset);
  282. return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset))];
  283. }
  284. return [formatter(prefix) + '=' + formatter(String(obj))];
  285. }
  286. var values = [];
  287. if (typeof obj === 'undefined') {
  288. return values;
  289. }
  290. var objKeys;
  291. if (Array.isArray(filter)) {
  292. objKeys = filter;
  293. } else {
  294. var keys = Object.keys(obj);
  295. objKeys = sort ? keys.sort(sort) : keys;
  296. }
  297. for (var i = 0; i < objKeys.length; ++i) {
  298. var key = objKeys[i];
  299. if (skipNulls && obj[key] === null) {
  300. continue;
  301. }
  302. if (Array.isArray(obj)) {
  303. pushToArray(values, stringify(
  304. obj[key],
  305. generateArrayPrefix(prefix, key),
  306. generateArrayPrefix,
  307. strictNullHandling,
  308. skipNulls,
  309. encoder,
  310. filter,
  311. sort,
  312. allowDots,
  313. serializeDate,
  314. formatter,
  315. encodeValuesOnly,
  316. charset
  317. ));
  318. } else {
  319. pushToArray(values, stringify(
  320. obj[key],
  321. prefix + (allowDots ? '.' + key : '[' + key + ']'),
  322. generateArrayPrefix,
  323. strictNullHandling,
  324. skipNulls,
  325. encoder,
  326. filter,
  327. sort,
  328. allowDots,
  329. serializeDate,
  330. formatter,
  331. encodeValuesOnly,
  332. charset
  333. ));
  334. }
  335. }
  336. return values;
  337. };
  338. module.exports = function (object, opts) {
  339. var obj = object;
  340. var options = opts ? utils.assign({}, opts) : {};
  341. if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
  342. throw new TypeError('Encoder has to be a function.');
  343. }
  344. var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;
  345. var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
  346. var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;
  347. var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;
  348. var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder;
  349. var sort = typeof options.sort === 'function' ? options.sort : null;
  350. var allowDots = typeof options.allowDots === 'undefined' ? defaults.allowDots : !!options.allowDots;
  351. var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;
  352. var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;
  353. var charset = options.charset || defaults.charset;
  354. if (typeof options.charset !== 'undefined' && options.charset !== 'utf-8' && options.charset !== 'iso-8859-1') {
  355. throw new Error('The charset option must be either utf-8, iso-8859-1, or undefined');
  356. }
  357. if (typeof options.format === 'undefined') {
  358. options.format = formats['default'];
  359. } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {
  360. throw new TypeError('Unknown format option provided.');
  361. }
  362. var formatter = formats.formatters[options.format];
  363. var objKeys;
  364. var filter;
  365. if (typeof options.filter === 'function') {
  366. filter = options.filter;
  367. obj = filter('', obj);
  368. } else if (Array.isArray(options.filter)) {
  369. filter = options.filter;
  370. objKeys = filter;
  371. }
  372. var keys = [];
  373. if (typeof obj !== 'object' || obj === null) {
  374. return '';
  375. }
  376. var arrayFormat;
  377. if (options.arrayFormat in arrayPrefixGenerators) {
  378. arrayFormat = options.arrayFormat;
  379. } else if ('indices' in options) {
  380. arrayFormat = options.indices ? 'indices' : 'repeat';
  381. } else {
  382. arrayFormat = 'indices';
  383. }
  384. var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
  385. if (!objKeys) {
  386. objKeys = Object.keys(obj);
  387. }
  388. if (sort) {
  389. objKeys.sort(sort);
  390. }
  391. for (var i = 0; i < objKeys.length; ++i) {
  392. var key = objKeys[i];
  393. if (skipNulls && obj[key] === null) {
  394. continue;
  395. }
  396. pushToArray(keys, stringify(
  397. obj[key],
  398. key,
  399. generateArrayPrefix,
  400. strictNullHandling,
  401. skipNulls,
  402. encode ? encoder : null,
  403. filter,
  404. sort,
  405. allowDots,
  406. serializeDate,
  407. formatter,
  408. encodeValuesOnly,
  409. charset
  410. ));
  411. }
  412. var joined = keys.join(delimiter);
  413. var prefix = options.addQueryPrefix === true ? '?' : '';
  414. if (options.charsetSentinel) {
  415. if (charset === 'iso-8859-1') {
  416. // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
  417. prefix += 'utf8=%26%2310003%3B&';
  418. } else {
  419. // encodeURIComponent('✓')
  420. prefix += 'utf8=%E2%9C%93&';
  421. }
  422. }
  423. return joined.length > 0 ? prefix + joined : '';
  424. };
  425. },{"./formats":1,"./utils":5}],5:[function(require,module,exports){
  426. 'use strict';
  427. var has = Object.prototype.hasOwnProperty;
  428. var hexTable = (function () {
  429. var array = [];
  430. for (var i = 0; i < 256; ++i) {
  431. array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
  432. }
  433. return array;
  434. }());
  435. var compactQueue = function compactQueue(queue) {
  436. while (queue.length > 1) {
  437. var item = queue.pop();
  438. var obj = item.obj[item.prop];
  439. if (Array.isArray(obj)) {
  440. var compacted = [];
  441. for (var j = 0; j < obj.length; ++j) {
  442. if (typeof obj[j] !== 'undefined') {
  443. compacted.push(obj[j]);
  444. }
  445. }
  446. item.obj[item.prop] = compacted;
  447. }
  448. }
  449. };
  450. var arrayToObject = function arrayToObject(source, options) {
  451. var obj = options && options.plainObjects ? Object.create(null) : {};
  452. for (var i = 0; i < source.length; ++i) {
  453. if (typeof source[i] !== 'undefined') {
  454. obj[i] = source[i];
  455. }
  456. }
  457. return obj;
  458. };
  459. var merge = function merge(target, source, options) {
  460. if (!source) {
  461. return target;
  462. }
  463. if (typeof source !== 'object') {
  464. if (Array.isArray(target)) {
  465. target.push(source);
  466. } else if (typeof target === 'object') {
  467. if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {
  468. target[source] = true;
  469. }
  470. } else {
  471. return [target, source];
  472. }
  473. return target;
  474. }
  475. if (typeof target !== 'object') {
  476. return [target].concat(source);
  477. }
  478. var mergeTarget = target;
  479. if (Array.isArray(target) && !Array.isArray(source)) {
  480. mergeTarget = arrayToObject(target, options);
  481. }
  482. if (Array.isArray(target) && Array.isArray(source)) {
  483. source.forEach(function (item, i) {
  484. if (has.call(target, i)) {
  485. if (target[i] && typeof target[i] === 'object') {
  486. target[i] = merge(target[i], item, options);
  487. } else {
  488. target.push(item);
  489. }
  490. } else {
  491. target[i] = item;
  492. }
  493. });
  494. return target;
  495. }
  496. return Object.keys(source).reduce(function (acc, key) {
  497. var value = source[key];
  498. if (has.call(acc, key)) {
  499. acc[key] = merge(acc[key], value, options);
  500. } else {
  501. acc[key] = value;
  502. }
  503. return acc;
  504. }, mergeTarget);
  505. };
  506. var assign = function assignSingleSource(target, source) {
  507. return Object.keys(source).reduce(function (acc, key) {
  508. acc[key] = source[key];
  509. return acc;
  510. }, target);
  511. };
  512. var decode = function (str, decoder, charset) {
  513. var strWithoutPlus = str.replace(/\+/g, ' ');
  514. if (charset === 'iso-8859-1') {
  515. // unescape never throws, no try...catch needed:
  516. return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
  517. }
  518. // utf-8
  519. try {
  520. return decodeURIComponent(strWithoutPlus);
  521. } catch (e) {
  522. return strWithoutPlus;
  523. }
  524. };
  525. var encode = function encode(str, defaultEncoder, charset) {
  526. // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
  527. // It has been adapted here for stricter adherence to RFC 3986
  528. if (str.length === 0) {
  529. return str;
  530. }
  531. var string = typeof str === 'string' ? str : String(str);
  532. if (charset === 'iso-8859-1') {
  533. return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
  534. return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
  535. });
  536. }
  537. var out = '';
  538. for (var i = 0; i < string.length; ++i) {
  539. var c = string.charCodeAt(i);
  540. if (
  541. c === 0x2D // -
  542. || c === 0x2E // .
  543. || c === 0x5F // _
  544. || c === 0x7E // ~
  545. || (c >= 0x30 && c <= 0x39) // 0-9
  546. || (c >= 0x41 && c <= 0x5A) // a-z
  547. || (c >= 0x61 && c <= 0x7A) // A-Z
  548. ) {
  549. out += string.charAt(i);
  550. continue;
  551. }
  552. if (c < 0x80) {
  553. out = out + hexTable[c];
  554. continue;
  555. }
  556. if (c < 0x800) {
  557. out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
  558. continue;
  559. }
  560. if (c < 0xD800 || c >= 0xE000) {
  561. out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
  562. continue;
  563. }
  564. i += 1;
  565. c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
  566. out += hexTable[0xF0 | (c >> 18)]
  567. + hexTable[0x80 | ((c >> 12) & 0x3F)]
  568. + hexTable[0x80 | ((c >> 6) & 0x3F)]
  569. + hexTable[0x80 | (c & 0x3F)];
  570. }
  571. return out;
  572. };
  573. var compact = function compact(value) {
  574. var queue = [{ obj: { o: value }, prop: 'o' }];
  575. var refs = [];
  576. for (var i = 0; i < queue.length; ++i) {
  577. var item = queue[i];
  578. var obj = item.obj[item.prop];
  579. var keys = Object.keys(obj);
  580. for (var j = 0; j < keys.length; ++j) {
  581. var key = keys[j];
  582. var val = obj[key];
  583. if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
  584. queue.push({ obj: obj, prop: key });
  585. refs.push(val);
  586. }
  587. }
  588. }
  589. compactQueue(queue);
  590. return value;
  591. };
  592. var isRegExp = function isRegExp(obj) {
  593. return Object.prototype.toString.call(obj) === '[object RegExp]';
  594. };
  595. var isBuffer = function isBuffer(obj) {
  596. if (obj === null || typeof obj === 'undefined') {
  597. return false;
  598. }
  599. return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
  600. };
  601. var combine = function combine(a, b) {
  602. return [].concat(a, b);
  603. };
  604. module.exports = {
  605. arrayToObject: arrayToObject,
  606. assign: assign,
  607. combine: combine,
  608. compact: compact,
  609. decode: decode,
  610. encode: encode,
  611. isBuffer: isBuffer,
  612. isRegExp: isRegExp,
  613. merge: merge
  614. };
  615. },{}]},{},[2])(2)
  616. });