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

@middy/util

Package Overview
Dependencies
Maintainers
3
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@middy/util - npm Package Compare versions

Comparing version 3.6.2 to 4.0.0-alpha.0

2

index.d.ts
import middy from '@middy/core'
interface Options<Client, ClientOptions> {
AwsClient?: new() => Client
AwsClient?: new(...args: any[]) => Client
awsClientOptions?: Partial<ClientOptions>

@@ -6,0 +6,0 @@ awsClientAssumeRole?: string

@@ -1,16 +0,3 @@

var _response;
import { Agent } from 'https';
export const awsClientDefaultOptions = {
httpOptions: {
agent: new Agent({
keepAlive: true,
secureProtocol: 'TLSv1_2_method'
})
}
};
export const createPrefetchClient = (options)=>{
const awsClientOptions = {
...awsClientDefaultOptions,
...options.awsClientOptions
};
const { awsClientOptions } = options;
const client = new options.AwsClient(awsClientOptions);

@@ -75,5 +62,5 @@ if (options.awsClientCapture && options.disablePrefetch) {

if (errors.length) {
const error = new Error('Failed to resolve internal values');
error.cause = errors;
throw error;
throw new Error('Failed to resolve internal values', {
cause: errors
});
}

@@ -181,6 +168,8 @@ return keys.reduce((obj, key, index)=>({

response = {
statusCode: 200,
body: response
};
}
(_response = response).headers ?? (_response.headers = {});
response.statusCode ??= 500;
response.headers ??= {};
request.response = response;

@@ -196,5 +185,4 @@ return response;

}
message ?? (message = httpErrorCodes[code]);
super(message);
this.cause = options.cause;
message ??= httpErrorCodes[code];
super(message, options);
const name = httpErrorCodes[code].replace(createErrorRegexp, '');

@@ -201,0 +189,0 @@ this.name = name.substr(-5) !== 'Error' ? name + 'Error' : name;

{
"name": "@middy/util",
"version": "3.6.2",
"version": "4.0.0-alpha.0",
"description": "🛵 The stylish Node.js middleware engine for AWS Lambda (util package)",
"type": "module",
"engines": {
"node": ">=14"
"node": ">=16"
},

@@ -63,10 +63,10 @@ "engineStrict": true,

"devDependencies": {
"@middy/core": "3.6.2",
"@aws-sdk/client-ssm": "^3.0.0",
"@middy/core": "4.0.0-alpha.0",
"@types/aws-lambda": "^8.10.76",
"@types/node": "^18.0.0",
"aws-sdk": "^2.939.0",
"aws-xray-sdk": "^3.3.3"
},
"homepage": "https://middy.js.org",
"gitHead": "4c5d64c72dd4bfde0d3b828a0082c99f688c759c"
"gitHead": "306fb9aa633d5757d11ced3dc192f046ef3c2685"
}

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