Isolate isObject().
This commit is contained in:
parent
2071a7d308
commit
73821b0f12
@ -4,6 +4,7 @@ import {BaseError} from 'make-error'
|
||||
import {EventEmitter} from 'events'
|
||||
|
||||
import isEmpty from './is-empty'
|
||||
import isObject from './is-object'
|
||||
|
||||
// ===================================================================
|
||||
|
||||
@ -139,7 +140,7 @@ export default class Collection extends EventEmitter {
|
||||
const [key] = this._resolveItem(keyOrObjectWithId)
|
||||
this._assertHas(key)
|
||||
const value = this.get(key)
|
||||
if (kindOf(value) !== 'object') {
|
||||
if (!isObject(value)) {
|
||||
throw new IllegalTouch(value)
|
||||
}
|
||||
|
||||
|
3
packages/xo-collection/src/is-object.js
Normal file
3
packages/xo-collection/src/is-object.js
Normal file
@ -0,0 +1,3 @@
|
||||
export function isObject (value) {
|
||||
return (value !== null) && (typeof value === 'object')
|
||||
}
|
Loading…
Reference in New Issue
Block a user