Docs
GitHub
Preparing search index...
The search index is not available
Mochila - v1.8.0
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
Mochila
NonReadonly
Type Alias NonReadonly<A>
Non
Readonly
<
A
>
:
{
-
readonly
[
K
in
keyof
A
]
:
A
[
K
]
}
Represents a type that removes the readonly modifier from all properties of a given object.
Type Parameters
A
extends
ReadonlyArray
<
unknown
>
|
UnknownRecord
Docs
GitHub
Mochila -
v1.8.0
LRUCache
Creates a Least Recently Used (LRU) cache.
Subscription
Creates a Subscription object that allows subscribing, unsubscribing, notifying and resetting subscribers.
add
Adds two numbers.
append
Appends a value to the end of a string or array.
assert
Is
Array
Asserts that the input is an array.
assert
Is
Boolean
Asserts that the input is a boolean.
assert
Is
Date
Asserts that the input is a Date object.
assert
Is
Function
Asserts that the given value is a function.
assert
Is
Non
Empty
Array
Asserts that the input is a non-empty array.
assert
Is
Non
Nullable
Asserts that a value is not null or undefined.
assert
Is
Nullable
Asserts that a value is either null or undefined.
assert
Is
Number
Asserts that the given value is a number.
assert
Is
Object
Asserts that the input is an object.
assert
Is
Plain
Object
Asserts that the input is a plain object.
assert
Is
String
Checks if the provided value is a string.
assert
Is
Tupleable
Asserts that the input is a tupleable array.
at
Returns the element at the specified position in the source array.
atW
Returns the element at the specified position in the source array.
capitalize
Capitalizes the first letter of a string.
capitalizeL
Capitalizes the first letter of a string.
cast
Array
Ensures that the returned value is an array.
chunkify
Returns an array of arrays, where each subarray contains a maximum of `chunkSize` elements from the input `source` array.
clamp
Clamps a number between a minimum and maximum value.
clone
Returns a non-deep copy of the provided value in the following way:
columnify
Takes an array and returns an array of arrays with a length of `columnsNumber`.
compact
Removes all nullable values from an array.
complement
Returns the complement of a function.
constant
Returns a function that always returns the provided value.
count
By
Counts the occurrences of each value in an array.
debounce
Debounces a function call, delaying its execution until a certain amount of time has passed without any new calls.
deep
Clone
Returns a deep copy of the provided value in the following way:
default
To
A function that receives a defaultValue and returns a new function that receives a value.
delete
At
Returns a new array with the element at the specified position removed.
divide
Curried function that takes two numbers and returns the first divided by the second.
divide
By
Curried function that takes two numbers and returns the second divided by the first.
ends
With
Checks if a value is the end of a source array or string.
equal
every
Checks if every element in an array passes a given predicate.
filter
Filters an array based on a predicate function.
filter
Values
Return a new array with all elements that are included in the given values.
find
Finds the first element in the source array that satisfies the provided predicate function.
find
Index
Finds the index of the first element in the source array that satisfies the provided predicate function.
find
Last
Finds the last element in the source array that satisfies the provided predicate function.
find
Last
Index
Finds the index of the last element in the source array that satisfies the provided predicate function.
first
Item
Returns the first item of an array.
flatten
Flattens a nested array into a single-dimensional array.
flow
Performs a series of function calls on a value, passing the result of each function call to the next.
group
By
Groups an array of items by a key returned by a mapping function.
has
Equal
Items
Determines if all items in the given array are equal.
has
Repeated
Items
Check if there is at least one repeated item in the source array.
identity
Returns the value passed in, preserving its type.
includes
Checks if a value is included in a source array or string.
includes
Items
Checks if all items in the searched array are included in the source array.
index
Of
Returns the index of the first occurrence of a value in an array.
is
Array
Determines if a value is an array.
is
Boolean
Determines if a value is a boolean.
is
Date
Determines if a value is a Date object.
is
Deep
Equal
Compares two items by value and returns true if they are deeply equal.
is
Function
Determines if a value is a function.
is
Non
Empty
Array
Determines if an array is not empty.
is
Non
Nullable
Determines if a value is not null nor undefined.
is
Nullable
Determines if a value is null or undefined.
is
Number
Determines if a value is a number.
is
Object
Determines if a value is an object.
is
Plain
Object
Determines if a value is a plain object.
is
Reg
Exp
Determines if a value is a RegExp.
is
String
Determines if a value is a string.
is
Tupleable
Determines if an array is tupleable (contains at least 2 items).
join
Joins the elements of an array into a string using a specified separator.
keys
Returns an array of string keys from an object, trying to preserve the type of the keys.
last
Index
Of
Returns the last index at which a given value can be found in an array.
last
Item
Returns the last item of an array.
length
Returns the length of a string or an array.
make
Is
Deep
Equal
Creates a function that checks if two values are deeply equal.
map
Applies a transformation function to each element of an array and returns a new array with the transformed elements.
map
Object
Maps an object's values to a new type using a transformation function.
map
Object
With
Maps an object's values to a new set of values using a transformation function.
map
With
Applies a transformation function over each element of an array and returns a new array with the transformed elements.
max
Item
Returns the maximum item from the given array.
min
Item
Returns the minimum item from the given array.
multiply
Curried function that multiplies two numbers.
none
Returns true if none of the elements in the array satisfy the predicate function.
noop
A function that does nothing.
omit
Returns a new object with the specified keys omitted.
parse
Position
Normalizes a position to a positive number.
partition
Partitions an array into two arrays based on a given predicate function.
path
Given a path in form of a string, returns a function that extracts the value at that path from an object.
pick
Creates a new object by picking specific properties from an existing object.
pipe
Composes multiple functions into a single function that can be called with multiple arguments.
prepend
Prepends a value to the start of a string or array.
prop
Returns the specified property of an object.
protect
Protects a function from throwing errors by returning a `Result` object.
reduce
Applies a reducer function to each element of the array, resulting in a single value.
reject
Rejects all the elements of an array that satisfy the condition specified in a callback function.
reject
Values
Filters the values in the source array that are not included in the values array.
replace
Replaces occurrences of a search value with a replace value in a string.
reverse
Immutable version of array reverse.
slice
Curriefied version of `Array.prototype.slice`
some
Returns true if at least one element in the array satisfies the provided testing function.
sort
Returns a new sorted array
sort
With
Returns a new sorted array, providing the sortFn as the first argument.
split
Splits a string into an array of substrings based on a specified separator.
starts
With
Checks if a value is the start of a source array or string.
throttle
Limits the rate at which a function can be called.
to
Lower
Case
Converts a string to lowercase returning LowerCase<S> as type
to
String
Returns a string representation of the input value trying to respect the string typing
to
StringL
Returns a string representation of the input value returning a wide string as type.
to
Upper
Case
Converts a string to uppercase returning Uppercase<S> as type
to
Upper
CaseL
Converts a string to uppercase returning string as type
unique
Returns a new array with unique values from the source array.
unique
Right
Returns a new array with all duplicate values removed starting from the end of the input array.
values
Returns an array of the values of a given object.
Absolute
Returns the absolute value of a number (removes the negative sign).
And
Type-level logical AND operation.
Any
Fn
Represents a function that takes any number of arguments and returns any value.
Assertion
Produces a function that asserts that the given argument is of type `R`
At
Returns the element at index `P` in `S`.
Bi
Readonly
Array
Represents an array of arrays of the given type.
Chunkify
Returns an array of chunks of length `N` from `S`.
Chunks
From
Extracts the type of the items in the given array type and returns an array of arrays
Columnify
Converts a tuple type into a tuple of tuples, where each tuple is a column of
Compact
Removes all `null` and `undefined` values from the given array type.
Complement
Represents the complement of a boolean type.
Constant
Represents a function that takes no arguments and returns `V`
Delete
At
Removes the element at index `N` from `S`.
Extract
Item
Filter
Values
Returns an array of values from `S` that are assignable to `V`.
Filterable
Represents a type that can be filtered.
Flatten
Flattens a nested array type.
If
Else
If `Cond` is `true`, return `Then`, otherwise return `Else`
If
Extends
Check if `A` is assignable to `B`
Is
Less
Than1
Checks if a number is zero or includes the negative sign.
Is
Negative
Checks if a number includes the negative sign.
Is
Non
Empty
Array
Determines if the given type is an array whose length is greater than zero.
Is
Positive
Checks if a number is positive.
Is
Tupleable
Determines if the given type is an array that contains at least 2 elements.
Is
Union
Check if `T` is a union type
Is
Wide
Check if `O` is a Wide type ( `W` extends from it)
Is
Wide
Boolean
Determines if the given type `B` is a wide boolean.
Is
Wide
Filterable
Checks if a type is a wide filterable.
Is
Wide
Number
Checks if a number is a wide number.
Is
Wide
String
Checks if a string type is a wide string.
Non
Empty
Array
A readonly array containing at least one element
Non
Readonly
Represents a type that removes the readonly modifier from all properties of a given object.
Or
Type alias that represents the logical OR operation between two boolean types.
Process
Filter
Values
Processes the values of `S` that are assignable to `V`.
Protect
If
Non
Empty
Array
Reject
Values
Returns an array of values from `S` that are not assignable to `V`.
Reverse
Returns the reverse of the given array type.
Stringifiable
Represents a type that can be converted to a string.
Sub
Type
Or
Return `A` if `A` is assignable to `B`, otherwise return `B`
To
String
Converts a value to a string, trying to preserve the narrow type.
Tupleable
A readonly array containing at least two elements
Unknown
Record
Represents an object with keys consisting of numbers or strings and unknown values.
Value
Of
Extracts the type of the values of an object.
With
Partial
Represents a type that adds the optional modifier to the keys passed.
With
Required
Represents a type that adds the required modifier to the keys passed.
Represents a type that removes the readonly modifier from all properties of a given object.