mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
👕 Fix lint issue
This commit is contained in:
@@ -17,7 +17,7 @@ export class MongoDb implements INodeType {
|
||||
|
||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
const { database, connectionString } = validateAndResolveMongoCredentials(
|
||||
this.getCredentials('mongoDb')
|
||||
this.getCredentials('mongoDb'),
|
||||
);
|
||||
|
||||
const client: MongoClient = await MongoClient.connect(connectionString, {
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
* @param {ICredentialDataDecryptedObject} credentials MongoDB credentials to use, unless conn string is overridden
|
||||
*/
|
||||
function buildParameterizedConnString(
|
||||
credentials: IMongoParametricCredentials
|
||||
credentials: IMongoParametricCredentials,
|
||||
): string {
|
||||
if (credentials.port) {
|
||||
return `mongodb://${credentials.user}:${credentials.password}@${credentials.host}:${credentials.port}`;
|
||||
@@ -31,7 +31,7 @@ function buildParameterizedConnString(
|
||||
* @param {ICredentialDataDecryptedObject} credentials raw/input MongoDB credentials to use
|
||||
*/
|
||||
function buildMongoConnectionParams(
|
||||
credentials: IMongoCredentialsType
|
||||
credentials: IMongoCredentialsType,
|
||||
): IMongoCredentials {
|
||||
const sanitizedDbName =
|
||||
credentials.database && credentials.database.trim().length > 0
|
||||
@@ -48,7 +48,7 @@ function buildMongoConnectionParams(
|
||||
};
|
||||
} else {
|
||||
throw new Error(
|
||||
'Cannot override credentials: valid MongoDB connection string not provided '
|
||||
'Cannot override credentials: valid MongoDB connection string not provided ',
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@@ -65,13 +65,13 @@ function buildMongoConnectionParams(
|
||||
* @param {ICredentialDataDecryptedObject} credentials raw/input MongoDB credentials to use
|
||||
*/
|
||||
export function validateAndResolveMongoCredentials(
|
||||
credentials?: ICredentialDataDecryptedObject
|
||||
credentials?: ICredentialDataDecryptedObject,
|
||||
): IMongoCredentials {
|
||||
if (credentials === undefined) {
|
||||
throw new Error('No credentials got returned!');
|
||||
} else {
|
||||
return buildMongoConnectionParams(
|
||||
credentials as unknown as IMongoCredentialsType
|
||||
credentials as unknown as IMongoCredentialsType,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ export function validateAndResolveMongoCredentials(
|
||||
*/
|
||||
export function getItemCopy(
|
||||
items: INodeExecutionData[],
|
||||
properties: string[]
|
||||
properties: string[],
|
||||
): IDataObject[] {
|
||||
// Prepare the data to insert and copy it to be returned
|
||||
let newItem: IDataObject;
|
||||
|
||||
Reference in New Issue
Block a user