MCPcopy Create free account
hub / github.com/Effect-TS/effect / makeKey

Function makeKey

packages/effect/src/Metric.ts:3476–3488  ·  view source on GitHub ↗
(
  metric: Metric<Input, State>,
  attributes: Metric.Attributes | undefined
)

Source from the content-addressed store, hash-verified

3474// Utilities
3475
3476function makeKey<Input, State>(
3477 metric: Metric<Input, State>,
3478 attributes: Metric.Attributes | undefined
3479) {
3480 let key = `${metric.type}:${metric.id}`
3481 if (Predicate.isNotUndefined(metric.description)) {
3482 key += `:${metric.description}`
3483 }
3484 if (Predicate.isNotUndefined(attributes)) {
3485 key += `:${serializeAttributes(attributes)}`
3486 }
3487 return key
3488}
3489
3490function makeHooks<Input, State>(
3491 get: (context: Context.Context<never>) => State,

Callers 1

getOrCreateFunction · 0.85

Calls 1

serializeAttributesFunction · 0.85

Tested by

no test coverage detected