Skip to content

Commit

Permalink
Fixed regex to process default values correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
devule committed Mar 20, 2022
1 parent a646d5c commit 2597324
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict'

function _interpolate (envValue, environment, config) {
const matches = envValue.match(/(.?\${*[\w]*(?::-)?[\w]*}*)/g) || []
const matches = envValue.match(/(.?\${*[\w]*(?::-[\w/]*)?}*)/g) || []

return matches.reduce(function (newEnv, match, index) {
const parts = /(.?)\${*([\w]*(?::-)?[\w]*)?}*/g.exec(match)
const parts = /(.?)\${*([\w]*(?::-[\w/]*)?)?}*/g.exec(match)
if (!parts || parts.length === 0) {
return newEnv
}
Expand Down

0 comments on commit 2597324

Please sign in to comment.