parseTomlKeys
Signature
Section titled “Signature”// Get list of keys present in a TOML stringfunction parseTomlKeys( string calldata toml, string calldata key) external pure returns (string[] memory keys);Description
Section titled “Description”Gets list of keys present in a TOML string
Examples
Section titled “Examples”// [key]// a = 1// b = 2
string memory toml = '[key]\n a = 1\n b = 2';string[] memory keys = vm.parseTomlKeys(toml, ".key"); // ["a", "b"]// key = "something"
string memory toml = 'key = \"something\"';string[] memory keys = vm.parseTomlKeys(toml, "$"); // ["key"]// [[root_key]]// a = 1// b = 2
string memory toml = '[[root_key]]\n a = 1\n b = 2';string[] memory keys = vm.parseTomlKeys(toml, ".root_key.0"); // ["a", "b"]