1.0.2 • Published 1 year ago

saviourjs v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

saviourjs

A collection of utility functions built to save your ass. It includes functions for common operations like string manipulation, array manipulation, object manipulation, and more.

Installation

You can install saviourjs using npm:

npm install saviourjs

Or using yarn:

yarn add saviourjs

Or using pnpm:

pnpm add saviourjs

Usage

FunctionDescriptionParameters
slugifyConverts a string into a URL-friendly slug.text: string
getNthLetterGets the nth letter from a string.text: string, n: number
getFirstLetterGets the first letter of a string.text: string
getLastLetterGets the last letter of a string.text: string
capitalizeCapitalizes the first letter of a string.text: string
reverseStringReverses a string.text: string
isPalindromeChecks if a string is a palindrome.text: string
truncateTruncates a string to a specified length.text: string, length: number
deepCloneCreates a deep clone of an object.obj: T
isEmptyChecks if a value is empty.value: any
isEmailValidates an email address.email: string
camelCaseConverts a string to camelCase.text: string
kebabCaseConverts a string to kebab-case.text: string
snakeCaseConverts a string to snake_case.text: string
randomStringGenerates a random string of specified length.length: number
flattenArrayFlattens a nested array.array: any[]
uniqRemoves duplicate values from an array.array: any[]
chunkSplits an array into chunks of a specified size.array: T[], size: number
shuffleArrayRandomly shuffles an array.array: T[]
isEqualPerforms a deep comparison between two values.value: any, other: any
groupByGroups elements of an array based on a key.array: T[], key: ((item: T) => string) | keyof T
formatDateFormats a date into a readable string.date: Date, format: string
parseQueryStringToObjectParses a query string into an object.queryString: string
parseObjectToQueryStringConverts an object into a query string.obj: { [key: string]: any }
selectRandomSelects a random element from an array.array: T[]
capitalizeFirstLetterCapitalizes the first letter of a given string and converts the rest to lowercase.text: string
1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago