remove mutating of interpolate data
This commit is contained in:
parent
b8e8afffa8
commit
4a98bb0503
3 changed files with 32 additions and 9 deletions
|
|
@ -1,12 +1,15 @@
|
|||
"use strict"
|
||||
|
||||
module.exports = function(object) {
|
||||
module.exports = function(object, dataKeys) {
|
||||
if (Object.prototype.toString.call(object) !== "[object Object]") return ""
|
||||
|
||||
var args = []
|
||||
for (var key in object) {
|
||||
dataKeys = dataKeys || Object.keys(object)
|
||||
for (var i = 0; i < dataKeys.length; i++) {
|
||||
var key = dataKeys[i]
|
||||
destructure(key, object[key])
|
||||
}
|
||||
|
||||
return args.join("&")
|
||||
|
||||
function destructure(key, value) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue