string-converters
Version:
A utility library for converting data types and working with arrays. Provides converters for boolean, number, and string values, along with array conversion functions and support for values with predefined options.
12 lines (11 loc) • 564 B
TypeScript
import { Converter } from "../types";
/**
* Creates a converter for arrays using the specified item converter and separator.
*
* @template T - The type of items in the array.
* @param {Converter<T>} itemConverter - The converter for individual items in the array.
* @param {string} [separator=','] - The separator used to split and join the array values.
* @returns {Converter<T[]>} The converter for arrays.
*/
declare const createArrayConverter: <T>(itemConverter: Converter<T>, separator?: string) => Converter<T[]>;
export default createArrayConverter;