Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit ccf1fef

Browse files
Fix transform display of optional string literal (#134)
1 parent 1b75105 commit ccf1fef

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Add functions and example for accessing PostgreSQL [#119](https://github.com/hypermodeAI/functions-as/pull/119)
66
- Make plugin version optional [#133](https://github.com/hypermodeAI/functions-as/pull/133)
7+
- Fix transform display of optional string literal [#134](https://github.com/hypermodeAI/functions-as/pull/134)
78

89
## 2024-07-10 - Version 0.9.4
910

src/transform/src/multiparam.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,10 @@ function getDefaultValue(param: ParameterNode): string | null {
191191
case NodeKind.Literal: {
192192
const literal = param.initializer as LiteralExpression;
193193
switch (literal.literalKind) {
194-
case LiteralKind.String:
195-
return (literal as StringLiteralExpression).value;
194+
case LiteralKind.String: {
195+
const value = (literal as StringLiteralExpression).value;
196+
return JSON.stringify(value);
197+
}
196198
case LiteralKind.Integer:
197199
return (literal as IntegerLiteralExpression).value.toString();
198200
case LiteralKind.Float:

0 commit comments

Comments
 (0)