{"repo":"pointfreeco/swift-custom-dump","free":true,"listed":false,"github":"https://github.com/pointfreeco/swift-custom-dump","clone":"git clone https://github.com/pointfreeco/swift-custom-dump.git","description":"A collection of tools for debugging, diffing, and testing your application's data structures.","language":"Swift","stars":887,"topics":["debugging","diffing","testing"],"license":"MIT","category":"dev-tools","readme_excerpt":"Custom Dump A collection of tools for debugging, diffing, and testing your application's data structures. Motivation customDump diff expectNoDifference expectDifference Customization CustomDumpStringConvertible CustomDumpReflectable CustomDumpRepresentable Contributing Installation Documentation Other Libraries License Motivation Swift comes with a wonderful tool for dumping the contents of any value to a string, and it's called dump . It prints all the fields and sub-fields of a value into a tree-like description: This is really useful, and can be great for building debug tools that visualize the data held in runtime values of our applications, but sometimes its output is not ideal. For example, dumping dictionaries leads to a verbose output that can be hard to read (also note that the keys are unordered): Similarly enums have a very verbose output: It gets even harder to read when dealing with deeply nested structures: There are also times that dump simply does not print useful information, such as enums imported from Objective-C: So, while the dump function can be handy, it is often too crude of a tool to use. This is the motivation for the customDump function. customDump The customDump function emulates the behavior of dump , but provides a more refined output of nested structures, optimizing for readability. For example, structs are dumped in a format that more closely mimics the struct syntax in Swift, and arrays are dumped with the indices of each element: Dictionaries","default_branch":null,"files":null,"tree":[],"storefront":"/r/pointfreeco","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/pointfreeco/swift-custom-dump/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}