Skip to content

Commit 6420443

Browse files
committed
style: format code
1 parent 5a4d5ff commit 6420443

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

components/date-picker/utils.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
export function formatDate(value, format) {
2-
const isFunction = function(obj) {
3-
return !!(obj && obj.constructor && obj.call && obj.apply);
4-
};
5-
62
if (!value) {
73
return '';
84
}
95
if (Array.isArray(format)) {
106
format = format[0];
117
}
12-
if (isFunction(format)) {
8+
if (typeof format === 'function') {
139
const result = format(value);
1410
if (typeof result === 'string') {
1511
return result;

components/table/Table.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export default {
157157
sPagination: this.getDefaultPagination(this.$props),
158158
pivot: undefined,
159159
sComponents: createComponents(this.components),
160-
filterDataCnt: 0
160+
filterDataCnt: 0,
161161
};
162162
},
163163
watch: {

components/vc-calendar/src/util/index.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ export function isAllowedDate(value, disabledDate, disabledTime) {
9292
}
9393

9494
export function formatDate(value, format) {
95-
const isFunction = function(obj) {
96-
return !!(obj && obj.constructor && obj.call && obj.apply);
97-
};
98-
9995
if (!value) {
10096
return '';
10197
}
@@ -104,7 +100,7 @@ export function formatDate(value, format) {
104100
format = format[0];
105101
}
106102

107-
if (isFunction(format)) {
103+
if (typeof format === 'function') {
108104
const result = format(value);
109105
if (typeof result === 'string') {
110106
return result;

0 commit comments

Comments
 (0)