mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: start on amending slugs
This commit is contained in:
1 parent
dd0b2bade7
commit
3d69d464f5
5 files changed
+38
-177
No files matched your search
@@ -1,5 +1,10 @@
|
||||
export function literals(string: string, literals: string[]) {
|
||||
return literals.reduce((accumulator, literal, index) => {
|
||||
return accumulator.replace(`%s${index + 1}`, literal);
|
||||
}, string);
|
||||
export function literals(
|
||||
string: string,
|
||||
literals?: Record<string, string | number>
|
||||
) {
|
||||
for (const key in literals) {
|
||||
string = string.replaceAll(`{${key}}`, `${literals[key]}`);
|
||||
}
|
||||
|
||||
return string;
|
||||
}
|
||||
Reference in new issue
Block a user