
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@0bdx/ainta
Advanced tools
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!"
FAQs
Utilities for validating values in apps, libraries and websites.
We found that @0bdx/ainta demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.