isTextNode.js.flow 496 B

123456789101112131415161718192021
  1. /**
  2. * Copyright (c) 2013-present, Facebook, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @providesModule isTextNode
  8. * @typechecks
  9. */
  10. const isNode = require('./isNode');
  11. /**
  12. * @param {*} object The object to check.
  13. * @return {boolean} Whether or not the object is a DOM text node.
  14. */
  15. function isTextNode(object) {
  16. return isNode(object) && object.nodeType == 3;
  17. }
  18. module.exports = isTextNode;