Skip to content

Commit

Permalink
revised typescript in Diff.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
llam722 committed Oct 11, 2022
1 parent efae829 commit 945b778
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/components/Diff.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function Diff(props: DiffProps) {
}

// cleaning preview from stateless data
const statelessCleanning = (obj:{name?:string; componentData?:object; state?:string|any; stateSnaphot?:object; children?:any[]}) => {
const statelessCleanning = (obj:{name?:string; componentData?: Record<string, unknown>; state?:string| any; stateSnaphot?: Record<string, unknown>; children?: any[]}) => {
const newObj = { ...obj };
if (newObj.name === 'nameless') {
delete newObj.name;
Expand All @@ -45,7 +45,7 @@ function Diff(props: DiffProps) {
if (newObj.children) {
newObj.children = [];
if (obj.children.length > 0) {
obj.children.forEach((element:{state?:object | string; children?:[]}) => {
obj.children.forEach((element:{state?: Record<string, unknown> | string; children?:[]}) => {
if (element.state !== 'stateless' || element.children.length > 0) {
const clean = statelessCleanning(element);
newObj.children.push(clean);
Expand Down

0 comments on commit 945b778

Please sign in to comment.