@tidyjs/tidy 2.5.1 → 2.5.2

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.
@@ -1,7 +1,7 @@
1
1
  function assignGroupKeys(d, keys) {
2
2
  if (d == null || typeof d !== "object" || Array.isArray(d))
3
3
  return d;
4
- const keysObj = Object.fromEntries(keys.filter((key) => typeof key[0] !== "function"));
4
+ const keysObj = Object.fromEntries(keys.filter((key) => typeof key[0] !== "function" && key[0] != null));
5
5
  return Object.assign(keysObj, d);
6
6
  }
7
7
 
@@ -1 +1 @@
1
- {"version":3,"file":"assignGroupKeys.js","sources":["../../../src/helpers/assignGroupKeys.ts"],"sourcesContent":["import { GroupKey } from '../types';\n\n/**\n * Given an object and a set of group keys [[keyName, keyValue], ...]\n * set the keys as properties within the object: { [keyName]: keyValue, ... }\n * (creates a new object with these properties added)\n */\nexport function assignGroupKeys<T extends object>(d: T, keys: GroupKey[]) {\n // abort if atypical input\n if (d == null || typeof d !== 'object' || Array.isArray(d)) return d;\n\n // transform to { groupKey1: value, ... } excluding function group keys\n const keysObj = Object.fromEntries(\n keys.filter((key) => typeof key[0] !== 'function')\n );\n\n return Object.assign(keysObj, d);\n}\n"],"names":[],"mappings":"yBAOkD,GAAM;AAEtD,MAAI,KAAK,QAAQ,OAAO,MAAM,YAAY,MAAM,QAAQ;AAAI,WAAO;AAGnE,QAAM,UAAU,OAAO,YACrB,KAAK,OAAO,CAAC,QAAQ,OAAO,IAAI,OAAO;AAGzC,SAAO,OAAO,OAAO,SAAS;AAAA;;;;"}
1
+ {"version":3,"file":"assignGroupKeys.js","sources":["../../../src/helpers/assignGroupKeys.ts"],"sourcesContent":["import { GroupKey } from '../types';\n\n/**\n * Given an object and a set of group keys [[keyName, keyValue], ...]\n * set the keys as properties within the object: { [keyName]: keyValue, ... }\n * (creates a new object with these properties added)\n */\nexport function assignGroupKeys<T extends object>(d: T, keys: GroupKey[]) {\n // abort if atypical input\n if (d == null || typeof d !== 'object' || Array.isArray(d)) return d;\n\n // transform to { groupKey1: value, ... } excluding function group keys\n const keysObj = Object.fromEntries(\n keys.filter((key) => typeof key[0] !== 'function' && key[0] != null)\n );\n\n return Object.assign(keysObj, d);\n}\n"],"names":[],"mappings":"yBAOkD,GAAM;AAEtD,MAAI,KAAK,QAAQ,OAAO,MAAM,YAAY,MAAM,QAAQ;AAAI,WAAO;AAGnE,QAAM,UAAU,OAAO,YACrB,KAAK,OAAO,CAAC,QAAQ,OAAO,IAAI,OAAO,cAAc,IAAI,MAAM;AAGjE,SAAO,OAAO,OAAO,SAAS;AAAA;;;;"}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  function assignGroupKeys(d, keys) {
6
6
  if (d == null || typeof d !== "object" || Array.isArray(d))
7
7
  return d;
8
- const keysObj = Object.fromEntries(keys.filter((key) => typeof key[0] !== "function"));
8
+ const keysObj = Object.fromEntries(keys.filter((key) => typeof key[0] !== "function" && key[0] != null));
9
9
  return Object.assign(keysObj, d);
10
10
  }
11
11
 
@@ -1 +1 @@
1
- {"version":3,"file":"assignGroupKeys.js","sources":["../../../src/helpers/assignGroupKeys.ts"],"sourcesContent":["import { GroupKey } from '../types';\n\n/**\n * Given an object and a set of group keys [[keyName, keyValue], ...]\n * set the keys as properties within the object: { [keyName]: keyValue, ... }\n * (creates a new object with these properties added)\n */\nexport function assignGroupKeys<T extends object>(d: T, keys: GroupKey[]) {\n // abort if atypical input\n if (d == null || typeof d !== 'object' || Array.isArray(d)) return d;\n\n // transform to { groupKey1: value, ... } excluding function group keys\n const keysObj = Object.fromEntries(\n keys.filter((key) => typeof key[0] !== 'function')\n );\n\n return Object.assign(keysObj, d);\n}\n"],"names":[],"mappings":";;;;yBAOkD,GAAM;AAEtD,MAAI,KAAK,QAAQ,OAAO,MAAM,YAAY,MAAM,QAAQ;AAAI,WAAO;AAGnE,QAAM,UAAU,OAAO,YACrB,KAAK,OAAO,CAAC,QAAQ,OAAO,IAAI,OAAO;AAGzC,SAAO,OAAO,OAAO,SAAS;AAAA;;;;"}
1
+ {"version":3,"file":"assignGroupKeys.js","sources":["../../../src/helpers/assignGroupKeys.ts"],"sourcesContent":["import { GroupKey } from '../types';\n\n/**\n * Given an object and a set of group keys [[keyName, keyValue], ...]\n * set the keys as properties within the object: { [keyName]: keyValue, ... }\n * (creates a new object with these properties added)\n */\nexport function assignGroupKeys<T extends object>(d: T, keys: GroupKey[]) {\n // abort if atypical input\n if (d == null || typeof d !== 'object' || Array.isArray(d)) return d;\n\n // transform to { groupKey1: value, ... } excluding function group keys\n const keysObj = Object.fromEntries(\n keys.filter((key) => typeof key[0] !== 'function' && key[0] != null)\n );\n\n return Object.assign(keysObj, d);\n}\n"],"names":[],"mappings":";;;;yBAOkD,GAAM;AAEtD,MAAI,KAAK,QAAQ,OAAO,MAAM,YAAY,MAAM,QAAQ;AAAI,WAAO;AAGnE,QAAM,UAAU,OAAO,YACrB,KAAK,OAAO,CAAC,QAAQ,OAAO,IAAI,OAAO,cAAc,IAAI,MAAM;AAGjE,SAAO,OAAO,OAAO,SAAS;AAAA;;;;"}
package/dist/umd/tidy.js CHANGED
@@ -268,7 +268,7 @@
268
268
  function assignGroupKeys(d, keys) {
269
269
  if (d == null || typeof d !== "object" || Array.isArray(d))
270
270
  return d;
271
- const keysObj = Object.fromEntries(keys.filter((key) => typeof key[0] !== "function"));
271
+ const keysObj = Object.fromEntries(keys.filter((key) => typeof key[0] !== "function" && key[0] != null));
272
272
  return Object.assign(keysObj, d);
273
273
  }
274
274