This commit is contained in:
eric sciple 2020-01-24 12:30:26 -05:00
parent 00c3b50fca
commit ae5dcb46c8
7331 changed files with 1784502 additions and 0 deletions

82
node_modules/define-property/CHANGELOG.md generated vendored Normal file
View file

@ -0,0 +1,82 @@
# Release history
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
<details>
<summary><strong>Guiding Principles</strong></summary>
- Changelogs are for humans, not machines.
- There should be an entry for every single version.
- The same types of changes should be grouped.
- Versions and sections should be linkable.
- The latest version comes first.
- The release date of each versions is displayed.
- Mention whether you follow Semantic Versioning.
</details>
<details>
<summary><strong>Types of changes</strong></summary>
Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_):
- `Added` for new features.
- `Changed` for changes in existing functionality.
- `Deprecated` for soon-to-be removed features.
- `Removed` for now removed features.
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.
</details>
## [2.0.0] - 2017-04-20
### Changed
- Now supports data descriptors in addition to accessor descriptors.
- Now uses [Reflect.defineProperty][reflect] when available, otherwise falls back to [Object.defineProperty][object].
## [1.0.0] - 2017-04-20
- stable release
## [0.2.5] - 2015-08-31
- use is-descriptor
## [0.2.3] - 2015-08-29
- check keys length
## [0.2.2] - 2015-08-27
- ensure val is an object
## [0.2.1] - 2015-08-27
- support functions
## [0.2.0] - 2015-08-27
- support get/set
- update docs
## [0.1.0] - 2015-08-12
- first commit
[2.0.0]: https://github.com/jonschlinkert/define-property/compare/1.0.0...2.0.0
[1.0.0]: https://github.com/jonschlinkert/define-property/compare/0.2.5...1.0.0
[0.2.5]: https://github.com/jonschlinkert/define-property/compare/0.2.3...0.2.5
[0.2.3]: https://github.com/jonschlinkert/define-property/compare/0.2.2...0.2.3
[0.2.2]: https://github.com/jonschlinkert/define-property/compare/0.2.1...0.2.2
[0.2.1]: https://github.com/jonschlinkert/define-property/compare/0.2.0...0.2.1
[0.2.0]: https://github.com/jonschlinkert/define-property/compare/0.1.3...0.2.0
[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog
[object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty
[reflect]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect/defineProperty

21
node_modules/define-property/LICENSE generated vendored Normal file
View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015-2018, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

117
node_modules/define-property/README.md generated vendored Normal file
View file

@ -0,0 +1,117 @@
# define-property [![NPM version](https://img.shields.io/npm/v/define-property.svg?style=flat)](https://www.npmjs.com/package/define-property) [![NPM monthly downloads](https://img.shields.io/npm/dm/define-property.svg?style=flat)](https://npmjs.org/package/define-property) [![NPM total downloads](https://img.shields.io/npm/dt/define-property.svg?style=flat)](https://npmjs.org/package/define-property) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/define-property.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/define-property)
> Define a non-enumerable property on an object. Uses Reflect.defineProperty when available, otherwise Object.defineProperty.
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save define-property
```
## Release history
See [the CHANGELOG](changelog.md) for updates.
## Usage
**Params**
* `object`: The object on which to define the property.
* `key`: The name of the property to be defined or modified.
* `value`: The value or descriptor of the property being defined or modified.
```js
var define = require('define-property');
var obj = {};
define(obj, 'foo', function(val) {
return val.toUpperCase();
});
// by default, defined properties are non-enumberable
console.log(obj);
//=> {}
console.log(obj.foo('bar'));
//=> 'BAR'
```
**defining setters/getters**
Pass the same properties you would if using [Object.defineProperty](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty) or [Reflect.defineProperty](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect/defineProperty).
```js
define(obj, 'foo', {
set: function() {},
get: function() {}
});
```
## About
<details>
<summary><strong>Contributing</strong></summary>
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
</details>
<details>
<summary><strong>Running Tests</strong></summary>
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
```sh
$ npm install && npm test
```
</details>
<details>
<summary><strong>Building docs</strong></summary>
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
To generate the readme, run the following command:
```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```
</details>
### Related projects
You might also be interested in these projects:
* [assign-deep](https://www.npmjs.com/package/assign-deep): Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target… [more](https://github.com/jonschlinkert/assign-deep) | [homepage](https://github.com/jonschlinkert/assign-deep "Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target (first) object.")
* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.")
* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.")
* [mixin-deep](https://www.npmjs.com/package/mixin-deep): Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | [homepage](https://github.com/jonschlinkert/mixin-deep "Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone.")
### Contributors
| **Commits** | **Contributor** |
| --- | --- |
| 28 | [jonschlinkert](https://github.com/jonschlinkert) |
| 1 | [doowb](https://github.com/doowb) |
### Author
**Jon Schlinkert**
* Connect with me on [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert)
* Follow me on [github/jonschlinkert](https://github.com/jonschlinkert)
* Follow me on [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
### License
Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on January 25, 2018._

38
node_modules/define-property/index.js generated vendored Normal file
View file

@ -0,0 +1,38 @@
/*!
* define-property <https://github.com/jonschlinkert/define-property>
*
* Copyright (c) 2015-2018, Jon Schlinkert.
* Released under the MIT License.
*/
'use strict';
var isobject = require('isobject');
var isDescriptor = require('is-descriptor');
var define = (typeof Reflect !== 'undefined' && Reflect.defineProperty)
? Reflect.defineProperty
: Object.defineProperty;
module.exports = function defineProperty(obj, key, val) {
if (!isobject(obj) && typeof obj !== 'function' && !Array.isArray(obj)) {
throw new TypeError('expected an object, function, or array');
}
if (typeof key !== 'string') {
throw new TypeError('expected "key" to be a string');
}
if (isDescriptor(val)) {
define(obj, key, val);
return obj;
}
define(obj, key, {
configurable: true,
enumerable: false,
writable: true,
value: val
});
return obj;
};

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015-2017, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View file

@ -0,0 +1,144 @@
# is-accessor-descriptor [![NPM version](https://img.shields.io/npm/v/is-accessor-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-accessor-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-accessor-descriptor.svg?style=flat)](https://npmjs.org/package/is-accessor-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-accessor-descriptor.svg?style=flat)](https://npmjs.org/package/is-accessor-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-accessor-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-accessor-descriptor)
> Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save is-accessor-descriptor
```
## Usage
```js
var isAccessor = require('is-accessor-descriptor');
isAccessor({get: function() {}});
//=> true
```
You may also pass an object and property name to check if the property is an accessor:
```js
isAccessor(foo, 'bar');
```
## Examples
`false` when not an object
```js
isAccessor('a')
isAccessor(null)
isAccessor([])
//=> false
```
`true` when the object has valid properties
and the properties all have the correct JavaScript types:
```js
isAccessor({get: noop, set: noop})
isAccessor({get: noop})
isAccessor({set: noop})
//=> true
```
`false` when the object has invalid properties
```js
isAccessor({get: noop, set: noop, bar: 'baz'})
isAccessor({get: noop, writable: true})
isAccessor({get: noop, value: true})
//=> false
```
`false` when an accessor is not a function
```js
isAccessor({get: noop, set: 'baz'})
isAccessor({get: 'foo', set: noop})
isAccessor({get: 'foo', bar: 'baz'})
isAccessor({get: 'foo', set: 'baz'})
//=> false
```
`false` when a value is not the correct type
```js
isAccessor({get: noop, set: noop, enumerable: 'foo'})
isAccessor({set: noop, configurable: 'foo'})
isAccessor({get: noop, configurable: 'foo'})
//=> false
```
## About
<details>
<summary><strong>Contributing</strong></summary>
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
</details>
<details>
<summary><strong>Running Tests</strong></summary>
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
```sh
$ npm install && npm test
```
</details>
<details>
<summary><strong>Building docs</strong></summary>
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
To generate the readme, run the following command:
```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```
</details>
### Related projects
You might also be interested in these projects:
* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.")
* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.")
* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.")
* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.")
* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.")
### Contributors
| **Commits** | **Contributor** |
| --- | --- |
| 22 | [jonschlinkert](https://github.com/jonschlinkert) |
| 2 | [realityking](https://github.com/realityking) |
### Author
**Jon Schlinkert**
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
### License
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 01, 2017._

View file

@ -0,0 +1,69 @@
/*!
* is-accessor-descriptor <https://github.com/jonschlinkert/is-accessor-descriptor>
*
* Copyright (c) 2015-2017, Jon Schlinkert.
* Released under the MIT License.
*/
'use strict';
var typeOf = require('kind-of');
// accessor descriptor properties
var accessor = {
get: 'function',
set: 'function',
configurable: 'boolean',
enumerable: 'boolean'
};
function isAccessorDescriptor(obj, prop) {
if (typeof prop === 'string') {
var val = Object.getOwnPropertyDescriptor(obj, prop);
return typeof val !== 'undefined';
}
if (typeOf(obj) !== 'object') {
return false;
}
if (has(obj, 'value') || has(obj, 'writable')) {
return false;
}
if (!has(obj, 'get') || typeof obj.get !== 'function') {
return false;
}
// tldr: it's valid to have "set" be undefined
// "set" might be undefined if `Object.getOwnPropertyDescriptor`
// was used to get the value, and only `get` was defined by the user
if (has(obj, 'set') && typeof obj[key] !== 'function' && typeof obj[key] !== 'undefined') {
return false;
}
for (var key in obj) {
if (!accessor.hasOwnProperty(key)) {
continue;
}
if (typeOf(obj[key]) === accessor[key]) {
continue;
}
if (typeof obj[key] !== 'undefined') {
return false;
}
}
return true;
}
function has(obj, key) {
return {}.hasOwnProperty.call(obj, key);
}
/**
* Expose `isAccessorDescriptor`
*/
module.exports = isAccessorDescriptor;

View file

@ -0,0 +1,77 @@
{
"name": "is-accessor-descriptor",
"description": "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.",
"version": "1.0.0",
"homepage": "https://github.com/jonschlinkert/is-accessor-descriptor",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"contributors": [
"Jon Schlinkert (http://twitter.com/jonschlinkert)",
"Rouven Weßling (www.rouvenwessling.de)"
],
"repository": "jonschlinkert/is-accessor-descriptor",
"bugs": {
"url": "https://github.com/jonschlinkert/is-accessor-descriptor/issues"
},
"license": "MIT",
"files": [
"index.js"
],
"main": "index.js",
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "mocha"
},
"dependencies": {
"kind-of": "^6.0.0"
},
"devDependencies": {
"gulp-format-md": "^1.0.0",
"mocha": "^3.5.3"
},
"keywords": [
"accessor",
"check",
"data",
"descriptor",
"get",
"getter",
"is",
"keys",
"object",
"properties",
"property",
"set",
"setter",
"type",
"valid",
"value"
],
"verb": {
"toc": false,
"layout": "default",
"tasks": [
"readme"
],
"plugins": [
"gulp-format-md"
],
"related": {
"list": [
"is-accessor-descriptor",
"is-data-descriptor",
"is-descriptor",
"is-plain-object",
"isobject"
]
},
"lint": {
"reflinks": true
}
}
,"_resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz"
,"_integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ=="
,"_from": "is-accessor-descriptor@1.0.0"
}

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015-2017, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View file

@ -0,0 +1,161 @@
# is-data-descriptor [![NPM version](https://img.shields.io/npm/v/is-data-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-data-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-data-descriptor.svg?style=flat)](https://npmjs.org/package/is-data-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-data-descriptor.svg?style=flat)](https://npmjs.org/package/is-data-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-data-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-data-descriptor)
> Returns true if a value has the characteristics of a valid JavaScript data descriptor.
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save is-data-descriptor
```
## Usage
```js
var isDataDesc = require('is-data-descriptor');
```
## Examples
`true` when the descriptor has valid properties with valid values.
```js
// `value` can be anything
isDataDesc({value: 'foo'})
isDataDesc({value: function() {}})
isDataDesc({value: true})
//=> true
```
`false` when not an object
```js
isDataDesc('a')
//=> false
isDataDesc(null)
//=> false
isDataDesc([])
//=> false
```
`false` when the object has invalid properties
```js
isDataDesc({value: 'foo', bar: 'baz'})
//=> false
isDataDesc({value: 'foo', bar: 'baz'})
//=> false
isDataDesc({value: 'foo', get: function(){}})
//=> false
isDataDesc({get: function(){}, value: 'foo'})
//=> false
```
`false` when a value is not the correct type
```js
isDataDesc({value: 'foo', enumerable: 'foo'})
//=> false
isDataDesc({value: 'foo', configurable: 'foo'})
//=> false
isDataDesc({value: 'foo', writable: 'foo'})
//=> false
```
## Valid properties
The only valid data descriptor properties are the following:
* `configurable` (required)
* `enumerable` (required)
* `value` (optional)
* `writable` (optional)
To be a valid data descriptor, either `value` or `writable` must be defined.
**Invalid properties**
A descriptor may have additional _invalid_ properties (an error will **not** be thrown).
```js
var foo = {};
Object.defineProperty(foo, 'bar', {
enumerable: true,
whatever: 'blah', // invalid, but doesn't cause an error
get: function() {
return 'baz';
}
});
console.log(foo.bar);
//=> 'baz'
```
## About
<details>
<summary><strong>Contributing</strong></summary>
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
</details>
<details>
<summary><strong>Running Tests</strong></summary>
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
```sh
$ npm install && npm test
```
</details>
<details>
<summary><strong>Building docs</strong></summary>
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
To generate the readme, run the following command:
```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```
</details>
### Related projects
You might also be interested in these projects:
* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.")
* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.")
* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.")
* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.")
### Contributors
| **Commits** | **Contributor** |
| --- | --- |
| 21 | [jonschlinkert](https://github.com/jonschlinkert) |
| 2 | [realityking](https://github.com/realityking) |
### Author
**Jon Schlinkert**
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
### License
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 01, 2017._

View file

@ -0,0 +1,49 @@
/*!
* is-data-descriptor <https://github.com/jonschlinkert/is-data-descriptor>
*
* Copyright (c) 2015-2017, Jon Schlinkert.
* Released under the MIT License.
*/
'use strict';
var typeOf = require('kind-of');
module.exports = function isDataDescriptor(obj, prop) {
// data descriptor properties
var data = {
configurable: 'boolean',
enumerable: 'boolean',
writable: 'boolean'
};
if (typeOf(obj) !== 'object') {
return false;
}
if (typeof prop === 'string') {
var val = Object.getOwnPropertyDescriptor(obj, prop);
return typeof val !== 'undefined';
}
if (!('value' in obj) && !('writable' in obj)) {
return false;
}
for (var key in obj) {
if (key === 'value') continue;
if (!data.hasOwnProperty(key)) {
continue;
}
if (typeOf(obj[key]) === data[key]) {
continue;
}
if (typeof obj[key] !== 'undefined') {
return false;
}
}
return true;
};

View file

@ -0,0 +1,76 @@
{
"name": "is-data-descriptor",
"description": "Returns true if a value has the characteristics of a valid JavaScript data descriptor.",
"version": "1.0.0",
"homepage": "https://github.com/jonschlinkert/is-data-descriptor",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"contributors": [
"Jon Schlinkert (http://twitter.com/jonschlinkert)",
"Rouven Weßling (www.rouvenwessling.de)"
],
"repository": "jonschlinkert/is-data-descriptor",
"bugs": {
"url": "https://github.com/jonschlinkert/is-data-descriptor/issues"
},
"license": "MIT",
"files": [
"index.js"
],
"main": "index.js",
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "mocha"
},
"dependencies": {
"kind-of": "^6.0.0"
},
"devDependencies": {
"gulp-format-md": "^1.0.0",
"mocha": "^3.5.3"
},
"keywords": [
"accessor",
"check",
"data",
"descriptor",
"get",
"getter",
"is",
"keys",
"object",
"properties",
"property",
"set",
"setter",
"type",
"valid",
"value"
],
"verb": {
"toc": false,
"layout": "default",
"tasks": [
"readme"
],
"plugins": [
"gulp-format-md"
],
"related": {
"list": [
"is-accessor-descriptor",
"is-data-descriptor",
"is-descriptor",
"isobject"
]
},
"lint": {
"reflinks": true
}
}
,"_resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz"
,"_integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ=="
,"_from": "is-data-descriptor@1.0.0"
}

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015-2017, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View file

@ -0,0 +1,193 @@
# 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)
> Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save is-descriptor
```
## Usage
```js
var isDescriptor = require('is-descriptor');
isDescriptor({value: 'foo'})
//=> true
isDescriptor({get: function(){}, set: function(){}})
//=> true
isDescriptor({get: 'foo', set: function(){}})
//=> false
```
You may also check for a descriptor by passing an object as the first argument and property name (`string`) as the second argument.
```js
var obj = {};
obj.foo = 'abc';
Object.defineProperty(obj, 'bar', {
value: 'xyz'
});
isDescriptor(obj, 'foo');
//=> true
isDescriptor(obj, 'bar');
//=> true
```
## Examples
### value type
`false` when not an object
```js
isDescriptor('a');
//=> false
isDescriptor(null);
//=> false
isDescriptor([]);
//=> false
```
### data descriptor
`true` when the object has valid properties with valid values.
```js
isDescriptor({value: 'foo'});
//=> true
isDescriptor({value: noop});
//=> true
```
`false` when the object has invalid properties
```js
isDescriptor({value: 'foo', bar: 'baz'});
//=> false
isDescriptor({value: 'foo', bar: 'baz'});
//=> false
isDescriptor({value: 'foo', get: noop});
//=> false
isDescriptor({get: noop, value: noop});
//=> false
```
`false` when a value is not the correct type
```js
isDescriptor({value: 'foo', enumerable: 'foo'});
//=> false
isDescriptor({value: 'foo', configurable: 'foo'});
//=> false
isDescriptor({value: 'foo', writable: 'foo'});
//=> false
```
### accessor descriptor
`true` when the object has valid properties with valid values.
```js
isDescriptor({get: noop, set: noop});
//=> true
isDescriptor({get: noop});
//=> true
isDescriptor({set: noop});
//=> true
```
`false` when the object has invalid properties
```js
isDescriptor({get: noop, set: noop, bar: 'baz'});
//=> false
isDescriptor({get: noop, writable: true});
//=> false
isDescriptor({get: noop, value: true});
//=> false
```
`false` when an accessor is not a function
```js
isDescriptor({get: noop, set: 'baz'});
//=> false
isDescriptor({get: 'foo', set: noop});
//=> false
isDescriptor({get: 'foo', bar: 'baz'});
//=> false
isDescriptor({get: 'foo', set: 'baz'});
//=> false
```
`false` when a value is not the correct type
```js
isDescriptor({get: noop, set: noop, enumerable: 'foo'});
//=> false
isDescriptor({set: noop, configurable: 'foo'});
//=> false
isDescriptor({get: noop, configurable: 'foo'});
//=> false
```
## About
### Related projects
* [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.")
* [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.")
* [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.")
* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.")
### Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
### Contributors
| **Commits** | **Contributor** |
| --- | --- |
| 24 | [jonschlinkert](https://github.com/jonschlinkert) |
| 1 | [doowb](https://github.com/doowb) |
| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
### Building docs
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
To generate the readme, run the following command:
```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```
### Running tests
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
```sh
$ npm install && npm test
```
### Author
**Jon Schlinkert**
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
### License
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 22, 2017._

View file

@ -0,0 +1,22 @@
/*!
* 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);
};

View file

@ -0,0 +1,79 @@
{
"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.2",
"homepage": "https://github.com/jonschlinkert/is-descriptor",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"contributors": [
"Brian Woodward (https://twitter.com/doowb)",
"Jon Schlinkert (http://twitter.com/jonschlinkert)",
"(https://github.com/wtgtybhertgeghgtwtg)"
],
"repository": "jonschlinkert/is-descriptor",
"bugs": {
"url": "https://github.com/jonschlinkert/is-descriptor/issues"
},
"license": "MIT",
"files": [
"index.js"
],
"main": "index.js",
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "mocha"
},
"dependencies": {
"is-accessor-descriptor": "^1.0.0",
"is-data-descriptor": "^1.0.0",
"kind-of": "^6.0.2"
},
"devDependencies": {
"gulp-format-md": "^1.0.0",
"mocha": "^3.5.3"
},
"keywords": [
"accessor",
"check",
"data",
"descriptor",
"get",
"getter",
"is",
"keys",
"object",
"properties",
"property",
"set",
"setter",
"type",
"valid",
"value"
],
"verb": {
"related": {
"list": [
"is-accessor-descriptor",
"is-data-descriptor",
"is-descriptor",
"isobject"
]
},
"plugins": [
"gulp-format-md"
],
"toc": false,
"layout": "default",
"tasks": [
"readme"
],
"lint": {
"reflinks": true
}
}
,"_resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz"
,"_integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg=="
,"_from": "is-descriptor@1.0.2"
}

71
node_modules/define-property/package.json generated vendored Normal file
View file

@ -0,0 +1,71 @@
{
"name": "define-property",
"description": "Define a non-enumerable property on an object. Uses Reflect.defineProperty when available, otherwise Object.defineProperty.",
"version": "2.0.2",
"homepage": "https://github.com/jonschlinkert/define-property",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"contributors": [
"Brian Woodward (https://twitter.com/doowb)",
"Jon Schlinkert (http://twitter.com/jonschlinkert)"
],
"repository": "jonschlinkert/define-property",
"bugs": {
"url": "https://github.com/jonschlinkert/define-property/issues"
},
"license": "MIT",
"files": [
"index.js"
],
"main": "index.js",
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "mocha"
},
"dependencies": {
"is-descriptor": "^1.0.2",
"isobject": "^3.0.1"
},
"devDependencies": {
"gulp-format-md": "^1.0.0",
"mocha": "^3.5.3"
},
"keywords": [
"define",
"define-property",
"enumerable",
"key",
"non",
"non-enumerable",
"object",
"prop",
"property",
"value"
],
"verb": {
"toc": false,
"layout": "default",
"tasks": [
"readme"
],
"plugins": [
"gulp-format-md"
],
"related": {
"list": [
"assign-deep",
"extend-shallow",
"merge-deep",
"mixin-deep"
]
},
"lint": {
"reflinks": true
}
}
,"_resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz"
,"_integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ=="
,"_from": "define-property@2.0.2"
}