object to assign.
additional source object.
Camelcase Converts string to camelcase.
the value to be transformed.
Capitalize Converts string to capitalize.
the value to be transformed.
Cast Type Attempts to cast to specified type.
the value to be cast.
the type to cast to.
optional default value to return on null.
Clone Performs deep cloning of objects.
object to be cloned.
performs quick shallow clone using JSON.
Contains Tests if array contains value.
the array to be inspected.
the value to check if is contained in array.
Contains Any Tests array check if contains value.
the array to be inspected.
array of values to compare.
Create is a convenience method that simply calls Object.create(). If no object is passed creates using null.
optional object to use with Object.create.
Decamelcase converts a camelcase string to --some-flag.
the value to de-camelize.
the separator char once decamelized.
Del Removes a property within the supplied object.
the object to inspect.
the dot notated key or array of keys.
when true original object NOT mutated.
Duplicates Counts the number of duplicates in an array.
the array to check for duplicates.
the value to match.
when true allows breaking at first duplicate.
Extend properties between target/source objects. This is NOT a deep copy.
NOTE: use Object.assign if available!!
primary target object.
additional source objects to merge with target.
Extend properties between target/source objects. This is NOT a deep copy.
NOTE: use Object.assign if available!!
when true only extends top level.
primary target object.
additional source objects to merge with target.
First Simple method to get first element just a little less typing.
the array to get first element from.
Flatten Takes multiple arrays and flattens to single array. NOTE: this will NOT work for empty nested arrays but will work for 90 plus % of cases.
From Epoch Converts to a Date from an epoch.
the epoch value to convert to date.
From JSON Simple wrapper to parse json.
the string to be parsed.
a default fallback value on failed parse.
Get Gets a property within the supplied object.
the object to inspect.
the dot notated key or array of keys.
a default value to set if not exists.
Get Type Gets the type of the provided value.
{} literal object true boolean boolean 'true' boolean string 25 integer number 25.5 float number new Date() date date '01/01/2017' date string RegExp regexp regexp '/^test/g' regexp string null null null function() {} function function [] array array 'some string' string string
the object to get type from.
when true returns the strict type see examples.
the optional string name for unknown types.
Has Checks if property exists in object.
the object to be inpsected.
the key to be found.
Includes Tests if array contains value.
the array to be inspected.
the value to check if is contained in array.
Includes Any Tests if array contains any value.
the array to be inspected.
the array to compare.
Is Array Check if value is an array.
the value to test if is array.
Is Boolean
Is Browser Checks if script is running in browser.
an optional key to inspect on process.env.
Is Buffer Checks if value is an instanceof Buffer.
the value to inspect as Buffer.
Is Date Inspects if is Date, parses date string when parse flag is set to true.
the value to inspect/test if is Date.
Indicates if app is in debug mode.
a manual flag to denote debugging.
Is Directory Checks if value is path to directory in filesytem. NODE ONLY!
the value to inspect as file.
Is Docker Checks if running inside Docker container.
Is Empty Test if value provided is empty. Note 0 would be empty.
value to be inspected.
Is Equal Tests if two values are equal. Does not support "deep equal".
the value to be compared.
the comparer value.
when true == is used instead of ===.
Is Error Checks if value is an error. Allows custom error property which can be useful in certain scenarios to flag an object as an error.
the value/object to be inspected.
a custom property to check if exists indicating is error.
Is File Checks if value is path to file in filesytem. NODE ONLY!
the value to inspect as file.
Is Float Checks if number is float.
the value to inspect.
Is Function Check if object provided is function.
test object provided is function.
Is Infinite Checks if value is Infinity.
the value to test if infinite.
Indicates if app is started with --inspect flag.
a manual flag to denote inspecting.
Is Integer Checks if numbers is an integer.
the value to inspect.
Is Moment Inspects object to detect if is moment.
the object to be inspected.
Is Node Tests if is NodeJS.
Is Null Checks if value is null.
the object to inspect for null.
Check if value provided is number.
the value to be tested.
Is Object Checks if value is an object.
the value to inspect.
Is Plain Object Inspects value checking if is object literal.
the value to inspect
Is Promise Checks if value is a Promise.
the value to inspect.
optional constructor name for promise defaults to Promise.
Is Reg Expression Tests if object is regular expression.
the value to inspect as RegExp.
Is Root If Node checks if is running under sudo.
Is String Inspect value provided testing if is string.
the value to be tested.
Is Symbol Checks if value is of type Symbol.
the value to inspect.
Is Truthy Checks if value is truthy e.g. not false, 0, null, undefined, empty.
Strings such as 'false', '0', '-' or 'no' will return true. If NOT desired call toBoolean on the value then pass to isTruthy.
the value to inspect.
Is Type Tests if object is instanceof provided Type.
the value to inspect.
the instance type to match.
Is Undefined Tests if value is undefined.
the value to inspect
Checks if is undefined or null value.
the value to inspect.
Is Unique Tests if the value is unique in the collection.
the array to be inspected.
the value to be matched.
Is Value Ensures is of some value, e.g. not null not undefined not isNaN & not Infinite.
the value to inspect.
Is Windows Returns boolean if node is running in Windows.
Keys Takes an object then returns keys in array.
the object to parse keys.
Last Simple method to get last element.
the array to get last element.
Lowercase Converts string to lowercase.
the value to be transformed.
Noop
Noop If If function provided return no operation funciton.
optional function.
Omits characters or words from strings, removes trailing whitespace before punctuation and also double spaces.
the string to omit chars from.
the characters or words to be omitted.
Omits a value from an array.
the array to be filtered.
the elements to be removed.
Omits properties from an object, supports dot notation nested removals.
the object to remove properties from.
the properties to be removed.
when true object is first cloned to not mutated source.
Orders arrays of objects by property, falls back to .sort() if not fields are specified.
the collection to be sorted.
an array of field names or comparator field objects.
Pad Left Pads a string on the left.
the string to be padded.
the length to pad.
an offset number or string to be counted.
the character to pad with.
Pad Right Pads a string to the right.
the string to be padded.
the length to pad.
an offset value to add.
the character to pad with.
Pad Values
an offset value to add.
the character to pad with.
Picks values from object by property name.
the object to pick from.
the properties to be picked.
Pop Pops/removes last element in array.
the array to pop value from.
Push Non mutating way to push to an array.
the array to push items to.
the items to be added.
Put a value to key. If the value is not currently an array it converts.
the object to push value to.
the key or array of keys to be joined as dot notation.
the value to be pushed.
when true update in immutable mode.
Reverse Reverses arrays, strings or objects. Only numbers, strings or booleans are supported when reverse mapping objects.
the object to reverse.
Set Sets a value on an object using dot notation or url path.
the object to set the value on.
the property used for setting the value.
when true the original object is NOT mutated.
Shift Shifts/removes first element in array. As this is a non-mutating method returns an object with new array and shifted value.
the array to shift value from.
Slugify Slugifies string.
the value to be transformed.
Splice Non mutating way of splicing an array.
the array to be spliced.
the starting index (default: 0)
the count to be spliced (default: 1)
additional items to be concatenated.
Split Splits a string at character. Default possible chars to match: ['/', '.', ',', ';', '|'] Note accepts string[] to simplify external methods that call split In this case will simply return the array.
the string to be split.
Titlecase Converts string to titlecase.
This fine script refactored from:
the value to be transformed.
when true words like and, a, but, for are also titlecased.
To Array Converts value to array with optional default value.
the value to convert to array.
optional default value on null or error.
Converts object to array where a key will be inserted into the object as $id: 'your defined id'.
the value to convert to array.
optional id for converting object to an array.
optional default value on null or error.
To Boolean Converts value if not boolean to boolean. Will convert 'true', '1', 'yes' or '+' to true.
the value to inspect.
optional default value on null.
To Date Converts value to date using Date.parse when string. Optionally you can pass a format object containing Intl.DateFormatOptions and locales. You may also pass the timezone ONLY as a string. In this case locale en-US is assumed.
the value to be converted to date.
date locale format options.
a default date when null.
To Default Returns a default value when provided if primary value is null or undefined. If neither then null is returned.
the value to return if defined.
an optional default value to be returned.
To Epoch Converts a Date type to an epoch.
the date value to convert.
optional default value when null.
To Float Converts value to a float.
the value to convert to float.
To Integer Convert value to integer.
the value to convert to integer.
optional default value on null or error.
To JSON Simple wrapper to strinigy using JSON.
the object to be stringified.
an integer or true for tabs in JSON.
optional default value on null.
To Number Converts value to number.
the value to convert to number.
optional default value on null.
To Regular Expression Attempts to convert to a regular expression from a string.
the value to convert to RegExp.
optional express as default on null.
To String When not null or undefined calls to string method on object.
the value to convert to string.
optional default value on null.
To Unnested Takes a nested object and flattens it to a single level safely. To disable key prefixing set prefix to false.
when NOT false parent key is prefixed to children.
optional default value on null.
To Window Adds key to window object if is browser.
the key or object to add to the window object.
the corresponding value to add to window object.
string or array of keys to exclude.
Try Require Tries to require a module returns null if cannot require or empty object.
the name of module to try and require.
optional default value on null.
used internally by tryRootRequire to require root modules.
Try Root Require Tries to require module relative from root module.
the name of the module to try and require.
the default value if null.
Try Wrap Generic helper for calling try catch on a method. If a default method is provided it will return in on error otherwise it will return null.
the parse method to be called in try/parse block.
arguments to pass to above method.
Unshift Unshifts a value to an array in a non mutable way.
the array to be unshifted.
Uppercase Converts string to uppercase.
the value to be transformed.
UUID Generates a UUID.
Generated using TypeDoc
Uses Object.assign if available or falls back to polyfill.