0.1.7 • Published 5 years ago
devx-js-utilities v0.1.7
DevX JS utilities
Javascript functions to help with development.
Install
yarn add devx-js-utilitiesUsage
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
5 years ago
0.1.6
5 years ago
0.1.5
5 years ago
0.1.4
5 years ago
0.1.1
6 years ago
0.1.0
6 years ago
0.0.22
6 years ago
0.0.21
6 years ago
0.0.20
6 years ago
0.0.19
7 years ago
0.0.17
7 years ago
0.0.16
7 years ago
0.0.15
7 years ago
0.0.14
7 years ago
0.0.13
7 years ago
0.0.12
7 years ago
0.0.11
7 years ago
0.0.10
7 years ago
0.0.9
7 years ago
0.0.8
8 years ago
0.0.7
8 years ago
0.0.6
8 years ago