and-finish-tracker.js 360 B

12345678910111213141516
  1. 'use strict'
  2. var validate = require('aproba')
  3. module.exports = function (tracker, cb) {
  4. validate('OF', [tracker, cb])
  5. return function () {
  6. tracker.finish()
  7. cb.apply(null, arguments)
  8. }
  9. }
  10. module.exports.now = function (tracker, cb) {
  11. validate('OF', [tracker, cb])
  12. tracker.finish()
  13. cb.apply(null, Array.prototype.slice.call(arguments, 2))
  14. }