0
0
Fork 0

Add type annotation for some js files (#24787)

This commit is contained in:
fusagiko / takayamaki 2023-05-03 18:43:29 +09:00 committed by GitHub
parent 9b8cb947a7
commit e38b391940
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 36 additions and 49 deletions

View file

@ -0,0 +1,11 @@
export default function compareId (id1: string, id2: string) {
if (id1 === id2) {
return 0;
}
if (id1.length === id2.length) {
return id1 > id2 ? 1 : -1;
} else {
return id1.length > id2.length ? 1 : -1;
}
}