mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
list and get organizations
This commit is contained in:
11
src/utils.ts
11
src/utils.ts
@@ -1,6 +1,7 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
import { Organization } from 'jslib/models/domain/organization';
|
||||
import { CipherView } from 'jslib/models/view/cipherView';
|
||||
import { CollectionView } from 'jslib/models/view/collectionView';
|
||||
import { FolderView } from 'jslib/models/view/folderView';
|
||||
@@ -116,4 +117,14 @@ export class CliUtils {
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
static searchOrganizations(organizations: Organization[], search: string) {
|
||||
search = search.toLowerCase();
|
||||
return organizations.filter((o) => {
|
||||
if (o.name != null && o.name.toLowerCase().indexOf(search) > -1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user