UNPKG

@exromany/lido-csm-sdk

Version:

[![GitHub license](https://img.shields.io/github/license/lidofinance/lido-csm-sdk?color=limegreen)](https://github.com/lidofinance/lido-csm-sdk/blob/main/LICENSE.txt) [![Version npm](https://img.shields.io/npm/v/@lidofinance/lido-csm-sdk?label=version)](h

14 lines 611 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.checkDuplicates = void 0; const append_error_js_1 = require("./append-error.js"); const checkDuplicates = (depositData, errors) => { depositData.forEach((data, index) => { const count = depositData.reduce((count, { pubkey }) => (data.pubkey === pubkey ? count + 1 : count), 0); if (count > 1) { (0, append_error_js_1.appendError)(errors, index, `pubkey is duplicated in deposit data`); } }); }; exports.checkDuplicates = checkDuplicates; //# sourceMappingURL=check-duplicates.js.map