Created
July 8, 2017 08:20
-
-
Save deptno/8646d3f70e4ae65729c1bba741d8e940 to your computer and use it in GitHub Desktop.
definition pascal, camelcase
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 c = require('camelcase'); | |
const p = require('pascalcase'); | |
const src = '' //definition | |
console.log( | |
src | |
.replace(/(\S+):/g, (_, $0) => `${c($0)}:`) | |
.replace(/interface (\S+)/g, (_, $0) => `interface ${p(c($0))}`) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment