This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require("fs"); | |
| const path = require("path"); | |
| function toKebabCase(name) { | |
| // Split at first period to separate initial name from the rest | |
| const [firstPart, ...rest] = name.split("."); | |
| // Convert camelCase and PascalCase to space-separated for first part only | |
| const withSpaces = firstPart | |
| .replace(/([a-z])([A-Z])/g, "$1 $2") |