ChemPare Documentation - v0.0.0
    Preparing search index...

    Module helpers/fetch

    Functions

    generateSimpleHash

    Generates a simple hash from a string using the djb2 algorithm. This is a non-cryptographic hash function suitable for request identification.

    generateRequestHash

    Generates a unique hash for a request based on its URL, method, headers, and body. This hash can be used to identify and track unique requests.

    fetchDecorator

    A decorator function that wraps the native fetch API with additional features:

    • Automatic response parsing based on content type
    • Request hash generation for tracking
    • Error handling
    • Response cloning to prevent body stream consumption

    Type Aliases

    FetchDecoratorResponse

    Response type that extends the standard Response with additional properties for data and request hash tracking.