1.2.21 • Published 2 years ago
@devtea2027/aut-explicabo-id-cum v1.2.21
@devtea2027/aut-explicabo-id-cum 
Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.
Examples
const isAccessorDescriptor = require('@devtea2027/aut-explicabo-id-cum');
const assert = require('assert');
const obj = {
get foo() {},
bar: { get: function() {} }
};
assert.equal(true, isAccessorDescriptor(obj, 'foo'));
assert.equal(false, isAccessorDescriptor(obj, 'bar'));
// or, if you already have the descriptor you can pass it directly
const foo = Object.getOwnPropertyDescriptor(obj, 'foo');
assert.equal(true, isAccessorDescriptor(foo));
const bar = Object.getOwnPropertyDescriptor(obj, 'bar');
assert.equal(false, isAccessorDescriptor(bar));Related projects
You might also be interested in these projects:
- is-data-descriptor: Returns true if a value has the characteristics of a valid JavaScript data descriptor.
- is-descriptor: Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… more
- 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
1.2.19
2 years ago
1.2.20
2 years ago
1.2.21
2 years ago
1.2.18
2 years ago
1.2.17
2 years ago
1.2.16
2 years ago
1.2.14
2 years ago
1.2.15
2 years ago
1.2.13
2 years ago
1.2.12
2 years ago
1.2.11
2 years ago
1.2.10
2 years ago
1.2.9
2 years ago
1.2.8
2 years ago
1.2.7
2 years ago
1.2.6
2 years ago
1.1.6
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
