Skip to content

Commit 4cc5ac6

Browse files
committed
feat(plugin-js-lambda-microlib): add ability to have objects
1 parent e657c1b commit 4cc5ac6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/plugin-js-lambda-microlib/src/MicroserviceType.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,16 @@ export default class MicroserviceType {
673673
case true:
674674
return 'true';
675675
default:
676+
if ('object' === typeof x) {
677+
return `{${Object.entries(x).reduce((acc, [k, v]) => {
678+
if (Array.isArray(v)) {
679+
v = this.mapToStringifyValueForHook(v, options);
680+
} else {
681+
v = this.stringifyValueForHook(`'${v}'`, options);
682+
}
683+
return `${acc}${acc ? ', ' : ''}${k}: ${v}`;
684+
}, '')}}`;
685+
}
676686
return this.stringifyValueForHook(`'${x}'`, options);
677687
}
678688
})

0 commit comments

Comments
 (0)