MCPcopy
hub / github.com/autobrr/qui / Normalize

Method Normalize

pkg/stringutils/normalize.go:45–53  ·  view source on GitHub ↗

Normalize returns the transformed value.

(key K)

Source from the content-addressed store, hash-verified

43
44// Normalize returns the transformed value.
45func (n *Normalizer[K, V]) Normalize(key K) V {
46 if cached, ok := n.cache.Get(key); ok {
47 return cached
48 }
49
50 transformed := n.transform(key)
51 n.cache.Set(key, transformed, ttlcache.DefaultTTL)
52 return transformed
53}
54
55// Clear removes a cached entry.
56func (n *Normalizer[K, V]) Clear(key K) {

Callers 5

ParseMethod · 0.45
ClearMethod · 0.45
normalizedFunction · 0.45
NormalizeUnicodeFunction · 0.45
NormalizeForMatchingFunction · 0.45

Calls 2

GetMethod · 0.65
SetMethod · 0.45

Tested by

no test coverage detected