files/api/user/services/user.js
function (user, next) {
    if (!user.hasOwnProperty('password') || !user.password || this.isHashed(user.password)) {
      next(null, user);
    } else {
      bcrypt.hash(user.password, 10, function (err, hash) {
        user.password = hash;
        next(err, user);
      });
    }
  }
function (user, next) {
    if (!user.hasOwnProperty('password') || !user.password || this.isHashed(user.password)) {
      next(null, user);
    } else {
      bcrypt.hash(user.password, 10, function (err, hash) {
        user.password = hash;
        next(err, user);
      });
    }
  }
function ( user , next ) { if ( ! user . hasOwnProperty ( 'password' ) || ! user . password || this . isHashed ( user . password ) ) { next ( null , user ) ; } else { bcrypt . hash ( user . password , 10 , function ( err , hash ) { user . password = hash ; next ( err , user ) ; } ) ; } }
Helper used to hash the password of a `user`.

@param {Object}   user
@param {Function} next
Helper used to hash the password of a user .