MCPcopy
hub / github.com/di-sukharev/opencommit / _parseVault

Function _parseVault

out/cli.cjs:1934–1958  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

1932 return obj;
1933 }
1934 function _parseVault(options) {
1935 const vaultPath = _vaultPath(options);
1936 const result = DotenvModule.configDotenv({ path: vaultPath });
1937 if (!result.parsed) {
1938 const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
1939 err.code = "MISSING_DATA";
1940 throw err;
1941 }
1942 const keys = _dotenvKey(options).split(",");
1943 const length = keys.length;
1944 let decrypted;
1945 for (let i3 = 0; i3 < length; i3++) {
1946 try {
1947 const key = keys[i3].trim();
1948 const attrs = _instructions(result, key);
1949 decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
1950 break;
1951 } catch (error) {
1952 if (i3 + 1 >= length) {
1953 throw error;
1954 }
1955 }
1956 }
1957 return DotenvModule.parse(decrypted);
1958 }
1959 function _log(message) {
1960 console.log(`[dotenv@${version}][INFO] ${message}`);
1961 }

Callers

nothing calls this directly

Calls 5

_vaultPathFunction · 0.85
_dotenvKeyFunction · 0.85
_instructionsFunction · 0.85
trimMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…