@kitql/helper
Advanced tools
Comparing version 0.3.0 to 0.3.1
18
index.js
@@ -44,3 +44,3 @@ 'use strict'; | ||
function queryStringApprend(searchParams, queryString) { | ||
let query = {}; | ||
const query = {}; | ||
// 1 Destructure searchParams | ||
@@ -55,3 +55,3 @@ searchParams.forEach((v, k) => { | ||
// 3 Transform in a table | ||
let qs = []; | ||
const qs = []; | ||
for (const key in query) { | ||
@@ -65,5 +65,5 @@ qs.push(`${key}=${query[key]}`); | ||
function sortObject(object) { | ||
var sortedObj = {}; | ||
var keys = Object.keys(object); | ||
keys.sort(function (key1, key2) { | ||
const sortedObj = {}; | ||
const keys = Object.keys(object); | ||
keys.sort((key1, key2) => { | ||
(key1 = key1.toLowerCase()), (key2 = key2.toLowerCase()); | ||
@@ -76,5 +76,5 @@ if (key1 < key2) | ||
}); | ||
for (var index in keys) { | ||
var key = keys[index]; | ||
if (typeof object[key] == 'object' && !(object[key] instanceof Array) && object[key]) { | ||
for (const index in keys) { | ||
const key = keys[index]; | ||
if (typeof object[key] == 'object' && !Array.isArray(object[key]) && object[key]) { | ||
sortedObj[key] = sortObject(object[key]); | ||
@@ -92,3 +92,3 @@ } | ||
} | ||
else if (obj === undefined) { | ||
if (obj === undefined) { | ||
return undefined; | ||
@@ -95,0 +95,0 @@ } |
{ | ||
"name": "@kitql/helper", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
Sorry, the diff of this file is not supported yet
7132