mirror of
https://github.com/actions/setup-python.git
synced 2024-11-14 07:31:09 +07:00
23 lines
498 B
JavaScript
23 lines
498 B
JavaScript
|
/*!
|
||
|
* is-descriptor <https://github.com/jonschlinkert/is-descriptor>
|
||
|
*
|
||
|
* Copyright (c) 2015-2017, Jon Schlinkert.
|
||
|
* Released under the MIT License.
|
||
|
*/
|
||
|
|
||
|
'use strict';
|
||
|
|
||
|
var typeOf = require('kind-of');
|
||
|
var isAccessor = require('is-accessor-descriptor');
|
||
|
var isData = require('is-data-descriptor');
|
||
|
|
||
|
module.exports = function isDescriptor(obj, key) {
|
||
|
if (typeOf(obj) !== 'object') {
|
||
|
return false;
|
||
|
}
|
||
|
if ('get' in obj) {
|
||
|
return isAccessor(obj, key);
|
||
|
}
|
||
|
return isData(obj, key);
|
||
|
};
|