Skip to content

Commit 695c2f9

Browse files
authored
fix #1384 (#1386)
1 parent b2695fd commit 695c2f9

File tree

1 file changed

+17
-1
lines changed
  • packages/react-bootstrap-table2/src

1 file changed

+17
-1
lines changed

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

+17-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ function splitNested(str) {
1111
.split('.');
1212
}
1313

14+
function contains(list, value) {
15+
if (_.includes) {
16+
return _.includes(list, value);
17+
}
18+
19+
return list.indexOf(value) > -1;
20+
}
21+
1422
function get(target, field) {
1523
const directGet = target[field];
1624
if (directGet !== undefined && directGet !== null) {
@@ -88,4 +96,12 @@ function debounce(func, wait, immediate) {
8896
};
8997
}
9098

91-
export default Object.assign(_, { get, set, isDefined, isEmptyObject, sleep, debounce });
99+
export default Object.assign(_, {
100+
get,
101+
set,
102+
isDefined,
103+
isEmptyObject,
104+
sleep,
105+
debounce,
106+
contains
107+
});

0 commit comments

Comments
 (0)