Updates
This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
||||
export = serializeQuery;
|
||||
declare function serializeQuery(param0: import("../types").SerializeQueryParams): string;
|
||||
declare function serializeQuery(query: any): string;
|
||||
|
||||
@@ -3,8 +3,22 @@
|
||||
const EJSON = require("./ejson");
|
||||
|
||||
/** @type {import("../types").SerializeQueryFnType} */
|
||||
function serializeQuery({ query }) {
|
||||
function serializeQuery(query) {
|
||||
let str = "?";
|
||||
|
||||
if (typeof query !== "object") {
|
||||
console.log("Invalid Query type");
|
||||
return str;
|
||||
}
|
||||
if (Array.isArray(query)) {
|
||||
console.log("Query is an Array. This is invalid.");
|
||||
return str;
|
||||
}
|
||||
if (!query) {
|
||||
console.log("No Query provided.");
|
||||
return str;
|
||||
}
|
||||
|
||||
const keys = Object.keys(query);
|
||||
|
||||
/** @type {string[]} */
|
||||
|
||||
Reference in New Issue
Block a user