All files / mongoose/lib/helpers/schema handleTimestampOption.js

70% Statements 7/10
50% Branches 5/10
100% Functions 1/1
70% Lines 7/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25    1x             2x       2x     2x     2x 1x   1x    
'use strict';
 
module.exports = handleTimestampOption;
 
/*!
 * ignore
 */
 
function handleTimestampOption(arg, prop) {
  Iif (arg == null) {
    return null;
  }
 
  Iif (typeof arg === 'boolean') {
    return prop;
  }
  Iif (typeof arg[prop] === 'boolean') {
    return arg[prop] ? prop : null;
  }
  if (!(prop in arg)) {
    return prop;
  }
  return arg[prop];
}