import e from"path";import i from"fs/promises";class m{static#a=".data";static generateDatabasePath({baseDir:r,databaseName:c,additionalFolder:a}){const s=e.join(r,this.#a),t=a?e.join(s,a):s;return e.join(t,c)}static async prepareDatabasePath({baseDir:r,databaseName:c,additionalFolder:a,removeExisting:s}){const t=this.generateDatabasePath({baseDir:r,databaseName:c,additionalFolder:a}),n=e.join(r,this.#a),o=a?e.join(n,a):n;return s?(await i.rm(o,{recursive:!0,force:!0}),await i.mkdir(o,{recursive:!0}),{databasePath:t}):(await i.access(t).then(()=>!0).catch(()=>!1)||await i.mkdir(o,{recursive:!0}),{databasePath:t})}}export{m as DatabasePathGenerator};
