<commit_before>import { Query, getQueryString } from './query';
import { Result } from './result';
import { Document } from './document';


export const get = async (id: string): Promise<Document> => {

    const response = await fetch(`/documents/${id}`);
    if (response.ok) return await response.json();
    else throw(await response.json());
};


export const search = async (query: Query): Promise<Result> => {

    const uri = `/documents/?${getQueryString(query)}`;
    const response = await fetch(uri);
    return response.json();
};

export const mapSearch = async (query: Query): Promise<Result> => {

    const uri = `/documents/map?${getQueryString(query)}`;
    const response = await fetch(uri);
    return response.json();
}<commit_msg>Code style<commit_after>import { Query, getQueryString } from './query';
import { Result } from './result';
import { Document } from './document';


export const get = async (id: string): Promise<Document> => {

    const response = await fetch(`/documents/${id}`);
    if (response.ok) return await response.json();
    else throw(await response.json());
};


export const search = async (query: Query): Promise<Result> => {

    const uri = `/documents/?${getQueryString(query)}`;
    const response = await fetch(uri);
    return response.json();
};


export const mapSearch = async (query: Query): Promise<Result> => {

    const uri = `/documents/map?${getQueryString(query)}`;
    const response = await fetch(uri);
    return response.json();
};
{'fraction_non_alphanumeric': 0.1654485049833887, 'fraction_numerical': 0.0, 'mean_word_length': 4.070707070707071, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '321650', 'n_tokens_mistral': 439, 'n_tokens_neox': 424, 'n_words': 129}