@tempots/std
std package
Functions
Function |
Description |
---|---|
Checks if all elements in an array satisfy a given predicate. | |
Calculates the minimum difference between two angles in degrees. | |
Checks if any element in the array satisfies the given predicate. | |
Applies a series of operations to an array and returns the modified array. | |
Checks if two arrays are equal based on a custom equality function. | |
Calculates the difference operations between two arrays based on a key function. | |
Checks if an array has values. | |
Returns the first element of an array, or | |
Converts an IterableIterator to an array. | |
Returns a new array containing all elements of the input array except for the first element. | |
Returns the absolute value of a bigint. | |
Calculates the ceiling division of two BigInt numbers. | |
Compares two BigInt values and returns a number indicating their relative order. | |
Divides two BigInt numbers and returns the largest integer less than or equal to the quotient. | |
Calculates the greatest common divisor (GCD) of two BigInt numbers. | |
Checks if a given bigint is even. | |
Checks if a given bigint is negative. | |
Checks if a given bigint is odd. | |
Checks if a given bigint is equal to 1n. | |
Checks if a bigint is positive. | |
Checks if a given number is prime. | |
Checks if a given bigint is zero. | |
Calculates the least common multiple (LCM) of two BigInt numbers. | |
Returns the maximum of two BigInt values. | |
Returns the minimum of two BigInt values. | |
Finds the next prime number greater than the given number. | |
Calculates the power of a bigint number. | |
Returns the previous prime number less than the given number. Throws an error if there is no previous prime. | |
Replaces occurrances of | |
| |
Capitalize the first letter of every word in | |
Rounds a number up to the specified number of decimals. | |
Returns an array of | |
| |
Clamps a number to a specified range and returns an integer value. | |
Like clamp but you only pass one argument ( | |
It cleans up all the whitespaces in the passed | |
Compares two arrays based on their lengths and element values. | |
Compares two strings ignoring their case. | |
It returns the comparison value (an integer number) between two | |
It compares to string and it returns a negative number if | |
Concatenates multiple arrays into a single array. | |
| |
| |
| |
| |
Return the number of occurrences of | |
Creates a new array with the specified length and fills it with the provided value. | |
Curries a function from left to right. | |
| |
Decodes a base64 encoded string. | |
Checks if two values are equal by comparing their contents. | |
If present, it removes the first occurrence of | |
If present, it removes the | |
If present, it removes the | |
If present, it removes all the occurrences of | |
| |
Same as | |
Encodes a string to base64. | |
Filters the elements of an array based on a predicate function. | |
Same as | |
| |
Applies a mapping function to each element of an array and returns a new array containing the mapped values, excluding any | |
Filters out null and undefined values from an array. | |
Applies a mapping function to each element of an array and flattens the result. | |
Flattens a two-dimensional array into a one-dimensional array. | |
Rounds a number down to the specified number of decimals. | |
Applies a function to each element of an array, accumulating the result from left to right. | |
Applies a function to each element in an array. | |
Generates an array of values by applying a function to each index. | |
Generates an array of numbers in a specified range. | |
Works the same as | |
Returns the input value as is. | |
| |
| |
Interpolates values in a polar coordinate system looking for the narrowest delta angle. It can be either clock-wise or counter-clock-wise. | |
Interpolates values in a polar coordinate system always in counter-clock-wise direction. | |
Interpolates values in a polar coordinate system always in clock-wise direction. | |
Interpolates values in a polar coordinate system looking for the wideset delta angle. It can be either clock-wise or counter-clock-wise. | |
Checks if | |
| |
Checks if an array is empty. | |
Checks if a string contains any breaking whitespace characters. | |
| |
Checks if an object is empty. An object is considered empty if it has no own enumerable properties. | |
| |
Checks if the value is a JSON array. | |
Checks if the value is a JSON object. | |
Checks if the value is a JSON primitive. | |
Returns | |
Checks if the given value is an object. | |
Checks if the character at the specified position in a string is a whitespace character. | |
Returns | |
Joins an array of values into a string using a conjunction and separator. | |
Quotes a string for use in JavaScript code. If the string contains a newline character, it will be quoted using backticks. Otherwise, it will be quoted using single quotes ( | |
Checks if two values are loosely equal. | |
Convert first letter in | |
Pads a string on the left with a specified character until it reaches a specified length. If the string is already longer than the specified length, it is returned as is. | |
Applies a function to each element of an array and returns a new array with the results. | |
It maps a string character by character using | |
Map the function | |
Memoizes the result of a function and returns a new function that caches the result. The cached result is returned if available, otherwise the original function is called and the result is cached for future invocations. | |
Merges two objects together. | |
number numbers can sometime introduce tiny errors even for simple operations. | |
number numbers can sometime introduce tiny errors even for simple operations. | |
| |
Returns an array of entries (key-value pairs) from the given object. | |
Creates an object from an array of entries. | |
Returns an array of keys from the given object. | |
Returns an array of values from the given object. | |
Returns a quoted version of the input string. | |
Returns a random substring from the | |
Returns a random sampling of the specified length from the seed string. | |
Like | |
Assigns ranks to the elements in the array based on the provided compare function. The ranks are assigned in ascending order, with the lowest value receiving a rank of 0. If there are duplicate values, the rank of the duplicates can be incremented or not based on the | |
Removes all occurrences of an item from an array. | |
Removes all occurrences in an array that satisfy the given predicate. | |
Removes specified fields from an object and returns a new object without those fields. | |
Removes the first occurrence of an item from an array. | |
Removes the first occurrence in an array that satisfy the given predicate. | |
| |
Replaces all occurrances of | |
Returns a new string whose characters are in reverse order. | |
Computes the nth root ( | |
Rounds a number to the specified number of decimals. | |
Pads a string on the right with a specified character until it reaches a specified length. If the string is already longer than the specified length, it is returned as is. | |
Checks if two objects have the same keys. | |
| |
Sleep for a given number of milliseconds. | |
Converts a string in a quoted string. | |
Sorts an array in place using the provided compare function. | |
It only splits on the first occurrance of separator. | |
Splits a string into two parts based on the first occurrence of a specified substring. If the substring is found, returns an array with two elements: the part of the string before the substring and the part after the substring. If the substring is not found, returns an array with a single element: the original string. | |
Splits a string into two parts at the last occurrence of a specified substring. If the substring is found, the function returns an array with two elements: the part of the string before the substring and the part after the substring. If the substring is not found, the function returns an array with a single element, which is the original string. | |
Checks if two values are strictly equal. | |
| |
Checks if a string ends with a specified suffix. | |
Returns | |
Returns | |
Calculates the hash code for a given string. | |
Compares strings | |
Checks if a string starts with a specified substring. | |
Returns | |
It transforms a string into an | |
It transforms a string into an | |
| |
| |
| |
| |
Surrounds a string with the contents of | |
| |
Compares a string | |
Checks if a string ends with another string in a case-insensitive manner. | |
Compares a string | |
Checks if a string starts with another string in a case-insensitive manner. | |
Returns an array of | |
Converts a number to its hexadecimal representation. | |
| |
| |
| |
Removes a slice from | |
| |
Returns an array of distinct elements from the input array based on the provided predicate. | |
Returns an array containing only the distinct primitive values from the input array. | |
Convert first letter in | |
Calculates the widest angle difference between two angles. | |
Passed two boundaries values ( | |
Similar to | |
| |
Wraps a string into multiple lines based on the specified number of columns, indentation, and newline character. |
Interfaces
Interface |
Description |
---|---|
Represents a JSON object. |
Variables
Variable |
Description |
---|---|
A set of utility functions for working with | |
Constant value employed to see if two | |
Utility functions for working with | |
Utility functions for working with |
Type Aliases
Type Alias |
Description |
---|---|
Represents the different operations that can be performed on an array. | |
Represents a failure result. | |
Represents the result of an asynchronous operation that can be in one of the following states: - | |
Represents a successful result. | |
Represents a function that compares two values of type T and returns a number. The returned number indicates the relative order of the two values: - A negative number if | |
Represents a failure result. | |
Filters out elements from a tuple that are equal to the specified type. | |
Extracts the first argument type from a function type. | |
Represents a function that takes no arguments and returns a value of type | |
Represents a function that takes one argument of type | |
Represents a function that takes two arguments of types | |
Represents a function that takes three arguments of types A, B, and C, and returns a value of type R. | |
Represents a function that takes four arguments of types A, B, C, and D, and returns a value of type R. | |
Represents a function that takes five arguments of types A, B, C, D, and E, and returns a value of type R. | |
Represents a function that takes six arguments of types A, B, C, D, E, F and returns a value of type R. | |
Represents an identity type that preserves the properties of the original type. | |
Represents a key type that can be used to index any object. | |
Represents an invalid value with an associated error. | |
Represents an array of JSON values. | |
Represents a JSON primitive value. It can be a string, boolean, number, or Nothing (null or undefined). | |
Represents a JSON value, which can be a primitive, an object, or an array. | |
Represents a loading state in an asynchronous result. | |
Represents a type that can either hold a value of type T or be undefined. | |
Represents the type resulting from merging two types | |
Represents the state when a result has not been requested yet. | |
Represents a value that can be either | |
Creates a new type by making the specified key | |
Represents a primitive value that can be of type string, boolean, number, null, or undefined. | |
Represents a promise that resolves to a | |
Represents a promise that resolves to a | |
Creates a new type by making the specified key | |
Represents a result that can either be a success or a failure. | |
Splits a string literal type | |
Converts a string literal type | |
Represents a successful result. | |
Converts a tuple type to a union type. | |
Represents a valid result. | |
Represents a type that can either be |