lib/parsers/yaml.js
function parseYAML (file) {
    return new Promise(function (resolve, reject) {
      var data = file.data;
      if (Buffer.isBuffer(data)) {
        data = data.toString();
      }

      if (typeof data === "string") {
        resolve(YAML.parse(data));
      }
      else {
        // data is already a JavaScript value (object, array, number, null, NaN, etc.)
        resolve(data);
      }
    });
  }
function parseYAML (file) {
    return new Promise(function (resolve, reject) {
      var data = file.data;
      if (Buffer.isBuffer(data)) {
        data = data.toString();
      }

      if (typeof data === "string") {
        resolve(YAML.parse(data));
      }
      else {
        // data is already a JavaScript value (object, array, number, null, NaN, etc.)
        resolve(data);
      }
    });
  }
function parseYAML ( file ) { return new Promise ( function ( resolve , reject ) { var data = file . data ; if ( Buffer . isBuffer ( data ) ) { data = data . toString ( ) ; } if ( typeof data === "string" ) { resolve ( YAML . parse ( data ) ) ; } else { // data is already a JavaScript value (object, array, number, null, NaN, etc.) resolve ( data ) ; } } ) ; }
JSON is valid YAML 
Parses the given file as YAML

@param {object} file           - An object containing information about the referenced file
@param {string} file.url       - The full URL of the referenced file
@param {string} file.extension - The lowercased file extension (e.g. ".txt", ".html", etc.)
@param {*}      file.data      - The file contents. This will be whatever data type was returned by the resolver
@returns {Promise}
JSON is valid YAML Parses the given file as YAML