Skip to content

Commit 823546c

Browse files
authored
fix: enforce dash case for event names in docs (vaadin#4588)
1 parent 1cab944 commit 823546c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/prepareDocs.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/usr/bin/env node
22
const fs = require('fs');
33

4+
const CAMEL_TO_DASH = /([A-Z])/g;
5+
46
function generateChangeEventName(property) {
5-
return `${property.name}-changed`;
7+
return `${property.name.replace(CAMEL_TO_DASH, '-$1').toLowerCase()}-changed`;
68
}
79

810
function findEvent(element, eventName) {

0 commit comments

Comments
 (0)