Skip to content

Instantly share code, notes, and snippets.

@ngs
Last active January 8, 2023 15:49
Show Gist options
  • Save ngs/3f1dfabcabe928d95d37d4705c776a86 to your computer and use it in GitHub Desktop.
Save ngs/3f1dfabcabe928d95d37d4705c776a86 to your computer and use it in GitHub Desktop.
[].slice.call(document.querySelectorAll('#content > div.fixedFont'), 0).map(function(i, n){
const text = i.innerText;
let desc = i.nextSibling;
while(desc && desc.className !== 'description') {
desc = desc.nextSibling;
}
const m = text.match(/\{([^\}]+)\}\s(.+)$/) || ['', 'void', text];
const retType = m[1];
const fn = m[2];
return '/**\n * ' + desc.innerText.replace(/\n/g, '\n * ') + '\n */\n' + fn + ': ' + retType + ';';
}).join('\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment