pakmanaged.js
function rename(filepath, transformer) {
      var result;
      /*
        Return a file object
    
        {
          dirname
          basename
          extname
          origin
        }
      */
      var fileObj = parse(filepath);
    
      if (!transformer) {
        result = stringify(fileObj);
        debug('transform to %s with no transformer', result);
        return result;
      }
    
      /*
        transformed object
    
        {
          dirname
          prefix
          basename
          suffix
          extname
        }
      */
      var transformed = util.isFunction(transformer) ? transformer(fileObj) : transformer;
    
      // rename it when transformer is string as a filepath
      if (util.isString(transformed)) {
        result = transformed || stringify(fileObj);
        debug('transform from %j to `%s` with %j', fileObj, result, transformed);
        return result;
      }
    
      if (!util.isObject(transformed)) {
        throw new Error('transformer should be string, function or object.');
      }
    
      result = transform(fileObj, transformed);
      debug('transform from %j to `%s` with %j', fileObj, result, transformed);
      return result;
    }
function rename(filepath, transformer) {
      var result;
      /*
        Return a file object
    
        {
          dirname
          basename
          extname
          origin
        }
      */
      var fileObj = parse(filepath);
    
      if (!transformer) {
        result = stringify(fileObj);
        debug('transform to %s with no transformer', result);
        return result;
      }
    
      /*
        transformed object
    
        {
          dirname
          prefix
          basename
          suffix
          extname
        }
      */
      var transformed = util.isFunction(transformer) ? transformer(fileObj) : transformer;
    
      // rename it when transformer is string as a filepath
      if (util.isString(transformed)) {
        result = transformed || stringify(fileObj);
        debug('transform from %j to `%s` with %j', fileObj, result, transformed);
        return result;
      }
    
      if (!util.isObject(transformed)) {
        throw new Error('transformer should be string, function or object.');
      }
    
      result = transform(fileObj, transformed);
      debug('transform from %j to `%s` with %j', fileObj, result, transformed);
      return result;
    }
/*
Rename filepath using transformer