mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-09 19:03:33 +02:00
Filter out current variable from autocomplete and show sub environment variables in base environment autocomplete
This commit is contained in:
10
src-web/components/core/PairEditor.util.tsx
Normal file
10
src-web/components/core/PairEditor.util.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import { generateId } from '../../lib/generateId';
|
||||
import type { Pair, PairWithId } from './PairEditor';
|
||||
|
||||
export function ensurePairId(p: Pair): PairWithId {
|
||||
if (typeof p.id === 'string') {
|
||||
return p as PairWithId;
|
||||
} else {
|
||||
return { ...p, id: p.id ?? generateId() };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user