Skip to content

Commit

Permalink
Merge pull request #134 from mattn/fix-typos
Browse files Browse the repository at this point in the history
fix typos
  • Loading branch information
andrueastman committed Jan 15, 2024
2 parents 1aed375 + 8ff30fe commit 5f7f709
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion serialization/parse_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/google/uuid"
)

// ParseNode Interface for a deserialization node in a parse tree. This interace provides an abstraction layer over serialization formats, libraries and implementations.
// ParseNode Interface for a deserialization node in a parse tree. This inteface provides an abstraction layer over serialization formats, libraries and implementations.
type ParseNode interface {
// GetChildNode returns a new parse node for the given identifier.
GetChildNode(index string) (ParseNode, error)
Expand Down
7 changes: 4 additions & 3 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func SetObjectValueFromSource[T interface{}](source func(ctor serialization.Pars
return nil
}

// SetCollectionValue is a utility function that receives a collection that can be cast to Parsable and a function that epects the results
// SetCollectionValue is a utility function that receives a collection that can be cast to Parsable and a function that expects the results
//
// source is any function that receives a `ParsableFactory` and returns a slice of Parsable or error
// ctor is a ParsableFactory
Expand All @@ -56,7 +56,8 @@ func SetCollectionValue[T interface{}](source func(ctor serialization.ParsableFa

// CollectionApply applies an operation to every element of the slice and returns a result of the modified collection
//
// is a slice of all the elementents to be mutated
// is a slice of all the elementents to be mutated
//
// mutator applies an operation to the collection and returns a response of type `R`
func CollectionApply[T any, R interface{}](collection []T, mutator func(t T) R) []R {
cast := make([]R, len(collection))
Expand Down Expand Up @@ -138,7 +139,7 @@ func p[T interface{}](t T) *T {
return &t
}

// GetValueOrDefault Converts a Pointer to a value or retuns a default value
// GetValueOrDefault Converts a Pointer to a value or returns a default value
func GetValueOrDefault[T interface{}](source func() *T, defaultValue T) T {
result := source()
if result != nil {
Expand Down

0 comments on commit 5f7f709

Please sign in to comment.