import * as minimatch from 'minimatch' ; export interface ConfigurationOptions { ignoreFiles : string [ ] ; alwaysCreateStatusCheck : boolean ; aggregateChecks : boolean ; } export const DEFAULT_CONFIGURATION = { ignoreFiles : [ ] , alwaysCreateStatusCheck : false , aggregateChecks : true , } ; export const CONFIGURATION_FILE_PATH = 'snippet-bot.yml' ; export class Configuration { private options : ConfigurationOptions ; private minimatches : minimatch . IMinimatch [ ] ; constructor ( options ) { this . options = options ; this . minimatches = options . ignoreFiles . map ( pattern => { return new minimatch . Minimatch ( pattern ) ; } ) ; } ignoredFile ( filename ) { return this . minimatches . some ( mm => { return mm . match ( filename ) ; } ) ; } alwaysCreateStatusCheck ( ) { return this . options . alwaysCreateStatusCheck ; } aggregateChecks ( ) { return this . options . aggregateChecks ; } }