Encrypts or decrypts a given string using the Caesar cipher.
The string to encrypt or decrypt.
The amount of characters to shift.
Whether to decrypt or encrypt.
The encrypted or decrypted string.
Converts an array of objects to a comma-separated values (CSV) string that contains only the columns specified.
The array of objects to convert.
The columns to include in the CSV string.
The delimiter to use between columns.
The CSV string.
Checks if all elements in an array are equal.
The array to check.
True if all elements are equal, false otherwise.
Checks if all elements in an array are unique.
The array to check.
True if all elements are unique, false otherwise.
Converts a 2D array to a comma-separated values (CSV) string.
The array to convert.
The delimiter to use.
The CSV string.
Removes falsy values from an array.
The array to compact.
The compacted array.
Counts the occurrences of a value in an array.
The array to search.
The value to search for.
The number of occurrences of the value in the array.
Returns every nth
element in an array.
The array to process.
The nth
element to return.
The nth
element in the array.
Generates an array with the given amount of items, using the given function.
The amount of items to generate.
The function to use to generate the items.
The generated array.
Checks if there are duplicate values in a flat array.
The array to check.
True if there are duplicate values, false otherwise.
Returns the head of an array.
The array to get the head of.
The head of the array.
Checks if all the elements in values
are included in arr
.
The array to check.
The values to check for.
true
if all the elements in values
are included in arr
.
Checks if at least one element of values
is included in arr
.
The array to check.
The values to check for.
true
if at least one value is included in arr
, otherwise false
.
Returns all the elements of an array except the last one.
The array to process.
The array with the last element removed.
Initializes a 2D array of given width and height and value.
Width of the array.
Height of the array.
Value to initialize the array with.
A 2D array of given width and height and value.
Initializes and fills an array with the specified values.
The length of the array.
The value to fill the array with.
The array.
Returns the elements that exist in both arrays, filtering duplicate values.
First array.
Second array.
An array of elements in both a
and b
.
Checks if a numeric array is sorted.
The array to check.
1
if the array is ascending order, -1
if the array is descending order, 0
otherwise.
Returns the last element in an array.
The array to query.
The last element in the array.
Returns the nth element of an array.
The array to get the element from.
The index of the element to get.
The nth element of the array.
Gets a random element from an array.
The array to sample from.
A random element from the array.
Returns an array of elements that appear in both arrays.
The first array.
The second array.
An array of elements that appear in both arrays.
Finds the lowest index at which a value should be inserted into an array in order to maintain its sorting order.
The sorted array to inspect.
The value to evaluate.
The lowest index at which n
should be inserted into arr
in order to maintain the sort order.
Finds the highest index at which a value should be inserted into an array in order to maintain its sort order.
The array to inspect.
The value to evaluate.
Returns the index at which value should be inserted into array in order to maintain its sort order.
Checks if the first iterable is a subset of the second one, excluding duplicate values.
The first iterable.
The second iterable.
true
if the first iterable is a subset of the second one, excluding duplicate values.
Checks if the first iterable is a superset of the second one, excluding duplicate values.
The first iterable.
The second iterable.
true
if the first iterable is a superset of the second one, excluding duplicate values.
Returns all elements in an array except for the first one.
The array to return the tail of.
The tail of the array.
Returns every element that exists in any of the two arrays at least once.
The first array.
The second array.
The union of the two arrays.
Finds all unique values in an array.
The array to find unique values in.
An array of unique values.
Filters out the elements of an array that have one of the specified values.
The array to filter.
The values to exclude.
The filtered array.
Calculates the date of n days from the given date, returning its string representation.
The date to add days to.
The number of days to add.
The date of n days from the given date, as a string.
Calculates the date of n
minutes from the given date, returning its string representation.
The date to add minutes to.
The number of minutes to add.
The date of n
minutes from the given date, as a string.
Calculates the date after adding the given number of business days.
The date to start with.
The number of business days to add.
The new date.
Counts the weekdays between two dates.
The start date.
The end date.
The number of weekdays between the two dates.
Creates a generator, that generates all dates in the given range using the given step.
The start date of the range.
The end date of the range.
The step.
The generator.
Gets the name of the weekday from a Date object.
The Date object.
The locale to use.
The name of the weekday.
Gets the day of the year (number in the range 1-366) from a Date
object.
The Date
object to get the day of the year from.
The day of the year.
Calculates the date of n
days ago from today as a string representation.
The number of days ago.
The date of n
days ago as a string representation.
Calculates the date of n days from today as a string representation.
The number of days from today.
The date of n days from today as a string representation.
Gets the number of days in the given month
of the specified year
.
The year.
The month.
The number of days in the month.
Returns the human-readable format of the given number of milliseconds.
The number of milliseconds.
The human-readable format of the given number of milliseconds.
Returns the ISO format of the given number of seconds.
The number of seconds.
The ISO format of the given number of seconds.
Creates a Date
object from a Unix timestamp.
The Unix timestamp.
The Date
object.
Returns a string of the form HH:MM:SS
from a Date
object.
The Date
object to get the time from.
The time as a string.
Calculates the difference (in days) between two dates.
The first date.
The second date.
The difference (in days) between the two dates.
Calculates the difference (in hours) between two dates.
The first date.
The second date.
The difference (in hours) between the two dates.
Converts an integer to a suffixed string, adding am
or pm
based on its value.
The number to convert.
The suffixed string.
Calculates the difference (in minutes) between two dates.
The first date.
The second date.
The difference (in minutes) between the two dates.
Calculates the difference (in months) between two dates.
The initial date.
The final date.
The difference (in months) between the two dates.
Calculates the difference (in seconds) between two dates.
The first date.
The second date.
The difference (in seconds) between the two dates.
Gets the Unix timestamp from a Date
object.
The Date
object to get the timestamp from.
The Unix timestamp.
Checks if a date is after another date.
The first date to compare.
The second date to compare.
true
if dateA
is after dateB
, false
otherwise.
Checks if a date is before another date.
The first date to compare.
The second date to compare.
true
if dateA
is before dateB
, false
otherwise.
Checks if a date is between two other dates.
The start date.
The end date.
The date to check.
True if the date is between the start and end dates.
Checks if a valid date object can be created from the given values.
the value to check
true if the date is valid, false otherwise
Checks if the given string is valid in the simplified extended ISO format (ISO 8601).
The string to check.
True if the string is valid, false otherwise.
Checks if the given year
is a leap year.
The year to check.
true
if the given year
is a leap year, otherwise false
.
Checks if a date is the same as another date.
The first date to check.
The second date to check.
True if the dates are the same, false otherwise.
Checks if the given date is a weekday.
The date to check.
True if the given date is a weekday, false otherwise.
Checks if the given date is a weekend.
The date to check.
True if the given date is a weekend, false otherwise.
Returns the string representation of the last date in the given date's month.
The date to get the last date of.
The last date in the given date's month.
Returns the maximum of the given dates.
The dates to compare.
The maximum date.
Returns the minimum of the given dates.
The dates to compare.
The minimum date.
Returns the quarter and year to which the supplied date belongs to.
The date to check.
The quarter and year to which the supplied date belongs to.
Converts a date to extended ISO format (ISO 8601), including timezone offset.
Date to convert.
Extended ISO format string.
Results in a string representation of tomorrow's date.
Tomorrow's date.
Returns the zero-indexed week of the year that a date corresponds to.
The date to get the week of.
The week of the year.
Results in a string representation of yesterday's date.
Determines if the current runtime environment is a browser so that front-end modules can run on the server (Node) without throwing errors.
Determines if the current runtime environment is Node.js.
Creates a pub/sub (publish–subscribe) event hub with emit
, on
, and off
methods.
EventHub
Customizes a coalesce function that returns the first argument which is true based on the given validator.
A validator function that returns true if the argument is valid.
A coalesce function that returns the first argument which is true based on the given validator.
Changes a function that accepts an array into a variadic function.
The function to convert.
A variadic function.
Checks if at least one function returns true
for a given set of arguments.
The functions to check.
The arguments to check.
true
if at least one function returns true
for the given arguments.
Negates a predicate function.
The predicate function to negate.
A negated predicate function.
Measures the time it takes for a function to execute.
The function to measure.
The result of the function.
Creates a function that accepts up to one argument, ignoring any additional arguments.
The function to wrap.
A function that will only accept one argument.
Returns a function that takes one argument and runs a callback if it's truthy or returns it if falsy.
A predicate function.
A callback function to run if the predicate is truthy.
A function that takes one argument and runs a callback if it's truthy or returns it if falsy.
Checks if two numbers are approximately equal to each other.
First number.
Second number.
Tolerance.
True if the numbers are approximately equal, false otherwise.
Calculates the average of two or more numbers.
The numbers to average.
The average of the numbers.
Clamps num within the inclusive range specified by the boundary values a and b.
The number to clamp.
The first boundary value.
The second boundary value.
The clamped number.
Copy sign to number Returns the absolute value of the first number, but the sign of the second.
The number to take the absolute value of.
The sign of the number.
The absolute value of the first number, but the sign of the second.
Converts an angle from degrees to radians.
The angle in degrees.
The angle in radians.
Calculates the distance between two points.
The x coordinate of the first point.
The y coordinate of the first point.
The x coordinate of the second point.
The y coordinate of the second point.
The distance between the two points.
Checks if a number has any decimals digits
number to check
true if the number has decimals
Checks if the given number falls within the given range.
The number to check.
The start of the range.
The end of the range.
true
if the number is within the range, otherwise false
.
Checks if the first numeric argument is divisible by the second one.
The dividend.
The divisor.
True if the dividend is divisible by the divisor, false otherwise.
Checks if the given number is even.
The number to check.
True if the number is even, false otherwise.
Checks if the given value is equal to negative zero (-0
).
The value to check.
true
if the value is negative zero, otherwise false
.
Checks if the given number is odd.
The number to check.
True if the number is odd, false otherwise.
Checks if the given number is a power of 10.
The number to check.
True if the number is a power of 10, false otherwise.
Checks if the given number is a power of 2.
The number to check.
True if the number is a power of 2, false otherwise.
Checks if the provided integer is a prime number.
The number to check.
True if the number is prime, false otherwise.
Calculates the logarithm of the given number in the given base.
The number.
The base.
The logarithm of the given number in the given base.
Calculates the median of an array of numbers.
The array of numbers.
The median of the array.
Calculates the nth root of a given number.
The number for which to calculate the nth root.
The root.
The nth root of x.
Calculates the product of two or more numbers/arrays.
The array of numbers to multiply.
The product of all the numbers in the array.
Converts an angle from radians to degrees.
The angle in radians.
The angle in degrees.
Rounds a number to a specified amount of digits.
The number to round.
The amount of decimals to round to.
The rounded number.
Calculates the sum of two or more numbers/arrays.
The array of numbers to sum.
The sum of the numbers in the array.
Sums all the numbers between 1
and n
.
The number to sum up to.
The sum of all the numbers between 1
and n
.
Converts a number to a decimal mark formatted string.
number to convert
decimal mark formatted string
Number to fixed-point notation without trailing zeros
number to convert
number of digits to show
fixed-point notation
Converts a value to a safe integer.
The value to convert.
A safe integer if the value is a number, otherwise NaN
.
Checks if the given value is a number.
The value to check.
true
if the value is a number, false
otherwise.
Creates a function that will invoke a predicate function for the specified property on a given object.
The predicate function that will be invoked.
The property to check.
A function that will invoke the predicate function for the specified property on a given object.
Deeply merges two objects, using a function to handle keys present in both.
The first object.
The second object.
The function to use to handle keys present in both objects.
The merged object.
Performs a deep comparison between two values to determine if they are equivalent.
The first value to compare.
The second value to compare.
true
if the values are equivalent, otherwise false
.
Retrieves a set of properties indicated by the given selectors from an object.
The object to retrieve the properties from.
The selectors to retrieve the properties from.
The retrieved properties.
Checks if an object is deeply frozen.
The object to check.
Whether the object is deeply frozen.
Checks if two URLs are on the same origin.
The origin to compare to.
The destination to compare to.
true
if the origins are the same, false
otherwise.
Compares two objects to determine if the first one contains equivalent property values to the second one.
The object to compare.
The source object to compare against.
true
if the objects are equivalent, otherwise false
.
Creates an array of key-value pair arrays from an object.
The object to convert to pairs.
An array of key-value pair arrays.
Generates an object from the given query string or URL.
The URL to parse.
The object.
Creates a shallow clone of an object.
The object to clone.
A shallow clone of the object.
Gets the size of an array, object or string.
The value to get the size of.
The size of the value.
Converts a comma-separated values (CSV) string to a 2D array.
The CSV string.
The delimiter used in the CSV string.
Whether to omit the first row of the CSV string.
The 2D array.
Converts a comma-separated values (CSV) string to a 2D array of objects. The first row of the string is used as the title row.
The CSV string.
The delimiter used in the CSV string.
A 2D array of objects.
Converts the values of RGB components to a hexadecimal color code.
The red component.
The green component.
The blue component.
The hexadecimal color code.
Joins all given URL segments together, then normalizes the resulting URL.
The URL segments to join.
The joined URL.
Capitalizes the first letter of a string.
Whether to lowercase the rest of the string.
The capitalized string.
Capitalizes the first letter of every word in a string.
The string to capitalize.
The capitalized string.
Changes the lightness value of an hsl()
color string.
The amount to change the lightness by.
The hsl()
color string to change.
The changed hsl()
color string.
Adds special characters to text to print in color in the console (combined with console.log()
).
The text to colorize.
The colorized text.
Compacts whitespaces in a string.
The string to compact.
The compacted string.
Checks if the given string contains any whitespace characters.
The string to check.
true
if the string contains any whitespace characters, otherwise false
.
Counts the occurrences of a substring in a given string.
The string to search.
The substring to search for.
The number of occurrences of the substring in the string.
Escapes a string for use in HTML.
The string to escape.
The escaped string.
Escapes a string to use in a regular expression.
The string to escape.
The escaped string.
Convert tabs to spaces, where each tab corresponds to count
spaces.
The string to convert.
The number of spaces to expand each tab to.
The converted string.
Extends a 3-digit color code to a 6-digit color code.
The 3-digit color code.
The 6-digit color code.
Formats a number using the local number format order.
The number to format.
The formatted number.
Converts a string from camelcase.
The string to convert.
The separator to use.
The converted string.
Gets the current URL without any parameters or fragment identifiers.
The URL to parse.
The current URL without any parameters or fragment identifiers.
Creates an object containing the parameters of the current URL.
The URL to parse.
An object containing the parameters of the current URL.
Indents each line in the provided string.
The string to indent.
The number of spaces to indent each line.
The indentation character.
The indented string.
Finds all the indexes of a substring in a given string.
The string to search in.
The substring to search for.
An array of indexes of the substring in the string.
Checks if the given string is an absolute URL.
The string to check.
true
if the string is an absolute URL, false
otherwise.
Checks if a string contains only alpha characters.
String to check
True if str is alphanumeric, false otherwise
Checks if a string contains only alphanumeric characters.
The string to check.
True if the string contains only alphanumeric characters, false otherwise.
Checks if a string is lower case.
String to check.
Returns true if the string is lower case, false otherwise.
Checks if a string is upper case.
String to check.
Returns true if the string is upper case, false otherwise.
Creates a new string with the results of calling a provided function on every character in the given string.
The string to map.
The function to call for each character.
The new string.
用指定的掩码字符替换除最后 num 个字符之外的所有字符
待替换的数字
最后保留的字符数
掩码字符
替换后的字符串
Normalizes line endings in a string.
The string to normalize.
The normalized string.
The normalized string.
Pads a string on both sides with the specified character, if it's shorter than the specified length
.
The string to pad.
The length of the resulting string.
The character to pad with.
The padded string.
用零向左填充指定长度的数字
number to pad
length of the resulting string
padded number
Parses an HTTP Cookie header string, returning an object of all cookie name-value pairs.
The cookie header string to parse.
An object of cookie name-value pairs.
Generates a random string with the specified length.
The length of the string to generate.
The random string.
Removes accents from strings.
The string to remove accents from.
The string without accents.
Removes non-printable ASCII characters.
String to remove non-printable ASCII characters from.
String with non-printable ASCII characters removed.
Returns a string with whitespaces removed.
The string to remove whitespaces from.
The string with whitespaces removed.
Replaces the last occurence of a pattern in a string.
The string to search.
The pattern to search for.
The string to replace the pattern with.
The resulting string.
Serializes a cookie name-value pair into a Set-Cookie header string.
The cookie name.
The cookie value.
The Set-Cookie header string.
Converts a string to a URL-friendly slug.
The string to convert.
The slugified string.
Splits a multiline string into an array of lines.
The string to split.
The array of lines.
Removes HTML/XML tags from string.
string to remove tags from
string without tags
Creates a string with uppercase characters converted to lowercase and vice versa.
The string to convert.
The converted string.
Converts a string to camelcase.
String to convert.
Camelcased string.
Converts a string to an array of characters.
The string to convert.
An array of characters.
Converts an hsl()
color string to an array of values.
The hsl()
color string to convert.
The HSL values.
Converts an hsl()
color string to an object with the values of each color.
The hsl()
color string to convert.
An object with the values of each color.
Converts a string to pascal case.
The string to convert.
The string in pascal case.
Converts an rgb()
color string to an array of values.
The rgb()
color string to convert.
The RGB values.
Converts an rgb()
color string to an object with the values of each color.
The rgb()
color string to convert.
An object with the values of each color.
Converts a string to snake case.
The string to convert.
The snake cased string.
Converts a string to title case.
The string to convert.
The converted string.
Truncates a string up to a specified length.
The string to truncate.
The maximum length of the string.
The truncated string.
Truncates a string up to specified length, respecting whitespace when possible.
The string to truncate.
The maximum length of the string.
The string to append to the end of the truncated string.
The truncated string.
Unescapes escaped HTML characters.
The string to unescape.
The unescaped string.
Wraps a string to a given number of characters using a string break character.
The string to wrap.
The maximum number of characters per line.
The string break character.
The wrapped string.
Casts the provided value as an array if it's not one.
The value to cast as an array.
The value as an array.
Clones a regular expression.
The regular expression to clone.
The cloned regular expression.
Returns the first defined, non-null argument.
The arguments to check.
The first defined, non-null argument.
Returns the native type of a value.
The value to get the type of.
The native type of the value.
Checks if the provided value is of the specified type.
The type to check against.
The value to check.
True if the value is of the specified type, false otherwise.
Checks if the provided argument is array-like (i.e. is iterable).
The object to check.
True if the object is array-like, false otherwise.
Checks if the given argument is an async function.
The value to check.
true
if the given argument is an async function; otherwise, false
.
Checks if the given argument is a native boolean element.
The value to check.
If the given argument is a native boolean element.
Checks if the a value is an empty object/collection, has no enumerable properties or is any type that is not considered a collection.
The value to check.
True if the value is an empty object/collection, false otherwise.
Checks if the given argument is a function.
The value to check.
Returns true if the value is an object, false otherwise.
Checks if the given argument is a generator function.
The value to check.
true
if the given argument is a generator function; otherwise, false
.
检查指定的值是否为 null 或 undefined
要检查的值
如果值为null或undefined,则返回true,否则返回false
检查指定的值是否为null
要检查的值
如果值为null,则返回true
Checks if the given argument is a number.
The value to check.
True if the given argument is a number, false otherwise.
Checks if the passed value is an object or not.
The value to check.
Returns true when the passed value is an object, false otherwise.
Checks if a value is object-like.
The value to check.
Returns true
if value
is object-like, else false
.
Checks if the provided value is an object created by the Object constructor.
The value to check.
Returns true if value is an object created by the Object constructor, else false.
Checks if the passed value is primitive or not.
The value to check.
true
if the value is primitive, false
otherwise.
Checks if an object looks like a Promise
.
The object to check.
If value
looks like a Promise.
Checks if the given argument is a string. Only works for string primitives.
The value to check.
True if the value is a string, false otherwise.
检查给定的参数是否是symbol
要检查的值
如果是symbol则返回true,否则返回false
检查指定的值是否为undefined
要检查的值
如果值为undefined,则返回true
Checks if the provided string is a valid JSON.
The value to check.
true
if the string is a valid JSON, false
otherwise.
Object type representing latitude and longitude