fork of hey-api/openapi-ts because I need some additional things
at feat/skip-token 30 lines 651 B view raw
1import { toCase } from './naming/naming'; 2import type { Casing } from './naming/types'; 3 4/** 5 * Utilities shared across the package. 6 */ 7export const utils = { 8 /** 9 * @deprecated use `toCase` instead 10 */ 11 stringCase({ 12 case: casing, 13 stripLeadingSeparators, 14 value, 15 }: { 16 readonly case: Casing | undefined; 17 /** 18 * If leading separators have a semantic meaning, we might not want to 19 * remove them. 20 */ 21 stripLeadingSeparators?: boolean; 22 value: string; 23 }) { 24 return toCase(value, casing, { stripLeadingSeparators }); 25 }, 26 /** 27 * Converts the given string to the specified casing. 28 */ 29 toCase, 30};