tap.js 303 B

12345678910
  1. // Invokes `interceptor` with the `obj` and then returns `obj`.
  2. // The primary purpose of this method is to "tap into" a method chain, in
  3. // order to perform operations on intermediate results within the chain.
  4. function tap(obj, interceptor) {
  5. interceptor(obj);
  6. return obj;
  7. }
  8. module.exports = tap;