Skip to content

Commit

Permalink
Added .ToReader(), .Wrap()
Browse files Browse the repository at this point in the history
  • Loading branch information
majkowskiPatrik committed Nov 9, 2021
1 parent 26b2ea0 commit 0f0e17c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rmap.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package rmap

import (
"bytes"
"context"
"fmt"
"io"
Expand Down Expand Up @@ -1132,3 +1133,12 @@ func (r Rmap) ToStringMap() (map[string]string, error) {

return output, nil
}

func (r Rmap) ToReader() *bytes.Reader {
return bytes.NewReader(r.Bytes())
}

// Wrap returns copy of this wrapped in specified key
func (r Rmap) Wrap(key string) Rmap {
return NewFromMap(map[string]interface{}{key: r.Copy().Mapa})
}

0 comments on commit 0f0e17c

Please sign in to comment.