Skip to content

Commit acf33c1

Browse files
committed
Merge branch 'dev'
2 parents 5a786e5 + 8c5eb59 commit acf33c1

File tree

5 files changed

+18
-17
lines changed

5 files changed

+18
-17
lines changed

package.json

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flattree",
3-
"version": "0.8.2",
3+
"version": "0.9.0",
44
"description": "Convert hierarchical tree structure to flat structure.",
55
"main": "lib/index.js",
66
"scripts": {
@@ -25,20 +25,22 @@
2525
"tree"
2626
],
2727
"devDependencies": {
28-
"babel-cli": "^6.6.5",
29-
"babel-core": "^6.7.4",
30-
"babel-eslint": "^6.0.2",
31-
"babel-plugin-transform-es3-member-expression-literals": "^6.5.0",
32-
"babel-plugin-transform-es3-property-literals": "^6.5.0",
28+
"babel-cli": "^6.8.0",
29+
"babel-core": "^6.8.0",
30+
"babel-eslint": "^6.0.4",
31+
"babel-plugin-transform-es3-member-expression-literals": "^6.8.0",
32+
"babel-plugin-transform-es3-property-literals": "^6.8.0",
3333
"babel-preset-es2015": "^6.6.0",
3434
"babel-preset-es2015-loose": "^7.0.0",
3535
"babel-preset-stage-0": "^6.5.0",
36-
"coveralls": "^2.11.8",
37-
"eslint": "^2.6.0",
38-
"eslint-config-airbnb": "^6.2.0",
39-
"eslint-plugin-react": "^4.2.3",
40-
"lodash": "^4.7.0",
41-
"tap": "^5.7.0"
36+
"coveralls": "^2.11.9",
37+
"eslint": "^2.9.0",
38+
"eslint-config-airbnb": "^9.0.1",
39+
"eslint-plugin-import": "^1.8.0",
40+
"eslint-plugin-jsx-a11y": "^1.2.0",
41+
"eslint-plugin-react": "^5.1.1",
42+
"lodash": "^4.12.0",
43+
"tap": "^5.7.1"
4244
},
4345
"nyc": {
4446
"exclude": [

src/extend.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint no-restricted-syntax: 0 */
12
const extend = (target, ...sources) => {
23
if (target === undefined || target === null) {
34
throw new TypeError('Cannot convert undefined or null to object');

src/flatten.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint no-console: 0 */
12
import extend from './extend';
23
import Node from './node';
34

@@ -26,7 +27,6 @@ const flatten = (nodes = [], options = {}) => {
2627
parentNode = new Node(parentNode);
2728
}
2829
const rootNode = parentNode || new Node({ // defaults
29-
label: '',
3030
parent: null,
3131
children: nodes,
3232
state: {
@@ -57,9 +57,8 @@ const flatten = (nodes = [], options = {}) => {
5757
if (options.throwOnError) {
5858
throw new Error('The node might have been corrupted: id=' + JSON.stringify(p.id) + ', state=' + JSON.stringify(p.state));
5959
} else {
60-
console && console.log('Error: The node might have been corrupted: id=%s, label=%s, parent=%s, children=%s, state=%s',
60+
console && console.log('Error: The node might have been corrupted: id=%s, parent=%s, children=%s, state=%s',
6161
JSON.stringify(p.id),
62-
JSON.stringify(p.label),
6362
p.parent,
6463
p.children,
6564
JSON.stringify(p.state),

src/node.js

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import extend from './extend';
22

33
class Node {
44
id = null;
5-
label = '';
65
parent = null;
76
children = [];
87
state = {};

test/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ test('[flatten] Corrupted parent node', (t) => {
523523
parent.parent.state.total = 0;
524524
const originalConsoleLogger = console.log;
525525
console.log = (msg) => {
526-
t.same(msg, 'Error: The node might have been corrupted: id=%s, label=%s, parent=%s, children=%s, state=%s');
526+
t.same(msg, 'Error: The node might have been corrupted: id=%s, parent=%s, children=%s, state=%s');
527527
};
528528
flatten(node, { openAllNodes: true, throwOnError: false });
529529
console.log = originalConsoleLogger;

0 commit comments

Comments
 (0)