pacc 2.1.4 → 2.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,7 +13,6 @@
13
13
 
14
14
  propetty path utils
15
15
 
16
-
17
16
  ```js
18
17
  import { getAttribute } from "pacc";
19
18
 
@@ -27,21 +26,16 @@ const result = getAttribute({ a: [0,{ b: 4 }]}, "a[1].b");
27
26
 
28
27
  ### Table of Contents
29
28
 
30
- - [pacc](#pacc)
31
- - [API](#api)
32
- - [Table of Contents](#table-of-contents)
33
- - [AttributeDefinition](#attributedefinition)
34
- - [Properties](#properties)
35
- - [setAttribute](#setattribute)
36
- - [Parameters](#parameters)
37
- - [getAttribute](#getattribute)
38
- - [Parameters](#parameters-1)
39
- - [getAttributeAndOperator](#getattributeandoperator)
40
- - [Parameters](#parameters-2)
41
- - [tokens](#tokens)
42
- - [Parameters](#parameters-3)
43
- - [install](#install)
44
- - [license](#license)
29
+ * [AttributeDefinition](#attributedefinition)
30
+ * [Properties](#properties)
31
+ * [setAttribute](#setattribute)
32
+ * [Parameters](#parameters)
33
+ * [getAttribute](#getattribute)
34
+ * [Parameters](#parameters-1)
35
+ * [getAttributeAndOperator](#getattributeandoperator)
36
+ * [Parameters](#parameters-2)
37
+ * [tokens](#tokens)
38
+ * [Parameters](#parameters-3)
45
39
 
46
40
  ## AttributeDefinition
47
41
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pacc",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -25,11 +25,11 @@
25
25
  "lint:docs": "documentation lint ./src/**/*.mjs"
26
26
  },
27
27
  "devDependencies": {
28
- "ava": "^5.3.1",
29
- "browser-ava": "^2.1.0",
28
+ "ava": "^6.0.1",
29
+ "browser-ava": "^2.1.6",
30
30
  "c8": "^8.0.1",
31
31
  "documentation": "^14.0.2",
32
- "semantic-release": "^22.0.7"
32
+ "semantic-release": "^22.0.12"
33
33
  },
34
34
  "repository": {
35
35
  "type": "git",
package/src/attribute.mjs CHANGED
@@ -75,11 +75,7 @@ export function setAttribute(object, expression, value) {
75
75
  * @returns {any} value associated with the given property name
76
76
  */
77
77
  export function getAttribute(object, expression) {
78
- if (object?.[expression] !== undefined) {
79
- return object[expression];
80
- }
81
-
82
- return getAttributeAndOperator(object, expression)[0];
78
+ return object?.[expression] || getAttributeAndOperator(object, expression)[0];
83
79
  }
84
80
 
85
81
  /**