utils77
v1.0.6
Published
A library for common utils.
Downloads
7
Readme
Utils
A library for common utils.
capitalize(words: string, splitter = ' ')
getKeyValue<T, keyof T>(property)(value)
toggleFullScreen(element?: HTMLElement | HTMLIFrameElement | null)
// Array operations
getUniqueListBy(arr: any[], key: string)
toggleArray(arr: any[], value: any, options?: IToggleArrayOptions)
refreshArray(arr: any[], value: any, options?: IRefreshArrayOptions)
repeat(count: number, ...items: any[])
// String operations
hasNumber(string: string)
isValidHttpUrl(string: string)
// Currency operations
getCurrencySymbol(currencyCode: string)
getCurrencyFormat(value: number, Currency, options?: ICFOptions)
// File operations
checkIfFileExists(url: string)
|Version | Compatibility| |------------|--------------| |0.x | React 18.2+|
It also use below libraries as dependencies:
"lodash": "^4.17.21",
"currency-symbol-map": "^5.1.0",
"currency.js": "^2.0.4"
Technical Documentation
Installing
$ npm install utils7mojos
Exports
Here's how to use this library exports:
// ES6
import
{
capitalize,
getKeyValue,
toggleFullScreen,
// Array operations
getUniqueListBy,
toggleArray,
refreshArray,
repeat,
// String operations
hasNumber,
isValidHttpUrl,
// Currency operations
getCurrencySymbol,
getCurrencyFormat,
// File operations
checkIfFileExists,
} from 'utils7mojos'; // Utils library
Scripts
In the project directory, you can run:
npm test
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
npm run publish
Change the version of package in the package.json and the run the command to build and publish the new version of the library.
npm run build
Builds the app to see the publish files on the dist
folder.
Your app is ready to be deployed!
License
7Mojos