Add unitests for basic functions.

This commit is contained in:
Dermot Duffy
2023-04-14 18:27:25 -07:00
parent 7361900d14
commit 9b7eae303b
4 changed files with 623 additions and 11 deletions
+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;
}
/**