| 1981 | |
| 1982 | const NodeValue = (is, name) => { |
| 1983 | const get = element => { |
| 1984 | if (!is(element)) { |
| 1985 | throw new Error('Can only get ' + name + ' value of a ' + name + ' node'); |
| 1986 | } |
| 1987 | return getOption(element).getOr(''); |
| 1988 | }; |
| 1989 | const getOption = element => is(element) ? Optional.from(element.dom.nodeValue) : Optional.none(); |
| 1990 | const set = (element, value) => { |
| 1991 | if (!is(element)) { |
no test coverage detected