mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 10:46:00 +00:00
13 lines
379 B
JavaScript
13 lines
379 B
JavaScript
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;
|