UNPKG

@ledgerhq/live-common

Version:
17 lines 636 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.filterPlatformAccounts = filterPlatformAccounts; const minimatch_1 = require("minimatch"); function filterPlatformAccounts(accounts, filters) { const filterCurrencyRegexes = filters.currencies ? filters.currencies.map(filter => (0, minimatch_1.makeRe)(filter)) : null; return accounts.filter(account => { if (filterCurrencyRegexes && !filterCurrencyRegexes.some(regex => account.currency.match(regex))) { return false; } return true; }); } //# sourceMappingURL=filters.js.map