is the input string to convert.
string as camel case.
is the input string to convert.
string as class case.
Clears the default value of a database object.
''
to single quote '
clearDefaultValue("'No ''value'' given'"); // "No value 'given'"
is the default for a database object.
default value to be used in a template.
is the input string to convert.
string as dash case.
Returns given the given database object name as a class name.
is the object to get the name as a class name.
is whether to include schema name.
Returns column length, precision and scale ready to be used in templates.
columnTypeModifier(price); // (10,4)
columnTypeModifier(name); // (20)
is the column to get details.
modifier string.
Wraps the given string with double quotes.
plural("Some "example" text"); // "some \"example\" text"
is the input string to wrap with double quotes.
string with quotes.
Completes given input's length using with given character (by default space). It may be used to align strings in JSDoc etc.
completeWithChar("member", "10"); // "member "
completeWithChar("member", "10", "-"); // "member----"
is the input to complete length of.
is the length of the finel string.
is the character to be used for filling.
Converts text to natural language.
human("message_properties"); // "Message properties"
human("message_properties", true); // "message properties"
is the input string to convert.
is whther to use small letter in first word.
string in human readable form.
Converts the given input's first letter to the lower case.
plural("User_name"); // User_name
is the input string to convert.
string with lower first case.
Adds given prefix each of the lines of given text.
linePrefix(`
Text line 1
Text line 2
`, "// ");
// Text line 1
// Text line 2
is the input string.
is the prefix to add each of the lines.
Returns an attribute of each objects as a CSV (comma separated values)
const objects = [{ name: "a" }, { name: "b" }, { name: "c" }]
listAttribute(objects, "name"); // a, b, c
listAttribute(objects, "name", { quote: "json" }); // "a", "b", "c"
listAttribute(objects, "name", { quote: "single" }); // 'a', 'b', 'c'
listAttribute(objects, "name", { quote: "json", wrap: "[]" }); // ["a", "b", "c"]
listAttribute(objects, "name", { quote: "json", wrap: "[]" }); // "a"
are the array of objects to get attribute of.
is the attribute to get for each object.
are the options.
is the character to join list.
is whether to add quotes around attributes.
is the characters to wrap the list if length is greater than 1.
the list as a string.
Cuts the text after given number of characters.
maxLength("some example text", 7); // "some ex...";
is the text to shorten.
is the maximum length allowed.
cut text
Pads given string's end with given padding string to complete its length to count.
is the input string to convert.
is the total length of the result string.
is the string to pad with.
the string padded with padding string.
is the input string to convert.
string as pascal case.
is the input string to convert.
string in plural form.
is the input string to wrap with quotes.
string with quotes.
If given data is a multi line string replaces new lines with escape characters. May be used to prevent JS multi line errors.
is the input to convert.
the string with escape characters.
Wraps the given string with single quotes.
plural("Some 'example' text"); // 'some \'example\' text'
is the input string to wrap with single quotes.
string with quotes.
is the input string to convert.
string in singular form.
is the input string to convert.
string as snake case.
If given data is object or array, converts it to string.
toString
method uses it. If it returns [object Object] tries other steps.util.inspect()
;is the input to convert.
are the options.
is size of the indentation of each level.
if true, converts all null values to undefined.
if true, does not add quotes around values.
converted value.
Vairadic function which strips all of the given strings or database object's names from the source string.
is the input string to convert.
is the list of strings or objects to remove from input.
converted string.
Vairadic function which strips all of the given strings or database object's names from the start of the source string.
is the input string to convert.
is the list of strings or objects to remove from input.
converted string.
Vairadic function which strips all of the given strings or database object's names from the end of the source string.
is the input string to convert.
is the list of strings or objects to remove from input.
converted string.
is the input string to convert.
string as title case.
Converts the given input's first letter to the upper case.
plural("user_name"); // User_name
is the input string to convert.
string with upper first case.
Returns given array with unique elements by eliminating duplicate values.
is the input array to eliminate duplicates from.
the array with unique values.
Word wraps given text.
wordWrap("The quick fox", 10); // "The quick\nfox"
wordWrap("The quick fox", 2, 10); // " The quick\n fox"
is the text to word wrap.
is the start or the stop position of each line. (The stop position if this is single option.)
is the stop position of each line.
word wrapped text.
Wraps given text with start and end characters. By default it wraps with curly braces.
wrap("hello"); // "{hello}"
wrap("hello", "~"); // "~hello~"
wrap("hello", "[]"); // "[hello]"
is the text to warp.
wrapped text.
Wraps given text with start and end characters if given condition is truthy. By default it wraps with curly braces.
wrapIf("hello", "x"); // "{hello}"
wrapIf("hello", true); // "{hello}"
wrapIf("hello", false); // "hello"
wrapIf("hello", true, "~"); // "~hello~"
wrapIf("hello", true, "[]"); // "[hello]"
is the text to warp.
is the condition or value to test.
wrapped text.
Generated using TypeDoc
Converts the given input to the camel case.
Example