Update Types
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// @ts-check
|
||||
|
||||
/** @type {import("@/package-shared/types/general.td").SerializeQueryFnType} */
|
||||
/** @type {import("@/package-shared/types").SerializeQueryFnType} */
|
||||
function serializeQuery({ query }) {
|
||||
let str = "?";
|
||||
const keys = Object.keys(query);
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ const https = require("https");
|
||||
/**
|
||||
* @typedef {Object} GetSchemaReturn
|
||||
* @property {boolean} success - Did the function run successfully?
|
||||
* @property {DSQL_DatabaseSchemaType | null} payload - Response payload
|
||||
* @property {import("@/package-shared/types").DSQL_DatabaseSchemaType | null} payload - Response payload
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
+3
-3
@@ -31,7 +31,7 @@ const serializeQuery = require("./functions/serialize-query");
|
||||
* @param {string[]} [params.queryValues] - An array of query values if using "?" placeholders
|
||||
* @param {string} [params.tableName] - Name of the table to query
|
||||
*
|
||||
* @returns { Promise<GetReturn> } - Return Object
|
||||
* @returns { Promise<import("@/package-shared/types").GetReturn> } - Return Object
|
||||
*/
|
||||
async function get({ key, db, query, queryValues, tableName }) {
|
||||
const scheme = process.env.DSQL_HTTP_SCHEME;
|
||||
@@ -59,7 +59,7 @@ async function get({ key, db, query, queryValues, tableName }) {
|
||||
DSQL_PASS?.match(/./) &&
|
||||
DSQL_DB_NAME?.match(/./)
|
||||
) {
|
||||
/** @type {DSQL_DatabaseSchemaType | undefined} */
|
||||
/** @type {import("@/package-shared/types").DSQL_DatabaseSchemaType | undefined} */
|
||||
let dbSchema;
|
||||
|
||||
try {
|
||||
@@ -86,7 +86,7 @@ async function get({ key, db, query, queryValues, tableName }) {
|
||||
* @description make a request to datasquirel.com
|
||||
*/
|
||||
const httpResponse = await new Promise((resolve, reject) => {
|
||||
/** @type {import("@/package-shared/types/general.td").GetReqQueryObject} */
|
||||
/** @type {import("@/package-shared/types").GetReqQueryObject} */
|
||||
const queryObject = {
|
||||
db: String(db),
|
||||
query: String(
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ async function post({ key, query, queryValues, database, tableName }) {
|
||||
DSQL_PASS?.match(/./) &&
|
||||
DSQL_DB_NAME?.match(/./)
|
||||
) {
|
||||
/** @type {DSQL_DatabaseSchemaType | undefined} */
|
||||
/** @type {import("@/package-shared/types").DSQL_DatabaseSchemaType | undefined} */
|
||||
let dbSchema;
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user