MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / IsFieldTokenized

Method IsFieldTokenized

model/identity.go:55–87  ·  view source on GitHub ↗
(fieldName string)

Source from the content-addressed store, hash-verified

53}
54
55func (i *Identity) IsFieldTokenized(fieldName string) bool {
56 if i.MetaData == nil {
57 return false
58 }
59
60 structFieldName := convertToStructFieldName(fieldName)
61
62 tokenizedFieldsRaw, exists := i.MetaData["tokenized_fields"]
63 if !exists {
64 return false
65 }
66
67 if tokenizedFields, ok := tokenizedFieldsRaw.(map[string]bool); ok {
68 return tokenizedFields[structFieldName] || tokenizedFields[fieldName]
69 }
70
71 // Try map[string]interface{} with boolean values
72 if tokenizedFields, ok := tokenizedFieldsRaw.(map[string]interface{}); ok {
73 // Check both with and without conversion
74 if val, exists := tokenizedFields[structFieldName]; exists {
75 if boolVal, ok := val.(bool); ok {
76 return boolVal
77 }
78 }
79 if val, exists := tokenizedFields[fieldName]; exists {
80 if boolVal, ok := val.(bool); ok {
81 return boolVal
82 }
83 }
84 }
85
86 return false
87}
88
89func (i *Identity) MarkFieldAsTokenized(fieldName string) {
90 if i.MetaData == nil {

Callers 3

TokenizeIdentityFieldMethod · 0.80

Calls 1

convertToStructFieldNameFunction · 0.70

Tested by 1