Merge pull request #1087 from dermotduffy/basic-unittests

Add unitests for `basic` support functions
This commit is contained in:
Dermot Duffy authored and GitHub committed 2023-04-14 18:31:05 -07:00
commit 6ea7c7d260
4 files changed
+623 -11

No files matched your search

+2 -1
View File
@@ -52,10 +52,11 @@ export function prettifyTitle(input?: string): string | undefined {
* @param from From index.
* @param to To index.
*/
export function arrayMove(target: unknown[], from: number, to: number): void {
export function arrayMove(target: unknown[], from: number, to: number): unknown[] {
const element = target[from];
target.splice(from, 1);
target.splice(to, 0, element);
return target;
}
/**