fdgt-apis/api

View on GitHub
src/helpers/serializeTwitchObject.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
export default object => {
    const foo = Object.entries(object).reduce((accumulator, [key, value]) => {
        if (accumulator) {
            accumulator += ';'
        }

        return `${accumulator}${key}=${value || ''}`
    }, '').replace(/\s/gu, '\\s')

    return foo
}