Skip to content

Commit

Permalink
remove console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
Flo0806 committed Jul 12, 2022
1 parent d9917cc commit c08dd0f
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
function getImageChilds(parent, options) {
console.log(options)
for (let child in parent.children) {
if (
parent.children[child].children &&
parent.children[child].children.length > 0
) {
getImageChilds(parent.children[child], options);
}
for (let child in parent.children) {
if (
parent.children[child].children &&
parent.children[child].children.length > 0
) {
getImageChilds(parent.children[child], options);
}

if (parent.children[child].type === "image") {
const data = (parent.children[child].data = {});
if (parent.children[child].type === "image") {
const data = (parent.children[child].data = {});

const props = (data.hProperties = {});
props.width = options.width ? options.width : "100%";
}
const props = (data.hProperties = {});
props.width = options.width ? options.width : "100%";
}
}
}

function imageSize(options={}) {
return (node) => {
for (let child in node.children) {
getImageChilds(node.children[child], options);
}
};
}
function imageSize(options = {}) {
return (node) => {
for (let child in node.children) {
getImageChilds(node.children[child], options);
}
};
}

module.exports = imageSize
module.exports = imageSize;

0 comments on commit c08dd0f

Please sign in to comment.