mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-11-29 01:24:35 +03:00
Extract function
This commit is contained in:
parent
9ec3b770ae
commit
6a77dc3831
@ -1171,17 +1171,17 @@ compactArbitraryFilesVisitor : Maybe ( List { a | path : String } -> moduleConte
|
||||
compactArbitraryFilesVisitor maybeArbitraryFilesVisitor =
|
||||
case maybeArbitraryFilesVisitor of
|
||||
Just ( arbitraryFilesVisitor, requestedFiles ) ->
|
||||
let
|
||||
predicate : { a | path : String } -> Bool
|
||||
predicate file =
|
||||
List.member file.path requestedFiles
|
||||
in
|
||||
Just (\files moduleContext -> ( [], arbitraryFilesVisitor (List.filter predicate files) moduleContext ))
|
||||
Just (\files moduleContext -> ( [], arbitraryFilesVisitor (List.filter (globMatch requestedFiles) files) moduleContext ))
|
||||
|
||||
Nothing ->
|
||||
Nothing
|
||||
|
||||
|
||||
globMatch : List String -> { a | path : String } -> Bool
|
||||
globMatch requestedFiles file =
|
||||
List.member file.path requestedFiles
|
||||
|
||||
|
||||
|
||||
-- PROJECT RULES
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user