This commit is contained in:
Benjamin Toby
2024-12-12 14:43:25 +01:00
parent 2a4e111160
commit 6be3ede31a
7 changed files with 21 additions and 16 deletions
@@ -7,5 +7,5 @@ declare function _exports({ code, clientId, clientSecret, database, additionalFi
res?: any;
email?: string;
userId?: string | number;
}): Promise<import("../../../../types").APIGoogleLoginFunctionReturn>;
}): Promise<import("../../../../types").APILoginFunctionReturn>;
export = _exports;
@@ -16,7 +16,7 @@ const camelJoinedtoCamelSpace = require("../../../../utils/camelJoinedtoCamelSpa
* @param {string} [param.email]
* @param {string | number} [param.userId]
*
* @returns {Promise<import("../../../../types").APIGoogleLoginFunctionReturn>}
* @returns {Promise<import("../../../../types").APILoginFunctionReturn>}
*/
module.exports = async function apiGithubLogin({
code,
+1 -4
View File
@@ -159,10 +159,7 @@ export interface GetReqQueryObject {
queryValues?: string;
tableName?: string;
}
export type SerializeQueryFnType = (param0: SerializeQueryParams) => string;
export interface SerializeQueryParams {
query: any;
}
export type SerializeQueryFnType = (query: any) => string;
export type DATASQUIREL_LoggedInUser = {
id: number;
uuid?: string;
+1 -7
View File
@@ -188,13 +188,7 @@ export interface GetReqQueryObject {
tableName?: string;
}
export type SerializeQueryFnType = (param0: SerializeQueryParams) => string;
export interface SerializeQueryParams {
query: any;
}
// @ts-check
export type SerializeQueryFnType = (query: any) => string;
export type DATASQUIREL_LoggedInUser = {
id: number;
+1 -1
View File
@@ -1,2 +1,2 @@
export = serializeQuery;
declare function serializeQuery(param0: import("../types").SerializeQueryParams): string;
declare function serializeQuery(query: any): string;
+15 -1
View File
@@ -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[]} */