patroon 1.4.0 → 1.4.1

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/CHANGELOG.md CHANGED
@@ -4,8 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v1.4.1](https://github.com/bas080/patroon/compare/v1.4.0...v1.4.1)
8
+
9
+ - Add test for checking some function values [`c19ca9b`](https://github.com/bas080/patroon/commit/c19ca9be1e5957564314f7cafa5b6a59629394a0)
10
+ - Do not fail silently when formatting not in order [`6fba5f8`](https://github.com/bas080/patroon/commit/6fba5f88f7c394633ff7fdcafdbf4dc86720d2eb)
11
+
7
12
  #### [v1.4.0](https://github.com/bas080/patroon/compare/v1.3.0...v1.4.0)
8
13
 
14
+ > 6 October 2022
15
+
9
16
  - Add the matches pattern helper [`249eba6`](https://github.com/bas080/patroon/commit/249eba61481ce1a8899a3474c5055e85d441b783)
10
17
 
11
18
  #### [v1.3.0](https://github.com/bas080/patroon/compare/v1.2.6...v1.3.0)
package/CONTRIBUTING.md CHANGED
@@ -16,7 +16,7 @@
16
16
  Standard is good enough.
17
17
 
18
18
  ```bash bash 1>&2
19
- npx standard || npx standard --fix
19
+ npx standard
20
20
  ```
21
21
 
22
22
  ## Documentation
@@ -42,11 +42,11 @@ npm link patroon
42
42
  ```
43
43
  ```
44
44
 
45
- up to date, audited 3 packages in 910ms
45
+ up to date, audited 3 packages in 2s
46
46
 
47
47
  found 0 vulnerabilities
48
48
 
49
- added 1 package, and audited 79 packages in 906ms
49
+ up to date, audited 79 packages in 1s
50
50
 
51
51
  52 packages are looking for funding
52
52
  run `npm fund` for details
package/CONTRIBUTING.mz CHANGED
@@ -16,7 +16,7 @@
16
16
  Standard is good enough.
17
17
 
18
18
  ```bash bash 1>&2
19
- npx standard || npx standard --fix
19
+ npx standard
20
20
  ```
21
21
 
22
22
  ## Documentation
package/README.md CHANGED
@@ -635,7 +635,7 @@ npx nyc npm t | npx tap-nyc
635
635
  npx nyc check-coverage
636
636
  ```
637
637
  ```
638
- > patroon@1.4.0 test
638
+ > patroon@1.4.1 test
639
639
  > tape ./src/index.test.js
640
640
  -------------|---------|----------|---------|---------|-------------------
641
641
  File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
@@ -649,7 +649,7 @@ npx nyc check-coverage
649
649
  total: 31
650
650
  passing: 31
651
651
 
652
- duration: 10.7s
652
+ duration: 7.9s
653
653
 
654
654
  ```
655
655
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patroon",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Pattern matching library",
5
5
  "repository": "github:bas080/patroon",
6
6
  "main": "./src/index.js",
package/src/index.test.js CHANGED
@@ -95,6 +95,26 @@ test('Throws in a predicate function', t => {
95
95
  )
96
96
  })
97
97
 
98
+ function wrappedInFunctions (value, times) {
99
+ if (times >= 0) { return wrappedInFunctions(() => value, times - 1) }
100
+
101
+ return () => value
102
+ }
103
+
104
+ test('Functions', check(gen.any, gen.int, (t, a, times) => {
105
+ const value = wrappedInFunctions(a, times)
106
+
107
+ patroon(value, a, _, _)(a)
108
+ patroon(value, value, _, _)(a)
109
+ patroon(a, value, _, _)(a)
110
+
111
+ patroon(value, a, _, _)(value)
112
+ patroon(value, value, _, _)(value)
113
+ patroon(a, value, _, _)(value)
114
+
115
+ t.end()
116
+ }))
117
+
98
118
  test('Throws when an uneven amount of arguments are passed', t => {
99
119
  t.plan(1)
100
120
  t.throws(() => patroon(1), UnevenArgumentCountError)