Q:

lower case not working on environment variable

Why can't you lower case a Node.js environment variable?  

process.env.someEnvironmentVariable.toLowerCase()
process.env.someEnvironmentVariable.toString().toLowerCase()

not of these work
this however does but is there a cleaner way to do this:
let test = process.env.someEnvironmentVariable
console.log(`test: ${test.toLowerCase()}`)

This is another problem but the cause is probably different
 options = {
      branch: env.BRANCH,
      domain: env.DOMAIN,
      localDeployFolder: env.FOLDER
    }
    const opts = Object.assign({}, options)
    opts.branch = opts.branch.toLowerCase()
    const bucket = `${options.domain.toLowerCase()}-${options.branch}`

it doesn't lower case branch

A:

Everything works as expected, because environment variables are always strings
❯ SOME_VAL=AbC1 node
> process.env.SOME_VAL.toLowerCase()
'abc1'

But if you define environment variable as 123, abc, 1a, of course toLowerCase will not work, as variables are already lowercased

