Run yarn lint-fix

This commit is contained in:
SebastjanPrachovskij
2023-11-02 22:17:36 +02:00
parent 83947dc55d
commit a240333e79
3 changed files with 14 additions and 47 deletions
@@ -12,7 +12,7 @@ class SearchApi implements INodeCredential {
this.name = 'searchApi'
this.version = 1.0
this.description =
'Sign in to <a target="_blank" href="https://www.searchapi.io/">SearchApi</a> to obtain a free API key from the dashboard.'
'Sign in to <a target="_blank" href="https://www.searchapi.io/">SearchApi</a> to obtain a free API key from the dashboard.'
this.inputs = [
{
label: 'SearchApi API Key',
@@ -74,17 +74,17 @@ class SearchAPI_DocumentLoaders implements INode {
const searchApiKey = getCredentialParam('searchApiKey', credentialData, nodeData)
// Check and parse custom parameters (should be JSON or object)
const parsedParameters = typeof customParameters === 'object' ? customParameters : JSON.parse(customParameters || '{}');
const parsedParameters = typeof customParameters === 'object' ? customParameters : JSON.parse(customParameters || '{}')
// Prepare the configuration for the SearchApiLoader
const loaderConfig = {
q: query,
apiKey: searchApiKey,
...parsedParameters
};
}
// Initialize the loader with the given configuration
const loader = new SearchApiLoader(loaderConfig);
const loader = new SearchApiLoader(loaderConfig)
// Fetch documents, split if a text splitter is provided
const docs = textSplitter ? await loader.loadAndSplit() : await loader.load()