Add editorconfig, resolve differences
This includes newlines, tabs, among other things.
This commit is contained in:
parent
80d0a69dab
commit
b4fb21475c
90 changed files with 1707 additions and 1701 deletions
|
|
@ -3,13 +3,13 @@
|
|||
module.exports = function(string) {
|
||||
if (string === "" || string == null) return {}
|
||||
if (string.charAt(0) === "?") string = string.slice(1)
|
||||
|
||||
|
||||
var entries = string.split("&"), data = {}, counters = {}
|
||||
for (var i = 0; i < entries.length; i++) {
|
||||
var entry = entries[i].split("=")
|
||||
var key = decodeURIComponent(entry[0])
|
||||
var value = entry.length === 2 ? decodeURIComponent(entry[1]) : ""
|
||||
|
||||
|
||||
//TODO refactor out
|
||||
var number = Number(value)
|
||||
if (value !== "" && !isNaN(number) || value === "NaN") value = number
|
||||
|
|
@ -19,7 +19,7 @@ module.exports = function(string) {
|
|||
var date = new Date(value)
|
||||
if (!isNaN(date.getTime())) value = date
|
||||
}
|
||||
|
||||
|
||||
var levels = key.split(/\]\[?|\[/)
|
||||
var cursor = data
|
||||
if (key.indexOf("[") > -1) levels.pop()
|
||||
|
|
@ -39,4 +39,4 @@ module.exports = function(string) {
|
|||
}
|
||||
}
|
||||
return data
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue