File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import {
2727 collectNamedBackups ,
2828 type NamedBackupSummary ,
2929} from "./storage/named-backups.js" ;
30+ import { clampIndex , isRecord } from "./storage/record-utils.js" ;
3031import {
3132 buildRestoreAssessment ,
3233 collectBackupMetadata ,
@@ -958,15 +959,6 @@ export function deduplicateAccountsByEmail<
958959 return deduplicateAccountsByIdentity ( accounts ) ;
959960}
960961
961- function isRecord ( value : unknown ) : value is Record < string , unknown > {
962- return ! ! value && typeof value === "object" && ! Array . isArray ( value ) ;
963- }
964-
965- function clampIndex ( index : number , length : number ) : number {
966- if ( length <= 0 ) return 0 ;
967- return Math . max ( 0 , Math . min ( index , length - 1 ) ) ;
968- }
969-
970962function extractActiveAccountRef (
971963 accounts : unknown [ ] ,
972964 activeIndex : number ,
Original file line number Diff line number Diff line change 1+ export function isRecord ( value : unknown ) : value is Record < string , unknown > {
2+ return ! ! value && typeof value === "object" && ! Array . isArray ( value ) ;
3+ }
4+
5+ export function clampIndex ( index : number , length : number ) : number {
6+ if ( length <= 0 ) return 0 ;
7+ return Math . max ( 0 , Math . min ( index , length - 1 ) ) ;
8+ }
You can’t perform that action at this time.
0 commit comments