pix-utils-js 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/test.yml +25 -0
- package/README.md +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: Node.js CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main" ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ "main" ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
strategy:
|
|
15
|
+
matrix:
|
|
16
|
+
node-version: [18.x]
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v3
|
|
20
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
21
|
+
uses: actions/setup-node@v3
|
|
22
|
+
with:
|
|
23
|
+
node-version: ${{ matrix.node-version }}
|
|
24
|
+
- run: yarn
|
|
25
|
+
- run: yarn test
|
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ Instale pix-utils-js com npm ou yarn
|
|
|
25
25
|
#### Identifique uma chave pix
|
|
26
26
|
|
|
27
27
|
```js
|
|
28
|
-
|
|
28
|
+
import { identify } from 'pix-utils-js'
|
|
29
29
|
const { pix, type } = identify({pix: 'test@gmail.com'}) // {pix: 'test@gmail.com', type: 'email'}
|
|
30
30
|
```
|
|
31
31
|
|
|
@@ -36,7 +36,7 @@ Instale pix-utils-js com npm ou yarn
|
|
|
36
36
|
#### Validar uma chave pix
|
|
37
37
|
|
|
38
38
|
```js
|
|
39
|
-
|
|
39
|
+
import { validate } from 'pix-utils-js'
|
|
40
40
|
console.log(validate({pix: 'test@gmail.com'})) // true
|
|
41
41
|
console.log(validate({pix: 'test'})) // false
|
|
42
42
|
console.log(validate({pix: 'test@gmail.com', type : 'cpf'})) // false
|
|
@@ -49,7 +49,7 @@ Instale pix-utils-js com npm ou yarn
|
|
|
49
49
|
#### Normalizar uma chave pix
|
|
50
50
|
|
|
51
51
|
```js
|
|
52
|
-
|
|
52
|
+
import { normalize } from 'pix-utils-js'
|
|
53
53
|
console.log(normalize({pix: '000.000.000-00'})) // {pix: '00000000000', type: 'cpf'}
|
|
54
54
|
console.log(normalize({pix: '00.000.000/0000-00'})) // {pix: '00000000000000', type: 'cnpj'}
|
|
55
55
|
console.log(normalize({pix: '+55 (11) 0000-0000'})) // {pix: '551100000000', type: 'phone'}
|