Files
napi-go/napi_status.go
Matheus Sampaio Queiroga 813d742aff Add docs and remove threadsafe_function
- Add new function to ValueType conversion
- Add more docs to functions and minor changes
- rename entry to module
- don't expose Value and Env structs.

Signed-off-by: Matheus Sampaio Queiroga <srherobrine20@gmail.com>
2025-05-17 01:36:40 -03:00

19 lines
535 B
Go

package napi
import "sirherobrine23.com.br/Sirherobrine23/napi-go/internal/napi"
// Process status to return error if StatusOK return nil on error
func mustValueErr[T any](input T, status napi.Status) (T, error) {
return input, status.ToError()
}
// return error from status
func singleMustValueErr(status napi.Status) error {
return status.ToError()
}
// Process status to return error if StatusOK return nil on error
func mustValueErr2[T any](input T, _ bool, status napi.Status) (T, error) {
return input, status.ToError()
}