plugins/metadata.js
function matchedMetadata(file, metadata) {
  for (let name in metadata) {
    const data = metadata[name];
    if (!data.pattern) return undefined;
    if (minimatch(file, data.pattern)) return data.metadata;
  }
  return undefined;
}
function matchedMetadata(file, metadata) {
  for (let name in metadata) {
    const data = metadata[name];
    if (!data.pattern) return undefined;
    if (minimatch(file, data.pattern)) return data.metadata;
  }
  return undefined;
}
function matchedMetadata ( file , metadata ) { for ( let name in metadata ) { const data = metadata [ name ] ; if ( ! data . pattern ) return undefined ; if ( minimatch ( file , data . pattern ) ) return data . metadata ; } return undefined ; }
Checks if the given file matches the pattern in the metadata object and
returns the metadata if there is a match.

@param {string} file - File path.
@param {Object} metadata - Object containing all metadata of all file
patterns.

@return {Object} Matching metadata.
Checks if the given file matches the pattern in the metadata object and returns the metadata if there is a match .