diff --git a/example/check_comment.coffee b/example/check_comment.coffee index 49c53d9..2f17fee 100644 --- a/example/check_comment.coffee +++ b/example/check_comment.coffee @@ -23,7 +23,7 @@ try url: "https://www.yourblog.com" result = await new Client("123YourAPIKey", blog).checkComment comment - console.log(if result is CheckResult.ham then "The comment is ham." else "The comment is spam.") + console.log if result is CheckResult.ham then "The comment is ham." else "The comment is spam." catch error console.error if error instanceof Error then error.message else error diff --git a/example/verify_key.coffee b/example/verify_key.coffee index a6e85b7..2dd4006 100644 --- a/example/verify_key.coffee +++ b/example/verify_key.coffee @@ -7,7 +7,7 @@ try client = new Client "123YourAPIKey", blog isValid = await client.verifyKey() - console.log(if isValid then "The API key is valid." else "The API key is invalid.") + console.log if isValid then "The API key is valid." else "The API key is invalid." catch error console.error if error instanceof Error then error.message else error diff --git a/src/client.coffee b/src/client.coffee index 564d71b..8859630 100644 --- a/src/client.coffee +++ b/src/client.coffee @@ -19,7 +19,7 @@ export class Client @apiKey = apiKey # The base URL of the remote API endpoint. - @baseUrl = new URL(if url.endsWith("/") then url else "#{url}/") + @baseUrl = new URL if url.endsWith("/") then url else "#{url}/" # The front page or home URL of the instance making requests. @blog = blog