@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,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