jquery-param
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -9,3 +9,2 @@ /** | ||
var s = []; | ||
var rbracket = /\[\]$/; | ||
var add = function (k, v) { | ||
@@ -22,10 +21,6 @@ v = typeof v === 'function' ? v() : v; | ||
for (i = 0, len = obj.length; i < len; i++) { | ||
if (rbracket.test(prefix)) { | ||
add(prefix, obj[i]); | ||
} else { | ||
buildParams( | ||
prefix + '[' + (typeof obj[i] === 'object' && obj[i] ? i : '') + ']', | ||
obj[i] | ||
); | ||
} | ||
buildParams( | ||
prefix + '[' + (typeof obj[i] === 'object' && obj[i] ? i : '') + ']', | ||
obj[i] | ||
); | ||
} | ||
@@ -32,0 +27,0 @@ } else if (String(obj) === '[object Object]') { |
/* | ||
jquery-param (c) 2015 KNOWLEDGECODE | MIT | ||
*/ | ||
(function(f){var c=function(c){var g=[],f=/\[\]$/,h=function(d,a){a="function"===typeof a?a():a;a=null===a?"":void 0===a?"":a;g[g.length]=encodeURIComponent(d)+"="+encodeURIComponent(a)},e=function(d,a){var c;if(d)if(Array.isArray(a)){var b=0;for(c=a.length;b<c;b++)f.test(d)?h(d,a[b]):e(d+"["+("object"===typeof a[b]&&a[b]?b:"")+"]",a[b])}else if("[object Object]"===String(a))for(b in a)e(d+"["+b+"]",a[b]);else h(d,a);else if(Array.isArray(a))for(b=0,c=a.length;b<c;b++)h(a[b].name,a[b].value);else for(b in a)e(b, | ||
a[b]);return g};return e("",c).join("&")};"object"===typeof module&&"object"===typeof module.exports?module.exports=c:"function"===typeof define&&define.amd?define([],function(){return c}):f.param=c})(this); | ||
(function(h){var c=function(c){var f=[],g=function(d,a){a="function"===typeof a?a():a;a=null===a?"":void 0===a?"":a;f[f.length]=encodeURIComponent(d)+"="+encodeURIComponent(a)},e=function(d,a){var c;if(d)if(Array.isArray(a)){var b=0;for(c=a.length;b<c;b++)e(d+"["+("object"===typeof a[b]&&a[b]?b:"")+"]",a[b])}else if("[object Object]"===String(a))for(b in a)e(d+"["+b+"]",a[b]);else g(d,a);else if(Array.isArray(a))for(b=0,c=a.length;b<c;b++)g(a[b].name,a[b].value);else for(b in a)e(b,a[b]);return f}; | ||
return e("",c).join("&")};"object"===typeof module&&"object"===typeof module.exports?module.exports=c:"function"===typeof define&&define.amd?define([],function(){return c}):h.param=c})(this); |
{ | ||
"name": "jquery-param", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "equivalent function to jQuery.param", | ||
@@ -5,0 +5,0 @@ "main": "jquery-param.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5717
58