const codes = codeBlocks.map(codeBlock => { var code = ""; try { code = toDoc.convertCode(codeBlock.value, file.path); } catch (error) { } return code; });
transform: function (file, encoding, next) { if (file.isBuffer()) { file.contents = Buffer(toDoc.convertCode(String(file.contents), file.path)); } if (file.isStream()) { throw new Error("not support"); } this.push(file); next(); }