Skip to content

Commit

Permalink
Merge pull request #54 from Henry-Sarabia/iss-53
Browse files Browse the repository at this point in the history
Replace "whitespace" package with "blank" package
  • Loading branch information
Henry Sarabia authored Mar 5, 2019
2 parents 73fd22d + c629097 commit 28d0c38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions image.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package igdb
import (
"errors"
"fmt"
"github.com/Henry-Sarabia/whitespace"
"github.com/Henry-Sarabia/blank"
)

// Errors returned when creating Image URLs.
Expand Down Expand Up @@ -60,7 +60,7 @@ const (
// image size, and display pixel ratio. The display pixel ratio only multiplies
// the resolution of the image. The current available ratios are 1 and 2.
func SizedImageURL(imageID string, size imageSize, ratio int) (string, error) {
if whitespace.IsBlank(imageID) {
if blank.Is(imageID) {
return "", ErrBlankID
}

Expand Down
14 changes: 7 additions & 7 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package igdb
import (
"fmt"
"github.com/Henry-Sarabia/apicalypse"
"github.com/Henry-Sarabia/whitespace"
"github.com/Henry-Sarabia/blank"
"github.com/pkg/errors"
"strings"
)
Expand Down Expand Up @@ -79,7 +79,7 @@ const (
// For more information, visit: https://api-docs.igdb.com/#sorting
func SetOrder(field string, order order) Option {
return func() (apicalypse.Option, error) {
if whitespace.IsBlank(field) {
if blank.Is(field) {
return nil, ErrEmptyFields
}

Expand Down Expand Up @@ -136,7 +136,7 @@ func SetFields(fields ...string) Option {
}

for _, f := range fields {
if whitespace.IsBlank(f) {
if blank.Is(f) {
return nil, ErrEmptyFields
}

Expand All @@ -162,7 +162,7 @@ func SetExclude(fields ...string) Option {
}

for _, f := range fields {
if whitespace.IsBlank(f) {
if blank.Is(f) {
return nil, ErrEmptyFields
}

Expand Down Expand Up @@ -224,10 +224,10 @@ const (
// For more information, visit: https://api-docs.igdb.com/#filters
func SetFilter(field string, op operator, val ...string) Option {
return func() (apicalypse.Option, error) {
if whitespace.IsBlank(field) {
if blank.Is(field) {
return nil, ErrEmptyFields
}
if len(val) <= 0 || whitespace.HasBlank(val) {
if len(val) <= 0 || blank.Has(val) {
return nil, ErrEmptyFilterVals
}

Expand All @@ -240,7 +240,7 @@ func SetFilter(field string, op operator, val ...string) Option {
// provided query.
func setSearch(qry string) Option {
return func() (apicalypse.Option, error) {
if whitespace.IsBlank(qry) {
if blank.Is(qry) {
return nil, ErrEmptyQry
}

Expand Down

0 comments on commit 28d0c38

Please sign in to comment.