feat: initial commit

This commit is contained in:
l.weber 2025-12-05 12:20:05 +01:00
commit a161b86c9a
705 changed files with 288162 additions and 0 deletions

View file

@ -0,0 +1,21 @@
package json
import "encoding/json"
type RawMessage = json.RawMessage
func GetContextDocument(doc RawMessage) (RawMessage, error) {
var check struct {
Context RawMessage `json:"@context,omitempty"`
}
if err := json.Unmarshal(doc, &check); err != nil {
return nil, err
}
if check.Context != nil {
return check.Context, nil
}
return doc, nil
}