Skip to content

Commit 4b4761b

Browse files
wayneparrottMinggang Wang
authored andcommitted
Improve tsd generation resilency.
rostsd_gen/index.js - support service idl defined in any folder starting with 'srv', e.g., 'srvs' - support action idl defined in any folder starting with 'action', e.g., 'actions' Fix #688
1 parent 5467e69 commit 4b4761b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rostsd_gen/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function getPkgInfos(generatedRoot) {
6565
for (let filename of files) {
6666
const typeClass = fileName2Typeclass(filename);
6767

68-
if (typeClass.type === 'srv') {
68+
if (typeClass.type && typeClass.type.startsWith('srv')) {
6969
// skip __srv__<action>
7070
if (
7171
!typeClass.name.endsWith('_Request') &&
@@ -90,7 +90,7 @@ function getPkgInfos(generatedRoot) {
9090
def: def,
9191
};
9292

93-
if (typeClass.type === 'action') {
93+
if (typeClass.type && typeClass.type.startsWith('action')) {
9494
pkgInfo.actions.push(msgInfo);
9595
} else {
9696
pkgInfo.messages.push(msgInfo);

0 commit comments

Comments
 (0)