Created
August 23, 2021 18:53
-
-
Save b-coimbra/64fdf7943b0c5d9f6fe098b7dec21804 to your computer and use it in GitHub Desktop.
converts function app config to standard json
This file contains 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
const configuration = [ | |
// YOUR EXPORTED AZURE CONFIGURATION | |
]; | |
let exportedConfig = {}; | |
configuration.forEach(setting => { | |
const subkeys = setting.name.split(':'); | |
subkeys.reduce((acc, curr) => { | |
if (curr in acc) return acc[curr]; | |
return acc[curr] = curr === subkeys[subkeys.length - 1] ? setting.value : {}; | |
}, exportedConfig); | |
}); | |
console.log(JSON.stringify(exportedConfig, null, 2)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment