Skip to content

Commit 7abd060

Browse files
committed
Optimized splitNested
1 parent ef22dc4 commit 7abd060

File tree

1 file changed

+3
-5
lines changed
  • packages/react-bootstrap-table2/src

1 file changed

+3
-5
lines changed

packages/react-bootstrap-table2/src/utils.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
import _ from 'underscore';
55

66
function splitNested(str) {
7-
return [str]
8-
.join('.')
9-
.replace(/\[/g, '.')
10-
.replace(/\]/g, '')
11-
.split('.');
7+
return str
8+
.replace(']', '')
9+
.split(/\[\./);
1210
}
1311

1412
function contains(list, value) {

0 commit comments

Comments
 (0)