nitroWebExportName function

String nitroWebExportName(
  1. String libName
)

Computes the Emscripten EXPORT_NAME factory for a nitro lib name: benchmark_cppcreateBenchmarkCppModule. The CMake emitter uses the same convention — keep the two in sync.

Implementation

String nitroWebExportName(String libName) {
  final pascal = libName.split(RegExp(r'[_\-]+')).where((p) => p.isNotEmpty).map((p) => p[0].toUpperCase() + p.substring(1)).join();
  return 'create${pascal}Module';
}