2023-03-14 13:18:55 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
2020-12-08 09:27:28 +00:00
|
|
|
import Helper from '@ember/component/helper';
|
|
|
|
import { inject as service } from '@ember/service';
|
|
|
|
|
|
|
|
export default class EnvHelper extends Helper {
|
|
|
|
@service('env') env;
|
|
|
|
|
|
|
|
compute([name, def = ''], hash) {
|
|
|
|
const val = this.env.var(name);
|
|
|
|
return val != null ? val : def;
|
|
|
|
}
|
|
|
|
}
|