UNPKG

@aws-lambda-powertools/parameters

Version:
24 lines (23 loc) 645 B
import { getNumberFromEnv } from '@aws-lambda-powertools/commons/utils/env'; 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(options = {}) { Object.assign(this, options); if (options.maxAge === undefined) { this.maxAge = getNumberFromEnv({ key: 'POWERTOOLS_PARAMETERS_MAX_AGE', defaultValue: DEFAULT_MAX_AGE_SECS, }); } } } export { GetOptions };