1 | /*!
|
2 | * has-value <https://github.com/jonschlinkert/has-value>
|
3 | *
|
4 | * Copyright (c) 2014-2018, Jon Schlinkert.
|
5 | * Released under the MIT License.
|
6 | */
|
7 |
|
8 | ;
|
9 |
|
10 | const get = require('get-value');
|
11 | const has = require('has-values');
|
12 |
|
13 | module.exports = function(obj, path, options) {
|
14 | if (isObject(obj) && (typeof path === 'string' || Array.isArray(path))) {
|
15 | return has(get(obj, path, options));
|
16 | }
|
17 | return false;
|
18 | };
|
19 |
|
20 | function isObject(val) {
|
21 | return val != null && (typeof val === 'object' || typeof val === 'function' || Array.isArray(val));
|
22 | }
|