chore: 🤖 add code format tool

This commit is contained in:
youxingzhi
2020-01-30 11:16:36 +08:00
parent 15f33d187d
commit d73b4c1829
15 changed files with 1449 additions and 146 deletions

View File

@@ -1,4 +1,4 @@
import {traverseTree} from './tools'
import { traverseTree } from './tools'
/**
* Tree data struct
* Created by ayou on 2017/7/20.
@@ -11,7 +11,7 @@ import {traverseTree} from './tools'
*/
export class TreeNode {
constructor(data) {
const {id, isLeaf} = data
const { id, isLeaf } = data
this.id = typeof id === 'undefined' ? new Date().valueOf() : id
this.parent = null
this.children = null
@@ -149,7 +149,7 @@ export class TreeNode {
export class Tree {
constructor(data) {
this.root = new TreeNode({name: 'root', isLeaf: false, id: 0})
this.root = new TreeNode({ name: 'root', isLeaf: false, id: 0 })
this.initNode(this.root, data)
return this.root
}