mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-22 04:27:59 +00:00
a5542fdd87
- Fixed internal @polkadot references to @pezkuwi - Updated hw-ledger and hw-ledger-transports packages - Updated keyring and networks packages - Version 14.0.7
19 lines
476 B
TypeScript
19 lines
476 B
TypeScript
// Copyright 2017-2025 @pezkuwi/util authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
/**
|
|
* @name arrayUnzip
|
|
* @description Splits a single [K, V][] into [K[], V[]]
|
|
*/
|
|
export function arrayUnzip <K, V> (entries: readonly [K, V][]): [K[], V[]] {
|
|
const count = entries.length;
|
|
const keys = new Array<K>(count);
|
|
const values = new Array<V>(count);
|
|
|
|
for (let i = 0; i < count; i++) {
|
|
[keys[i], values[i]] = entries[i];
|
|
}
|
|
|
|
return [keys, values];
|
|
}
|