初始化环境文件
This commit is contained in:
25
node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForObjectNotExists.js
generated
vendored
Normal file
25
node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForObjectNotExists.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import { checkExceptions, createWaiter, WaiterState, } from "@smithy/util-waiter";
|
||||
import { HeadObjectCommand } from "../commands/HeadObjectCommand";
|
||||
const checkState = async (client, input) => {
|
||||
let reason;
|
||||
try {
|
||||
let result = await client.send(new HeadObjectCommand(input));
|
||||
reason = result;
|
||||
}
|
||||
catch (exception) {
|
||||
reason = exception;
|
||||
if (exception.name && exception.name == "NotFound") {
|
||||
return { state: WaiterState.SUCCESS, reason };
|
||||
}
|
||||
}
|
||||
return { state: WaiterState.RETRY, reason };
|
||||
};
|
||||
export const waitForObjectNotExists = async (params, input) => {
|
||||
const serviceDefaults = { minDelay: 5, maxDelay: 120 };
|
||||
return createWaiter({ ...serviceDefaults, ...params }, input, checkState);
|
||||
};
|
||||
export const waitUntilObjectNotExists = async (params, input) => {
|
||||
const serviceDefaults = { minDelay: 5, maxDelay: 120 };
|
||||
const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);
|
||||
return checkExceptions(result);
|
||||
};
|
||||
Reference in New Issue
Block a user