mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 22:49:18 +00:00
refactor: improve template input
This commit is contained in:
committed by
Carlos Valente
parent
5fb30c75c4
commit
6b2e45e7de
+10
@@ -83,6 +83,16 @@ export function matchRemaining(a: string, b: string) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// naive match assuming that a template will start with {{
|
||||
if (a.endsWith('{{') && b.startsWith('{{')) {
|
||||
return b.substring(2);
|
||||
}
|
||||
|
||||
// naive match assuming that a template will start with {
|
||||
if (a.endsWith('{') && b.startsWith('{{')) {
|
||||
return b.substring(1);
|
||||
}
|
||||
|
||||
for (let i = 0; i < b.length; i++) {
|
||||
const searchString = b.substring(0, i + 1);
|
||||
if (a.endsWith(searchString)) {
|
||||
|
||||
Reference in New Issue
Block a user