MCPcopy
hub / github.com/loopbackio/loopback-next / tag

Method tag

packages/context/src/binding.ts:668–683  ·  view source on GitHub ↗

* Tag the binding with names or name/value objects. A tag has a name and * an optional value. If not supplied, the tag name is used as the value. * * @param tags - A list of names or name/value objects. Each * parameter can be in one of the following forms: * - string: A tag name with

(...tags: BindingTag[])

Source from the content-addressed store, hash-verified

666 * ```
667 */
668 tag(...tags: BindingTag[]): this {
669 for (const t of tags) {
670 if (typeof t === 'string') {
671 this.tagMap[t] = t;
672 } else if (Array.isArray(t)) {
673 // Throw an error as TypeScript cannot exclude array from TagMap
674 throw new Error(
675 'Tag must be a string or an object (but not array): ' + t,
676 );
677 } else {
678 Object.assign(this.tagMap, t);
679 }
680 }
681 this.emitChangedEvent('tag');
682 return this;
683 }
684
685 /**
686 * Get an array of tag names

Callers 15

extensionForFunction · 0.80
asLifeCycleObserverFunction · 0.80
asServiceFunction · 0.80
service.unit.tsFile · 0.80
lifecycle.unit.tsFile · 0.80
repositoryMethod · 0.80
dataSourceMethod · 0.80
createModelClassBindingFunction · 0.80

Calls 1

emitChangedEventMethod · 0.95

Tested by 15

givenContextFunction · 0.64
givenContextFunction · 0.64
specFunction · 0.64
setupBindingsFunction · 0.64
givenContextFunction · 0.64
givenBindingsFunction · 0.64
givenControllerFunction · 0.64
givenControllerFunction · 0.64
constructorMethod · 0.64
tagBindingFunction · 0.64
createTaggedBindingsFunction · 0.64
givenWorkloadMonitorFunction · 0.64