NUEVA BUSQUEDA DE DATOS SRI
This commit is contained in:
26
node_modules/qs/lib/utils.js
generated
vendored
26
node_modules/qs/lib/utils.js
generated
vendored
@@ -1,5 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
var formats = require('./formats');
|
||||
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
var isArray = Array.isArray;
|
||||
|
||||
@@ -43,6 +45,7 @@ var arrayToObject = function arrayToObject(source, options) {
|
||||
};
|
||||
|
||||
var merge = function merge(target, source, options) {
|
||||
/* eslint no-param-reassign: 0 */
|
||||
if (!source) {
|
||||
return target;
|
||||
}
|
||||
@@ -119,14 +122,19 @@ var decode = function (str, decoder, charset) {
|
||||
}
|
||||
};
|
||||
|
||||
var encode = function encode(str, defaultEncoder, charset) {
|
||||
var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
||||
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
||||
// It has been adapted here for stricter adherence to RFC 3986
|
||||
if (str.length === 0) {
|
||||
return str;
|
||||
}
|
||||
|
||||
var string = typeof str === 'string' ? str : String(str);
|
||||
var string = str;
|
||||
if (typeof str === 'symbol') {
|
||||
string = Symbol.prototype.toString.call(str);
|
||||
} else if (typeof str !== 'string') {
|
||||
string = String(str);
|
||||
}
|
||||
|
||||
if (charset === 'iso-8859-1') {
|
||||
return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
|
||||
@@ -146,6 +154,7 @@ var encode = function encode(str, defaultEncoder, charset) {
|
||||
|| (c >= 0x30 && c <= 0x39) // 0-9
|
||||
|| (c >= 0x41 && c <= 0x5A) // a-z
|
||||
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
||||
|| (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
|
||||
) {
|
||||
out += string.charAt(i);
|
||||
continue;
|
||||
@@ -168,6 +177,7 @@ var encode = function encode(str, defaultEncoder, charset) {
|
||||
|
||||
i += 1;
|
||||
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
||||
/* eslint operator-linebreak: [2, "before"] */
|
||||
out += hexTable[0xF0 | (c >> 18)]
|
||||
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
||||
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
||||
@@ -217,6 +227,17 @@ var combine = function combine(a, b) {
|
||||
return [].concat(a, b);
|
||||
};
|
||||
|
||||
var maybeMap = function maybeMap(val, fn) {
|
||||
if (isArray(val)) {
|
||||
var mapped = [];
|
||||
for (var i = 0; i < val.length; i += 1) {
|
||||
mapped.push(fn(val[i]));
|
||||
}
|
||||
return mapped;
|
||||
}
|
||||
return fn(val);
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
arrayToObject: arrayToObject,
|
||||
assign: assign,
|
||||
@@ -226,5 +247,6 @@ module.exports = {
|
||||
encode: encode,
|
||||
isBuffer: isBuffer,
|
||||
isRegExp: isRegExp,
|
||||
maybeMap: maybeMap,
|
||||
merge: merge
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user