extractLibNameFromSpec function
Extracts the lib: value from a @NitroModule(...) annotation in specFile.
Returns null when the annotation has no explicit lib parameter.
Implementation
String? extractLibNameFromSpec(File specFile) {
final content = specFile.readAsStringSync();
final match = RegExp(r'''@NitroModule\s*\([^)]*lib\s*:\s*['"]([^'"]+)['"]''').firstMatch(content);
return match?.group(1);
}