ansi-to-react
Advanced tools
Comparing version 0.0.1 to 0.0.3
18
index.js
@@ -1,16 +0,18 @@ | ||
const React = require('react'); | ||
'use strict'; | ||
const ansiToJSON = require('ansi-to-json'); | ||
var React = require('react'); | ||
var ansiToJSON = require('ansi-to-json'); | ||
function ansiJSONtoStyleBundle(ansiBundle) { | ||
const style = {}; | ||
var style = {}; | ||
if (ansiBundle.bg) { | ||
style.backgroundColor = `rgb(${ansiBundle.bg})`; | ||
style.backgroundColor = 'rgb(' + ansiBundle.bg + ')'; | ||
} | ||
if (ansiBundle.fg) { | ||
style.color = `rgb(${ansiBundle.fg})`; | ||
style.color = 'rgb(' + ansiBundle.fg + ')'; | ||
} | ||
return { | ||
content: ansiBundle.content, | ||
style, | ||
style: style | ||
}; | ||
@@ -26,3 +28,3 @@ } | ||
style: bundle.style, | ||
key, | ||
key: key | ||
}, bundle.content); | ||
@@ -39,5 +41,5 @@ } | ||
Ansi.propTypes = { | ||
children: React.PropTypes.string, | ||
children: React.PropTypes.string | ||
}; | ||
module.exports = Ansi; |
{ | ||
"name": "ansi-to-react", | ||
"version": "0.0.1", | ||
"version": "0.0.3", | ||
"description": "ANSI to React Elements", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "mocha 'test/**/*.js'" | ||
}, | ||
@@ -17,3 +17,14 @@ "keywords": [ | ||
"ansi-to-json": "^1.0.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^0.14.0 || ^15.0.0-0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^3.5.0", | ||
"enzyme": "^2.2.0", | ||
"mocha": "^2.4.5", | ||
"react": "^15.0.1", | ||
"react-addons-test-utils": "^15.0.1", | ||
"react-dom": "^15.0.1" | ||
} | ||
} |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
3440
6
61
2
0
20
2
6