UNPKG

widl-nan

Version:

Auto generate native C++ addon source code by parsing Web IDL definition

19 lines (15 loc) 594 B
{{ var classNameToMemberName = function(className) { /* TODO(widl-nan): covert camel style to under bar style */ return className.toLowerCase() + '_'; }; var classNameToFileName = function(className) { /* Following https://google.github.io/styleguide/cppguide.html#File_Names * If interface name is MyTestInterface, the C++ file name will be my_test_interface.cpp|h */ return className.replace(/((?!^)[A-Z][a-z0-9]+)/g, '_$1').toLowerCase(); }; var classNameToGuardName = function(className) { return className.replace(/((?!^)[A-Z][a-z0-9]+)/g, '_$1').toUpperCase(); }; }}