mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 06:34:05 -08:00
fix(editor): Omit pairedItem
from proxy completions (#5098)
* ⚡ Omit `pairedItem` from proxy completions * 🧪 Fix tests
This commit is contained in:
parent
bae1487a53
commit
320e646380
|
@ -21,7 +21,7 @@ export const nodeSelectorProxy = new Proxy(
|
|||
{},
|
||||
{
|
||||
ownKeys() {
|
||||
return ['all', 'context', 'first', 'item', 'last', 'params', 'pairedItem', 'itemMatching'];
|
||||
return ['all', 'context', 'first', 'item', 'last', 'params', 'itemMatching'];
|
||||
},
|
||||
get(_, property) {
|
||||
if (property === 'all') return [];
|
||||
|
@ -30,7 +30,6 @@ export const nodeSelectorProxy = new Proxy(
|
|||
if (property === 'item') return {};
|
||||
if (property === 'last') return {};
|
||||
if (property === 'params') return {};
|
||||
if (property === 'pairedItem') return {};
|
||||
if (property === 'itemMatching') return {};
|
||||
|
||||
return undefined;
|
||||
|
@ -39,7 +38,7 @@ export const nodeSelectorProxy = new Proxy(
|
|||
);
|
||||
|
||||
export const itemProxy = new Proxy(
|
||||
{ json: {}, pairedItem: {} },
|
||||
{ json: {} },
|
||||
{
|
||||
get(_, property) {
|
||||
if (property === 'json') return {};
|
||||
|
|
|
@ -56,7 +56,7 @@ export function proxyCompletions(context: CompletionContext): CompletionResult |
|
|||
}
|
||||
|
||||
function generateOptions(toResolve: string, proxy: IDataObject, word: Word): Completion[] {
|
||||
const SKIP_SET = new Set(['__ob__']);
|
||||
const SKIP_SET = new Set(['__ob__', 'pairedItem']);
|
||||
|
||||
if (word.text.includes('json[')) {
|
||||
return Object.keys(proxy.json as object)
|
||||
|
|
Loading…
Reference in a new issue