Download node_modules/@aws-sdk/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js from sweet2004/bot: direct link, hf CLI and curl.
- Browser
- Download file 928 Bytes
-
https://huggingface.co/spaces/sweet2004/bot/resolve/main/node_modules/%40aws-sdk/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js
- Command line
-
hf download hf://spaces/sweet2004/bot/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js
-
curl -L -o loadSharedConfigFiles.js https://huggingface.co/spaces/sweet2004/bot/resolve/main/node_modules/%40aws-sdk/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js
928 Bytes
| import { getConfigFilepath } from "./getConfigFilepath"; | |
| import { getCredentialsFilepath } from "./getCredentialsFilepath"; | |
| import { getProfileData } from "./getProfileData"; | |
| import { parseIni } from "./parseIni"; | |
| import { slurpFile } from "./slurpFile"; | |
| const swallowError = () => ({}); | |
| export const loadSharedConfigFiles = async (init = {}) => { | |
| const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init; | |
| const parsedFiles = await Promise.all([ | |
| slurpFile(configFilepath, { | |
| ignoreCache: init.ignoreCache, | |
| }) | |
| .then(parseIni) | |
| .then(getProfileData) | |
| .catch(swallowError), | |
| slurpFile(filepath, { | |
| ignoreCache: init.ignoreCache, | |
| }) | |
| .then(parseIni) | |
| .catch(swallowError), | |
| ]); | |
| return { | |
| configFile: parsedFiles[0], | |
| credentialsFile: parsedFiles[1], | |
| }; | |
| }; | |