import type { Assert } from '../assert'; import type { Chars } from './chars'; import type { IndexOf } from '../index-of'; import type { NumberLike } from '../number-like'; import type { SplitAt } from './split-at'; /** * Check if a string literal includes another string literal, inclusive (⊆). * * @example * ``` * type _StringIncludes_Cases = [ * ExpectTrue>, * ExpectTrue>, * ExpectTrue>, * ExpectFalse>, * // * ExpectTrue>, * ExpectTrue>, * ExpectTrue>, * ExpectTrue>, * ExpectFalse>, * // * ExpectTrue>, * ExpectTrue>, * ExpectFalse>, * ExpectFalse>, * ExpectFalse>, * // * ExpectTrue>, * ExpectTrue>, * ExpectFalse>, * ExpectFalse>, * ExpectFalse>, * ExpectFalse> * ] * ``` */ export type StringIncludes>> = Assert<0, NumberLike>>>> = SplitAt extends [infer _A, infer B] ? B extends `${infer _A}${Search}${infer _B}` ? true : false : never;