
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@smartlyio/oats-fast-check
Advanced tools
Fast-check generators for @smartlyio/oats types.
Generate values of named types from the openapi specification. Here using a jest wrapper.
// yarn jest examples/type.spec.ts
import * as fc from 'fast-check';
import { generator } from '../src/index';
import * as runtime from '@smartlyio/oats-runtime';
import * as types from '../tmp/openapi.types.generated';
describe('value generation', () => {
it ('generates valid values', () =>
fc.assert(
fc.property(
// create a fast-check Arbitrary from the type structure
generator.named(types.typeTestObject),
(value: types.TestObject) => {
// assert that all the generated values are valid
const json = runtime.valueClass.toJSON(value);
types.typeTestObject.maker(json).success();
}
)
))
});
Override automatic generators globally with a custom Arbitrary
// yarn jest examples/override.spec.ts
import * as fc from 'fast-check';
import { generator } from '../src/index';
import * as types from '../tmp/openapi.types.generated';
describe('overriding generators', () => {
it ('.override provides custom generator for type', () => {
generator.override(types.typeTestTarget, fc.constant('overridden value'));
fc.assert(
fc.property(
generator.named(types.typeTestTarget),
(value: types.TestTarget) => {
expect(value).toEqual('overridden value');
}
)
);
})
it ('.clear removes override', () => {
generator.override(types.typeTestTarget, fc.constant('overridden value'));
generator.clear(types.typeTestTarget);
fc.assert(
fc.property(
generator.named(types.typeTestTarget),
(value: types.TestTarget) => {
expect(value).not.toEqual('overridden value');
}
)
);
})
});
FAQs
fast-check value generator for smartlyio/oats types
We found that @smartlyio/oats-fast-check demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.