1
0
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:
Kyle Spearrin
2018-05-18 15:26:59 -04:00
parent 7c33af769e
commit 2e8d0aaf53
6 changed files with 87 additions and 7 deletions

View File

@@ -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;
});
}
}