Skip to content

Commit

Permalink
Merge pull request #29 from KompiTech/feature/update
Browse files Browse the repository at this point in the history
Added .ToReader(), .Wrap()
  • Loading branch information
majkowskiPatrik authored Nov 9, 2021
2 parents 26b2ea0 + 0f0e17c commit 2e4e5d2
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 2e4e5d2

Please sign in to comment.