mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
regex + revert test
This commit is contained in:
parent
069fa3cffa
commit
67de6b1147
2 changed files with 3 additions and 9 deletions
|
|
@ -445,7 +445,7 @@ func Test_PerformerStore_UpdatePartial(t *testing.T) {
|
|||
url = "url"
|
||||
twitter = "twitter"
|
||||
instagram = "instagram"
|
||||
urls = []string{instagram, twitter, url} // sorted alphabetically
|
||||
urls = []string{url, twitter, instagram}
|
||||
rating = 3
|
||||
ethnicity = "ethnicity"
|
||||
country = "country"
|
||||
|
|
|
|||
|
|
@ -1,14 +1,8 @@
|
|||
/**
|
||||
* Extracts the sortable portion of a URL by removing the protocol and www. prefix
|
||||
*/
|
||||
function urlSortKey(url: string): string {
|
||||
let key = url;
|
||||
// Remove http:// or https://
|
||||
key = key.replace(/^https?:\/\//, "");
|
||||
// Remove www. prefix
|
||||
key = key.replace(/^www\./, "");
|
||||
return key.toLowerCase();
|
||||
}
|
||||
const urlSortKey = (url: string): string =>
|
||||
url.toLowerCase().replace(/^(https?:\/\/)?(www\.)?/, "");
|
||||
|
||||
/**
|
||||
* Sorts a list of URLs alphabetically by their base URL,
|
||||
|
|
|
|||
Loading…
Reference in a new issue