import type {AllExtend} from './all-extend.d.ts'; /** Returns a boolean for whether the given string literal is lowercase. @example ``` import type {IsLowercase} from 'type-fest'; IsLowercase<'abc'>; //=> true IsLowercase<'Abc'>; //=> false IsLowercase; //=> boolean ``` */ export type IsLowercase = AllExtend<_IsLowercase, true>; /** Loops through each part in the string and returns a boolean array indicating whether each part is lowercase. */ type _IsLowercase = S extends `${infer First}${infer Rest}` ? _IsLowercase]> : [...Accumulator, IsLowercaseHelper]; /** Returns a boolean for whether an individual part of the string is lowercase. */ type IsLowercaseHelper = S extends Lowercase ? true : S extends Uppercase | Capitalize | `${string}${Uppercase}${string}` ? false : boolean; export {};