1
0
Fork 0
mirror of https://github.com/betagouv/mon-entreprise synced 2025-02-08 22:15:02 +00:00
mon-entreprise/source/engine/traverse-common-functions.js

10 lines
266 B
JavaScript
Raw Normal View History

2018-01-08 16:07:26 +01:00
import { any, pipe, equals } from 'ramda'
export let val = node => node && node.nodeValue
export let undefOrTrue = val => val == undefined || val == true
2018-01-08 16:07:26 +01:00
export let anyNull = any(pipe(val, equals(null)))
export let applyOrEmpty = func => v => (v ? func(v) : [])