@commonly/iterable
@commonly/reflect
@commonly/transducer
Collection of functional utilities, often higher-order functions.
Performs a function composition of a given functions.
...functions: undefined[] | are functions to be composed |
returns: Function.Variadic
a composed function
package | @commonly/function |
version | v0.2.0-next.54 |
since | v1.0.0 |
import { compose } from "@commonly/function"
const composed = compose(String, Math.sin)
composed(7) // -> "0.6569865987187891"
Performs a currying of an f function.
f: Function.Variadic | is a function to be curried |
returns: Function.Curried
a curried version of an f function
package | @commonly/function |
version | v0.2.0-next.54 |
since | v1.0.0 |
import { curry } from "@commonly/function"
const power = curry(Math.pow)
power(2)(3) // -> 8
Debounces a function postponing its execution by a `wait` time every time the function is invoked.
debounced: Function.Variadic | is a function to be debounced |
wait: number | is a time in milliseconds to delay the next execution of the debounced function |
options: | is an object which further defines the behaviour of the debounced function |
returns: Debounced
a debounced function
package | @commonly/function |
version | v0.2.0-next.54 |
since | v1.0.0 |
import { debounce } from "@commonly/function"
document.body.onscroll = debounce(alert, 250) // -> A prompt will be shown only once for every time scrolling happens
[Not documented yet]
f: Function.Variadic | |
options: |
returns:
package | @commonly/function |
version | v0.2.0-next.54 |
since | v1.0.0 |
import { delegate } from "@commonly/function"
In mathematics, an identity function, also called an identity relation or identity map or identity transformation, is a function that always returns the same value that was used as its argument. That is, for f being identity the equality f(x) = x holds for all x.
value: TValue | is any given value |
returns: TValue
a passed in value
package | @commonly/function |
version | v0.2.0-next.54 |
since | v1.0.0 |
import { identity } from "@commonly/function"
identity(2) // -> 2
identity(3) // -> 3
identity(5) // -> 5
Negates a given predicate function, thus creating a new negated version of that function.
predicate: Predicate | is a predicate function to be negated |
returns: Predicate
a negated version of a predicate function
package | @commonly/function |
version | v0.2.0-next.54 |
since | v1.0.0 |
import { negate } from "@commonly/function"
const isUnsealed = negate(Object.isSealed)
isUnsealed(window) // -> true
Always returns an undefined no matter the arguments.
..._: unknown[] | is a variadic list of parameters which are unused anyway |
returns: undefined
an undefined
package | @commonly/function |
version | v0.2.0-next.54 |
since | v1.0.0 |
import { noop } from "@commonly/function"
noop(1, 1, 2, 3, 5) // -> undefined
Partially applies a list of arguments to an f function. It's similar to a Function.prototype.bind method, except it preserves this context.
f: Function.Variadic | is a function to partially apply list of arguments to |
...applied: TApplied | is a list of arguments to be prepended to an f function |
returns: Function.Partial
a partially applied f function
package | @commonly/function |
version | v0.2.0-next.54 |
since | v1.0.0 |
import { partial } from "@commonly/function"
const isNaN = partial(Object.is, NaN)
isNaN(NaN) // -> true
[Not yet documented]
value: TValue | Reduced |
returns: Reduced
package | @commonly/function |
version | v0.2.0-next.54 |
since | v1.0.0 |
Provides a reducing function based on passed accumulator, if nothing suitable is found, then it returns a scalar reducer.
accumulator: unknown |
returns: Transduced
a reducing function
package | @commonly/function |
version | v0.2.0-next.54 |
since | v1.0.0 |
Invokes a function on a given value and returns that value.
interceptor: | is a function to which the intercepted value will be provided, any value returned will be thrown away |
value: TValue | is a value to be intercepted |
returns: TValue
an intercepted value
package | @commonly/function |
version | v0.2.0-next.54 |
since | v1.0.0 |
import { tap } from "@commonly/function"
Promise.resolve(3)
.then(tap(alert)) // -> value `x` will be shown in the alert box, it will equal to 3
.then(x => x * x) // -> x is still equal to 3, chain is preserved
.then(tap(alert)) // -> value `x` will be shown again, this time it will equal to 9
Throttles a function meaning it will be executed only once per `wait` time.
throttled: Function.Variadic | is a function to be throttled |
wait: number | is a time in milliseconds to delay the next execution of the throttled function |
returns: Throttled
a throttled function
package | @commonly/function |
version | v0.2.0-next.54 |
since | v1.0.0 |
import { throttle } from "@commonly/function"
document.body.onscroll = throttle(alert, 1250) // -> A prompt will be shown once every 1250 milliseconds while scrolling
Collection of functional utilities, often higher-order functions.
Applies a mapper function to each element in the iterable, producing an iterable of the same type.
mapper: Mapper | is a mapping function |
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { chain } from "@commonly/iterable"
chain(x => [ x, x * x ], [ 0, 1, 1, 2, 3, 5, 8 ]) // -> [ 0, 0, 1, 1, 1, 1, 2, 4, 3, 9, 5, 25, 8, 64 ]
Returns a duplicated iterable of the same type as the one given.
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { distinct } from "@commonly/iterable"
distinct([ 0, 1, 1, 2, 3, 5, 8 ]) // -> [ 0, 1, 2, 3, 5, 8 ]
Returns an iterable which contains a slice of all elements of given `iterable` except for the first `n` elements.
n: number | is a number of elements to be dropped |
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { drop } from "@commonly/iterable"
drop(5, [ 0, 1, 1, 2, 3, 5, 8 ]) // -> [ 5, 8 ]
Creates a new iterable of the same type as the one given, where every value excluding the first n values are taken.
predicate: Predicate | is a predicate function |
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { dropWhile } from "@commonly/iterable"
dropWhile(value => value <= 3, [ 0, 1, 1, 2, 3, 5, 8 ]) // -> [ 5, 8 ]
Applies a `predicate` function to each element in the `iterable`, returning a boolean indicating whether all of the elements passed this predicate.
predicate: Predicate | is a predicate function |
iterable: Iterable | is an iterable to be iterated over |
returns:
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { every } from "@commonly/iterable"
every(x => x % 2, [ 0, 1, 1, 2, 3, 5, 8 ]) // -> false
Applies a `predicate` function to each element in the `iterable`, returning an element passing this predicate.
predicate: Predicate | is a predicate function |
iterable: Iterable | is an iterable to be iterated over |
returns:
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { find } from "@commonly/iterable"
find(x => x > 2, [ 0, 1, 1, 2, 3, 5, 8 ]) // -> 3
Applies a `predicate` function to each element in the `iterable`, producing an iterable of the same type with elements passing this predicate.
predicate: Predicate | is a predicate function |
iterable: Iterable | is an iterable to be iterated over |
returns:
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { filter } from "@commonly/iterable"
filter(x => x % 2, [ 0, 1, 1, 2, 3, 5, 8 ]) // -> [ 1, 1, 2, 3, 5 ]
Returns a flattened iterable.
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { flatten } from "@commonly/iterable"
flatten([ 0, [ 1 ], [ 1, 2 ], [ 3 , 5, 8 ] ]) // -> [ 0, 1, 1, 2, 3, 5, 8 ]
Returns a first element of `iterable`.
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
a first element of an iterable
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { head } from "@commonly/iterable"
head([ 0, 1, 1, 2, 3, 5, 8 ]) // -> 0
Returns a last element of `iterable`.
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
a last element of an iterable
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { last } from "@commonly/iterable"
last([ 0, 1, 1, 2, 3, 5, 8 ]) // -> 8
Applies a mapper function to each element in the iterable, producing an iterable of the same type.
mapper: Mapper | is a mapping function |
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { map } from "@commonly/iterable"
map(x => x * x, [ 0, 1, 1, 2, 3, 5, 8 ]) // -> [ 0, 1, 1, 4, 9, 25, 64 ]
Returns an `i`-nth element of `iterable`.
i: number | is a position of an element |
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
an nth element of an iterable
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { nth } from "@commonly/iterable"
nth(4, [ 0, 1, 1, 2, 3, 5, 8 ]) // -> 3
Returns an iterable partitioned into `n`-tuples.
n: number | is a number of elements to be put into a tuple |
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { partition } from "@commonly/iterable"
partition(2, [ 0, 1, 1, 2, 3, 5, 8 ]) // -> [ [ 0, 1 ], [ 1, 2 ], [ 3, 5 ], [ 8 ] ]
Returns an iterable partitioned into tuples.
mapper: Mapper | is a mapper function |
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { partitionBy } from "@commonly/iterable"
partitionBy(number => number > 2, [ 0, 1, 1, 2, 3, 5, 8 ]) // -> [ [ 0, 1, 1, 2 ], [ 3, 5, 8 ] ]
Perform a reduction on a given iterable by applying a given reducing function to each yield value from an iterable.
reducer: Reducer | is a reducing function |
accumulator: TAccumulator | is an initial value for an accumulator |
iterable: Iterable | is an iterable to be reduced |
returns: TAccumulator
an accumulated value
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { reduce } from "@commonly/iterable"
reduce((accumulator, value) => accumulator + value, 0, [0, 1, 1, 2, 3]) // -> 7
Returns an iterable of which the order of the elements is reversed.
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { reverse } from "@commonly/iterable"
reverse([ 0, 1, 1, 2, 3, 5, 8 ]) // -> [ 8, 5, 3, 2, 1, 1, 0 ]
Returns the size of the `iterable`.
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { size } from "@commonly/iterable"
size([ 0, 1, 1, 2, 3, 5, 8 ]) // -> 7
Returns an iterable which contains a slice of elements of given `iterable`.
start: number | is a beginning of a slice |
end: number | is an end of a slice |
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { slice } from "@commonly/iterable"
slice(1, 5, [ 0, 1, 1, 2, 3, 5, 8 ]) // -> [ 1, 1, 2, 3, 5 ]
Applies a `predicate` function to each element in the `iterable`, returning a boolean indicating whether any of the elements passed this predicate.
predicate: Predicate | is a predicate function |
iterable: Iterable | is an iterable to be iterated over |
returns:
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { some } from "@commonly/iterable"
some(x => x % 2, [ 0, 1, 1, 2, 3, 5, 8 ]) // -> true
Returns an iterable of which the order of the elements is dictated by a `comparator` function.
comparator: Comparator | is a comparator function |
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { sort } from "@commonly/iterable"
sort((a, b) => b - a, [ 0, 1, 1, 2, 3, 5, 8 ]) // -> [ 8, 5, 3, 2, 1, 1, 0 ]
Returns an iterable which contains a slice of only the first `n` elements of given `iterable`.
n: number | is a number of elements to be taken |
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { take } from "@commonly/iterable"
take(5, [ 0, 1, 1, 2, 3, 5, 8 ]) // -> [ 0, 1, 1, 2, 3 ]
Returns an iterable which contains a slice of only the first `n` elements of given `iterable`.
predicate: Predicate | is a predicate function |
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { takeWhile } from "@commonly/iterable"
takeWhile(value => value <= 3, [ 0, 1, 1, 2, 3, 5, 8 ]) // -> [ 0, 1, 1, 2, 3 ]
Returns a tail of `iterable` as an iterable of the same type as the one given.
iterable: Iterable | is an iterable to be iterated over |
returns: Iterable
an iterable of the same type as the one given
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
import { tail } from "@commonly/iterable"
tail([ 0, 1, 1, 2, 3, 5, 8 ]) // -> [ 1, 1, 2, 3, 5, 8 ]
[Not yet documented]
transducer: Transducer | |
iterable: Iterable | |
reducer: Transduced | |
accumulator: TAccumulator |
returns: TAccumulator
package | @commonly/iterable |
version | v0.2.0-next.58 |
since | v1.0.0 |
Collection of mathematics utilities.
Combines two quantities using the plus operator.
augend: number | is the first of two addends |
addend: number | is the second of two addends |
returns: number
a sum
package | @commonly/math |
version | v0.1.1-next.8 |
since | v1.0.0 |
import { add } from "@commonly/math"
add(3, 2) // -> 5
Decrements a given number by one.
number: number | is a number to decrement by one |
returns: number
a decremented number by one
package | @commonly/math |
version | v0.1.1-next.8 |
since | v1.0.0 |
import { decrement } from "@commonly/math"
decrement(7) // -> 6
Divides two quantities.
dividend: number | is a quantity that is divided by another quantity |
divisor: number | is a quantity which divides a dividend |
returns: number
a quotient
package | @commonly/math |
version | v0.1.1-next.8 |
since | v1.0.0 |
import { divide } from "@commonly/math"
divide(3, 2) // -> 1.5
Increments a given number by one.
number: number | is a number to decrement by one |
returns: number
an incremented number by one
package | @commonly/math |
version | v0.1.1-next.8 |
since | v1.0.0 |
import { decrement } from "@commonly/Math"
decrement(7) // -> 8
Finds a maximum in a given list.
numbers: number[] | is a list in which we will look for a maximum |
returns: number
a maximum of an xs
package | @commonly/math |
version | v0.1.1-next.8 |
since | v1.0.0 |
import { maximum } from "@commonly/math"
maximum([ 0, 1, 1, 2, 3, 5, 8 ]) // -> 8
Finds a minimum in a given list.
numbers: number[] | is a list in which we will look for a maximum |
returns: number
a maximum of an xs
package | @commonly/math |
version | v0.1.1-next.8 |
since | v1.0.0 |
import { minimum } from "@commonly/math"
minimum([ 0, 1, 1, 2, 3, 5, 8 ]) // -> 0
Multiplies two quantities.
multiplier: number | is a quantity by which another (the multiplicand) is multiplied |
multiplicand: number | is a quantity that is multiplied by another (the multiplier) |
returns: number
a product
package | @commonly/math |
version | v0.1.1-next.8 |
since | v1.0.0 |
import { multiply } from "@commonly/math"
multiply(3, 2) // -> 6
Subtracts two quantities using the minus operator.
minuend: number | is a quantity from which another (the subtrahend) is subtracted |
subtrahend: number | is a quantity which is subtracted from another (the minuend) |
returns: number
a difference
package | @commonly/math |
version | v0.1.1-next.8 |
since | v1.0.0 |
import { subtract } from "@commonly/math"
subtract(3, 2) // -> 1
Collection of reflection utilities.
Check if a given value is an array.
value: unknown | TValue[] | is a value to check |
returns: boolean
either true or false whether the value is an array or not
package | @commonly/reflect |
version | v0.1.1-next.4 |
since | v1.0.0 |
import { isArray } from "@commonly/reflect"
isArray([]) //-> true
isArray({}) //-> false
Check if a given value is a boolean.
value: unknown | boolean | is a value to check |
returns: boolean
either true or false whether the value is a boolean or not
package | @commonly/reflect |
version | v0.1.1-next.4 |
since | v1.0.0 |
import { isBoolean } from "@commonly/reflect"
isBoolean(true) //-> true
isBoolean(false) //-> true
isBoolean(NaN) //-> false
Check if a given value is an Error.
value: unknown | Error | is a value to check |
returns: boolean
either true or false whether the value is an Error or not
package | @commonly/reflect |
version | v0.1.1-next.4 |
since | v1.0.0 |
import { isError } from "@commonly/reflect"
isError(new Error()) //-> true
isError(TypeError()) //-> true
isError(NaN) //-> false
Check if a given value is a function.
value: unknown | TFunction | is a value to check |
returns: boolean
either true or false whether the value is a function or not
package | @commonly/reflect |
version | v0.1.1-next.4 |
since | v1.0.0 |
import { isFunction } from "@commonly/reflect"
isFunction(Math.add) //-> true
isFunction(() => void 0)) //-> true
isFunction(Math.PI) //-> false
Check if a given value is a Map.
value: unknown | Map | is a value to check |
returns: boolean
either true or false whether the value is a Map or not
package | @commonly/reflect |
version | v0.1.1-next.4 |
since | v1.0.0 |
import { isMap } from "@commonly/reflect"
isMap(new Map()) //-> true
isMap(NaN) //-> false
Check if a given value is a Nil (either an undefined or a null).
value: unknown | Nil | is a value to check |
returns: boolean
either true or false whether the value is a Nil or not
package | @commonly/reflect |
version | v0.1.1-next.4 |
since | v1.0.0 |
import { isNil } from "@commonly/reflect"
isNil(undefined) //-> true
isNil(null) //-> true
isNil(NaN) //-> false
Check if a given value is a null.
value: unknown | null | is a value to check |
returns: boolean
either true or false whether the value is a null or not
package | @commonly/reflect |
version | v0.1.1-next.4 |
since | v1.0.0 |
import { isNull } from "@commonly/reflect"
isNull(null) //-> true
isNull(undefined) //-> false
Check if a given value is a number.
value: unknown | number | is a value to check |
returns: boolean
either true or false whether the value is a number or not
package | @commonly/reflect |
version | v0.1.1-next.4 |
since | v1.0.0 |
import { isNumber } from "@commonly/reflect"
isNumber(0) //-> true
isNumber(NaN) //-> true
isNumber(null) //-> false
Check if a given value is an Object.
value: unknown | | is a value to check |
returns: boolean
either true or false whether the value is an Object or not
package | @commonly/reflect |
version | v0.1.1-next.4 |
since | v1.0.0 |
import { isObject } from "@commonly/reflect"
isObject(new Object()) //-> true
isObject({}) //-> true
isObject(null) //-> false
isObject(undefined) //-> false
Check if a given value is a Primitive.
value: unknown | Primitive | is a value to check |
returns: boolean
either true or false whether the value is a Primitive or not
package | @commonly/reflect |
version | v0.1.1-next.4 |
since | v1.0.0 |
import { isPrimitive } from "@commonly/reflect"
isPrimitive(undefined) //-> true
isPrimitive(null) //-> true
isPrimitive(NaN) //-> true
isPrimitive([]) //-> false
Check if a given value is a Promise.
value: unknown | Promise | is a value to check |
returns: boolean
either true or false whether the value is a Promise or not
package | @commonly/reflect |
version | v0.1.1-next.4 |
since | v1.0.0 |
import { isPromise } from "@commonly/reflect"
isPromise(new Promise()) //-> true
isPromise(Promise.resolve()) //-> true
isPromise(NaN) //-> false
[Not yet documented]
value: TValue | Reduced |
returns: boolean
package | @commonly/reflect |
version | v0.1.1-next.4 |
since | v1.0.0 |
Check if a given value is a RegExp.
value: unknown | RegExp | is a value to check |
returns: boolean
either true or false whether the value is a RegExp or not
package | @commonly/reflect |
version | v0.1.1-next.4 |
since | v1.0.0 |
import { isRegExp } from "@commonly/reflect"
isRegExp(new RegExp("ab+c")) //-> true
isRegExp(/ab+c/) //-> true
isRegExp(NaN) //-> false
Check if a given value is a Set.
value: unknown | Set | is a value to check |
returns: boolean
either true or false whether the value is a Set or not
package | @commonly/reflect |
version | v0.1.1-next.4 |
since | v1.0.0 |
import { isSet } from "@commonly/reflect"
isSet(new Set()) //-> true
isSet(NaN) //-> false
Check if a given value is a string.
value: unknown | string | is a value to check |
returns: boolean
either true or false whether the value is a string or not
package | @commonly/reflect |
version | v0.1.1-next.4 |
since | v1.0.0 |
import { isString } from "@commonly/reflect"
isString("string") //-> true
isString(null) //-> false
Check if a given value is a symbol.
value: unknown | symbol | is a value to check |
returns: boolean
either true or false whether the value is a symbol or not
package | @commonly/reflect |
version | v0.1.1-next.4 |
since | v1.0.0 |
import { isSymbol } from "@commonly/reflect"
isSymbol(Symbol()) //-> true
isSymbol(NaN) //-> false
Check if a given value is an undefined.
value: unknown | undefined | is a value to check |
returns: boolean
either true or false whether the value is an undefined or not
package | @commonly/reflect |
version | v0.1.1-next.4 |
since | v1.0.0 |
import { isUndefined } from "@commonly/reflect"
isUndefined(undefined) //-> true
isUndefined(null) //-> false
Collection of transducing functions.
[Not yet documented]
mapper: Mapper | is a mapping function |
returns: Transducer
a transducing function
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
n: number |
returns: Transducer
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
predicate: Predicate |
returns: Transducer
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
predicate: Predicate |
returns: Transducer
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
predicate: Predicate | is a predicate function |
returns: Transducer
a transducer function
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
predicate: Predicate | is a predicate function |
returns: Transducer
a transducer function
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
mapper: Mapper | is a mapping function |
returns: Transducer
a transducing function
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
i: number |
returns: Transducer
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
n: number |
returns: Transducer
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
mapper: Mapper |
returns: Transducer
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
n: number |
returns: Transducer
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
start: number | |
end: number |
returns: Transducer
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
predicate: Predicate |
returns: Transducer
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
comparator: Comparator |
returns: Transducer
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
n: number |
returns: Transducer
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
[Not yet documented]
predicate: Predicate |
returns: Transducer
package | @commonly/transducer |
version | v0.2.0-next.55 |
since | v1.0.0 |
Collection of utility types.
The Comparator type represents a comparison function, which imposes a total ordering on enumerable lists.
package | @commonly/type |
version | v0.2.0-next.40 |
since | v1.0.0 |
The Function type represents the function's constructor.
package | @commonly/type |
version | v0.2.0-next.40 |
since | v1.0.0 |
The Identity type represents a function which takes a single value as an argument and returns that value, an identity function.
package | @commonly/type |
version | v0.2.0-next.40 |
since | v1.0.0 |
The Mapper type represents a function which always a single value as an argument and returns a value, a mapper function.
package | @commonly/type |
version | v0.2.0-next.40 |
since | v1.0.0 |
The Nil type represents a union of undefined and null.
package | @commonly/type |
version | v0.2.0-next.40 |
since | v1.0.0 |
The Predicate type represents a function which takes a single value as an argument and returns a boolean, a predicate function.
package | @commonly/type |
version | v0.2.0-next.40 |
since | v1.0.0 |
The Primitive type represents a union of primitive} data types. An {@link https://developer.mozilla.org/en-US/docs/Glossary/undefined.
package | @commonly/type |
version | v0.2.0-next.40 |
since | v1.0.0 |
[Not yet documented]
package | @commonly/type |
version | v0.2.0-next.40 |
since | v1.0.0 |
The Reducer type represents a function which takes an accumulator and a value and returns an updated accumulator.
package | @commonly/type |
version | v0.2.0-next.40 |
since | v1.0.0 |
[Not yet documented]
package | @commonly/type |
version | v0.2.0-next.40 |
since | v1.0.0 |