refactor: Simplify getJsApiCode utility function
Simplify the getJsApiCode utility function in the get-js-api-code.tsx file. The unnecessary replacement of JavaScript boolean literals has been removed, improving code readability and maintainability.
This commit is contained in:
parent
590ab5135e
commit
c06227e7d0
1 changed files with 1 additions and 4 deletions
|
|
@ -18,11 +18,8 @@ export default function getJsApiCode(
|
||||||
if (!tweaksObject) {
|
if (!tweaksObject) {
|
||||||
throw new Error("Expected tweaks object is not provided.");
|
throw new Error("Expected tweaks object is not provided.");
|
||||||
}
|
}
|
||||||
tweaksString = JSON.stringify(tweaksObject, null, 2)
|
tweaksString = JSON.stringify(tweaksObject, null, 2);
|
||||||
.replace(/true/g, "true") // Ensuring JavaScript boolean literals are correctly formatted
|
|
||||||
.replace(/false/g, "false");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return `class LangflowClient {
|
return `class LangflowClient {
|
||||||
constructor(baseURL, apiKey) {
|
constructor(baseURL, apiKey) {
|
||||||
this.baseURL = baseURL;
|
this.baseURL = baseURL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue