diff --git a/lib/api-sim.js b/lib/api-sim.js index 23572d319..eade49c95 100644 --- a/lib/api-sim.js +++ b/lib/api-sim.js @@ -7,7 +7,11 @@ let cls; module.exports = function (appoptics) { ao = appoptics; aob = ao.addon; - cls = ao.cls; + // check for property to avoid triggering node 14 warning on + // non-existent property in unfinished module.exports + if (ao.hasOwnProperty('cls')) { + cls = ao.cls; + } // define the properties (some of which are part of the API) definePropertiesOn(ao); @@ -760,4 +764,3 @@ function insertLogObject (o = {}) { function wrapLambdaHandler (fn) { return fn; } - diff --git a/lib/api.js b/lib/api.js index 2ad72c66c..22d7e80aa 100644 --- a/lib/api.js +++ b/lib/api.js @@ -34,7 +34,9 @@ module.exports = function (appoptics) { ao.maps.responseFinalizers = responseFinalizers; // each invocation in lambda is counted - if (ao.lambda) { + // use property check that does not trigger node 14 warning on + // non-existent property in unfinished module.exports + if (ao.hasOwnProperty('lambda')) { ao.lambda.invocations = 0; }