preconditions 4.0.2 → 4.0.4
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 +8 -1
- package/README.md +6 -6
- package/api.md +233 -233
- package/lib/preconditions.js +1 -1
- package/package.json +3 -3
- package/test.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to this project are documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [4.0.3] - 2026-05-15
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **`engines.node`** set to **`>=20.0.0`** (broader support while staying aligned with **errr** 5.x).
|
|
13
|
+
|
|
8
14
|
## [4.0.2] - 2026-05-15
|
|
9
15
|
|
|
10
16
|
### Changed
|
|
@@ -47,10 +53,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
47
53
|
|
|
48
54
|
### Breaking
|
|
49
55
|
|
|
50
|
-
- **Node
|
|
56
|
+
- **4.0.0** initially required **Node 24+** in `package.json` **`engines`**; **4.0.3** widens support to **Node 20+** (`>=20.0.0`).
|
|
51
57
|
- **`errr` 5.x** is required as a runtime dependency; upgrade errr in consuming apps if they pin it tightly.
|
|
52
58
|
- **`core-util-is`** is no longer a transitive dependency.
|
|
53
59
|
|
|
60
|
+
[4.0.3]: https://github.com/corybill/preconditions/compare/v4.0.2...v4.0.3
|
|
54
61
|
[4.0.2]: https://github.com/corybill/preconditions/compare/v4.0.1...v4.0.2
|
|
55
62
|
[4.0.1]: https://github.com/corybill/preconditions/compare/v4.0.0...v4.0.1
|
|
56
63
|
[4.0.0]: https://github.com/corybill/preconditions/compare/v3.0.2...v4.0.0
|
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ There are four functions that are exposed from the library.
|
|
|
31
31
|
1. errr() - Verify a one value at a time while building an 'errr' object. You can append errors together and add debug params to the stack trace.
|
|
32
32
|
2. singleton() - Verify one value at a time with a chainable preconditions interface.
|
|
33
33
|
3. instance() - Create a testing suite passing in a single object. Run a single, or multiple tests on the passed in object. Shouldn't be used in production code.
|
|
34
|
-
4.
|
|
34
|
+
4. getConstructor() - Get the constructor function so you can extend the Preconditions library (see below for example). Shouldn't be used in production code.
|
|
35
35
|
|
|
36
36
|
### Examples Using the Errr Interface (.errr())
|
|
37
37
|
|
|
@@ -104,13 +104,13 @@ Should not be used in production code!
|
|
|
104
104
|
</code>
|
|
105
105
|
</pre>
|
|
106
106
|
|
|
107
|
-
### Examples Using The Constructor (.
|
|
107
|
+
### Examples Using The Constructor (.getConstructor())
|
|
108
108
|
Should not be used in production code!
|
|
109
109
|
|
|
110
110
|
The Preconditions object itself is exposed so that you can extend the Preconditions class.
|
|
111
111
|
<pre>
|
|
112
112
|
<code>
|
|
113
|
-
let Constructor = preconditions.
|
|
113
|
+
let Constructor = preconditions.getConstructor();
|
|
114
114
|
let ChildClass = class extends Constructor {
|
|
115
115
|
constructor(out) {
|
|
116
116
|
super(out);
|
|
@@ -1830,7 +1830,7 @@ Preconditions entry point interface.
|
|
|
1830
1830
|
* [.errr()](#Preconditions.errr) ⇒
|
|
1831
1831
|
* [.singleton()](#Preconditions.singleton) ⇒
|
|
1832
1832
|
* [.instance(objectUnderTest)](#Preconditions.instance) ⇒
|
|
1833
|
-
* [.
|
|
1833
|
+
* [.getConstructor()](#Preconditions.getConstructor) ⇒
|
|
1834
1834
|
|
|
1835
1835
|
<a name="Preconditions.errr"></a>
|
|
1836
1836
|
|
|
@@ -1859,9 +1859,9 @@ Validate values of a given JSON object with the preconditions object.
|
|
|
1859
1859
|
| --- | --- |
|
|
1860
1860
|
| objectUnderTest | Object Under Test |
|
|
1861
1861
|
|
|
1862
|
-
<a name="Preconditions.
|
|
1862
|
+
<a name="Preconditions.getConstructor"></a>
|
|
1863
1863
|
|
|
1864
|
-
### Preconditions.
|
|
1864
|
+
### Preconditions.getConstructor() ⇒
|
|
1865
1865
|
Gives ability to extend and add other preconditions to the Error Validation constructor.
|
|
1866
1866
|
|
|
1867
1867
|
**Kind**: static method of <code>[Preconditions](#Preconditions)</code>
|