add function
This commit is contained in:
parent
fe9a50d367
commit
3a5c098128
@ -77,6 +77,10 @@ export function randomString() {
|
||||
return Math.random().toString(36).substring(2, 9);
|
||||
}
|
||||
|
||||
export function isJustOne<T>(list: T[]): list is [T] {
|
||||
return list.length === 1;
|
||||
}
|
||||
|
||||
export function trackByFactory<T extends ITrackable<PrimaryKey>, PrimaryKey extends Id = T['id']>() {
|
||||
return (_index: number, item: T): Id => item.id;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user