mjml-parser-xml
Advanced tools
Comparing version 4.6.3 to 4.7.0-beta.0
@@ -10,3 +10,3 @@ "use strict"; | ||
var _lodash = _interopRequireDefault(require("lodash")); | ||
var _forEach2 = _interopRequireDefault(require("lodash/forEach")); | ||
@@ -17,3 +17,3 @@ function cleanNode(node) { | ||
if (node.children && node.children.length) { | ||
_lodash["default"].forEach(node.children, cleanNode); | ||
(0, _forEach2["default"])(node.children, cleanNode); | ||
} else { | ||
@@ -20,0 +20,0 @@ delete node.children; |
@@ -10,3 +10,3 @@ "use strict"; | ||
var _mapValues = _interopRequireDefault(require("lodash/mapValues")); | ||
var _mapValues2 = _interopRequireDefault(require("lodash/mapValues")); | ||
@@ -18,3 +18,3 @@ /** | ||
function convertBooleansOnAttrs(attrs) { | ||
return (0, _mapValues["default"])(attrs, function (val) { | ||
return (0, _mapValues2["default"])(attrs, function (val) { | ||
if (val === 'true') { | ||
@@ -21,0 +21,0 @@ return true; |
@@ -10,3 +10,3 @@ "use strict"; | ||
var _forEach = _interopRequireDefault(require("lodash/forEach")); | ||
var _forEach2 = _interopRequireDefault(require("lodash/forEach")); | ||
@@ -19,3 +19,3 @@ function setEmptyAttributes(node) { | ||
if (node.children) { | ||
(0, _forEach["default"])(node.children, setEmptyAttributes); | ||
(0, _forEach2["default"])(node.children, setEmptyAttributes); | ||
} | ||
@@ -22,0 +22,0 @@ } |
@@ -14,19 +14,19 @@ "use strict"; | ||
var _htmlparser = _interopRequireDefault(require("htmlparser2")); | ||
var _flow2 = _interopRequireDefault(require("lodash/fp/flow")); | ||
var _isObject = _interopRequireDefault(require("lodash/isObject")); | ||
var _map2 = _interopRequireDefault(require("lodash/fp/map")); | ||
var _findLastIndex = _interopRequireDefault(require("lodash/findLastIndex")); | ||
var _filter2 = _interopRequireDefault(require("lodash/fp/filter")); | ||
var _find = _interopRequireDefault(require("lodash/find")); | ||
var _find2 = _interopRequireDefault(require("lodash/find")); | ||
var _path = _interopRequireDefault(require("path")); | ||
var _findLastIndex2 = _interopRequireDefault(require("lodash/findLastIndex")); | ||
var _fs = _interopRequireDefault(require("fs")); | ||
var _isObject2 = _interopRequireDefault(require("lodash/isObject")); | ||
var _filter = _interopRequireDefault(require("lodash/fp/filter")); | ||
var _htmlparser = _interopRequireDefault(require("htmlparser2")); | ||
var _map = _interopRequireDefault(require("lodash/fp/map")); | ||
var _path = _interopRequireDefault(require("path")); | ||
var _flow = _interopRequireDefault(require("lodash/fp/flow")); | ||
var _fs = _interopRequireDefault(require("fs")); | ||
@@ -73,5 +73,5 @@ var _cleanNode = _interopRequireDefault(require("./helpers/cleanNode")); | ||
preprocessors = _options$preprocessor === void 0 ? [] : _options$preprocessor; | ||
var endingTags = (0, _flow["default"])((0, _filter["default"])(function (component) { | ||
var endingTags = (0, _flow2["default"])((0, _filter2["default"])(function (component) { | ||
return component.endingTag; | ||
}), (0, _map["default"])(function (component) { | ||
}), (0, _map2["default"])(function (component) { | ||
return component.getTagName(); | ||
@@ -101,3 +101,3 @@ }))((0, _objectSpread2["default"])({}, components)); | ||
var findTag = function findTag(tagName, tree) { | ||
return (0, _find["default"])(tree.children, { | ||
return (0, _find2["default"])(tree.children, { | ||
tagName: tagName | ||
@@ -113,3 +113,3 @@ }); | ||
var curBeforeInclude = cur; | ||
if ((0, _find["default"])(cur.includedIn, { | ||
if ((0, _find2["default"])(cur.includedIn, { | ||
file: partialPath | ||
@@ -143,3 +143,3 @@ })) throw new Error("Circular inclusion detected on file : ".concat(partialPath)); | ||
content = content.indexOf('<mjml>') === -1 ? "<mjml><mj-body>".concat(content, "</mj-body></mjml>") : content; | ||
var partialMjml = MJMLParser(content, (0, _objectSpread2["default"])({}, options, { | ||
var partialMjml = MJMLParser(content, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, options), {}, { | ||
filePath: partialPath, | ||
@@ -155,3 +155,3 @@ actualPath: partialPath | ||
return children.map(function (c) { | ||
return (0, _objectSpread2["default"])({}, c, { | ||
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, c), {}, { | ||
parent: tree | ||
@@ -217,3 +217,3 @@ }); | ||
var line = (0, _findLastIndex["default"])(lineIndexes, function (i) { | ||
var line = (0, _findLastIndex2["default"])(lineIndexes, function (i) { | ||
return i <= parser.startIndex; | ||
@@ -290,3 +290,3 @@ }) + 1; | ||
cur.children.push({ | ||
line: (0, _findLastIndex["default"])(lineIndexes, function (i) { | ||
line: (0, _findLastIndex2["default"])(lineIndexes, function (i) { | ||
return i <= parser.startIndex; | ||
@@ -307,7 +307,7 @@ }) + 1, | ||
xml = (0, _flow["default"])(preprocessors)(xml); | ||
xml = (0, _flow2["default"])(preprocessors)(xml); | ||
parser.write(xml); | ||
parser.end(); | ||
if (!(0, _isObject["default"])(mjml)) { | ||
if (!(0, _isObject2["default"])(mjml)) { | ||
throw new Error('Parsing failed. Check your mjml.'); | ||
@@ -314,0 +314,0 @@ } |
{ | ||
"name": "mjml-parser-xml", | ||
"description": "mjml-parser-xml", | ||
"version": "4.6.3", | ||
"version": "4.7.0-beta.0", | ||
"main": "lib/index.js", | ||
@@ -28,7 +28,7 @@ "repository": { | ||
"chai": "^4.1.1", | ||
"mjml": "4.6.3", | ||
"mjml-core": "4.6.3", | ||
"mjml": "4.7.0-beta.0", | ||
"mjml-core": "4.7.0-beta.0", | ||
"rimraf": "^3.0.2" | ||
}, | ||
"gitHead": "967cd5d2988836d93d051678cecd5ac58e77c669" | ||
"gitHead": "fd4e870da63a14672d9c00a4c2f698f7d5363c1e" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26039
1