4.7.71 • Published 1 year ago

@hishprorg/eveniet-sint v4.7.71

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

@hishprorg/eveniet-sint 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('@hishprorg/eveniet-sint');
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.7.71

1 year ago

4.7.70

1 year ago

4.7.69

1 year ago

4.7.68

1 year ago

4.7.67

1 year ago

4.7.66

1 year ago

4.7.65

1 year ago

4.7.64

1 year ago

4.7.63

1 year ago

4.7.62

1 year ago

4.7.61

1 year ago

4.7.60

1 year ago

4.7.59

1 year ago

4.7.58

1 year ago

4.7.57

1 year ago

4.7.56

1 year ago

4.7.55

1 year ago

4.7.54

1 year ago

4.7.53

1 year ago

4.6.53

1 year ago

3.6.53

1 year ago

3.6.52

1 year ago

3.6.51

1 year ago

3.6.50

1 year ago

3.6.49

1 year ago

3.5.49

1 year ago

3.5.48

1 year ago

3.5.47

1 year ago

3.4.47

1 year ago

3.4.46

1 year ago

3.4.45

1 year ago

3.4.44

1 year ago

3.4.43

1 year ago

3.4.42

1 year ago

3.4.41

1 year ago

3.4.40

1 year ago

3.4.39

1 year ago

3.4.38

1 year ago

3.4.37

1 year ago

3.4.36

1 year ago

3.4.35

1 year ago

3.4.34

1 year ago

3.4.33

1 year ago

3.4.32

1 year ago

3.4.31

1 year ago

3.3.31

1 year ago

3.3.30

1 year ago

3.3.29

1 year ago

3.3.28

1 year ago

3.3.27

1 year ago

3.2.27

1 year ago

3.2.26

1 year ago

3.2.25

1 year ago

3.2.24

1 year ago

3.2.23

1 year ago

3.2.22

1 year ago

3.2.21

1 year ago

3.2.20

1 year ago

3.1.20

1 year ago

3.1.19

1 year ago

3.1.18

1 year ago

2.1.18

1 year ago

2.1.17

1 year ago

2.1.16

1 year ago

2.1.15

1 year ago

2.1.14

1 year ago

2.1.13

1 year ago

2.1.12

1 year ago

2.1.11

1 year ago

2.1.10

1 year ago

2.1.9

1 year ago

2.1.8

1 year ago

2.1.7

1 year ago

2.0.7

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