diff --git a/src/Web/DOM/Node.js b/src/Web/DOM/Node.js index 9c3b687..bf901a6 100644 --- a/src/Web/DOM/Node.js +++ b/src/Web/DOM/Node.js @@ -40,7 +40,7 @@ exports._previousSibling = getEffProp("previousSibling"); exports._nextSibling = getEffProp("nextSibling"); -exports.nodeValue = getEffProp("nodeValue"); +exports._nodeValue = getEffProp("nodeValue"); exports.setNodeValue = function (value) { return function (node) { diff --git a/src/Web/DOM/Node.purs b/src/Web/DOM/Node.purs index a471c78..1cdb06d 100644 --- a/src/Web/DOM/Node.purs +++ b/src/Web/DOM/Node.purs @@ -121,9 +121,12 @@ nextSibling = map toMaybe <<< _nextSibling foreign import _nextSibling :: Node -> Effect (Nullable Node) --- | If the node type is text, comment, or processing instruction this is the --- | node's data, or null in all other cases. -foreign import nodeValue :: Node -> Effect String +-- | If the node type is text, comment, or processing instruction this is +-- | `Just` the node's data, or `Nothing` in all other cases. +nodeValue :: Node -> Effect (Maybe String) +nodeValue = map toMaybe <<< _nodeValue + +foreign import _nodeValue :: Node -> Effect (Nullable String) -- | If the node type is text, comment, or processing instruction this allows -- | the node's data to be changed, or has no effect in all other cases.