Files
pezkuwi-common/packages/util/src/array/unzip.ts
T
pezkuwichain a5542fdd87 Rebrand: polkadot → pezkuwi internal references fixed
- Fixed internal @polkadot references to @pezkuwi
- Updated hw-ledger and hw-ledger-transports packages
- Updated keyring and networks packages
- Version 14.0.7
2026-01-07 02:34:39 +03:00

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];
}