Skip to content

Commit acee422

Browse files
committed
2 parents 6b89cc2 + f32ba6f commit acee422

File tree

3 files changed

+85
-85
lines changed

3 files changed

+85
-85
lines changed

package.json

+78-78
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,80 @@
11
{
2-
"name": "react-bootstrap-table",
3-
"version": "2.5.8",
4-
"description": "It's a react table for bootstrap",
5-
"main": "./lib/index.js",
6-
"repository": {
7-
"type": "git",
8-
"url": "https://github.com/AllenFang/react-bootstrap-table.git"
9-
},
10-
"scripts": {
11-
"lint": "eslint src",
12-
"start": "gulp example-server"
13-
},
14-
"keywords": [
15-
"react",
16-
"bootstrap",
17-
"table",
18-
"grid",
19-
"react-component"
20-
],
21-
"files": [
22-
"README.md",
23-
"lib/",
24-
"dist/",
25-
"css/"
26-
],
27-
"tags": [
28-
"react"
29-
],
30-
"author": "AllenFang",
31-
"license": "MIT",
32-
"devDependencies": {
33-
"babel": "^5.8.29",
34-
"babel-core": "^5.8.30",
35-
"babel-eslint": "^4.1.1",
36-
"babel-loader": "^5.3.3",
37-
"babelify": "^6.4.0",
38-
"bootstrap": "3.3.5",
39-
"browserify": "^11.2.0",
40-
"css-loader": "^0.21.0",
41-
"del": "^2.2.0",
42-
"eslint": "1.7.3",
43-
"eslint-config-airbnb": "0.1.0",
44-
"eslint-loader": "^1.3.0",
45-
"eslint-plugin-react": "3.6.3",
46-
"gulp": "^3.9.1",
47-
"gulp-babel": "^5.3.0",
48-
"gulp-concat-css": "^2.2.0",
49-
"gulp-cssmin": "^0.1.7",
50-
"gulp-shell": "^0.5.2",
51-
"jquery": "^2.1.4",
52-
"jsx-loader": "^0.13.2",
53-
"react": "^0.14.3 || ^15.0.0",
54-
"react-bootstrap": "^0.29.5",
55-
"react-dom": "^0.14.3 || ^15.0.0",
56-
"react-hot-loader": "^1.3.0",
57-
"react-router": "^1.0.2",
58-
"style-loader": "^0.13.0",
59-
"toastr": "^2.1.2",
60-
"vinyl-source-stream": "^1.1.0",
61-
"watchify": "^3.0.0",
62-
"webpack": "^1.12.4",
63-
"webpack-dev-server": "^1.12.1"
64-
},
65-
"dependencies": {
2+
"name": "react-bootstrap-table",
3+
"version": "2.5.8",
4+
"description": "It's a react table for bootstrap",
5+
"main": "./lib/index.js",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/AllenFang/react-bootstrap-table.git"
9+
},
10+
"scripts": {
11+
"lint": "eslint src",
12+
"start": "gulp example-server"
13+
},
14+
"keywords": [
15+
"react",
16+
"bootstrap",
17+
"table",
18+
"grid",
19+
"react-component"
20+
],
21+
"files": [
22+
"README.md",
23+
"lib/",
24+
"dist/",
25+
"css/"
26+
],
27+
"tags": [
28+
"react"
29+
],
30+
"author": "AllenFang",
31+
"license": "MIT",
32+
"devDependencies": {
33+
"babel": "^5.8.29",
34+
"babel-core": "^5.8.30",
35+
"babel-eslint": "^4.1.1",
36+
"babel-loader": "^5.3.3",
37+
"babelify": "^6.4.0",
38+
"bootstrap": "3.3.5",
39+
"browserify": "^11.2.0",
40+
"css-loader": "^0.21.0",
41+
"del": "^2.2.0",
42+
"eslint": "1.7.3",
43+
"eslint-config-airbnb": "0.1.0",
44+
"eslint-loader": "^1.3.0",
45+
"eslint-plugin-react": "3.6.3",
46+
"gulp": "^3.9.1",
47+
"gulp-babel": "^5.3.0",
48+
"gulp-concat-css": "^2.2.0",
49+
"gulp-cssmin": "^0.1.7",
50+
"gulp-shell": "^0.5.2",
51+
"history": "^1.17.0",
52+
"jquery": "^2.1.4",
53+
"jsx-loader": "^0.13.2",
54+
"react": "^0.14.3 || ^15.0.0",
55+
"react-bootstrap": "^0.29.5",
56+
"react-dom": "^0.14.3 || ^15.0.0",
57+
"react-hot-loader": "^1.3.0",
58+
"react-router": "^1.0.2",
59+
"style-loader": "^0.13.0",
60+
"toastr": "^2.1.2",
61+
"vinyl-source-stream": "^1.1.0",
62+
"watchify": "^3.0.0",
63+
"webpack": "^1.12.4",
64+
"webpack-dev-server": "^1.12.1"
65+
},
66+
"dependencies": {
6667
"underscore": "1.8.3",
67-
"history": "^1.7.0",
68-
"classnames": "^2.1.2",
69-
"react-toastr": "^2.8.0"
70-
},
71-
"peerDependencies": {
72-
"react": "^0.14.3 || ^15.0.0"
73-
},
74-
"jest": {
75-
"scriptPreprocessor": "<rootDir>/preprocessor.js",
76-
"unmockedModulePathPatterns": [
77-
"<rootDir>/node_modules/react"
78-
]
79-
}
80-
}
68+
"classnames": "^2.1.2",
69+
"react-toastr": "^2.8.0"
70+
},
71+
"peerDependencies": {
72+
"react": "^0.14.3 || ^15.0.0"
73+
},
74+
"jest": {
75+
"scriptPreprocessor": "<rootDir>/preprocessor.js",
76+
"unmockedModulePathPatterns": [
77+
"<rootDir>/node_modules/react"
78+
]
79+
}
80+
}

