@tap-payments/os-micro-frontend-shared 0.0.50 → 0.0.51

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,4 +1,4 @@
1
- export declare function extractIdsFromRowData<T>({ rowData, prefixes, keys, accessor }: {
1
+ export declare function extractIdsFromRowData<T>({ rowData, prefixes, keys, accessor, }: {
2
2
  rowData: T;
3
3
  prefixes: string[];
4
4
  keys?: string[];
@@ -1,9 +1,10 @@
1
1
  import get from 'lodash/get';
2
2
  import { matchOccurrence, removePrefixFromString } from './index.js';
3
- export function extractIdsFromRowData({ rowData, prefixes, keys = [], accessor }) {
3
+ export function extractIdsFromRowData({ rowData, prefixes, keys = [], accessor, }) {
4
+ var _a;
4
5
  const hasGetFunction = !!accessor;
5
6
  const keysToUse = hasGetFunction ? accessor === null || accessor === void 0 ? void 0 : accessor(rowData) : keys;
6
- const filteredIds = keysToUse === null || keysToUse === void 0 ? void 0 : keysToUse.reduce((acc, key) => {
7
+ const filteredIds = (_a = keysToUse === null || keysToUse === void 0 ? void 0 : keysToUse.filter(Boolean)) === null || _a === void 0 ? void 0 : _a.reduce((acc, key) => {
7
8
  const items = hasGetFunction ? key : get(rowData, key);
8
9
  if (typeof items === 'string' &&
9
10
  (prefixes === null || prefixes === void 0 ? void 0 : prefixes.some((prefix) => items.includes(prefix) && matchOccurrence(removePrefixFromString(items, prefix), '_') === 0))) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tap-payments/os-micro-frontend-shared",
3
3
  "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.0.50",
4
+ "version": "0.0.51",
5
5
  "type": "module",
6
6
  "main": "build/index.js",
7
7
  "module": "build/index.js",