'use strict'; import type { AnyRecord, ConvertValuesToArrays } from '../types'; export function convertPropertyToArray(value: T | undefined): T[] { return value !== undefined ? (Array.isArray(value) ? value : [value]) : []; } export function convertPropertiesToArrays(config: T) { return Object.fromEntries( Object.entries(config).map(([key, value]) => [ key, convertPropertyToArray(value), ]) ) as ConvertValuesToArrays; } export function kebabizeCamelCase(property: T) { return property.replace(/[A-Z]/g, (x) => `-${x.toLowerCase()}`); } export function camelizeKebabCase(property: T) { return property.replace(/-./g, (x) => x[1].toUpperCase()); }