Skip to content

Commit

Permalink
eslint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianpraja committed Nov 7, 2021
1 parent 9411f0a commit 2f7efe0
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,33 @@ var Lambda = function( o ) {
Lambda.prototype._resolve_refs = function( $config ) {
this.envs = {}

if ((typeof $config.AWS_KEY === "object") && $config.AWS_KEY.hasOwnProperty('Ref') && (typeof $config.AWS_KEY.Ref === "string") && ($config.AWS_KEY.Ref.indexOf('env.') === 0)) {
if (
(typeof $config.AWS_KEY === "object") &&
Object.prototype.hasOwnProperty.call( $config.AWS_KEY , 'Ref') &&
(typeof $config.AWS_KEY.Ref === "string") &&
($config.AWS_KEY.Ref.indexOf('env.') === 0)
) {
this.envs[ $config.AWS_KEY.Ref.split('env.')[1] ] = process.env[ $config.AWS_KEY.Ref.split('env.')[1] ]
$config.AWS_KEY = process.env[ $config.AWS_KEY.Ref.split('env.')[1] ]
}

if ((typeof $config.AWS_SECRET === "object") && $config.AWS_SECRET.hasOwnProperty('Ref') && (typeof $config.AWS_SECRET.Ref === "string") && ($config.AWS_SECRET.Ref.indexOf('env.') === 0)) {
if (
(typeof $config.AWS_SECRET === "object") &&
Object.prototype.hasOwnProperty.call( $config.AWS_SECRET , 'Ref') &&
(typeof $config.AWS_SECRET.Ref === "string") &&
($config.AWS_SECRET.Ref.indexOf('env.') === 0)
) {
this.envs[ $config.AWS_SECRET.Ref.split('env.')[1] ] = process.env[ $config.AWS_SECRET.Ref.split('env.')[1] ]
$config.AWS_SECRET = process.env[ $config.AWS_SECRET.Ref.split('env.')[1] ]
}


if ((typeof $config.Role === "object") && $config.Role.hasOwnProperty('Ref') && (typeof $config.Role.Ref === "string") && ($config.Role.Ref.indexOf('env.') === 0)) {
if (
(typeof $config.Role === "object") &&
Object.prototype.hasOwnProperty.call( $config.Role , 'Ref') &&
(typeof $config.Role.Ref === "string") &&
($config.Role.Ref.indexOf('env.') === 0)
) {
this.envs[ $config.Role.Ref.split('env.')[1] ] = process.env[ $config.Role.Ref.split('env.')[1] ]
$config.Role = process.env[ $config.Role.Ref.split('env.')[1] ]
}
Expand Down

0 comments on commit 2f7efe0

Please sign in to comment.