@blake.regalia/belt
Advanced tools
Comparing version 0.43.0 to 0.44.0
@@ -207,2 +207,13 @@ import type { NaiveBase58, NaiveBase64, NaiveBase93, NaiveHexLower } from './strings'; | ||
/** | ||
* Takes two equal-length arrays and applies the given callback to each element-wise pair | ||
* @param a_a | ||
* @param a_b | ||
* @param f_apply | ||
* @param a_out - the output | ||
* @returns | ||
*/ | ||
export declare const arrays_zip: <a_out extends ArrayLike<number> & { | ||
map(f_callback: (n_value: number, i_index: number) => any): any; | ||
}>(a_a: a_out, a_b: ArrayLike<number>, f_apply: (n_a: number, n_b: number) => number) => a_out; | ||
/** | ||
* Concatenate a sequence of Uint8Arrays. | ||
@@ -209,0 +220,0 @@ * @param a_buffers the data to concatenate in order |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.bytes_to_string8 = exports.string8_to_bytes = exports.base64_to_bytes = exports.bytes_to_base64 = exports.base64_to_bytes_slim = exports.bytes_to_base64_slim = exports.hex_to_bytes = exports.bytes_to_hex = exports.concat2 = exports.concat = exports.bytes_split = exports.bytes_to_bigint_be = exports.bytes_to_biguint_be = exports.bigint_to_bytes_be = exports.biguint_to_bytes_be = exports.bytes_to_uint32_be = exports.uint32_to_bytes_be = exports.bytes_to_json = exports.json_to_bytes = exports.text_to_base64 = exports.base64_to_text = exports.bytes_to_text = exports.text_to_bytes = exports.decode_length_prefix_u16 = exports.encode_length_prefix_u16 = exports.zero_out = exports.hkdf = exports.hmac = exports.import_key = exports.sha512 = exports.sha384 = exports.sha256d = exports.sha256 = exports.dataview = exports.bytes = exports.canonicalize_json = exports.safe_json = exports.parse_json_safe = exports.parse_json = exports.stringify_json = exports.safely_sync = exports.uuid_v4 = exports.bigint_min = exports.bigint_max = exports.bigint_abs = exports.bigint_greater = exports.bigint_lesser = exports.SI_HASH_ALGORITHM_SHA512 = exports.SI_HASH_ALGORITHM_SHA384 = exports.SI_HASH_ALGORITHM_SHA256 = void 0; | ||
exports.crypto_random_int = exports.crypto_random = exports.crypto_random_unit_double = exports.crypto_random_bytes = exports.base58_to_bytes = exports.bytes_to_base58 = exports.base93_to_bytes = exports.bytes_to_base93 = void 0; | ||
exports.string8_to_bytes = exports.base64_to_bytes = exports.bytes_to_base64 = exports.base64_to_bytes_slim = exports.bytes_to_base64_slim = exports.hex_to_bytes = exports.bytes_to_hex = exports.concat2 = exports.concat = exports.arrays_zip = exports.bytes_split = exports.bytes_to_bigint_be = exports.bytes_to_biguint_be = exports.bigint_to_bytes_be = exports.biguint_to_bytes_be = exports.bytes_to_uint32_be = exports.uint32_to_bytes_be = exports.bytes_to_json = exports.json_to_bytes = exports.text_to_base64 = exports.base64_to_text = exports.bytes_to_text = exports.text_to_bytes = exports.decode_length_prefix_u16 = exports.encode_length_prefix_u16 = exports.zero_out = exports.hkdf = exports.hmac = exports.import_key = exports.sha512 = exports.sha384 = exports.sha256d = exports.sha256 = exports.dataview = exports.bytes = exports.canonicalize_json = exports.safe_json = exports.parse_json_safe = exports.parse_json = exports.stringify_json = exports.safely_sync = exports.uuid_v4 = exports.bigint_min = exports.bigint_max = exports.bigint_abs = exports.bigint_greater = exports.bigint_lesser = exports.SI_HASH_ALGORITHM_SHA512 = exports.SI_HASH_ALGORITHM_SHA384 = exports.SI_HASH_ALGORITHM_SHA256 = void 0; | ||
exports.crypto_random_int = exports.crypto_random = exports.crypto_random_unit_double = exports.crypto_random_bytes = exports.base58_to_bytes = exports.bytes_to_base58 = exports.base93_to_bytes = exports.bytes_to_base93 = exports.bytes_to_string8 = void 0; | ||
const belt_js_1 = require("./belt.js"); | ||
@@ -365,2 +365,18 @@ exports.SI_HASH_ALGORITHM_SHA256 = 'SHA-256'; | ||
/** | ||
* Takes two equal-length arrays and applies the given callback to each element-wise pair | ||
* @param a_a | ||
* @param a_b | ||
* @param f_apply | ||
* @param a_out - the output | ||
* @returns | ||
*/ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
const arrays_zip = (a_a, a_b, f_apply) => a_a.length === a_b.length | ||
// apply to each element | ||
? a_a.map((n, i) => f_apply(n, a_b[i])) | ||
// assert equal-length arrays | ||
: (0, belt_js_1.die)('Arrays must have identical length'); | ||
exports.arrays_zip = arrays_zip; | ||
/* eslint-enable */ | ||
/** | ||
* Concatenate a sequence of Uint8Arrays. | ||
@@ -367,0 +383,0 @@ * @param a_buffers the data to concatenate in order |
@@ -207,2 +207,13 @@ import type { NaiveBase58, NaiveBase64, NaiveBase93, NaiveHexLower } from './strings'; | ||
/** | ||
* Takes two equal-length arrays and applies the given callback to each element-wise pair | ||
* @param a_a | ||
* @param a_b | ||
* @param f_apply | ||
* @param a_out - the output | ||
* @returns | ||
*/ | ||
export declare const arrays_zip: <a_out extends ArrayLike<number> & { | ||
map(f_callback: (n_value: number, i_index: number) => any): any; | ||
}>(a_a: a_out, a_b: ArrayLike<number>, f_apply: (n_a: number, n_b: number) => number) => a_out; | ||
/** | ||
* Concatenate a sequence of Uint8Arrays. | ||
@@ -209,0 +220,0 @@ * @param a_buffers the data to concatenate in order |
@@ -330,2 +330,17 @@ import { XG_8, is_array, is_dict_es, is_string, entries, from_entries, die, try_sync } from './belt.js'; | ||
/** | ||
* Takes two equal-length arrays and applies the given callback to each element-wise pair | ||
* @param a_a | ||
* @param a_b | ||
* @param f_apply | ||
* @param a_out - the output | ||
* @returns | ||
*/ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
export const arrays_zip = (a_a, a_b, f_apply) => a_a.length === a_b.length | ||
// apply to each element | ||
? a_a.map((n, i) => f_apply(n, a_b[i])) | ||
// assert equal-length arrays | ||
: die('Arrays must have identical length'); | ||
/* eslint-enable */ | ||
/** | ||
* Concatenate a sequence of Uint8Arrays. | ||
@@ -332,0 +347,0 @@ * @param a_buffers the data to concatenate in order |
{ | ||
"name": "@blake.regalia/belt", | ||
"version": "0.43.0", | ||
"version": "0.44.0", | ||
"repository": "github:blake-regalia/belt", | ||
@@ -5,0 +5,0 @@ "license": "ISC", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
360148
6736