UNPKG

@onurege3467/zerohelper

Version:

ZeroHelper is a versatile JavaScript library offering helper functions and database utilities for developers. It supports MongoDB, MySQL, SQLite, Redis, and PostgreSQL.

16 lines (12 loc) 515 B
"use strict"; const errors = require("../errors/strings.js"); module.exports = async function (key, table = "default") { if (!table || typeof table !== "string") throw new TypeError(errors.table.replace("{received}", typeof table)); if (!key || typeof key !== "string") throw new TypeError(errors.key.replace("{received}", typeof key)); let tables = await this.tables(); if (!tables.includes(table)) return false; let data = await this.get(table, key); return data != null ? true : false; };