闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
216 B

  1. export default function compareId (id1, id2) {
  2. if (id1 === id2) {
  3. return 0;
  4. }
  5. if (id1.length === id2.length) {
  6. return id1 > id2 ? 1 : -1;
  7. } else {
  8. return id1.length > id2.length ? 1 : -1;
  9. }
  10. };