package jx

import (
	

	
)

// Validate consumes all input, validating that input is a json object
// without any trialing data.
func ( *Decoder) () error {
	// First encountered value skip should consume all buffer.
	if  := .Skip();  != nil {
		return errors.Wrap(, "consume")
	}
	// Check for any trialing json.
	if  := .Skip();  != io.EOF {
		return errors.Wrap(, "unexpected trialing data")
	}

	return nil
}