🌐 AI搜索 & 代理 主页
Skip to content

Commit a293467

Browse files
devdoomaridevdoomari3
authored andcommitted
[ts plugin] nullable to null OR undefined
1 parent 3aea732 commit a293467

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

py_type_extractor/plugins/typescript/Converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __init__(
7474
def get_identifier(self, node: NodeType) -> str:
7575
# TODO: sanitize names!
7676
if isinstance(node, NoneNode):
77-
return 'null'
77+
return 'null | undefined'
7878
if isinstance(node, ClassFound):
7979
return node.name.replace('.', '__')
8080
if isinstance(node, FunctionFound):
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export function func_return_none(
2-
some_input: string | null,
3-
some_input2: boolean | null,
2+
some_input: string | null | undefined,
3+
some_input2: boolean | null | undefined,
44
): any
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export function func_with_builtin_type_args(
22
a: number,
3-
b: string | null,
3+
b: string | null | undefined,
44
): number

0 commit comments

Comments
 (0)