This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import sys | |
# λλ νμ΄ν°μ μ°Έκ°νκΈ° μν΄μλ μμ΄μ νΈλ₯Ό λ§λ€μ΄μ μ μΆν΄ μ£Όμ μΌ ν©λλ€. | |
# μμ΄μ νΈλ μ¬μ©μκ° μμ±νλ μΈκ³΅μ§λ₯ μ½λλ‘μ, μ£Όμ΄μ§λ νμ¬ κ²μ μνλ₯Ό λ°νμΌλ‘ | |
# μ΄λ€ μ‘μ μ μ·¨ν μ§λ₯Ό κ²°μ νλ μν μ ν©λλ€. | |
# | |
# μ‘μ μ€λͺ | |
# - idle - μ무κ²λ νμ§ μμ΅λλ€. | |
# - forward - μμΌλ‘ μμ§μ λλ€. μλκ° λ°λ‘ μμ μμ κ²½μ° λ μμ§μ΄μ§ μμ΅λλ€. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Polyfill to expand variables in a string | |
// Example: expandEnv("Welcome back ${name}. Glad to see you"); | |
// Example: expandEnv("Welcome back $name. Glad to see you"); | |
// eslint-disable-next-line no-extend-native | |
function expandEnv(s: string): string { | |
return s.replace(/\$([\w]+|{([^{}]*)})/g, (str, varName) => { | |
const vName = varName.startsWith("{") ? varName.substring(1, varName.length - 1) : varName; | |
var value = process.env[vName]; |