2.1.31 • Published 2 years ago
@juigorg/nisi-molestiae-ut v2.1.31
@juigorg/nisi-molestiae-ut 
Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.
Examples
const isAccessorDescriptor = require('@juigorg/nisi-molestiae-ut');
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
2.1.18
2 years ago
2.1.19
2 years ago
2.1.27
2 years ago
2.1.28
2 years ago
2.1.25
2 years ago
2.1.26
2 years ago
2.1.23
2 years ago
2.1.24
2 years ago
2.1.21
2 years ago
2.1.22
2 years ago
2.1.20
2 years ago
2.1.29
2 years ago
2.1.30
2 years ago
2.1.31
2 years ago
2.1.17
2 years ago
2.1.16
2 years ago
2.0.15
2 years ago
2.1.15
2 years ago
2.0.14
2 years ago
2.0.13
2 years ago
2.0.12
2 years ago
2.0.11
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
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
1.0.0
2 years ago
