mirror of
https://github.com/usebruno/bruno.git
synced 2025-08-09 14:05:15 +02:00
feat: bru hasEnvVar, hasVar, deleteVar (#2531)
Co-authored-by: Anoop M D <anoop.md1421@gmail.com>
This commit is contained in:
@ -43,6 +43,10 @@ class Bru {
|
||||
return this.processEnvVars[key];
|
||||
}
|
||||
|
||||
hasEnvVar(key) {
|
||||
return Object.hasOwn(this.envVariables, key);
|
||||
}
|
||||
|
||||
getEnvVar(key) {
|
||||
return this._interpolate(this.envVariables[key]);
|
||||
}
|
||||
@ -55,6 +59,10 @@ class Bru {
|
||||
this.envVariables[key] = value;
|
||||
}
|
||||
|
||||
hasVar(key) {
|
||||
return Object.hasOwn(this.collectionVariables, key);
|
||||
}
|
||||
|
||||
setVar(key, value) {
|
||||
if (!key) {
|
||||
throw new Error('Creating a variable without specifying a name is not allowed.');
|
||||
@ -81,6 +89,10 @@ class Bru {
|
||||
return this._interpolate(this.collectionVariables[key]);
|
||||
}
|
||||
|
||||
deleteVar(key) {
|
||||
delete this.collectionVariables[key];
|
||||
}
|
||||
|
||||
getRequestVar(key) {
|
||||
return this._interpolate(this.requestVariables[key]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user