src/BootstrapTable.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class BootstrapTable extends Component {
5757
React.Children.forEach(props.children, column => {
5858
if (column.props.isKey) {
5959
if (keyField) {
60-
throw 'Error. Multiple key column be detected in TableHeaderColumn.';
60+
throw new Error('Error. Multiple key column be detected in TableHeaderColumn.');
6161
}
6262
keyField = column.props.dataField;
6363
}
@@ -85,8 +85,8 @@ class BootstrapTable extends Component {
8585
}, {});
8686

8787
if (!isKeyFieldDefined && !keyField) {
88-
throw `Error. No any key column defined in TableHeaderColumn.
89-
Use 'isKey={true}' to specify a unique column after version 0.5.4.`;
88+
throw new Error(`Error. No any key column defined in TableHeaderColumn.
89+
Use 'isKey={true}' to specify a unique column after version 0.5.4.`);
9090
}
9191

9292
this.store.setProps({

src/store/TableDataStore.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,12 @@ export class TableDataStore {
167167

168168
addAtBegin(newObj) {
169169
if (!newObj[this.keyField] || newObj[this.keyField].toString() === '') {
170-
throw `${this.keyField} can't be empty value.`;
170+
throw new Error(`${this.keyField} can't be empty value.`);
171171
}
172172
const currentDisplayData = this.getCurrentDisplayData();
173173
currentDisplayData.forEach(function(row) {
174174
if (row[this.keyField].toString() === newObj[this.keyField].toString()) {
175-
throw `${this.keyField} ${newObj[this.keyField]} already exists`;
175+
throw new Error(`${this.keyField} ${newObj[this.keyField]} already exists`);
176176
}
177177
}, this);
178178
currentDisplayData.unshift(newObj);
@@ -184,12 +184,12 @@ export class TableDataStore {
184184

185185
add(newObj) {
186186
if (!newObj[this.keyField] || newObj[this.keyField].toString() === '') {
187-
throw `${this.keyField} can't be empty value.`;
187+
throw new Error(`${this.keyField} can't be empty value.`);
188188
}
189189
const currentDisplayData = this.getCurrentDisplayData();
190190
currentDisplayData.forEach(function(row) {
191191
if (row[this.keyField].toString() === newObj[this.keyField].toString()) {
192-
throw `${this.keyField} ${newObj[this.keyField]} already exists`;
192+
throw new Error(`${this.keyField} ${newObj[this.keyField]} already exists`);
193193
}
194194
}, this);
195195

0 commit comments

Comments
 (0)