<commit_before>// Type definitions for fetch-mock 4.6.0
// Project: https://github.com/wheresrhys/fetch-mock
// Definitions by: <NAME> <https://github.com/asvetliakov>, <NAME> <https://github.com/tamird>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../whatwg-fetch/whatwg-fetch.d.ts" />


declare module "fetch-mock" {
    /**
     * Mock matcher function
     * @param url
     * @param opts
     */
    type MockMatcherFunction = (url: string, opts: any) => boolean;
    /**
     * Mock matcher. Can be one of following:
     * string: Either an exact url to match e.g. 'http://www.site.com/page.html' or, if the string begins with a ^, the string following the ^ must begin the url
     * e.g. '^http://www.site.com' would match 'http://www.site.com' or 'http://www.site.com/page.html'
     * RegExp: A regular expression to test the url against
     * Function(url, opts): A function (returning a Boolean) that is passed the url and opts fetch() is called with (or, if fetch() was called with one, the Request instance)
     */
    type MockMatcher = string | RegExp | Function | MockMatcherFunction;

    /**
     * Mock response function
     * @param url
     * @param opts
     */
    type MockResponseFunction = (url: string, opts: any) => MockResponse;
    /**
     * number: Creates a response with this status
     * string: Creates a 200 response with the string as the response body
     * object: As long as the object does not contain any of the properties below it is converted into a json string and returned as the body of a 200 response.
     * If MockResponseObject was given then it's used to configure response
     */
    type MockResponse = number | string | Object | MockResponseObject;


    /**
     * Mock response object
     */
    interface MockResponseObject {
        /**
         * Set the response body
         */
        body?: string | Object;
        /**
         * Set the response status
         * @default 200
         */
        status?: number;
        /**
         * Set the response headers.
         */
        headers?: { [key: string]: any };
        /**
         * If this property is present then a Promise rejected with the value of throws is returned
         */
        throws?: boolean;
        /**
         * This property determines whether or not the request body should be JSON.stringified before being sent
         * @default true
         */
        sendAsJson?: boolean;
    }

    interface MockCallOptions {
        [key: string]: any;
    }

    type MockCall = [string, RequestInit];

    interface MatchedRoutes {
        matched: MockCall[];<commit_msg>Use {} type instead of object interface<commit_after>// Type definitions for fetch-mock 4.6.0
// Project: https://github.com/wheresrhys/fetch-mock
// Definitions by: <NAME> <https://github.com/asvetliakov>, <NAME> <https://github.com/tamird>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../whatwg-fetch/whatwg-fetch.d.ts" />


declare module "fetch-mock" {
    /**
     * Mock matcher function
     * @param url
     * @param opts
     */
    type MockMatcherFunction = (url: string, opts: any) => boolean;
    /**
     * Mock matcher. Can be one of following:
     * string: Either an exact url to match e.g. 'http://www.site.com/page.html' or, if the string begins with a ^, the string following the ^ must begin the url
     * e.g. '^http://www.site.com' would match 'http://www.site.com' or 'http://www.site.com/page.html'
     * RegExp: A regular expression to test the url against
     * Function(url, opts): A function (returning a Boolean) that is passed the url and opts fetch() is called with (or, if fetch() was called with one, the Request instance)
     */
    type MockMatcher = string | RegExp | Function | MockMatcherFunction;

    /**
     * Mock response function
     * @param url
     * @param opts
     */
    type MockResponseFunction = (url: string, opts: any) => MockResponse;
    /**
     * number: Creates a response with this status
     * string: Creates a 200 response with the string as the response body
     * object: As long as the object does not contain any of the properties below it is converted into a json string and returned as the body of a 200 response.
     * If MockResponseObject was given then it's used to configure response
     */
    type MockResponse = number | string | MockResponseObject | {};


    /**
     * Mock response object
     */
    interface MockResponseObject {
        /**
         * Set the response body
         */
        body?: string | {};
        /**
         * Set the response status
         * @default 200
         */
        status?: number;
        /**
         * Set the response headers.
         */
        headers?: { [key: string]: any };
        /**
         * If this property is present then a Promise rejected with the value of throws is returned
         */
        throws?: boolean;
        /**
         * This property determines whether or not the request body should be JSON.stringified before being sent
         * @default true
         */
        sendAsJson?: boolean;
    }

    interface MockCallOptions {
        [key: string]: any;
    }

    type MockCall = [string, RequestInit];

    interface MatchedRoutes {
        matched: MockCall[];
{'fraction_non_alphanumeric': 0.10724962630792227, 'fraction_numerical': 0.004484304932735426, 'mean_word_length': 2.282035561005518, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 8, 'lorem ipsum': 0, 'www.': 8, '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': '7217762', 'n_tokens_mistral': 1459, 'n_tokens_neox': 1420, 'n_words': 548}