0.1.7 • Published 3 years ago
devx-js-utilities v0.1.7
DevX JS utilities
Javascript functions to help with development.
Install
yarn add devx-js-utilities
Usage
Cookie
import { cookie } from 'devx-js-utilities'
function | specification |
---|---|
createCookie | (name: string, value: string, minutes?: number, secure?: boolean, samesite?: 'strict' \ 'lax') => void |
readCookie | (name: string) => null / string |
Random
import { random } from 'devx-js-utilities'
function | specification |
---|---|
randomIntFromInterval | (min: number, max: number) => number |
generateUniqueKey | () => string |
generateUniqueNumberFromTwoNumbers | (n1: number, n2: number) => number |
guid | () => string (xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx) |
Validate
import { validate } from 'devx-js-utilities'
function | specification |
---|---|
validateCreditCard | (value: string) => boolean |
validateEmail | (value: string) => boolean |
validatePhone | (value: string, prefixRequired?: string = false) => boolean |
validateZipCode | (value: string) => boolean |
validateStreet | (value: string) => boolean |
validateCity | (value: string) => boolean |
validateSurname | (value: string) => boolean |
validateLandRegistryNumber | (value: string) => boolean |
isNumeric | (n: string \ number) => boolean |
isRCValid | (identificationNumber: string) => boolean |
isICOValid | (ico: string) => boolean |
Humanizer
import { humanizer } from 'devx-js-utilities'
function | specification |
---|---|
humanizeNumber | (x: number, locales?: string) => string |
csNumber | (value: string) => string |
Convert
import { convert } from 'devx-js-utilities'
function | specification |
---|---|
dataURItoBlob | (dataURI: string) => Blob |
getURLParams | (url: string) => Object |
Transform
import { transform } from 'devx-js-utilities'
function | specification |
---|---|
toCamelCase | (word: string) => string |
toSnakeCase | (word: string) => string |
transformAllKeys | (data: Array \ Object) => Array \ Object |
capitalize | (word: string) => string |
Array
import { array } from 'devx-js-utilities'
import { closest } from 'devx-js-utilities'
function | specification |
---|---|
unique | (array) => array |
closest | (arr: string[] \ number[], target: number) => number |
Salutation
import { salutation } from 'devx-js-utilities'
function | specification |
---|---|
salutation | (name: string) => string |
0.1.7
3 years ago
0.1.6
3 years ago
0.1.5
3 years ago
0.1.4
4 years ago
0.1.1
4 years ago
0.1.0
4 years ago
0.0.22
5 years ago
0.0.21
5 years ago
0.0.20
5 years ago
0.0.19
5 years ago
0.0.17
5 years ago
0.0.16
5 years ago
0.0.15
5 years ago
0.0.14
5 years ago
0.0.13
6 years ago
0.0.12
6 years ago
0.0.11
6 years ago
0.0.10
6 years ago
0.0.9
6 years ago
0.0.8
6 years ago
0.0.7
6 years ago
0.0.6
6 years ago