Skip to content

Commit f2e4952

Browse files
committed
Make createRootObj smaller
1 parent 450026d commit f2e4952

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ const reduce = fn => zero => xs => xs.reduce(fn, zero)
2323
const split = d => s => s.split(d)
2424

2525
const createRootObj = compose(
26-
join,
27-
x =>
28-
Identity.of(x).map(isNaN).map(b => (b ? Object.create(null) : Array.of(x))),
26+
n => maybe(Object.create(null))(Array.of)(Maybe.of(isNaN(n) && undefined)),
2927
Number
3028
)
3129

0 commit comments

Comments
 (0)