@aws-lambda-powertools/parameters
Version:
The parameters package for the Powertools for AWS Lambda (TypeScript) library
21 lines (20 loc) • 521 B
JavaScript
import { DEFAULT_MAX_AGE_SECS } from '../constants.js';
/**
* Options for the `get` method.
*
* It merges the default options with the provided options.
*/
class GetOptions {
forceFetch = false;
maxAge;
sdkOptions;
transform;
constructor(envVarsService, options = {}) {
Object.assign(this, options);
if (options.maxAge === undefined) {
this.maxAge =
envVarsService.getParametersMaxAge() ?? DEFAULT_MAX_AGE_SECS;
}
}
}
export { GetOptions };