How to use the @loopback/metadata.MetadataInspector.defineMetadata function in @loopback/metadata

To help you get started, we’ve selected a few @loopback/metadata examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github strongloop / loopback-next / packages / context / src / inject.ts View on Github external
} else if (Object.prototype.hasOwnProperty.call(target, method)) {
    // The method exists in the target, no injections on the super method
    // should be honored
    options.ownMetadataOnly = true;
  }
  meta =
    MetadataInspector.getAllParameterMetadata>(
      PARAMETERS_KEY,
      target,
      method,
      options,
    ) ?? [];

  // Cache the result
  cache[method] = meta;
  MetadataInspector.defineMetadata[]>>(
    METHODS_KEY,
    cache,
    target,
  );
  return meta;
}