Skip to content

Commit 9d7573c

Browse files
fhammerschmidtcristianoc
authored andcommitted
Fix isNamespaced check when namespace is string
1 parent 1874101 commit 9d7573c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

analysis/src/FindFiles.ml

+4-2
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,12 @@ let nameSpaceToName n =
9595

9696
let getNamespace config =
9797
let ns = config |> Json.get "namespace" in
98-
let isNamespaced = ns |> bind Json.bool |> Option.value ~default:false in
98+
let fromString = ns |> bind Json.string in
99+
let isNamespaced =
100+
ns |> bind Json.bool |> Option.value ~default:(fromString |> Option.is_some)
101+
in
99102
let either x y = if x = None then y else x in
100103
if isNamespaced then
101-
let fromString = ns |> bind Json.string in
102104
let fromName = config |> Json.get "name" |> bind Json.string in
103105
either fromString fromName |> Option.map nameSpaceToName
104106
else None

0 commit comments

Comments
 (0)