diff --git a/CHANGELOG.md b/CHANGELOG.md index 261cac6..81ad323 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Notable changes to this project are documented in this file. The format is based Breaking changes: - Migrate FFI to ES modules (#51 by @JordanMartinez) +- Unwrap returned `Effect` for `doctype` (#52 by @JordanMartinez) New features: diff --git a/src/Web/DOM/Document.js b/src/Web/DOM/Document.js index 405f97b..5b2d823 100644 --- a/src/Web/DOM/Document.js +++ b/src/Web/DOM/Document.js @@ -12,7 +12,9 @@ export const origin = getEffProp("origin"); export const compatMode = getEffProp("compatMode"); export const characterSet = getEffProp("characterSet"); export const contentType = getEffProp("contentType"); -export const _doctype = getEffProp("doctype"); +export function _doctype(doc) { + return doc["doctype"]; +} export const _documentElement = getEffProp("documentElement"); export function getElementsByTagName(localName) { diff --git a/src/Web/DOM/Document.purs b/src/Web/DOM/Document.purs index 8fbb3d8..981f135 100644 --- a/src/Web/DOM/Document.purs +++ b/src/Web/DOM/Document.purs @@ -89,10 +89,10 @@ foreign import compatMode :: Document -> Effect String foreign import characterSet :: Document -> Effect String foreign import contentType :: Document -> Effect String -doctype :: Document -> Effect (Maybe DocumentType) -doctype = map toMaybe <<< _doctype +doctype :: Document -> Maybe DocumentType +doctype = toMaybe <<< _doctype -foreign import _doctype :: Document -> Effect (Nullable DocumentType) +foreign import _doctype :: Document -> Nullable DocumentType documentElement :: Document -> Effect (Maybe Element) documentElement = map toMaybe <<< _documentElement