Current collected state Current
Observed since 20 Oct, 22:04 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Utilities for validating values in apps, libraries and websites.
Utilities for validating values in apps, libraries and websites.
∅ Version: 0.0.20
∅ NPM: https://www.npmjs.com/package/@0bdx/ainta
∅ Repo: https://github.com/0bdx/ainta
∅ Homepage: https://0bdx.com/ainta
@TODO add an overview
import { aintaBoolean } from '@0bdx/ainta';
aintaBoolean(true);
// false
aintaBoolean(1234);
// "A value is type 'number' not 'boolean'"
aintaBoolean(null, 'isDone', { begin:'doThings()' });
// "doThings(): `isDone` is null not type 'boolean'"
narrowAintas() helper:In the example below, narrowAintas() is used to narrow aintaNumber()
into aintaNatural(), and then capture its validation results:
begin:'bothNatural()' sets a prefix, added to all explanationsgte:0 checks that the value is not negativemod:1 checks that the value is an integerlte:1000 and lte:50 specify different maximum values for each argumentif (results.length) checks whether there were any problemsimport narrowAintas, { aintaNumber } from '@0bdx/ainta';
function bothNatural(a, b) {
const [ results, aintaNatural ] = narrowAintas(
{ begin:'bothNatural()', gte:0, mod:1 },
aintaNumber
);
aintaNatural(a, 'a', { lte:1000 });
aintaNatural(b, 'b', { lte:50 });
if (results.length) return results;
return "a and b are both natural numbers, in range!";
}
bothNatural(-5, 12.34);
// [ "bothNatural(): `a` -5 is not gte 0",
// "bothNatural(): `b` 23.45 is not divisible by 1" ]
bothNatural(99, 200);
// [ "bothNatural(): `b` 200 is not lte 50" ]
bothNatural(12, 3);
// "a and b are both natural numbers, in range!"
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.0.20Registry latest | 6 Oct 2023 | 3 | |
| 0.0.19 | 4 May 2023 | 3 | |
| 0.0.18 | 17 Apr 2023 | 3 | |
| 0.0.17 | 16 Apr 2023 | 3 | |
| 0.0.16 | 13 Apr 2023 | 3 | |
| 0.0.15 | 7 Apr 2023 | 3 | |
| 0.0.14 | 6 Apr 2023 | 3 | |
| 0.0.13 | 4 Apr 2023 | 3 | |
| 0.0.12 | 4 Apr 2023 | 3 | |
| 0.0.11 | 4 Apr 2023 | 3 | |
| 0.0.10 | 3 Apr 2023 | 3 | |
| 0.0.9 | 2 Apr 2023 | 3 | |
| 0.0.8 | 29 Mar 2023 | 3 | |
| 0.0.7 | 25 Mar 2023 | 3 | |
| 0.0.6 | 23 Mar 2023 | 3 | |
| 0.0.5 | 23 Mar 2023 | 3 | |
| 0.0.4 | 22 Mar 2023 | 4 | |
| 0.0.3 | 21 Mar 2023 | 3 | |
| 0.0.2 | 18 Mar 2023 | 3 | |
| 0.0.1 | 5 Mar 2023 | 3 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 22:04 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:8a5bd0b1b92412f125a90981a56ad46920e8d82a046de84ebb4c212fe4ce3e14