Allow adding to a group by phone number

This commit is contained in:
Fedor Indutny 2022-04-04 17:38:22 -07:00 committed by GitHub
parent 76a1a805ef
commit 9568d5792e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 1842 additions and 693 deletions

View file

@ -1,4 +1,4 @@
// Copyright 2019-2021 Signal Messenger, LLC
// Copyright 2019-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
// Camelcase disabled due to emoji-datasource using snake_case
@ -220,15 +220,12 @@ export function getImagePath(
const fuse = new Fuse(data, {
shouldSort: true,
threshold: 0.2,
maxPatternLength: 32,
minMatchCharLength: 1,
tokenize: true,
tokenSeparator: /[-_\s]+/,
keys: ['short_name', 'name'],
});
export function search(query: string, count = 0): Array<EmojiData> {
const results = fuse.search(query.substr(0, 32));
const results = fuse.search(query.substr(0, 32)).map(result => result.item);
if (count) {
return take(results, count);