All files / src/render/dom/utils camel-to-dash.ts

100% Statements 5/5
100% Branches 0/0
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 934x 34x         34x 13x  
const CAMEL_CASE_PATTERN = /([a-z])([A-Z])/g
const REPLACE_TEMPLATE = "$1-$2"
 
/**
 * Convert camelCase to dash-case properties.
 */
export const camelToDash = (str: string) =>
    str.replace(CAMEL_CASE_PATTERN, REPLACE_TEMPLATE).toLowerCase()