diff --git a/init.go b/init.go index 9c28cd1..29817ad 100644 --- a/init.go +++ b/init.go @@ -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.) diff --git a/types.go b/types.go index 6024ee3..3336e30 100644 --- a/types.go +++ b/types.go @@ -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 diff --git a/wrap.go b/wrap.go index b8093c8..5e798d2 100644 --- a/wrap.go +++ b/wrap.go @@ -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 }