Skip to content

Commit b9d6ae4

Browse files
fix: use indexOf for :: split to handle paths with colons
Impact: 1 functions changed, 0 affected
1 parent 1c4ca34 commit b9d6ae4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/export.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@ export function exportMermaid(db, opts = {}) {
305305
const allKeys = [...nodeIdMap.keys()];
306306
const roleStyles = [];
307307
for (const key of allKeys) {
308-
const [file, name] = key.split('::');
308+
const colonIdx = key.indexOf('::');
309+
const file = colonIdx !== -1 ? key.slice(0, colonIdx) : key;
310+
const name = colonIdx !== -1 ? key.slice(colonIdx + 2) : '';
309311
const row = db
310312
.prepare('SELECT role FROM nodes WHERE file = ? AND name = ? AND role IS NOT NULL LIMIT 1')
311313
.get(file, name);

0 commit comments

Comments
 (0)