A lodash-like library for types, with support for type-level lambda functions.
๐ง work in progress ๐ง
// prettier-ignore
type result = Pipe<
// ^? 78
[1, 2, 3, 4, 3, 4],
[
T.Map<Add<3>>,
S.Join<'.'>,
S.Split<'.'>,
T.Map<S.ToNumber>,
T.Map<N.Add<10>>,
T.Sum
]
>;
// This is a type-level lambda!
interface Duplicate extends Fn {
output: [this["args"][0], this["args"][0]];
}
type result = Call<T.FlatMap<Duplicate>, [1, 2, 3, 4]>;
// ^? [1, 1, 2, 2, 3, 3, 4, 4]
- Composition
- Pipe
- PipeRight
- Call
- Apply
- Tuples
- Zip
- Partition
- Head
- Tail
- Last
- FlatMap
- Find
- Sum
- Drop n
- Take n
- TakeWhile
- Join separator
- Map
- Filter
- Reduce
- ReduceRight
- Object
- FromEntries
- Entries
- MapValues
- MapKeys
- GroupBy
- Assign
- Pick
- PickBy
- Omit
- OmitBy
- Union
- Assign
- FromEntries
- Entries
- Extract
- ExtractBy
- Exclude
- ExcludeBy
- String
- Concat
- Uppercase
- Lowercase
- Capitalize
- Uncapitalize
- Split separator
- Words
- Reduce