Updates
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
type Param = {
|
||||
dbName: string;
|
||||
userId?: string | number;
|
||||
};
|
||||
/**
|
||||
* # Grab Database Full Name
|
||||
*/
|
||||
export default function grabDbFullName({ dbName, userId }: Param): string;
|
||||
export {};
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = grabDbFullName;
|
||||
/**
|
||||
* # Grab Database Full Name
|
||||
*/
|
||||
function grabDbFullName({ dbName, userId }) {
|
||||
const sanitizedName = dbName.replace(/[^a-z0-9\_]/g, "");
|
||||
const cleanedDbName = sanitizedName.replace(/datasquirel_user_\d+_/, "");
|
||||
if (!userId)
|
||||
return cleanedDbName;
|
||||
const dbNamePrefix = `datasquirel_user_${userId}_`;
|
||||
return dbNamePrefix + cleanedDbName;
|
||||
}
|
||||
Reference in New Issue
Block a user