// Stub module for reflect-metadata
// This module is not actually used by the CLI but is imported by shared dependencies

// Create a chainable stub that works for both property access and function calls
const createStub = () => {
  const handler = {
    get(target, prop) {
      // Avoid thenable detection
      if (prop === 'then' || prop === 'catch') {
        return undefined;
      }
      // Return a new stub for any property access
      return createStub();
    },
    apply() {
      // When called as a function, return a stub
      return createStub();
    },
  };
  // Wrap a function in a Proxy so it can be called and have properties accessed
  return new Proxy(function() {}, handler);
};

const stub = createStub();
module.exports = stub;
module.exports.default = stub;