UNPKG

draft-js

Version:

A React framework for building text editors.

19 lines (17 loc) 453 B
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format * @flow strict-local * @emails oncall+draft_js */ function getCorrectDocumentFromNode(node: ?Node): Document { if (!node || !node.ownerDocument) { return document; } return node.ownerDocument; } module.exports = getCorrectDocumentFromNode;