File tree Expand file tree Collapse file tree 2 files changed +2
-14
lines changed Expand file tree Collapse file tree 2 files changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -191,12 +191,12 @@ let findDependencyFiles base config =
191
191
let open Infix in
192
192
let deps =
193
193
config |> Json. get " bs-dependencies" |?> Json. array |? []
194
- |> optMap Json. string
194
+ |> List. filter_map Json. string
195
195
in
196
196
let devDeps =
197
197
config
198
198
|> Json. get " bs-dev-dependencies"
199
- |?> Json. array |? [] |> optMap Json. string
199
+ |?> Json. array |? [] |> List. filter_map Json. string
200
200
in
201
201
let deps = deps @ devDeps in
202
202
Log. log (" Dependencies: " ^ String. concat " " deps);
Original file line number Diff line number Diff line change 1
- (* *
2
- * This combines a filter and a map.
3
- * You provide a function that turns an element into an optional of another element,
4
- * and you get a list of all of the present results.
5
- *)
6
- let optMap : ('a -> 'b option) -> 'a list -> 'b list =
7
- fun fn items ->
8
- List. fold_left
9
- (fun result item ->
10
- match fn item with None -> result | Some res -> res :: result)
11
- [] items
12
-
13
1
let ( |! ) o d = match o with None -> failwith d | Some v -> v
14
2
15
3
let ( |? ) o d = match o with None -> d | Some v -> v
You can’t perform that action at this time.
0 commit comments