Update vendored code

This commit is contained in:
Pam Selle 2020-09-08 15:52:44 -04:00
parent 712f5a5cc3
commit 4089b77c2a
1 changed files with 6 additions and 2 deletions

View File

@ -192,13 +192,13 @@ func (val Value) Mark(mark interface{}) Value {
}
// MarkWithPaths accepts a slice of PathValueMarks to apply
// marker particular paths
// markers to particular paths and returns the marked
// Value.
func (val Value) MarkWithPaths(pvm []PathValueMarks) Value {
ret, _ := Transform(val, func(p Path, v Value) (Value, error) {
for _, path := range pvm {
if p.Equals(path.Path) {
return v.WithMarks(path.Marks), nil
}
}
return v, nil
@ -241,6 +241,10 @@ func (val Value) UnmarkDeep() (Value, ValueMarks) {
return ret, marks
}
// UnmarkDeepWithPaths is like UnmarkDeep, except it returns a slice
// of PathValueMarks rather than a superset of all marks. This allows
// a caller to know which marks are associated with which paths
// in the Value.
func (val Value) UnmarkDeepWithPaths() (Value, []PathValueMarks) {
var marks []PathValueMarks
ret, _ := Transform(val, func(p Path, v Value) (Value, error) {