Last change
on this file since 59329aa was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
498 bytes
|
Line | |
---|
1 | /*!
|
---|
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 |
|
---|
10 | var typeOf = require('kind-of');
|
---|
11 | var isAccessor = require('is-accessor-descriptor');
|
---|
12 | var isData = require('is-data-descriptor');
|
---|
13 |
|
---|
14 | module.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 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.