winston0410/camouflage

View on GitHub
benchmarks/handleComma/mapJoin.ts

Summary

Maintainability
A
0 mins
Test Coverage
const handleCommaByMapJoin = (parentSelector: string, childSelectors: string): string => {
    if (!childSelectors.includes(',')) {
        return childSelectors
    }
    return childSelectors
        .split(',')
        .map((selector) => {
            return `${parentSelector} ${selector}`
        })
        .join(',')
}

module.exports = handleCommaByMapJoin