Initial
This commit is contained in:
31
resources/app/node_modules/@smithy/smithy-client/dist-es/extensions/checksum.js
generated
vendored
Normal file
31
resources/app/node_modules/@smithy/smithy-client/dist-es/extensions/checksum.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
import { AlgorithmId } from "@smithy/types";
|
||||
export { AlgorithmId };
|
||||
export const getChecksumConfiguration = (runtimeConfig) => {
|
||||
const checksumAlgorithms = [];
|
||||
for (const id in AlgorithmId) {
|
||||
const algorithmId = AlgorithmId[id];
|
||||
if (runtimeConfig[algorithmId] === undefined) {
|
||||
continue;
|
||||
}
|
||||
checksumAlgorithms.push({
|
||||
algorithmId: () => algorithmId,
|
||||
checksumConstructor: () => runtimeConfig[algorithmId],
|
||||
});
|
||||
}
|
||||
return {
|
||||
_checksumAlgorithms: checksumAlgorithms,
|
||||
addChecksumAlgorithm(algo) {
|
||||
this._checksumAlgorithms.push(algo);
|
||||
},
|
||||
checksumAlgorithms() {
|
||||
return this._checksumAlgorithms;
|
||||
},
|
||||
};
|
||||
};
|
||||
export const resolveChecksumRuntimeConfig = (clientConfig) => {
|
||||
const runtimeConfig = {};
|
||||
clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {
|
||||
runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor();
|
||||
});
|
||||
return runtimeConfig;
|
||||
};
|
||||
Reference in New Issue
Block a user