Skip to content

Commit

Permalink
fix toJSONString
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Feb 12, 2020
1 parent 987da69 commit 2e9a14f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -15,4 +15,5 @@ csharp/**/.vs/
.idea
target/
*.iml

java/.project
java/.settings/
2 changes: 1 addition & 1 deletion csharp/core/Common.cs
Expand Up @@ -116,7 +116,7 @@ public static string ToFormString(Dictionary<string, object> map)
return result.ToString();
}

public static string ToJSONString(Dictionary<string, object> dict)
public static string ToJSONString(Object value)
{
return JsonConvert.SerializeObject(dict);
}
Expand Down
2 changes: 1 addition & 1 deletion golang/service/service.go
Expand Up @@ -62,7 +62,7 @@ func DefaultString(reaStr, defaultStr string) string {
return reaStr
}

func ToJSONString(a map[string]interface{}) string {
func ToJSONString(a interface{}) string {
byt, _ := json.Marshal(a)
return string(byt)
}
Expand Down
6 changes: 3 additions & 3 deletions main.tea
Expand Up @@ -97,10 +97,10 @@ static function defaultNumber(real: number, default: number): number;
static function toFormString(val: object): string;

/**
* If not set the real, use default value
* @return the return string
* Stringify a value by JSON format
* @return the JSON format string
*/
static function toJSONString(val: object): string;
static function toJSONString(val: any): string;

/**
* Check the string is empty?
Expand Down
2 changes: 1 addition & 1 deletion ts/src/client.ts
Expand Up @@ -130,7 +130,7 @@ export default class Client {
return querystring.stringify(val);
}

static toJSONString(val: {[key: string]: any}): string {
static toJSONString(val: any): string {
return JSON.stringify(val);
}

Expand Down

0 comments on commit 2e9a14f

Please sign in to comment.