blob: c9b91d76226a358f860045450395768d6edec2d5 [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001/*!
2 * is-descriptor <https://github.com/jonschlinkert/is-descriptor>
3 *
4 * Copyright (c) 2015-2017, Jon Schlinkert.
5 * Released under the MIT License.
6 */
7
8'use strict';
9
10var typeOf = require('kind-of');
11var isAccessor = require('is-accessor-descriptor');
12var isData = require('is-data-descriptor');
13
14module.exports = function isDescriptor(obj, key) {
15 if (typeOf(obj) !== 'object') {
16 return false;
17 }
18 if ('get' in obj) {
19 return isAccessor(obj, key);
20 }
21 return isData(obj, key);
22};