UNPKG

@aws-sdk/client-dynamodb

Version:

AWS SDK for JavaScript Dynamodb Client for Node.js, Browser and React Native

27 lines 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.waitForTableNotExists = void 0; const DescribeTableCommand_1 = require("../commands/DescribeTableCommand"); const util_waiter_1 = require("@aws-sdk/util-waiter"); const checkState = async (client, input) => { try { let result = await client.send(new DescribeTableCommand_1.DescribeTableCommand(input)); } catch (exception) { if (exception.name && exception.name == "ResourceNotFoundException") { return { state: util_waiter_1.WaiterState.SUCCESS }; } } return { state: util_waiter_1.WaiterState.RETRY }; }; /** * * @param params : Waiter configuration options. * @param input : the input to DescribeTableCommand for polling. */ const waitForTableNotExists = async (params, input) => { const serviceDefaults = { minDelay: 20, maxDelay: 120 }; return util_waiter_1.createWaiter({ ...serviceDefaults, ...params }, input, checkState); }; exports.waitForTableNotExists = waitForTableNotExists; //# sourceMappingURL=waitForTableNotExists.js.map