Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws-sdk-wrap

Package Overview
Dependencies
Maintainers
1
Versions
252
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-sdk-wrap - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

25

lib/index.js

@@ -5,6 +5,15 @@ const get = require('lodash.get');

const serviceLookup = Object.keys(AWS).reduce((prev, cur) => Object.assign(prev, {
[cur.toLowerCase()]: cur
}), {});
const lookupCache = new Map();
const getAttr = (obj, key) => {
// case insensitive lookup
if (!lookupCache.has(obj)) {
lookupCache.set(obj, Object.entries(obj).reduce((prev, [k, v]) => Object.assign(prev, {
[k.toLowerCase()]: v
}), {}));
}
return lookupCache.get(obj)[key.toLowerCase()];
};
module.exports = ({

@@ -17,7 +26,9 @@ config = {},

const getService = service => {
if (services[service] === undefined) {
services[service] = new AWS[serviceLookup[service]](config);
const serviceLower = service.toLowerCase();
if (services[serviceLower] === undefined) {
services[serviceLower] = new (serviceLower.split('.').reduce(getAttr, AWS))(config);
}
return services[service];
return services[serviceLower];
};

@@ -47,2 +58,2 @@

};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJnZXQiLCJyZXF1aXJlIiwiQVdTIiwic2VydmljZUxvb2t1cCIsIk9iamVjdCIsImtleXMiLCJyZWR1Y2UiLCJwcmV2IiwiY3VyIiwiYXNzaWduIiwidG9Mb3dlckNhc2UiLCJtb2R1bGUiLCJleHBvcnRzIiwiY29uZmlnIiwibG9nZ2VyIiwic2VydmljZXMiLCJnZXRTZXJ2aWNlIiwic2VydmljZSIsInVuZGVmaW5lZCIsImNhbGwiLCJmdW5jTmFtZSIsInBhcmFtcyIsImV4cGVjdGVkRXJyb3JDb2RlcyIsInByb21pc2UiLCJjYXRjaCIsImUiLCJpbm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Nbc2VydmljZUxvb2t1cFtzZXJ2aWNlXV0oY29uZmlnKTtcbiAgICB9XG4gICAgcmV0dXJuIHNlcnZpY2VzW3NlcnZpY2VdO1xuICB9O1xuXG4gIHJldHVybiB7XG4gICAgY2FsbDogKHNlcnZpY2UsIGZ1bmNOYW1lLCBwYXJhbXMsIHsgZXhwZWN0ZWRFcnJvckNvZGVzID0gW10gfSA9IHt9KSA9PiBnZXRTZXJ2aWNlKHNlcnZpY2UpW2Z1bmNOYW1lXShwYXJhbXMpXG4gICAgICAucHJvbWlzZSgpLmNhdGNoKChlKSA9PiB7XG4gICAgICAgIGlmIChleHBlY3RlZEVycm9yQ29kZXMuaW5kZXhPZihlLmNvZGUpICE9PSAtMSkge1xuICAgICAgICAgIHJldHVybiBlLmNvZGU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGxvZ2dlciAhPT0gbnVsbCkge1xuICAgICAgICAgIGxvZ2dlci5lcnJvcih7XG4gICAgICAgICAgICBtZXNzYWdlOiBgUmVxdWVzdCBmYWlsZWQgZm9yICR7c2VydmljZX0uJHtmdW5jTmFtZX0oKWAsXG4gICAgICAgICAgICBlcnJvck5hbWU6IGdldChlLCBcImNvbnN0cnVjdG9yLm5hbWVcIiksXG4gICAgICAgICAgICBlcnJvckRldGFpbHM6IGUsXG4gICAgICAgICAgICByZXF1ZXN0UGFyYW1zOiBwYXJhbXNcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICB0aHJvdyBlO1xuICAgICAgfSksXG4gICAgZ2V0OiBnZXRTZXJ2aWNlXG4gIH07XG59O1xuIl19
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJnZXQiLCJyZXF1aXJlIiwiQVdTIiwibG9va3VwQ2FjaGUiLCJNYXAiLCJnZXRBdHRyIiwib2JqIiwia2V5IiwiaGFzIiwic2V0IiwiT2JqZW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ZpY2VMb3dlcl0gPSBuZXcgKHNlcnZpY2VMb3dlci5zcGxpdCgnLicpLnJlZHVjZShnZXRBdHRyLCBBV1MpKShjb25maWcpO1xuICAgIH1cbiAgICByZXR1cm4gc2VydmljZXNbc2VydmljZUxvd2VyXTtcbiAgfTtcblxuICByZXR1cm4ge1xuICAgIGNhbGw6IChzZXJ2aWNlLCBmdW5jTmFtZSwgcGFyYW1zLCB7IGV4cGVjdGVkRXJyb3JDb2RlcyA9IFtdIH0gPSB7fSkgPT4gZ2V0U2VydmljZShzZXJ2aWNlKVtmdW5jTmFtZV0ocGFyYW1zKVxuICAgICAgLnByb21pc2UoKS5jYXRjaCgoZSkgPT4ge1xuICAgICAgICBpZiAoZXhwZWN0ZWRFcnJvckNvZGVzLmluZGV4T2YoZS5jb2RlKSAhPT0gLTEpIHtcbiAgICAgICAgICByZXR1cm4gZS5jb2RlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChsb2dnZXIgIT09IG51bGwpIHtcbiAgICAgICAgICBsb2dnZXIuZXJyb3Ioe1xuICAgICAgICAgICAgbWVzc2FnZTogYFJlcXVlc3QgZmFpbGVkIGZvciAke3NlcnZpY2V9LiR7ZnVuY05hbWV9KClgLFxuICAgICAgICAgICAgZXJyb3JOYW1lOiBnZXQoZSwgXCJjb25zdHJ1Y3Rvci5uYW1lXCIpLFxuICAgICAgICAgICAgZXJyb3JEZXRhaWxzOiBlLFxuICAgICAgICAgICAgcmVxdWVzdFBhcmFtczogcGFyYW1zXG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgdGhyb3cgZTtcbiAgICAgIH0pLFxuICAgIGdldDogZ2V0U2VydmljZVxuICB9O1xufTtcbiJdfQ==
{
"name": "aws-sdk-wrap",
"version": "1.1.0",
"version": "1.1.1",
"description": "Wrapper around aws-sdk",

@@ -31,5 +31,5 @@ "main": "lib/index.js",

"devDependencies": {
"aws-sdk": "2.298.0",
"aws-sdk": "2.309.0",
"babel-cli": "7.0.0-beta.3",
"babel-eslint": "8.2.6",
"babel-eslint": "9.0.0",
"babel-plugin-transform-flow-comments": "7.0.0-beta.3",

@@ -40,6 +40,6 @@ "babel-preset-flow": "7.0.0-beta.3",

"coveralls": "3.0.2",
"js-gardener": "1.31.1",
"js-gardener": "1.31.4",
"nock": "9.6.1",
"nyc": "12.0.2",
"semantic-release": "15.9.9"
"nyc": "13.0.1",
"semantic-release": "15.9.12"
},

@@ -46,0 +46,0 @@ "peerDependencies": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc