How to use the @creditkarma/thrift-server-core.deepMerge function in @creditkarma/thrift-server-core

To help you get started, we’ve selected a few @creditkarma/thrift-server-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github creditkarma / thrift-server / packages / thrift-client / src / main / connections / index.ts View on Github external
options: ICreateHttpClientOptions,
): TClient {
    let serviceName: string = ''
    if ((ServiceClient as any).serviceName !== 'undefined') {
        serviceName = (ServiceClient as any).serviceName
    } else {
        const nullConnection: NullConnection = new NullConnection(
            BufferedTransport,
            BinaryProtocol,
        )
        const nullClient: TClient = new ServiceClient(nullConnection)
        serviceName = nullClient._serviceName
    }

    const connection: HttpConnection = new HttpConnection(
        deepMerge(options, { serviceName }),
    )

    // Register optional middleware
    connection.register(...(options.register || []))

    return new ServiceClient(connection)
}
github creditkarma / thrift-server / packages / thrift-client / src / main / connections / HttpConnection.ts View on Github external
(
                nextData?: Buffer,
                nextOptions?: RequestOptions,
            ): Promise => {
                const data: Buffer =
                    nextData !== undefined ? nextData : currentRequest.data

                return applyFilters(
                    {
                        data,
                        methodName: currentRequest.methodName,
                        uri: currentRequest.uri,
                        context: Core.deepMerge(
                            currentRequest.context,
                            nextOptions || {},
                        ),
                    },
                    tail,
                    callback,
                )
            },
        )