(options)
| 2008 | return { ciphertext, key }; |
| 2009 | } |
| 2010 | function _vaultPath(options) { |
| 2011 | let possibleVaultPath = null; |
| 2012 | if (options && options.path && options.path.length > 0) { |
| 2013 | if (Array.isArray(options.path)) { |
| 2014 | for (const filepath of options.path) { |
| 2015 | if (fs7.existsSync(filepath)) { |
| 2016 | possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`; |
| 2017 | } |
| 2018 | } |
| 2019 | } else { |
| 2020 | possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`; |
| 2021 | } |
| 2022 | } else { |
| 2023 | possibleVaultPath = path5.resolve(process.cwd(), ".env.vault"); |
| 2024 | } |
| 2025 | if (fs7.existsSync(possibleVaultPath)) { |
| 2026 | return possibleVaultPath; |
| 2027 | } |
| 2028 | return null; |
| 2029 | } |
| 2030 | function _resolveHome(envPath) { |
| 2031 | return envPath[0] === "~" ? path5.join(os4.homedir(), envPath.slice(1)) : envPath; |
| 2032 | } |
no test coverage detected
searching dependent graphs…