import Immutable from "immutable" ; import createIgnore from "ignore" ; class Ignore extends Immutable . Record ( { ignore : createIgnore ( ) , } , "Ignore" ) { getIgnore ( ) { return this . get ( "ignore" ) ; } return { boolean } param filename isFileIgnored ( filename ) { const ignore = this . getIgnore ( ) ; return ignore . filter ( [ filename ] ) . length == 0 ; } param { string } return { Ignore } add ( rule ) { const ignore = this . getIgnore ( ) ; const newIgnore = createIgnore ( ) ; newIgnore . add ( ignore ) ; newIgnore . add ( rule ) ; return this . set ( "ignore" , newIgnore ) ; } } export default Ignore ;