mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-25 04:36:46 +00:00
Rename files
This commit is contained in:
13
ts/util/isSorted.std.ts
Normal file
13
ts/util/isSorted.std.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export function isSorted(list: Iterable<number>): boolean {
|
||||
let previousItem: undefined | number;
|
||||
for (const item of list) {
|
||||
if (previousItem !== undefined && item < previousItem) {
|
||||
return false;
|
||||
}
|
||||
previousItem = item;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user