mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 15:25:59 +00:00
archive
This commit is contained in:
12
packages/api/src/utility/getJslFileName.js
Normal file
12
packages/api/src/utility/getJslFileName.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const path = require('path');
|
||||
const { jsldir, archivedir } = require('./directories');
|
||||
|
||||
function getJslFileName(jslid) {
|
||||
const archiveMatch = jslid.match(/^archive:\/\/([^/]+)\/(.*)$/);
|
||||
if (archiveMatch) {
|
||||
return path.join(archivedir(), archiveMatch[1], `${archiveMatch[2]}.jsonl`);
|
||||
}
|
||||
return path.join(jsldir(), `${jslid}.jsonl`);
|
||||
}
|
||||
|
||||
module.exports = getJslFileName;
|
||||
Reference in New Issue
Block a user