@polkadot/util
Version:
A collection of useful utilities for @polkadot
17 lines (16 loc) • 448 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.arrayZip = void 0;
/**
* @name arrayZip
* @description Combines 2 distinct key/value arrays into a single [K, V] array
*/
function arrayZip(keys, values) {
const count = keys.length;
const result = new Array(count);
for (let i = 0; i < count; i++) {
result[i] = [keys[i], values[i]];
}
return result;
}
exports.arrayZip = arrayZip;
;