"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _slugid = _interopRequireDefault(require("slugid"));
var _constants = require("../constants");
const imageRule = (element, parseChild) => {
  const {
    nodeName
  } = element;
  if (nodeName === 'IMG') {
    return {
      id: _slugid.default.nice(),
      type: _constants.IMAGE,
      data: {
        src: element.getAttribute('src')
      },
      children: [{
        text: '',
        id: _slugid.default.nice()
      }]
    };
  }
  return;
};
var _default = exports.default = imageRule;