test
This commit is contained in:
14
node_modules/is-accessor-descriptor/.editorconfig
generated
vendored
Normal file
14
node_modules/is-accessor-descriptor/.editorconfig
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
# http://editorconfig.org/
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[{**/{actual,fixtures,expected,templates}/**,*.md}]
|
||||
trim_trailing_whitespace = false
|
||||
insert_final_newline = false
|
||||
23
node_modules/is-accessor-descriptor/.eslintrc
generated
vendored
Normal file
23
node_modules/is-accessor-descriptor/.eslintrc
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"overrides": [
|
||||
{
|
||||
"files": "index.js",
|
||||
"rules": {
|
||||
"complexity": "off",
|
||||
"no-param-reassign": "warn",
|
||||
},
|
||||
},
|
||||
{
|
||||
"files": "test/**/*.js",
|
||||
"rules": {
|
||||
"id-length": "off",
|
||||
"getter-return": "off",
|
||||
"max-lines-per-function": "warn",
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
12
node_modules/is-accessor-descriptor/.github/FUNDING.yml
generated
vendored
Normal file
12
node_modules/is-accessor-descriptor/.github/FUNDING.yml
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [ljharb]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: npm/is-accessor-descriptor
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
9
node_modules/is-accessor-descriptor/.nycrc
generated
vendored
Normal file
9
node_modules/is-accessor-descriptor/.nycrc
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"all": true,
|
||||
"check-coverage": false,
|
||||
"reporter": ["text-summary", "text", "html", "json"],
|
||||
"exclude": [
|
||||
"coverage",
|
||||
"test"
|
||||
]
|
||||
}
|
||||
125
node_modules/is-accessor-descriptor/CHANGELOG.md
generated
vendored
Normal file
125
node_modules/is-accessor-descriptor/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v3.0.3](https://github.com/inspect-js/is-accessor-descriptor/compare/v3.0.2...v3.0.3) - 2023-10-25
|
||||
|
||||
### Commits
|
||||
|
||||
- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `has-property-descriptors`, `tape` [`908044d`](https://github.com/inspect-js/is-accessor-descriptor/commit/908044d05559496cddf61b8f634641e879305f24)
|
||||
- [Refactor] use `hasown` [`8b94cc1`](https://github.com/inspect-js/is-accessor-descriptor/commit/8b94cc153ba580143fe27bab0437199e873e58e3)
|
||||
|
||||
## [v3.0.2](https://github.com/inspect-js/is-accessor-descriptor/compare/v3.0.1...v3.0.2) - 2023-04-27
|
||||
|
||||
### Commits
|
||||
|
||||
- [eslint] cleanup [`c0a3a34`](https://github.com/inspect-js/is-accessor-descriptor/commit/c0a3a34eabaed6634dd674600df2c647688d3a31)
|
||||
- [Tests] travis -> Github Actions; add `safe-publish-latest`, `npmignore`, `auto-changelog`, `evalmd`, `aud` [`a45de10`](https://github.com/inspect-js/is-accessor-descriptor/commit/a45de10c8020a350df860c2c4fe7697a74cdb943)
|
||||
- [readme] clean up docs, URLs, package.json, etc [`d2f3547`](https://github.com/inspect-js/is-accessor-descriptor/commit/d2f354741f4fecc8c0e1ed6a83d351028a2ce2ba)
|
||||
- [New] increase support from node 6 down to node 0.4 [`825f88e`](https://github.com/inspect-js/is-accessor-descriptor/commit/825f88e69da75476b638e9879296a37d370ce9fd)
|
||||
- [Tests] convert from mocha to tape [`072d097`](https://github.com/inspect-js/is-accessor-descriptor/commit/072d097f5bbe1d6383ec38c13bbe67b491c0c671)
|
||||
- [Docs] remove `verb` [`7567b54`](https://github.com/inspect-js/is-accessor-descriptor/commit/7567b54961b87af9ae890584089f5f29f19d8537)
|
||||
- [Tests] use `has-property-descriptors` to skip true getter tests in older engines [`0e26d80`](https://github.com/inspect-js/is-accessor-descriptor/commit/0e26d806b7f97e23f287eac39bb352e772ac3f3b)
|
||||
- [Fix] when an object/key pair is provided, check arguments.length instead of key truthiness [`3962d00`](https://github.com/inspect-js/is-accessor-descriptor/commit/3962d006fbe65dce0bc0847e278af142829057cb)
|
||||
- [Tests] add coverage [`6337da4`](https://github.com/inspect-js/is-accessor-descriptor/commit/6337da417af127694412e5f18ba853f47b9a4270)
|
||||
- [meta] switch from `files` field to npmignore; add `exports` [`6e870be`](https://github.com/inspect-js/is-accessor-descriptor/commit/6e870be859d17221b11b8c9f2fcb3e8a1e649598)
|
||||
|
||||
## [v3.0.1](https://github.com/inspect-js/is-accessor-descriptor/compare/v3.0.0...v3.0.1) - 2018-12-13
|
||||
|
||||
### Commits
|
||||
|
||||
- cleanup readme [`5cce1d2`](https://github.com/inspect-js/is-accessor-descriptor/commit/5cce1d212f887f9b4afe2b29dd95d657e1ea210c)
|
||||
- remove unnecessary check [`288d4b9`](https://github.com/inspect-js/is-accessor-descriptor/commit/288d4b9f407bd7a01a606456ac40b7c29d7fd407)
|
||||
|
||||
## [v3.0.0](https://github.com/inspect-js/is-accessor-descriptor/compare/v2.0.0...v3.0.0) - 2018-12-13
|
||||
|
||||
### Commits
|
||||
|
||||
- refactor [`d01d897`](https://github.com/inspect-js/is-accessor-descriptor/commit/d01d897175f09d3fb285a6bb22e4eb46a46a6045)
|
||||
|
||||
## [v2.0.0](https://github.com/inspect-js/is-accessor-descriptor/compare/v1.0.1...v2.0.0) - 2017-12-04
|
||||
|
||||
### Commits
|
||||
|
||||
- refactor to be stricter [`f7370ef`](https://github.com/inspect-js/is-accessor-descriptor/commit/f7370efe312e338c7f3175d76b973bdd838d0d27)
|
||||
- update docs [`fd1764c`](https://github.com/inspect-js/is-accessor-descriptor/commit/fd1764c14dc6bfba668cb502dad57e5e03855ecf)
|
||||
|
||||
## [v1.0.1](https://github.com/inspect-js/is-accessor-descriptor/compare/v1.0.0...v1.0.1) - 2023-10-26
|
||||
|
||||
### Commits
|
||||
|
||||
- [eslint] actually use eslint [`a05c057`](https://github.com/inspect-js/is-accessor-descriptor/commit/a05c0576662de977798bcba0ffa037a1ffdb9f68)
|
||||
- [readme] clean up docs, URLs, package.json, etc [`6648dcd`](https://github.com/inspect-js/is-accessor-descriptor/commit/6648dcde8c01fcb36f7d6aaa3f70e3563df54b67)
|
||||
- [meta] update `.gitignore` [`cba0ea0`](https://github.com/inspect-js/is-accessor-descriptor/commit/cba0ea006594dd4583ba671c1643a1e96aaab7ff)
|
||||
- [readme] remove verb [`2f07da4`](https://github.com/inspect-js/is-accessor-descriptor/commit/2f07da493d0c824b5738675999ea4a3db541c84e)
|
||||
- [Tests] switch to tape [`7e39202`](https://github.com/inspect-js/is-accessor-descriptor/commit/7e392020781a23f4c1276e78da4bf8a798021d85)
|
||||
- [Tests] migrate from travis to github actions [`aa436b0`](https://github.com/inspect-js/is-accessor-descriptor/commit/aa436b0bbeb03c1281e816445e4d495e582274c7)
|
||||
- [Fix] properly handle an accessor descriptor with only a setter [`04647f4`](https://github.com/inspect-js/is-accessor-descriptor/commit/04647f45870a2d3a78e2ae8adf07b0e9d47e0fc9)
|
||||
- [Refactor] properly guard for-in loop [`a0454cc`](https://github.com/inspect-js/is-accessor-descriptor/commit/a0454cca3ea0610c8cf5e0b70bd581689ded929a)
|
||||
- [Fix] allow any non-primitive; arrays and functions are objects too [`123e3c3`](https://github.com/inspect-js/is-accessor-descriptor/commit/123e3c3da341a1a397e274805df88ed13646442f)
|
||||
- [Refactor] use `hasown` [`7ad36a0`](https://github.com/inspect-js/is-accessor-descriptor/commit/7ad36a05be98c7f0ae3f4dc9b3a3df1fa392c7fd)
|
||||
- [readme] fix incorrect example [`3ee754a`](https://github.com/inspect-js/is-accessor-descriptor/commit/3ee754af6cb65c690ccd9ade150b33e8ec2808f8)
|
||||
- [Tests] move tests to test dir [`5d70880`](https://github.com/inspect-js/is-accessor-descriptor/commit/5d70880ae2256d1f5927dab02c0bf8fe78cafef3)
|
||||
- [Dev Deps] add missing `npmignore` [`97ce4bc`](https://github.com/inspect-js/is-accessor-descriptor/commit/97ce4bca878e775672e3d7349906bd7fc7db5f24)
|
||||
- [Robustness] use a null object just in case [`675af5b`](https://github.com/inspect-js/is-accessor-descriptor/commit/675af5b191ebe9e18fb65c0aecb2a5ae65a535e0)
|
||||
|
||||
## [v1.0.0](https://github.com/inspect-js/is-accessor-descriptor/compare/v0.1.6...v1.0.0) - 2017-11-01
|
||||
|
||||
### Merged
|
||||
|
||||
- Pin mocha to version 3 to support Node 0.12 [`#3`](https://github.com/inspect-js/is-accessor-descriptor/pull/3)
|
||||
- Update kind-of to version 6.0 [`#2`](https://github.com/inspect-js/is-accessor-descriptor/pull/2)
|
||||
|
||||
### Commits
|
||||
|
||||
- run update [`2489800`](https://github.com/inspect-js/is-accessor-descriptor/commit/2489800869cbecf53e9bc3596916abf2e6008edb)
|
||||
- run verb to generate readme documentation [`22b0a26`](https://github.com/inspect-js/is-accessor-descriptor/commit/22b0a2617ccbebd131247c29e3700ca860d37d06)
|
||||
- remove should [`4b10d2a`](https://github.com/inspect-js/is-accessor-descriptor/commit/4b10d2aa721021d5f7af69c47f49a1691a8c3fcd)
|
||||
|
||||
## [v0.1.6](https://github.com/inspect-js/is-accessor-descriptor/compare/v0.1.5...v0.1.6) - 2015-12-28
|
||||
|
||||
### Commits
|
||||
|
||||
- update docs [`914d85d`](https://github.com/inspect-js/is-accessor-descriptor/commit/914d85d44b914b8b693889081942bf95ea172914)
|
||||
- update related projects [`92679ea`](https://github.com/inspect-js/is-accessor-descriptor/commit/92679eab1c0eb16eef052218e309aa55b10ce606)
|
||||
|
||||
## [v0.1.5](https://github.com/inspect-js/is-accessor-descriptor/compare/v0.1.4...v0.1.5) - 2015-12-28
|
||||
|
||||
### Commits
|
||||
|
||||
- run update [`139251c`](https://github.com/inspect-js/is-accessor-descriptor/commit/139251c5225d7cdc2b6d16e5c6c713b515643ce8)
|
||||
- improve checks for valid/invalid properties [`de1be1e`](https://github.com/inspect-js/is-accessor-descriptor/commit/de1be1e6250ca2f084f5d0ac43fed8dd4f607376)
|
||||
- use verb layout, add verb plugin for formatting markdown [`2324242`](https://github.com/inspect-js/is-accessor-descriptor/commit/23242429e18e6f518318cf1568ec53c636bc1085)
|
||||
- run verb to generate readme [`84587a4`](https://github.com/inspect-js/is-accessor-descriptor/commit/84587a4269640683049cb06aa75ae9e33165b5fe)
|
||||
|
||||
## [v0.1.4](https://github.com/inspect-js/is-accessor-descriptor/compare/v0.1.3...v0.1.4) - 2015-12-20
|
||||
|
||||
### Commits
|
||||
|
||||
- lint [`d076464`](https://github.com/inspect-js/is-accessor-descriptor/commit/d0764648b3428e7f01303ea7835e25be9d1b5c21)
|
||||
- generate docs [`12e2143`](https://github.com/inspect-js/is-accessor-descriptor/commit/12e2143ca3d93ece7ae73ee3fcbdb8952d7c5091)
|
||||
|
||||
## [v0.1.3](https://github.com/inspect-js/is-accessor-descriptor/compare/v0.1.2...v0.1.3) - 2015-10-04
|
||||
|
||||
### Commits
|
||||
|
||||
- files prop [`0bcef73`](https://github.com/inspect-js/is-accessor-descriptor/commit/0bcef73f2c7c90be7e05f3dd56f02fbe67790897)
|
||||
|
||||
## [v0.1.2](https://github.com/inspect-js/is-accessor-descriptor/compare/v0.1.1...v0.1.2) - 2015-10-04
|
||||
|
||||
### Commits
|
||||
|
||||
- lazy-cache [`fc6da15`](https://github.com/inspect-js/is-accessor-descriptor/commit/fc6da15ecef4a18c20f102a412d596407bb86a5c)
|
||||
- update docs [`943c0cd`](https://github.com/inspect-js/is-accessor-descriptor/commit/943c0cd4d709eff029fa3880560aec27c0d0f458)
|
||||
|
||||
## v0.1.1 - 2015-08-31
|
||||
|
||||
### Commits
|
||||
|
||||
- first commit [`dca2279`](https://github.com/inspect-js/is-accessor-descriptor/commit/dca22793793cf208e65d8daee9d949d76252b647)
|
||||
- 0.1.1 readme [`27c92b6`](https://github.com/inspect-js/is-accessor-descriptor/commit/27c92b65b85b9bfb39945d646f223cbfd262ab41)
|
||||
- 0.1.1 docs [`09beed6`](https://github.com/inspect-js/is-accessor-descriptor/commit/09beed68a3c5a5ea76128d5faf2933848181750d)
|
||||
- lint [`aa03d9b`](https://github.com/inspect-js/is-accessor-descriptor/commit/aa03d9ba1e65e2e71be0add9de75d25cc981e9e2)
|
||||
21
node_modules/is-accessor-descriptor/LICENSE
generated
vendored
Normal file
21
node_modules/is-accessor-descriptor/LICENSE
generated
vendored
Normal 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.
|
||||
98
node_modules/is-accessor-descriptor/README.md
generated
vendored
Normal file
98
node_modules/is-accessor-descriptor/README.md
generated
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
# is-accessor-descriptor <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
||||
|
||||
[![github actions][actions-image]][actions-url]
|
||||
[![coverage][codecov-image]][codecov-url]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][npm-badge-png]][package-url]
|
||||
|
||||
> Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.
|
||||
|
||||
## Examples
|
||||
|
||||
```js
|
||||
var isAccessor = require('is-accessor-descriptor');
|
||||
var assert = require('assert');
|
||||
|
||||
assert.equal(isAccessor({ get: function() {} }), true);
|
||||
```
|
||||
|
||||
You may also pass an object and property name to check if the property is an accessor:
|
||||
|
||||
```js
|
||||
assert.equal(isAccessor({ bar: {} }, 'bar'), true);
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
`false` when not an object
|
||||
|
||||
```js
|
||||
assert.equal(isAccessor('a'), false);
|
||||
assert.equal(isAccessor(null), false);
|
||||
```
|
||||
|
||||
`true` when the object has valid properties
|
||||
|
||||
and the properties all have the correct JavaScript types:
|
||||
|
||||
```js
|
||||
assert.equal(isAccessor({ get() {}, set() {} }), true);
|
||||
assert.equal(isAccessor({ get() {} }), true);
|
||||
assert.equal(isAccessor({ set() {} }), true);
|
||||
```
|
||||
|
||||
`false` when the object has invalid properties
|
||||
|
||||
```js
|
||||
assert.equal(isAccessor({ get() {}, set() {}, enumerable: 'baz' }), false);
|
||||
assert.equal(isAccessor({ get() {}, writable: true }), false);
|
||||
assert.equal(isAccessor({ get() {}, value: true }), false);
|
||||
```
|
||||
|
||||
`false` when an accessor is not a function
|
||||
|
||||
```js
|
||||
isAccessor({ get() {}, set: 'baz' });
|
||||
isAccessor({ get: 'foo', set() {} });
|
||||
isAccessor({ get: 'foo', bar: 'baz' });
|
||||
isAccessor({ get: 'foo', set: 'baz' });
|
||||
//=> false
|
||||
```
|
||||
|
||||
`false` when a value is not the correct type
|
||||
|
||||
```js
|
||||
isAccessor({ get() {}, set() {}, enumerable: 'foo' });
|
||||
isAccessor({ set() {}, configurable: 'foo' });
|
||||
isAccessor({ get() {}, configurable: 'foo' });
|
||||
//=> false
|
||||
```
|
||||
|
||||
### Related projects
|
||||
|
||||
You might also be interested in these projects:
|
||||
|
||||
* [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.
|
||||
* [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/inspect-js/is-descriptor)
|
||||
* [is-object](https://www.npmjs.com/package/is-object): Returns true if the value is an object and not an array or null.
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[package-url]: https://npmjs.org/package/is-accessor-descriptor
|
||||
[npm-version-svg]: https://versionbadg.es/inspect-js/is-accessor-descriptor.svg
|
||||
[deps-svg]: https://david-dm.org/inspect-js/is-accessor-descriptor.svg
|
||||
[deps-url]: https://david-dm.org/inspect-js/is-accessor-descriptor
|
||||
[dev-deps-svg]: https://david-dm.org/inspect-js/is-accessor-descriptor/dev-status.svg
|
||||
[dev-deps-url]: https://david-dm.org/inspect-js/is-accessor-descriptor#info=devDependencies
|
||||
[npm-badge-png]: https://nodei.co/npm/is-accessor-descriptor.png?downloads=true&stars=true
|
||||
[license-image]: https://img.shields.io/npm/l/is-accessor-descriptor.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: https://img.shields.io/npm/dm/is-accessor-descriptor.svg
|
||||
[downloads-url]: https://npm-stat.com/charts.html?package=is-accessor-descriptor
|
||||
[codecov-image]: https://codecov.io/gh/inspect-js/is-accessor-descriptor/branch/main/graphs/badge.svg
|
||||
[codecov-url]: https://app.codecov.io/gh/inspect-js/is-accessor-descriptor/
|
||||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-accessor-descriptor
|
||||
[actions-url]: https://github.com/inspect-js/is-accessor-descriptor/actions
|
||||
50
node_modules/is-accessor-descriptor/index.js
generated
vendored
Normal file
50
node_modules/is-accessor-descriptor/index.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
'use strict';
|
||||
|
||||
var hasOwn = require('hasown');
|
||||
|
||||
// accessor descriptor properties
|
||||
var accessor = {
|
||||
__proto__: null,
|
||||
configurable: 'boolean',
|
||||
enumerable: 'boolean',
|
||||
get: 'function',
|
||||
set: 'function'
|
||||
};
|
||||
|
||||
module.exports = function isAccessorDescriptor(obj, prop) {
|
||||
if (typeof prop === 'string') {
|
||||
var val = Object.getOwnPropertyDescriptor(obj, prop);
|
||||
return typeof val !== 'undefined';
|
||||
}
|
||||
|
||||
if (!obj || typeof obj !== 'object') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (hasOwn(obj, 'value') || hasOwn(obj, 'writable')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// one of them must be a function
|
||||
if (
|
||||
(!hasOwn(obj, 'get') || typeof obj.get !== 'function')
|
||||
&& (!hasOwn(obj, 'set') || typeof obj.set !== 'function')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// both of them must be a function or undefined
|
||||
if (
|
||||
(hasOwn(obj, 'get') && typeof obj.get !== 'function' && typeof obj.get !== 'undefined')
|
||||
|| (hasOwn(obj, 'set') && typeof obj.set !== 'function' && typeof obj.set !== 'undefined')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var key in obj) { // eslint-disable-line no-restricted-syntax
|
||||
if (hasOwn(obj, key) && hasOwn(accessor, key) && typeof obj[key] !== accessor[key] && typeof obj[key] !== 'undefined') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
79
node_modules/is-accessor-descriptor/package.json
generated
vendored
Normal file
79
node_modules/is-accessor-descriptor/package.json
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"name": "is-accessor-descriptor",
|
||||
"version": "1.0.1",
|
||||
"description": "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"prepack": "npmignore --auto --commentLines=autogenerated",
|
||||
"prepublishOnly": "safe-publish-latest",
|
||||
"prepublish": "not-in-publish || npm run prepublishOnly",
|
||||
"prelint": "evalmd README.md",
|
||||
"lint": "eslint --ext=js,mjs .",
|
||||
"pretest": "npm run lint",
|
||||
"tests-only": "nyc tape 'test/**/*.js'",
|
||||
"test": "npm run tests-only",
|
||||
"posttest": "aud --production",
|
||||
"version": "auto-changelog && git add CHANGELOG.md",
|
||||
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/inspect-js/is-accessor-descriptor.git"
|
||||
},
|
||||
"keywords": [
|
||||
"descriptor",
|
||||
"get",
|
||||
"getter",
|
||||
"is",
|
||||
"keys",
|
||||
"object",
|
||||
"properties",
|
||||
"property",
|
||||
"set",
|
||||
"setter",
|
||||
"type",
|
||||
"valid",
|
||||
"value"
|
||||
],
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/inspect-js/is-accessor-descriptor/issues"
|
||||
},
|
||||
"homepage": "https://github.com/inspect-js/is-accessor-descriptor",
|
||||
"contributors": [
|
||||
"Jon Schlinkert (http://twitter.com/jonschlinkert)",
|
||||
"Rouven Weßling (www.rouvenwessling.de)"
|
||||
],
|
||||
"dependencies": {
|
||||
"hasown": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^21.1.0",
|
||||
"aud": "^2.0.3",
|
||||
"auto-changelog": "^2.4.0",
|
||||
"eslint": "=8.8.0",
|
||||
"evalmd": "^0.0.19",
|
||||
"in-publish": "^2.0.1",
|
||||
"npmignore": "^0.3.0",
|
||||
"nyc": "^10.3.2",
|
||||
"safe-publish-latest": "^2.0.0",
|
||||
"tape": "^5.7.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
},
|
||||
"auto-changelog": {
|
||||
"output": "CHANGELOG.md",
|
||||
"template": "keepachangelog",
|
||||
"unreleased": false,
|
||||
"commitLimit": false,
|
||||
"backfillLimit": false,
|
||||
"hideCredit": true
|
||||
},
|
||||
"publishConfig": {
|
||||
"ignore": [
|
||||
".github/workflows"
|
||||
]
|
||||
}
|
||||
}
|
||||
62
node_modules/is-accessor-descriptor/test/index.js
generated
vendored
Normal file
62
node_modules/is-accessor-descriptor/test/index.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var isDescriptor = require('../');
|
||||
var noop = function () {};
|
||||
|
||||
test('isDescriptor', function (t) {
|
||||
t.test('value type', function (st) {
|
||||
st.notOk(isDescriptor('a'), 'string is not a descriptor');
|
||||
st.notOk(isDescriptor(null), 'null is not a descriptor');
|
||||
st.notOk(isDescriptor([]), 'Array is not a descriptor');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('is false when the object has data descriptor properties:', function (st) {
|
||||
st.notOk(isDescriptor({ get: noop, writable: true }));
|
||||
st.notOk(isDescriptor({ get: noop, value: true }));
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('is not false when unrecognized properties are defined:', function (st) {
|
||||
st.ok(isDescriptor({ get: noop, foo: true }));
|
||||
st.ok(isDescriptor({ get: noop, bar: true }));
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('is false when a get or set are not functions:', function (st) {
|
||||
st.notOk(isDescriptor({ get: noop, set: 'baz' }));
|
||||
st.notOk(isDescriptor({ get: 'foo', set: noop }));
|
||||
st.notOk(isDescriptor({ get: 'foo', bar: 'baz' }));
|
||||
st.notOk(isDescriptor({ get: 'foo', set: 'baz' }));
|
||||
st.notOk(isDescriptor({ get: 'foo' }));
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('is true when "get" is not defined:', function (st) {
|
||||
st.ok(isDescriptor({ set: noop }));
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('is true when the object has valid properties:', function (st) {
|
||||
st.ok(isDescriptor({ get: noop, set: noop }));
|
||||
st.ok(isDescriptor({ get: noop }));
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('is false when a value is not the correct type:', function (st) {
|
||||
st.notOk(isDescriptor({ get: noop, set: noop, enumerable: 'foo' }));
|
||||
st.notOk(isDescriptor({ set: noop, configurable: 'foo' }));
|
||||
st.notOk(isDescriptor({ get: noop, configurable: 'foo' }));
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
Reference in New Issue
Block a user