diff --git a/README.md b/README.md index 238acbc..98ffe53 100644 --- a/README.md +++ b/README.md @@ -211,40 +211,6 @@ assert(inspect(info, {process = anonymize_password}) == [[{ }]]) ``` - - - - - - - - - - - - - - - - -Sometimes it might be convenient to "filter out" some parts of the output. The `options.filter` option can do that. - -`options.filter` accepts a table of values. Any value on that table will be rendered as ``. This is useful for hiding things like long complex tables that are not interesting for the task at hand, for example an unuseful complex metatable. - - local person = {name = 'peter'} - setmetatable(person, complex_mt) - inspect(x, {filter = {complex_mt}}) == [[{ - name = "peter", - = - }]] - -`options.filter` can also be a function. The function must return true for the values that must be filtered out. - - local isEvenNumber = function(x) return type(x) == 'number' and x % 2 == 0 end - - inspect({1,2,3,4,5}, {filter = isEvenNumber}) == "{ 1, , 3, , 5 }" - - Gotchas / Warnings ==================