
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
construct-typed-parameters
Advanced tools
Type-safe parameter construction library. Useful for managing environment variables, aws parameter stores and more.
Type-safe parameters construction library. Useful for managing Query Parameters, Environment Variables, AWS System Manager Parameter Store, and more.
npm install construct-typed-parameters
import { TypedParameters } from 'construct-typed-parameters';
const parameters = new TypedParameters(parameterType => ({
TOKEN: parameterType.string({ required: true }),
FIREBASE_CONFIG: parameterType.json<{ apiKey: string }>({ required: true }),
}));
const stringifiedParameters = parameters.stringify({
TOKEN: 'xxxx',
FIREBASE_CONFIG: { apiKey: 'xxxx' },
});
//=> { TOKEN: 'xxxx', FIREBASE_CONFIG: '{"apiKey":"xxxx"}'}
const parsedParameters = parameters.parse({
TOKEN: 'xxxx',
FIREBASE_CONFIG: '{"apiKey":"xxxx"}',
});
//=> { TOKEN: 'xxxx', FIREBASE_CONFIG: { apiKey: 'xxxx' }}

const queryString = new URLSearchParams(
parameters.stringify({
TOKEN: 'xxxx',
FIREBASE_CONFIG: { apiKey: 'xxxx' },
})
).toString();
//=> 'TOKEN=xxxx&FIREBASE_CONFIG=%7B%22apiKey%22%3A%22xxxx%22%7D'
const parsedParameters = parameters.parse(
Object.fromEntries(
new URLSearchParams(
'TOKEN=xxxx&FIREBASE_CONFIG=%7B%22apiKey%22%3A%22xxxx%22%7D'
).entries()
)
);
//=> { TOKEN: 'xxxx', FIREBASE_CONFIG: { apiKey: 'xxxx' } }
Object.entries(
parameters.stringify({
TOKEN: 'xxxx',
FIREBASE_CONFIG: { apiKey: 'xxxx' },
})
).forEach(([parameterName, stringifiedValue]) => {
process.env[parameterName] = stringifiedValue;
});
//=>
// process.env.TOKEN: 'xxxx'
// process.env.FIREBASE_CONFIG: '{"apiKey":"xxxx"}'
const parsedParameters = parameters.parse({
TOKEN: process.env.TOKEN,
FIREBASE_CONFIG: process.env.FIREBASE_CONFIG,
});
//=> { TOKEN: 'xxxx', FIREBASE_CONFIG: { apiKey: 'xxxx' } }
see https://github.com/masahirompp/ssm-parameters-boot
see test/index.spec.ts.
import { TypedParameters } from 'construct-typed-parameters';
const parameters = new TypedParameters(pt => ({
stringValue: pt.string({
// required: boolean
required: true,
// defaultValue?: T1
defaultValue: 'xxxx',
// validate?: (value: T1) => string | string[] | null;
validate: v => (v.includes('x') ? null : 'the value must contain x'),
}),
unionStringValue: pt.unionString<'v1' | 'v2'>({
required: true,
defaultValue: 'v1',
validate: v =>
['v1', 'v2'].includes(v) ? null : 'the value must be v1 or v2',
}),
numberValue: pt.number({
required: true,
defaultValue: 1,
validate: v => (v === 0 ? 'value must not be 0' : null),
}),
unionNumberValue: pt.unionNumber<0 | 1>({
required: true,
defaultValue: 0,
validate: v => ([0, 1].includes(v) ? null : 'the value must be 0 or 1'),
}),
booleanValue: pt.boolean({
required: true,
defaultValue: true,
validate: v => (v ? null : 'the value must be true'),
}),
jsonValue: pt.json<{ apiKey: string }>({
required: true,
defaultValue: { apiKey: 'xxxx' },
validate: v => (v.apiKey.length ? null : 'apiKey must be specified'),
}),
arrayValue: pt.json<string[]>({
required: true,
defaultValue: ['main', 'sub'],
validate: v => (v.length ? null : 'array must not empty'),
}),
}));
parameters.parse(
stringifiedParameters: Partial<StringifiedParameters<T>>,
shouldValidate = true
) : ParsedParameters<T>
parameters.stringify(
parsedParameters: Partial<ParsedParameters<T>>,
shouldValidate = true
) : StringifiedParameters<T>
FAQs
Type-safe parameter construction library. Useful for managing environment variables, aws parameter stores and more.
We found that construct-typed-parameters 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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.