Comparing version 0.0.6 to 0.0.7
@@ -7,6 +7,6 @@ 'use strict'; | ||
var fnMap = { | ||
chars: jsdiff.diffChars, | ||
words: jsdiff.diffWords, | ||
sentences: jsdiff.diffSentences, | ||
json: jsdiff.diffJson | ||
'chars': jsdiff.diffChars, | ||
'words': jsdiff.diffWords, | ||
'sentences': jsdiff.diffSentences, | ||
'json': jsdiff.diffJson | ||
}; | ||
@@ -33,3 +33,3 @@ | ||
var diff = fnMap[this.props.type](this.props.inputA, this.props.inputB); | ||
var result = diff.map(function (part) { | ||
var result = diff.map(function (part, index) { | ||
var spanStyle = { | ||
@@ -40,3 +40,3 @@ backgroundColor: part.added ? 'lightgreen' : part.removed ? 'salmon' : 'lightgrey' | ||
'span', | ||
{ style: spanStyle }, | ||
{ key: index, style: spanStyle }, | ||
part.value | ||
@@ -50,3 +50,4 @@ ); | ||
); | ||
} }); | ||
} | ||
}); | ||
@@ -44,3 +44,3 @@ var React = require('react'); | ||
backgroundColor: part.added ? 'lightgreen' : part.removed ? 'salmon' : 'lightgrey' | ||
} | ||
}; | ||
return <span key={index} style={spanStyle}>{part.value}</span> | ||
@@ -47,0 +47,0 @@ }); |
{ | ||
"name": "react-diff", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Highlight differences between inputs", | ||
@@ -5,0 +5,0 @@ "main": "dist/react-diff.js", |
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
7155
5
90