This repository was archived by the owner on Sep 21, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-12
lines changed
packages/devtools-reps/src Expand file tree Collapse file tree 3 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -218,7 +218,7 @@ class ObjectInspector extends Component {
218218 value ? : string | Element ,
219219 label ? : string
220220 } ) {
221- let label = item . name ;
221+ const label = item . name ;
222222 const isPrimitive = nodeIsPrimitive ( item ) ;
223223
224224 if ( nodeIsOptimizedOut ( item ) ) {
@@ -307,7 +307,9 @@ class ObjectInspector extends Component {
307307 repProps . mode = MODE . TINY ;
308308 }
309309
310- repProps . showFullText = nodeHasFullText ( item ) && expanded ;
310+ repProps . member = {
311+ open : nodeHasFullText ( item ) && expanded
312+ } ;
311313
312314 return {
313315 label,
Original file line number Diff line number Diff line change @@ -249,10 +249,12 @@ function nodeHasEntries(
249249 return false ;
250250 }
251251
252- return value . class === "Map"
253- || value . class === "Set"
254- || value . class === "WeakMap"
255- || value . class === "WeakSet" ;
252+ return [
253+ "Map" ,
254+ "Set" ,
255+ "WeakMap" ,
256+ "WeakSet"
257+ ] . includes ( value . class ) ;
256258}
257259
258260function nodeHasAllEntriesInPreview ( item : Node ) : boolean {
Original file line number Diff line number Diff line change @@ -29,11 +29,10 @@ StringRep.propTypes = {
2929 escapeWhitespace : PropTypes . bool ,
3030 style : PropTypes . object ,
3131 cropLimit : PropTypes . number . isRequired ,
32- member : PropTypes . string ,
32+ member : PropTypes . object ,
3333 object : PropTypes . object . isRequired ,
3434 openLink : PropTypes . func ,
3535 className : PropTypes . string ,
36- showFullText : PropTypes . bool ,
3736} ;
3837
3938function StringRep ( props ) {
@@ -45,14 +44,14 @@ function StringRep(props) {
4544 useQuotes = true ,
4645 escapeWhitespace = true ,
4746 member,
48- openLink,
49- showFullText
47+ openLink
5048 } = props ;
5149
5250 let text = object ;
5351
5452 const isLong = isLongString ( object ) ;
55- const shouldCrop = ( ! member || ! member . open ) && cropLimit && text . length > cropLimit ;
53+ const isOpen = member && member . open ;
54+ const shouldCrop = ! isOpen && cropLimit && text . length > cropLimit ;
5655
5756 if ( isLong ) {
5857 text = maybeCropLongString ( {
@@ -61,7 +60,7 @@ function StringRep(props) {
6160 } , text ) ;
6261
6362 const { fullText } = object ;
64- if ( showFullText && fullText ) {
63+ if ( isOpen && fullText ) {
6564 text = fullText ;
6665 }
6766 }
You can’t perform that action at this time.
0 commit comments