mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-01-11 12:41:12 +08:00
[improvement][headless-fe] Revised the interaction for semantic modeling routing and implemented the initial version of metric management switching.
This commit is contained in:
@@ -502,3 +502,10 @@ export function decryptPassword(encryptPassword: string) {
|
||||
export function uniqueArray(arr: any[]) {
|
||||
return Array.from(new Set(arr));
|
||||
}
|
||||
|
||||
// 替换以:开头标记的变量
|
||||
export const replaceRouteParams = (template: string, values: Record<string, string>): string => {
|
||||
return template.replace(/:([a-zA-Z0-9_]+)/g, (match, key) => {
|
||||
return values[key] !== undefined ? values[key] : match;
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user