mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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() {
|
ownKeys() {
|
||||||
return ['all', 'context', 'first', 'item', 'last', 'params', 'pairedItem', 'itemMatching'];
|
return ['all', 'context', 'first', 'item', 'last', 'params', 'itemMatching'];
|
||||||
},
|
},
|
||||||
get(_, property) {
|
get(_, property) {
|
||||||
if (property === 'all') return [];
|
if (property === 'all') return [];
|
||||||
|
@ -30,7 +30,6 @@ export const nodeSelectorProxy = new Proxy(
|
||||||
if (property === 'item') return {};
|
if (property === 'item') return {};
|
||||||
if (property === 'last') return {};
|
if (property === 'last') return {};
|
||||||
if (property === 'params') return {};
|
if (property === 'params') return {};
|
||||||
if (property === 'pairedItem') return {};
|
|
||||||
if (property === 'itemMatching') return {};
|
if (property === 'itemMatching') return {};
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
|
@ -39,7 +38,7 @@ export const nodeSelectorProxy = new Proxy(
|
||||||
);
|
);
|
||||||
|
|
||||||
export const itemProxy = new Proxy(
|
export const itemProxy = new Proxy(
|
||||||
{ json: {}, pairedItem: {} },
|
{ json: {} },
|
||||||
{
|
{
|
||||||
get(_, property) {
|
get(_, property) {
|
||||||
if (property === 'json') return {};
|
if (property === 'json') return {};
|
||||||
|
|
|
@ -56,7 +56,7 @@ export function proxyCompletions(context: CompletionContext): CompletionResult |
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateOptions(toResolve: string, proxy: IDataObject, word: Word): Completion[] {
|
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[')) {
|
if (word.text.includes('json[')) {
|
||||||
return Object.keys(proxy.json as object)
|
return Object.keys(proxy.json as object)
|
||||||
|
|
Loading…
Reference in a new issue