mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
fix(core): Fix .map calls on NodeExecutionOutput (no-changelog) (#11955)
This commit is contained in:
committed by
GitHub
parent
967340a293
commit
969439ce56
@@ -14,7 +14,7 @@ import type { URLSearchParams } from 'url';
|
||||
|
||||
import type { CODE_EXECUTION_MODES, CODE_LANGUAGES, LOG_LEVELS } from './Constants';
|
||||
import type { IDeferredPromise } from './DeferredPromise';
|
||||
import type { ExecutionCancelledError } from './errors';
|
||||
import { ApplicationError, type ExecutionCancelledError } from './errors';
|
||||
import type { ExpressionError } from './errors/expression.error';
|
||||
import type { NodeApiError } from './errors/node-api.error';
|
||||
import type { NodeOperationError } from './errors/node-operation.error';
|
||||
@@ -1587,17 +1587,25 @@ export interface SupplyData {
|
||||
closeFunction?: CloseFunction;
|
||||
}
|
||||
|
||||
export class NodeExecutionOutput extends Array {
|
||||
private hints: NodeExecutionHint[];
|
||||
|
||||
export class NodeExecutionOutput extends Array<INodeExecutionData[]> {
|
||||
constructor(data: INodeExecutionData[][], hints: NodeExecutionHint[] = []) {
|
||||
super();
|
||||
this.push(...data);
|
||||
this.hints = hints;
|
||||
// TODO: This is a temporary solution for NODE-1740, until we move away from extending native Array class
|
||||
Object.defineProperty(data, 'getHints', {
|
||||
value: () => hints,
|
||||
enumerable: false,
|
||||
writable: false,
|
||||
configurable: false,
|
||||
});
|
||||
return data as NodeExecutionOutput;
|
||||
}
|
||||
|
||||
public getHints(): NodeExecutionHint[] {
|
||||
return this.hints;
|
||||
static [Symbol.hasInstance](instance: unknown) {
|
||||
return Array.isArray(instance) && 'getHints' in instance;
|
||||
}
|
||||
|
||||
getHints(): NodeExecutionHint[] {
|
||||
throw new ApplicationError('This should not have been called');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user