Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roitinnovation/roit-utils
Roit utils & validators
https://github.com/roitinnovation/roit-utils
Last synced: 29 days ago
JSON representation
Roit utils & validators
- Host: GitHub
- URL: https://github.com/roitinnovation/roit-utils
- Owner: roitinnovation
- License: mit
- Created: 2021-04-19T20:27:59.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-05-13T22:19:57.000Z (over 3 years ago)
- Last Synced: 2023-03-03T10:50:46.981Z (almost 2 years ago)
- Language: TypeScript
- Size: 29.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ROIT Utils
### V1
- Normalize string method
- Create md5 hash (no dependencies)### Usage
`npm install @roit/roit-utils`- Creating md5 hash
```ts
import {md5} from '@roit/roit-utils'md5('any_name')
// 13a55449ce38a9d14343d79fdbb8860b```
- Normalizing strings
```ts
import {normalizeString} from '@roit/roit-utils'normalizeString('são paulo') // default use Canonical Decomposition. (remove all accents from string and normalize it)
//SAO PAULO//also you can use an explicit type ("NFC" | "NFD" | "NFKC" | "NFKD")
normalizeString('any_text', 'NFC')
//check normalize method for details:
//https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/String/normalize
```