/* istanbul ignore next */ [util.inspect.custom](depth, options) { // https://nodejs.org/docs/latest-v8.x/api/util.html#util_custom_inspection_functions_on_objects if (depth < 0) { return options.stylize("[Context]", "special"); } const inner = util.inspect(this.toJSON(), options); return `${options.stylize("Context", "special")}< ${inner} >`; }
(() => { try { return require('util').promisify.custom; } catch (e) { return; } })()
constructor() { super(); this.proxy = false; this.middleware = []; this.subdomainOffset = 2; this.env = process.env.NODE_ENV || 'development'; this.context = Object.create(context); this.request = Object.create(request); this.response = Object.create(response); if (util.inspect.custom) { this[util.inspect.custom] = this.inspect; } }
const MethodProxy = (object, selector) => { const self = object; return new Proxy(() => {}, { get: (_, key) => { if (key === util.inspect.custom) { return () => `[objc.MethodProxy '${self.type === 'class' ? '+' : '-'}[${object.class()} ${selector}]']`; } }, apply: (target, _this, args) => { // Add a trailing underscore to the selector if: // 1. There are more arguments than underscores // 2. The method doesn't already end w/ an underscore if (!selector.endsWith('_') && (selector.split('_').length - 1) < args.length) { selector += '_'; } return self.call(new Selector(selector), ...args); } }); }
if (key === util.inspect.custom) { return () => `[objc.InstanceProxy ${self.description()}]`; } else if (key === Symbol.toPrimitive) {
constructor() { super(); this.proxy = false; this.middleware = []; this.subdomainOffset = 2; this.env = process.env.NODE_ENV || 'development'; this.context = Object.create(context); this.request = Object.create(request); this.response = Object.create(response); if (util.inspect.custom) { this[util.inspect.custom] = this.inspect; } }