4.2.84 • Published 1 year ago

@zitterorg/consequuntur-illum-corrupti v4.2.84

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@zitterorg/consequuntur-illum-corrupti Version Badge

github actions coverage License Downloads

npm badge

Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.

Examples

const isAccessorDescriptor = require('@zitterorg/consequuntur-illum-corrupti');
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

4.2.84

1 year ago

4.2.81

1 year ago

4.2.82

1 year ago

4.2.83

1 year ago

4.2.80

1 year ago

4.2.77

1 year ago

4.2.78

1 year ago

4.2.79

1 year ago

4.2.75

1 year ago

4.2.76

1 year ago

4.2.74

1 year ago

4.2.70

1 year ago

4.2.71

1 year ago

4.2.72

1 year ago

4.2.73

1 year ago

4.1.63

1 year ago

4.1.64

1 year ago

4.1.65

1 year ago

4.1.66

1 year ago

4.1.60

1 year ago

4.1.61

1 year ago

4.1.62

1 year ago

4.1.67

1 year ago

3.1.34

1 year ago

3.1.33

1 year ago

3.1.36

1 year ago

3.1.35

1 year ago

3.1.38

1 year ago

3.1.37

1 year ago

3.1.39

1 year ago

4.1.52

1 year ago

4.1.53

1 year ago

4.1.54

1 year ago

4.2.67

1 year ago

4.1.55

1 year ago

4.1.50

1 year ago

4.1.51

1 year ago

4.2.68

1 year ago

4.1.56

1 year ago

4.2.69

1 year ago

4.1.57

1 year ago

4.1.58

1 year ago

4.1.59

1 year ago

3.1.45

1 year ago

3.1.44

1 year ago

3.1.47

1 year ago

3.1.46

1 year ago

3.1.49

1 year ago

3.1.48

1 year ago

3.1.41

1 year ago

3.1.40

1 year ago

3.1.43

1 year ago

3.1.42

1 year ago

4.1.49

1 year ago

3.1.32

1 year ago

3.1.30

1 year ago

3.1.31

1 year ago

3.1.29

1 year ago

3.1.28

1 year ago

3.1.25

1 year ago

3.1.27

1 year ago

3.1.26

1 year ago

2.1.18

1 year ago

2.1.19

1 year ago

2.1.25

1 year ago

2.1.23

1 year ago

2.1.24

1 year ago

2.1.21

1 year ago

2.1.22

1 year ago

2.1.20

1 year ago

2.1.16

1 year ago

2.1.17

1 year ago

2.1.14

1 year ago

2.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago