8000 fix(generic): fixes on usage of isUndefined in many files by moein · Pull Request #6069 · bootstrap-vue/bootstrap-vue · GitHub
[go: up one dir, main page]

Skip to content

fix(generic): fixes on usage of isUndefined in many files #6069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/components/calendar/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import {
} from '../../utils/date'
import { attemptBlur, attemptFocus, requestAF } from '../../utils/dom'
import { stopEvent } from '../../utils/events'
import { isArray, isPlainObject, isString, isUndefined } from '../../utils/inspect'
import { isArray, isPlainObject, isString, isUndefinedOrNull } from '../../utils/inspect'
import { isLocaleRTL } from '../../utils/locale'
import { mathMax } from '../../utils/math'
import { toInteger } from '../../utils/number'
Expand Down Expand Up @@ -346,7 +346,7 @@ export const BCalendar = Vue.extend({
try {
result = dateDisabledFn()
} catch {}
return isUndefined(result) ? () => false : dateDisabledFn
return isUndefinedOrNull(result) ? () => false : dateDisabledFn
},
// TODO: Change `dateInfoFn` to handle events and notes as well as classes
computedDateInfoFn() {
Expand All @@ -355,7 +355,7 @@ export const BCalendar = Vue.extend({
try {
result = dateInfoFn()
} catch {}
return isUndefined(result) ? () => ({}) : dateInfoFn
return isUndefinedOrNull(result) ? () => ({}) : dateInfoFn
},
calendarLocale() {
// This locale enforces the gregorian calendar (for use in formatter functions)
Expand Down
11 changes: 2 additions & 9 deletions src/components/form-file/form-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@ import { makePropsConfigurable } from '../../utils/config'
import { closest } from '../../utils/dom'
import { hasPromiseSupport } from '../../utils/env'
import { eventOn, eventOff, stopEvent } from '../../utils/events'
import {
isArray,
isFile,
isFunction,
isNull,
isUndefined,
isUndefinedOrNull
} from '../../utils/inspect'
import { isArray, isFile, isFunction, isNull, isUndefinedOrNull } from '../../utils/inspect'
import { File } from '../../utils/safe-types'
import { escapeRegExp } from '../../utils/string'
import { warn } from '../../utils/warn'
Expand Down Expand Up @@ -280,7 +273,7 @@ export const BFormFile = /*#__PURE__*/ Vue.extend({
try {
result = fileNameFormatter()
} catch {}
return isUndefined(result) ? this.defaultFileNameFormatter : fileNameFormatter
return isUndefinedOrNull(result) ? this.defaultFileNameFormatter : fileNameFormatter
},
clonedFiles() {
return cloneDeep(this.files)
Expand Down
4 changes: 2 additions & 2 deletions src/components/form-spinbutton/form-spinbutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { arrayIncludes, concat } from '../../utils/array'
import { makePropsConfigurable } from '../../utils/config'
import { attemptBlur, attemptFocus } from '../../utils/dom'
import { eventOnOff, stopEvent } from '../../utils/events'
import { isNull, isUndefined } from '../../utils/inspect'
import { isNull, isUndefinedOrNull } from '../../utils/inspect'
import { isLocaleRTL } from '../../utils/locale'
import { mathFloor, mathMax, mathPow, mathRound } from '../../utils/math'
import { toFloat, toInteger } from '../../utils/number'
Expand Down Expand Up @@ -227,7 +227,7 @@ export const BFormSpinbutton = /*#__PURE__*/ Vue.extend({
try {
result = formatterFn()
} catch {}
return isUndefined(result) ? this.defaultFormatter : formatterFn
return isUndefinedOrNull(result) ? this.defaultFormatter : formatterFn
},
computedAttrs() {
return {
Expand Down
4 changes: 2 additions & 2 deletions src/components/form-tags/form-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
} from '../../utils/dom'
import { stopEvent } from '../../utils/events'
import { pick } from '../../utils/object'
import { isEvent, isNumber, isString, isUndefined } from '../../utils/inspect'
import { isEvent, isNumber, isString, isUndefinedOrNull } from '../../utils/inspect'
import { escapeRegExp, toString, trim, trimLeft } from '../../utils/string'
import formControlMixin, { props as formControlProps } from '../../mixins/form-control'
import formSizeMixin, { props as formSizeProps } from '../../mixins/form-size'
Expand Down Expand Up @@ -512,7 +512,7 @@ export const BFormTags = /*#__PURE__*/ Vue.extend({
try {
result = tagValidator()
} catch {}
return isUndefined(result) ? true : tagValidator(tag)
return isUndefinedOrNull(result) ? true : tagValidator(tag)
},
getInput() {
// Returns the input element reference (or null if not found)
Expand Down
4 changes: 2 additions & 2 deletions src/components/table/helpers/mixin-filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import identity from '../../../utils/identity'
import looseEqual from '../../../utils/loose-equal'
import { concat } from '../../../utils/array'
import { makePropsConfigurable } from '../../../utils/config'
import { isFunction, isString, isRegExp, isUndefined } from '../../../utils/inspect'
import { isFunction, isString, isRegExp, isUndefinedOrNull } from '../../../utils/inspect'
import { toInteger } from '../../../utils/number'
import { escapeRegExp } from '../../../utils/string'
import { warn } from '../../../utils/warn'
Expand Down Expand Up @@ -87,7 +87,7 @@ export default {
try {
result = filterFunction()
} catch {}
return isUndefined(result) ? null : filterFunction
return isUndefinedOrNull(result) ? null : filterFunction
},
// Returns the records in `localItems` that match the filter criteria
// Returns the original `localItems` array if not sorting
Expand Down
4 changes: 2 additions & 2 deletions src/mixins/form-text.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { makePropsConfigurable } from '../utils/config'
import { attemptBlur, attemptFocus } from '../utils/dom'
import { stopEvent } from '../utils/events'
import { isUndefined } from '../utils/inspect'
import { isUndefinedOrNull } from '../utils/inspect'
import { mathMax } from '../utils/math'
import { toInteger, toFloat } from '../utils/number'
import { toString } from '../utils/string'
Expand Down Expand Up @@ -116,7 +116,7 @@ export default {
try {
result = this.formatter()
} catch {}
return !isUndefined(result)
return !isUndefinedOrNull(result)
}
},
watch: {
Expand Down
0