Skip to content

Helpers โ€‹

Transformers โ€‹

  • setToArray: Converts a Set to an array.
  • arrayToSet: Converts an array to a Set.
  • parseNumber: Parses the given value into a number.
  • parseBoolean: Parses the given value and returns a boolean representation.
  • objectKeys: Returns an array of keys from the given object.
  • objectValues: Returns an array of values from the given object.
  • objectEntries: Returns an array of entries from the given object.
  • objectToMap: Converts an object to a Map.
  • sortObjectsAlphabetically: Sorts an array of objects alphabetically based on a specified key.
  • sortObjectsNumerically: Sorts an array of objects numerically based on a specified key.
  • sortAlphabetically: Sorts an array of strings alphabetically, in ascending or descending order.
  • sortNumerically: Sorts an array of numbers in ascending or descending order.
  • mapValue: Maps the values of a specific key from an array of objects.
  • scrutinize: Filters an array based on a given predicate function.
  • doubleLoop: Executes a callback function for each item in an array of objects, where each object has an array property.
  • tripleLoop: Executes a triple loop over an array of objects and invokes a callback function for each iteration.
  • chunkMultiline: Splits a multiline string into an array of strings, where each string has a maximum length of maxLength.

For Maps โ€‹

  • mapValuesToArray: Converts the values of a Map to an array.
  • mapKeysToArray: Returns an array containing all the keys from a given Map.
  • mapEntriesToArray: Converts a Map object to an array of key-value pairs.
  • mapToObject: Converts a Map to an object.
  • setInMapIfNotExists: Sets a key-value pair in a Map if the key does not already exist.
  • returnAMergeWith: Merges two maps and returns a new map.
  • putArrayItemsInMap: Puts array items in a Map.
  • mergeMaps: Merges two maps into a new Map.
  • fromMapOfSetsToMapsOfArrays: Converts a Map of Sets to a Map of Arrays.
  • mapFromArray: Creates a Map from an array of items, using a key handler function to determine the keys.
  • mapFromArrayWithValues: Creates a new Map object from an array by applying a transformation function to each item.
  • mapOfArraysFromArray: Creates a Map of arrays from an input array, using a key handler function.
  • mergeMapsOfArrays: Merges two maps of arrays into a single map of arrays. The resulting map contains unique values from both input maps.

String processors โ€‹

  • capitalize: Converts first character of string literal type to uppercase.
  • uncapitalize: Converts first character of string literal type to lowercase.
  • kebabCase: Converts a string to kebab case.
  • pascalCase: Converts a string to pascal case.
  • snakeCase: Converts a string to snake case.
  • camelCase: Converts a string to camel case.
  • upper: Converts a string to uppercase.
  • lower: Converts a string to lowercase.
  • removeAll: Removes all occurrences of a target string from the input string.
  • replaceAll: Replaces all occurrences of a target string with a replacement string in a given string.
  • first: Returns the first element of a string after splitting it by a separator.
  • last: Returns the last part of a string after a specified separator.
  • removeExtension: Removes the file extension from a given string.
  • reverse: Reverses a string.
  • underscorePerSpace: Replaces all underscores (_) in the given text with spaces.
  • spacePerUnderScore: Replaces all spaces in the given text with underscores (_).
  • hyphenPerSpace: Replaces all hyphens (-) in the given text with spaces.
  • spacePerHyphen: Replaces all spaces in the given text with hyphens (-).

Casters โ€‹

  • isBoolean: Checks if a value is a boolean.
  • isString: Checks if the provided value is a string.
  • isChar: Checks if the provided value is a single character string.
  • isHTTP_URL: Checks if a given string is a valid HTTP URL.
  • isNotEmptyString: Checks if a string is not empty.
  • isNumber: Checks if the provided value is a number.
  • isObject: Checks if the given value is an object.
  • isEmptyObject: Checks if the given object is an empty object.
  • isDictOfStrings: Checks if the given object is a dictionary (object) where all values of type string.
  • isDictOfNumbers: Checks if the given object is a dictionary (object) with values of type number.
  • isDictOfBooleans: Checks if the given object is a dictionary (object) with values of type boolean.
  • isDictOfObjects: Checks if the given object is a dictionary (object) with values of type object.
  • isDictOfArrays: Checks if the given object is a dictionary (object) with values of type array.
  • isPrimitive: Checks if a value is a primitive type (string, number, boolean, or null).
  • isNonNullablePrimitive: Checks if a value is a primitive type (string, number, or boolean).
  • isMap: Checks if the provided value is an instance of Map.
  • isObjectKeyMap: Checks if the given map is a Map where the keys are objects.
  • isStringKeyMap: Checks if the provided value is a Map with string keys.
  • isNumberKeyMap: Checks if the provided value is a Map with number keys.
  • isStringOrNumberKeyMap: Checks if the provided value is a Map with string or number keys.
  • isArray: Checks if the provided value is an array.
  • isArrayOfNumbers: Checks if the given array is an array of numbers.
  • isArrayOfStrings: Checks if the given value is an array of strings.
  • isArrayOfObjects: Checks if the given array is an array of objects.
  • isArrayOfBooleans: Checks if the given array is an array of booleans.
  • isMatrix: Checks if the given array is a matrix. A matrix is defined as a two-dimensional array where each element is an array.

Promises โ€‹

  • reducePromisedItems: This function reduces promised items.
  • mergePromises: Merges an array of promises into a single promise that resolves to an array of values.
  • countPromises: Counts the resolved values of an array of promises and returns the sum.
  • awaitResolved: Waits for multiple promises to resolve and returns an array of resolved values.
  • awaitRejected: Returns an array of rejected reasons from an array of promises.
  • awaitClassified: Waits for multiple promises to settle and classifies the results into resolved and rejected arrays.

Other โ€‹

  • inferTypeOfArray: Infers the types of elements in an array, returning a list with the types.
  • sleep: Asynchronously pauses the execution for the specified amount of time.