@cerner/svg-to-carbon
Advanced tools
Comparing version 1.0.0 to 1.1.0
"use strict"; | ||
const R = require("ramda"); | ||
const svgTagList = require("./src/tagList"); | ||
const { convertSVGToJSON, getSVGFiles, getSVGFile } = require("./src/parser"); | ||
@@ -42,3 +43,4 @@ | ||
svgFolderToJSON, | ||
svgToJSON | ||
svgToJSON, | ||
svgTagList | ||
}; |
{ | ||
"name": "@cerner/svg-to-carbon", | ||
"description": "Converter for Cerner icons to JSON format for Carbon", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"author": "Cerner Corporation", | ||
@@ -45,4 +45,4 @@ "bugs": "https://github.com/cerner/svg-to-carbon/issues", | ||
"devDependencies": { | ||
"@commitlint/cli": "^8.0.0", | ||
"@commitlint/config-conventional": "^8.0.0", | ||
"@commitlint/cli": "^8.1.0", | ||
"@commitlint/config-conventional": "^8.1.0", | ||
"@semantic-release/git": "^7.0.16", | ||
@@ -52,6 +52,6 @@ "conventional-changelog-eslint": "^3.0.1", | ||
"eslint-plugin-ideal": "^0.1.3", | ||
"husky": "^3.0.0", | ||
"husky": "^3.0.2", | ||
"jest": "^24.5.0", | ||
"prettier": "^1.14.2", | ||
"semantic-release": "^15.13.18" | ||
"semantic-release": "^15.13.19" | ||
}, | ||
@@ -58,0 +58,0 @@ "engines": { |
@@ -26,3 +26,3 @@ <div align="center"> | ||
const path = require("path"); | ||
const { svgFolderToJSON } = require("svg-to-carbon"); | ||
const { svgFolderToJSON } = require("@cerner/svg-to-carbon"); | ||
@@ -43,3 +43,3 @@ svgFolderToJSON({ | ||
```javascript | ||
const { svgToJSON } = require("svg-to-carbon"); | ||
const { svgToJSON } = require("@cerner/svg-to-carbon"); | ||
svgToJSON({ | ||
@@ -46,0 +46,0 @@ path: path.join(__dirname, "../dev/assets/0031_glasses_a.svg"), |
@@ -13,2 +13,6 @@ "use strict"; | ||
const getNodeWithInnerHtml = (html, attrs) => | ||
Object.assign(attrs, { | ||
_html: html | ||
}); | ||
/** | ||
@@ -32,9 +36,19 @@ * Parses the node based on the buffered output provided using node js scan of the file | ||
} else { | ||
Object.assign(nodes, { | ||
[childKey]: Object.keys(childNode).some((c) => | ||
tagList.includes(c) | ||
) | ||
? parseNode(childNode) | ||
: childNode.$ | ||
}); | ||
const hasMatchingTagList = Object.keys(childNode).some((c) => | ||
tagList.includes(c) | ||
); | ||
if (!hasMatchingTagList && childNode._) { | ||
Object.assign(nodes, { | ||
[childKey]: getNodeWithInnerHtml( | ||
childNode._, | ||
childNode.$ | ||
) | ||
}); | ||
} else { | ||
Object.assign(nodes, { | ||
[childKey]: hasMatchingTagList | ||
? parseNode(childNode) | ||
: childNode.$ | ||
}); | ||
} | ||
} | ||
@@ -41,0 +55,0 @@ } |
"use strict"; | ||
module.exports = ["path", "circle", "polygon", "g", "linearGradient", "stop"]; | ||
module.exports = [ | ||
"path", | ||
"circle", | ||
"rect", | ||
"polygon", | ||
"g", | ||
"ellipse", | ||
"image", | ||
"line", | ||
"polyline", | ||
"text", | ||
"linearGradient", | ||
"stop", | ||
"style" | ||
]; |
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
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
22462
171