/** * @typed/fp/string is an extension of fp-ts/string with additional * type-class instances. * @since 0.9.2 */ import { L } from 'ts-toolbelt' /** * @since 0.9.2 * @category Combinator */ export const captialize = (s: S): Capitalize => (s.length === 0 ? s : `${s[0].toUpperCase()}${s.slice(1)}`) as Capitalize /** * @since 0.9.2 * @category Combinator */ export const uncaptialize = (s: S): Uncapitalize => (s.length === 0 ? s : `${s[0].toLowerCase()}${s.slice(1)}`) as Uncapitalize /** * @since 0.9.2 * @category Combinator */ export const upperCase = (s: S): Uppercase => s.toUpperCase() as Uppercase /** * @since 0.9.2 * @category Combinator */ export const lowerCase = (s: S): Lowercase => s.toLowerCase() as Lowercase /** * @since 0.9.2 * @category Type-level */ export type ConcatStrings = [] extends A ? R : ConcatStrings, `${R}${A[0]}`> /** * @since 0.9.2 * @category Combinator */ export function concat(...strings: S): ConcatStrings { return strings.join() as ConcatStrings } export * from 'fp-ts/string'