Skip to content

Commit

Permalink
♻️ refactor: refactor codebase #2
Browse files Browse the repository at this point in the history
  • Loading branch information
pnguyen215 committed Dec 14, 2024
1 parent 56e9300 commit e275e8e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions init.go
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,10 @@ func (w *wrapper) Respond() map[string]interface{} {
return m
}

func (w *wrapper) Reply() R {
return R{wrapper: w}
}

// Respond generates a map representation of the `pagination` instance.
//
// This method collects various fields related to pagination (e.g., `page`, `per_page`, etc.)
Expand Down
4 changes: 4 additions & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ package wrapify

import "time"

type R struct {
*wrapper
}

// Frame represents a program counter inside a stack frame.
// A `Frame` is essentially a single point in the stack trace,
// representing a program counter (the location in code) at the
Expand Down
6 changes: 6 additions & 0 deletions wrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ func (w *wrapper) IsDebuggingKeyPresent(key string) bool {
// - `true` if `data` is not nil.
// - `false` if `data` is nil.
func (w *wrapper) IsBodyPresent() bool {
s, ok := w.data.(string)
if ok {
return w.Available() &&
unify4g.IsNotEmpty(s) &&
unify4g.IsNotBlank(s)
}
return w.Available() && w.data != nil
}

Expand Down

0 comments on commit e275e8e

Please sign in to comment.