( scopeAndTags: BindingScopeAndTags, )
| 120 | * @typeParam T - Value type |
| 121 | */ |
| 122 | export function asBindingTemplate<T = unknown>( |
| 123 | scopeAndTags: BindingScopeAndTags, |
| 124 | ): BindingTemplate<T> { |
| 125 | return function applyBindingScopeAndTag(binding) { |
| 126 | if (scopeAndTags.scope) { |
| 127 | binding.inScope(scopeAndTags.scope); |
| 128 | } |
| 129 | if (scopeAndTags.tags) { |
| 130 | if (Array.isArray(scopeAndTags.tags)) { |
| 131 | binding.tag(...scopeAndTags.tags); |
| 132 | } else { |
| 133 | binding.tag(scopeAndTags.tags); |
| 134 | } |
| 135 | } |
| 136 | }; |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * Get binding metadata for a class |
no test coverage detected