tasks/compile.js
function mapSync(transformation) {
    return through2.obj(function write(chunk, _, callback) {
      let mappedData;
      try {
        mappedData = transformation(chunk);
      } catch (error) {
        callback(error);
      }
      if (mappedData !== undefined) {
        this.push(mappedData);
      }

      callback();
    });
  }
function mapSync(transformation) {
    return through2.obj(function write(chunk, _, callback) {
      let mappedData;
      try {
        mappedData = transformation(chunk);
      } catch (error) {
        callback(error);
      }
      if (mappedData !== undefined) {
        this.push(mappedData);
      }

      callback();
    });
  }
function mapSync ( transformation ) { return through2 . obj ( function write ( chunk , _ , callback ) { let mappedData ; try { mappedData = transformation ( chunk ) ; } catch ( error ) { callback ( error ) ; } if ( mappedData !== undefined ) { this . push ( mappedData ) ; } callback ( ) ; } ) ; }
Apply method for stream.

@param {function} transformation
@return {Stream<File>} Stream processor for files.
Apply method for stream .