hkt-toolbelt
Advanced tools
Comparing version 0.7.0 to 0.8.0
{ | ||
"name": "hkt-toolbelt", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "A collection of useful HKT utilities and building blocks", | ||
@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts", |
@@ -43,2 +43,20 @@ import { Cast, Conditional, Kind, List } from "."; | ||
} | ||
export declare type _$tail<S extends string> = S extends `${string}${infer Tail}` ? Tail extends "" ? S : Tail : string extends S ? S : ""; | ||
export declare abstract class Tail extends Kind { | ||
abstract f: (x: Cast<this[Kind._], string>) => _$tail<typeof x>; | ||
} | ||
declare type _$init2<S extends string> = S extends `${infer Head}${infer Tail}` ? Tail extends "" ? "" : `${Head}${_$init2<Tail>}` : ""; | ||
export declare type _$init<S extends string> = string extends S ? string : _$init2<S>; | ||
export declare abstract class Init extends Kind { | ||
abstract f: (x: Cast<this[Kind._], string>) => _$init<typeof x>; | ||
} | ||
declare type _$replace2<S extends string, From extends string, To extends string, O extends string = ""> = S extends `${infer Head}${From}${infer Tail}` ? _$replace2<Tail, From, To, `${O}${Head}${To}`> : `${O}${S}`; | ||
export declare type _$replace<S extends string, From extends string, To extends string> = _$isTemplate<From> extends true ? string : string extends From ? string : From extends "" ? `${To}${_$replace2<S, From, To>}` : _$replace2<S, From, To>; | ||
export declare abstract class Replace<From extends string, To extends string> extends Kind { | ||
abstract f: (x: Cast<this[Kind._], string>) => _$replace<typeof x, From, To>; | ||
} | ||
export declare type _$reverse<S extends string, O extends string = ""> = S extends `${infer Head}${infer Tail}` ? _$reverse<Tail, `${Head}${O}`> : `${string extends S ? string : ""}${O}`; | ||
export declare abstract class Reverse extends Kind { | ||
abstract f: (x: Cast<this[Kind._], string>) => _$reverse<typeof x>; | ||
} | ||
export * as String from "./string"; |
16657
257