Add get util fn
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
removeResizeEventListener
|
||||
} from '../../utils/event'
|
||||
import { getAdjacentIndexes } from '../../utils/page'
|
||||
import { get } from '../../utils/object'
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
|
||||
3
src/utils/object.js
Normal file
3
src/utils/object.js
Normal file
@@ -0,0 +1,3 @@
|
||||
export const get = (object, field, defaultValue) => {
|
||||
return object && object.hasOwnProperty(field) ? options[field] : defaultValue
|
||||
}
|
||||
Reference in New Issue
Block a user