is-descriptor
Advanced tools
Comparing version 1.0.0 to 1.0.1
12
index.js
/*! | ||
* is-descriptor <https://github.com/jonschlinkert/is-descriptor> | ||
* | ||
* Copyright (c) 2015, 2017, Jon Schlinkert. | ||
* Copyright (c) 2015-2017, Jon Schlinkert. | ||
* Released under the MIT License. | ||
@@ -10,12 +10,14 @@ */ | ||
var utils = require('./utils'); | ||
var typeOf = require('kind-of'); | ||
var isAccessor = require('is-accessor-descriptor'); | ||
var isData = require('is-data-descriptor'); | ||
module.exports = function isDescriptor(obj, key) { | ||
if (utils.typeOf(obj) !== 'object') { | ||
if (typeOf(obj) !== 'object') { | ||
return false; | ||
} | ||
if ('get' in obj) { | ||
return utils.isAccessor(obj, key); | ||
return isAccessor(obj, key); | ||
} | ||
return utils.isData(obj, key); | ||
return isData(obj, key); | ||
}; |
{ | ||
"name": "is-descriptor", | ||
"description": "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"homepage": "https://github.com/jonschlinkert/is-descriptor", | ||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"contributors": [ | ||
"<wtgtybhertgeghgtwtg@gmail.com> (https://github.com/wtgtybhertgeghgtwtg)", | ||
"Brian Woodward <brian.woodward@gmail.com> (https://github.com/doowb)", | ||
"Jon Schlinkert <jon.schlinkert@sellside.com> (http://twitter.com/jonschlinkert)" | ||
"Brian Woodward (https://twitter.com/doowb)", | ||
"Jon Schlinkert (http://twitter.com/jonschlinkert)", | ||
"(https://github.com/wtgtybhertgeghgtwtg)" | ||
], | ||
@@ -18,4 +18,3 @@ "repository": "jonschlinkert/is-descriptor", | ||
"files": [ | ||
"index.js", | ||
"utils.js" | ||
"index.js" | ||
], | ||
@@ -32,8 +31,7 @@ "main": "index.js", | ||
"is-data-descriptor": "^0.1.4", | ||
"kind-of": "^3.0.2", | ||
"lazy-cache": "^2.0.2" | ||
"kind-of": "^5.0.0" | ||
}, | ||
"devDependencies": { | ||
"gulp-format-md": "^0.1.11", | ||
"mocha": "*" | ||
"gulp-format-md": "^1.0.0", | ||
"mocha": "^3.4.2" | ||
}, | ||
@@ -40,0 +38,0 @@ "keywords": [ |
@@ -1,2 +0,2 @@ | ||
# is-descriptor [![NPM version](https://img.shields.io/npm/v/is-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-descriptor) | ||
# is-descriptor [![NPM version](https://img.shields.io/npm/v/is-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-descriptor.svg?style=flat)](https://npmjs.org/package/is-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-descriptor) | ||
@@ -157,3 +157,3 @@ > Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors. | ||
| --- | --- | | ||
| 20 | [jonschlinkert](https://github.com/jonschlinkert) | | ||
| 24 | [jonschlinkert](https://github.com/jonschlinkert) | | ||
| 1 | [doowb](https://github.com/doowb) | | ||
@@ -194,2 +194,2 @@ | 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | | ||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 25, 2017._ | ||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 22, 2017._ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
3
1
9010
4
19
+ Addedkind-of@5.1.0(transitive)
- Removedlazy-cache@^2.0.2
- Removedis-buffer@1.1.6(transitive)
- Removedkind-of@3.2.2(transitive)
- Removedlazy-cache@2.0.2(transitive)
- Removedset-getter@0.1.1(transitive)
- Removedto-object-path@0.3.0(transitive)
Updatedkind-of@^5.0.0