UNPKG

@aws-lambda-powertools/parameters

Version:
27 lines (26 loc) 772 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetOptions = void 0; const env_1 = require("@aws-lambda-powertools/commons/utils/env"); const constants_js_1 = require("../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 = (0, env_1.getNumberFromEnv)({ key: 'POWERTOOLS_PARAMETERS_MAX_AGE', defaultValue: constants_js_1.DEFAULT_MAX_AGE_SECS, }); } } } exports.GetOptions = GetOptions;