Type aliases
ExtractUnionMember
Extract
UnionMember<A, Tag, Value>: Extract<A, Record<Tag, Value>>
Type parameters
-
A: object
-
Tag: keyof A
-
Value: A[Tag]
Immutable
Immutable<A>:
Type parameters
ImmutableObject
ImmutableObject<A>: {}
Type parameters
MergeObjects
MergeObjects<A, B>: {} & {}
Type parameters
Mutable
Mutable<A>: A extends Primitive ? A : A extends ImmutableArray<infer V> ? MutableArray<V> : A extends ReadonlyArray<infer V> ? MutableArray<V> : A extends ImmutableMap<infer K, infer V> ? MutableMap<K, V> : A extends ReadonlyMap<infer K, infer V> ? MutableMap<K, V> : A extends ImmutableSet<infer V> ? MutableSet<V> : A extends ReadonlySet<infer V> ? MutableSet<V> : MutableObject<A>
Type parameters
MutableObject
MutableObject<A>: {}
Type parameters
ObjectPath
ObjectPath<T, Keys>: Keys extends [] ? T : Keys extends [keyof T] ? Prop<T, Keys[0]> : Keys extends [PropertyKey, PropertyKey] ? Prop<Prop<T, Keys[0]>, Keys[1]> : Keys extends [PropertyKey, PropertyKey, PropertyKey] ? Prop<Prop<Prop<T, Keys[0]>, Keys[1]>, Keys[2]> : Keys extends [PropertyKey, PropertyKey, PropertyKey, PropertyKey] ? Prop<Prop<Prop<Prop<T, Keys[0]>, Keys[1]>, Keys[2]>, Keys[3]> : Keys extends [PropertyKey, PropertyKey, PropertyKey, PropertyKey, PropertyKey] ? Prop<Prop<Prop<Prop<Prop<T, Keys[0]>, Keys[1]>, Keys[2]>, Keys[3]>, Keys[4]> : undefined
Type parameters
OptionalKeys
Optional
Keys<A, K>: DropKeys<A, K> & Partial<Pick<A, K>>
Type parameters
OptionalProperties
Type parameters
OptionalPropertyNames
OptionalPropertyNames<A>: {}[keyof A]
Type parameters
Overwrite
Type parameters
Prop
Prop<T, K>: K extends keyof T ? T[K] : undefined
Type parameters
RequiredProperties
Type parameters
RequiredPropertyNames
RequiredPropertyNames<A>: {}[keyof A]
Type parameters
ValuesOf
ValuesOf<A>: {}[keyof A]
Type parameters
Variables
Const dissoc
dissoc
: { <K, A>
(key
: K, obj
: A): DropKeys<A, K>; <K>
(key
: K): <A>
(obj
: A) => DropKeys<A, K> } = curry(_dissoc) as {<K extends PropertyKey, A extends Record<K, any>>(key: K, obj: A): DropKeys<A, K><K extends PropertyKey>(key: K): <A extends Record<K, any>>(obj: A) => DropKeys<A, K>}
Type declaration
-
- <K, A>(key: K, obj: A): DropKeys<A, K>
- <K>(key: K): <A>(obj: A) => DropKeys<A, K>
-
Type parameters
Parameters
-
Type parameters
Parameters
Returns <A>(obj: A) => DropKeys<A, K>
-
-
Type parameters
Parameters
Const hasOwnProperty
hasOwnProperty: { <A, B>(key: A, obj: B): obj is B & {}; <A>(key: A): <B>(obj: B) => obj is B & {} } = curry(<A extends PropertyKey, B extends object>(key: A,obj: B,): obj is B & { readonly [K in A]: unknown } =>obj && Object.prototype.hasOwnProperty.call(obj, key),) as {<A extends PropertyKey, B extends object>(key: A, obj: B): obj is B &{ readonly [K in A]: unknown }<A extends PropertyKey>(key: A): <B extends object>(obj: B,) => obj is B & { readonly [K in A]: unknown }}
Type declaration
-
- <A, B>(key: A, obj: B): obj is B & {}
- <A>(key: A): <B>(obj: B) => obj is B & {}
-
Type parameters
Parameters
Returns obj is B & {}
-
Type parameters
Parameters
Returns <B>(obj: B) => obj is B & {}
-
- <B>(obj: B): obj is B & {}
-
Type parameters
Parameters
Returns obj is B & {}
Const mapObj
mapObj: { <A, B, C>(fn: <K>(key: K, value: C[K]) => B, obj: C): {}; <A, B, C>(fn: <K>(key: K, value: C[K]) => B): (obj: C) => {} } = curry(__mapObj) as {<A, B, C extends Record<PropertyKey, A>>(fn: <K extends keyof C>(key: K, value: C[K]) => B,obj: C,): { [K in keyof C]: B }<A, B, C extends Record<PropertyKey, A>>(fn: <K extends keyof C>(key: K, value: C[K]) => B): (obj: C,) => { [K in keyof C]: B }}
Type declaration
-
- <A, B, C>(fn: <K>(key: K, value: C[K]) => B, obj: C): {}
- <A, B, C>(fn: <K>(key: K, value: C[K]) => B): (obj: C) => {}
-
Type parameters
Parameters
-
fn: <K>(key: K, value: C[K]) => B
-
- <K>(key: K, value: C[K]): B
-
Type parameters
Parameters
Returns B
-
obj: C
Returns {}
-
Type parameters
Parameters
-
fn: <K>(key: K, value: C[K]) => B
-
- <K>(key: K, value: C[K]): B
-
Type parameters
Parameters
Returns B
Returns (obj: C) => {}
Const mapToList
map
ToList: { <A, B, C>(fn: (key: A, value: B) => C, obj: Record<A, B>): C[]; <A, B, C>(fn: (key: A, value: B) => C): (obj: Record<A, B>) => C[] } = curry(__mapToList)
Type declaration
-
- <A, B, C>(fn: (key: A, value: B) => C, obj: Record<A, B>): C[]
- <A, B, C>(fn: (key: A, value: B) => C): (obj: Record<A, B>) => C[]
-
Type parameters
Parameters
-
fn: (key: A, value: B) => C
-
Returns C[]
-
Type parameters
Parameters
-
fn: (key: A, value: B) => C
Returns (obj: Record<A, B>) => C[]
Const path
path
: { <Keys, A>
(keys
: Keys, obj
: A): Maybe<ObjectPath<A, Keys>>; <Keys>
(keys
: Keys): <A>
(obj
: A) => Maybe<ObjectPath<A, Keys>> } = curry(<Keys extends PropertyKey[], A extends object>(keys: Keys, obj: A): Maybe<ObjectPath<A, Keys>> =>(keys.length === 0? Maybe.of(obj): keys.length === 1? prop(keys[0], obj): keys.slice(1).reduce((maybe, key) => chain(prop(key) as any, maybe) as any,prop(keys[0], obj),)) as Maybe<ObjectPath<A, Keys>>,) as {<Keys extends PropertyKey[], A extends object>(keys: Keys, obj: A): Maybe<ObjectPath<A, Keys>><Keys extends PropertyKey[]>(keys: Keys): <A extends object>(obj: A) => Maybe<ObjectPath<A, Keys>>}
Type declaration
-
-
Type parameters
-
Keys: PropertyKey[]
-
A: object
Parameters
-
Type parameters
Parameters
Returns <A>(obj: A) => Maybe<ObjectPath<A, Keys>>
-
-
Type parameters
Parameters
Const prop
prop
: { <K, O>
(key
: K, obj
: O): Maybe<O[K]>; <K>
(key
: K): <O>
(obj
: O) => Maybe<O[K]> } = curry(<K extends PropertyKey, O extends Partial<{ [_ in K]: any }>>(key: K, obj: O): Maybe<O[K]> =>hasOwnProperty(key, obj) ? Maybe.of(obj[key]) : Nothing,) as {<K extends PropertyKey, O extends Partial<{ [_ in K]: any }>>(key: K, obj: O): Maybe<O[K]><K extends PropertyKey>(key: K): <O extends Partial<{ [_ in K]: any }>>(obj: O) => Maybe<O[K]>}
Type declaration
-
- <K, O>(key: K, obj: O): Maybe<O[K]>
- <K>(key: K): <O>(obj: O) => Maybe<O[K]>
-
Type parameters
-
K: PropertyKey
-
O: Partial<{}>
Parameters
Returns Maybe<O[K]>
-
Type parameters
Parameters
Returns <O>(obj: O) => Maybe<O[K]>
-
-
Type parameters
Parameters
Returns Maybe<O[K]>
Const propOf
propOf: { <K, O>(key: K, obj: O): O[K]; <K>(key: K): <O>(obj: O) => O[K] } = curry(<K extends PropertyKey, O extends Record<K, any>>(key: K, obj: O): O[K] => obj[key],) as {<K extends PropertyKey, O extends Record<K, any>>(key: K, obj: O): O[K]<K extends PropertyKey>(key: K): <O extends Record<K, any>>(obj: O) => O[K]}
Type declaration
-
- <K, O>(key: K, obj: O): O[K]
- <K>(key: K): <O>(obj: O) => O[K]
-
Type parameters
Parameters
Returns O[K]
-
Type parameters
Parameters
Returns <O>(obj: O) => O[K]
-
-
Type parameters
Parameters
Returns O[K]
Const set
set: { <K, V, O>(key: K, value: V, obj: O): O; <K, V>(key: K, value: V): <O>(obj: O) => O; <K>(key: K): { <V, O>(value: V, obj: O): O; <V>(value: V): <O>(obj: O) => O } } = curry(__set) as {<K extends PropertyKey, V, O extends { [Key in K]: V }>(key: K, value: V, obj: O): O<K extends PropertyKey, V>(key: K, value: V): <O extends { [Key in K]: V }>(obj: O) => O<K extends PropertyKey>(key: K): {<V, O extends { [Key in K]: V }>(value: V, obj: O): O<V>(value: V): <O extends { [Key in K]: V }>(obj: O) => O}}
Type declaration
-
- <K, V, O>(key: K, value: V, obj: O): O
- <K, V>(key: K, value: V): <O>(obj: O) => O
- <K>(key: K): { <V, O>(value: V, obj: O): O; <V>(value: V): <O>(obj: O) => O }
-
Type parameters
Parameters
Returns O
-
Type parameters
Parameters
Returns <O>(obj: O) => O
-
-
Type parameters
Parameters
Returns O
-
Type parameters
Parameters
Returns { <V, O>(value: V, obj: O): O; <V>(value: V): <O>(obj: O) => O }
-
- <V, O>(value: V, obj: O): O
- <V>(value: V): <O>(obj: O) => O
-
Type parameters
Parameters
Returns O
-
Type parameters
Parameters
Returns <O>(obj: O) => O
-
-
Type parameters
Parameters
Returns O
@typed/objects