pacc 4.34.2 → 4.35.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pacc",
3
- "version": "4.34.2",
3
+ "version": "4.35.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -1,5 +1,5 @@
1
1
  import { getAttribute } from "./settergetter.mjs";
2
- import { types, oneOfType } from "./types.mjs";
2
+ import { oneOfType } from "./types.mjs";
3
3
 
4
4
  /**
5
5
  * Create attributes from its definition.
package/src/multiple.mjs CHANGED
@@ -60,17 +60,18 @@ export function getAttributes(object, definitions) {
60
60
  * Retrive attribute values from an object.
61
61
  * @param {Object} object attribute value source
62
62
  * @param {Object} definitions
63
+ * @param {Object} filter
63
64
  * @return {Object} values
64
65
  */
65
- export function getAttributesJSON(object, definitions) {
66
+ export function getAttributesJSON(object, definitions, filter) {
66
67
  const result = {};
67
68
 
68
- for (const [path, def] of attributeIterator(definitions)) {
69
+ for (const [path, def] of attributeIterator(definitions, filter)) {
69
70
  const name = path.join(".");
70
71
 
71
72
  let value = getAttribute(object, name, def);
72
73
  if (value !== undefined) {
73
- if(value instanceof Set) {
74
+ if (value instanceof Set) {
74
75
  value = [...value];
75
76
  }
76
77
  setAttribute(result, def.externalName ?? name, value, def);
@@ -17,6 +17,7 @@ export function getAttributes(object: any, definitions: any): any;
17
17
  * Retrive attribute values from an object.
18
18
  * @param {Object} object attribute value source
19
19
  * @param {Object} definitions
20
+ * @param {Object} filter
20
21
  * @return {Object} values
21
22
  */
22
- export function getAttributesJSON(object: any, definitions: any): any;
23
+ export function getAttributesJSON(object: any, definitions: any, filter: any): any;