Skip to content

Commit 6d6ff30

Browse files
committed
remove commented out code
1 parent c7cead7 commit 6d6ff30

File tree

1 file changed

+0
-50
lines changed

1 file changed

+0
-50
lines changed

lib/main.js

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,5 @@
11
'use strict'
22

3-
// // like String.prototype.search but returns the last index
4-
// function _searchLast (str, rgx) {
5-
// const matches = Array.from(str.matchAll(rgx))
6-
// return matches.length > 0 ? matches.slice(-1)[0].index : -1
7-
// }
8-
//
9-
// function _interpolate (value, processEnv, parsed) {
10-
// // find the last unescaped dollar sign in the value to evaluate
11-
// const lastUnescapedDollarSignIndex = _searchLast(value, /(?!(?<=\\))\$/g)
12-
//
13-
// // return early unless unescaped dollar sign
14-
// if (lastUnescapedDollarSignIndex === -1) {
15-
// return value
16-
// }
17-
//
18-
// // This is the right-most group of variables in the string
19-
// const rightMostGroup = value.slice(lastUnescapedDollarSignIndex)
20-
//
21-
// console.log('rightMostGroup', rightMostGroup)
22-
//
23-
// /**
24-
// * This finds the inner most variable/group divided
25-
// * by variable name and default value (if present)
26-
// * (
27-
// * (?!(?<=\\))\$ // only match dollar signs that are not escaped
28-
// * {? // optional opening curly brace
29-
// * ([\w.]+) // match the variable name
30-
// * (?::-([^}\\]*))? // match an optional default value
31-
// * }? // optional closing curly brace
32-
// * )
33-
// */
34-
// const matchGroup = /((?!(?<=\\))\${?([\w.]+)(?::-([^}\\]*))?}?)/
35-
// const match = rightMostGroup.match(matchGroup)
36-
//
37-
// if (match != null) {
38-
// const [, group, key, defaultValue] = match
39-
// const replacementString = processEnv[key] || defaultValue || parsed[key] || ''
40-
// const modifiedValue = value.replace(group, replacementString)
41-
//
42-
// // return early for scenario like processEnv.PASSWORD = 'pas$word'
43-
// if (processEnv[key] && modifiedValue === processEnv[key]) {
44-
// return modifiedValue
45-
// }
46-
//
47-
// return _interpolate(modifiedValue, processEnv, parsed)
48-
// }
49-
//
50-
// return value
51-
// }
52-
533
function _resolveEscapeSequences (value) {
544
return value.replace(/\\\$/g, '$')
555
}

0 commit comments

Comments
 (0)