how to write in node js local dynamodb runs locally not in actual lambda

this simple aws.js I’m using to run dynamoDB locally

"use strict";
 const AWS = require("aws-sdk");


 AWS.config.dynamodb = {
     region: "eu-west-2",
     endpoint: "http://localhost:8000"
 };


 module.exports = ()=>{
     return new AWS.DynamoDB.DocumentClient();
 };

How to make sure this runs locally only. I want to make sure this won’t run in actual lambda after I merge my PR. So in actual lambda it should use the real dynamoDB